aboutsummaryrefslogtreecommitdiff
path: root/Utility/UserInfo.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <id@joeyh.name>2013-05-10 15:08:53 -0500
committerGravatar Joey Hess <id@joeyh.name>2013-05-10 15:08:53 -0500
commit493db9a024a89f1f696a858789ce55844a180215 (patch)
tree3d34bea905c3623156a07406f027bf50e005c881 /Utility/UserInfo.hs
parent720d0230d6333a3cc3a7d533ef09e921ed6b0d8f (diff)
stub out posix stuff for Windows
This is enough to let the configure program build.
Diffstat (limited to 'Utility/UserInfo.hs')
-rwxr-xr-x[-rw-r--r--]Utility/UserInfo.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/Utility/UserInfo.hs b/Utility/UserInfo.hs
index 916ebb191..6fad3d7b4 100644..100755
--- a/Utility/UserInfo.hs
+++ b/Utility/UserInfo.hs
@@ -14,29 +14,45 @@ module Utility.UserInfo (
) where
import Control.Applicative
+#if 0
import System.Posix.User
import System.Posix.Env
+#endif
{- Current user's home directory.
-
- getpwent will fail on LDAP or NIS, so use HOME if set. -}
myHomeDir :: IO FilePath
+#if 0
myHomeDir = myVal ["HOME"] homeDirectory
+#else
+myHomeDir = error "myHomeDir TODO"
+#endif
{- Current user's user name. -}
myUserName :: IO String
+#if 0
myUserName = myVal ["USER", "LOGNAME"] userName
+#else
+myUserName = error "myUserName TODO"
+#endif
myUserGecos :: IO String
#ifdef __ANDROID__
myUserGecos = return "" -- userGecos crashes on Android
#else
+#if 0
myUserGecos = myVal [] userGecos
+#else
+myUserGecos = error "myUserGecos TODO"
+#endif
#endif
+#if 0
myVal :: [String] -> (UserEntry -> String) -> IO String
myVal envvars extract = maybe (extract <$> getpwent) return =<< check envvars
where
check [] = return Nothing
check (v:vs) = maybe (check vs) (return . Just) =<< getEnv v
getpwent = getUserEntryForID =<< getEffectiveUserID
+#endif