From f28060acd449643d267954647c1bb7c748c35fa9 Mon Sep 17 00:00:00 2001 From: Mitchell Rosen Date: Thu, 1 Dec 2022 11:57:51 -0500 Subject: [PATCH] Delete System.PosixCompat.User module --- CHANGELOG.md | 5 ++ src/System/PosixCompat.hs | 2 - src/System/PosixCompat/User.hsc | 133 -------------------------------- unix-compat.cabal | 3 +- 4 files changed, 6 insertions(+), 137 deletions(-) delete mode 100644 src/System/PosixCompat/User.hsc diff --git a/CHANGELOG.md b/CHANGELOG.md index f2df80d..45e2d2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## Version 0.7 (unreleased) + +- Remove `System.PosixCompat.User` module +- Support `unix-2.8.0.0` + ## Version 0.6 (2022-05-22) - Better support for symbolic links diff --git a/src/System/PosixCompat.hs b/src/System/PosixCompat.hs index ed3a618..22b06dd 100644 --- a/src/System/PosixCompat.hs +++ b/src/System/PosixCompat.hs @@ -11,7 +11,6 @@ module System.PosixCompat ( , module System.PosixCompat.Time , module System.PosixCompat.Types , module System.PosixCompat.Unistd - , module System.PosixCompat.User , usingPortableImpl ) where @@ -20,7 +19,6 @@ import System.PosixCompat.Temp import System.PosixCompat.Time import System.PosixCompat.Types import System.PosixCompat.Unistd -import System.PosixCompat.User -- | 'True' if unix-compat is using its portable implementation, -- or 'False' if the unix package is simply being re-exported. diff --git a/src/System/PosixCompat/User.hsc b/src/System/PosixCompat/User.hsc deleted file mode 100644 index b5b07e2..0000000 --- a/src/System/PosixCompat/User.hsc +++ /dev/null @@ -1,133 +0,0 @@ -{-# LANGUAGE CPP #-} - -{-| -This module makes the operations exported by @System.Posix.User@ -available on all platforms. On POSIX systems it re-exports operations from -@System.Posix.User@. On other platforms it provides dummy implementations. --} -module System.PosixCompat.User ( - -- * User environment - -- ** Querying the user environment - getRealUserID - , getRealGroupID - , getEffectiveUserID - , getEffectiveGroupID - , getGroups - , getLoginName - , getEffectiveUserName - - -- *** The group database - , GroupEntry(..) - , getGroupEntryForID - , getGroupEntryForName - , getAllGroupEntries - - -- *** The user database - , UserEntry(..) - , getUserEntryForID - , getUserEntryForName - , getAllUserEntries - - -- ** Modifying the user environment - , setUserID - , setGroupID - ) where - -#ifndef mingw32_HOST_OS - -#include "HsUnixCompat.h" - -import System.Posix.User - -#if __GLASGOW_HASKELL__<605 -getAllGroupEntries :: IO [GroupEntry] -getAllGroupEntries = return [] - -getAllUserEntries :: IO [UserEntry] -getAllUserEntries = return [] -#endif - -#else /* Portable implementation */ - -import System.IO.Error -import System.PosixCompat.Types - -unsupported :: String -> IO a -unsupported f = ioError $ mkIOError illegalOperationErrorType x Nothing Nothing - where x = "System.PosixCompat.User." ++ f ++ ": not supported" - --- ----------------------------------------------------------------------------- --- User environment - -getRealUserID :: IO UserID -getRealUserID = unsupported "getRealUserID" - -getRealGroupID :: IO GroupID -getRealGroupID = unsupported "getRealGroupID" - -getEffectiveUserID :: IO UserID -getEffectiveUserID = unsupported "getEffectiveUserID" - -getEffectiveGroupID :: IO GroupID -getEffectiveGroupID = unsupported "getEffectiveGroupID" - -getGroups :: IO [GroupID] -getGroups = return [] - -getLoginName :: IO String -getLoginName = unsupported "getLoginName" - -setUserID :: UserID -> IO () -setUserID _ = return () - -setGroupID :: GroupID -> IO () -setGroupID _ = return () - --- ----------------------------------------------------------------------------- --- User names - -getEffectiveUserName :: IO String -getEffectiveUserName = unsupported "getEffectiveUserName" - --- ----------------------------------------------------------------------------- --- The group database - -data GroupEntry = GroupEntry - { groupName :: String - , groupPassword :: String - , groupID :: GroupID - , groupMembers :: [String] - } deriving (Show, Read, Eq) - -getGroupEntryForID :: GroupID -> IO GroupEntry -getGroupEntryForID _ = unsupported "getGroupEntryForID" - -getGroupEntryForName :: String -> IO GroupEntry -getGroupEntryForName _ = unsupported "getGroupEntryForName" - -getAllGroupEntries :: IO [GroupEntry] -getAllGroupEntries = return [] - --- ----------------------------------------------------------------------------- --- The user database (pwd.h) - -data UserEntry = UserEntry - { userName :: String - , userPassword :: String - , userID :: UserID - , userGroupID :: GroupID - , userGecos :: String - , homeDirectory :: String - , userShell :: String - } deriving (Show, Read, Eq) - -getUserEntryForID :: UserID -> IO UserEntry -getUserEntryForID _ = unsupported "getUserEntryForID" - -getUserEntryForName :: String -> IO UserEntry -getUserEntryForName _ = unsupported "getUserEntryForName" - -getAllUserEntries :: IO [UserEntry] -getAllUserEntries = return [] - -#endif diff --git a/unix-compat.cabal b/unix-compat.cabal index 8879404..a95e1be 100644 --- a/unix-compat.cabal +++ b/unix-compat.cabal @@ -1,5 +1,5 @@ name: unix-compat -version: 0.6 +version: 0.7 synopsis: Portable POSIX-compatibility layer. description: This package provides portable implementations of parts of the unix package. This package re-exports the unix @@ -40,7 +40,6 @@ Library System.PosixCompat.Time System.PosixCompat.Types System.PosixCompat.Unistd - System.PosixCompat.User if os(windows) c-sources: