summaryrefslogtreecommitdiff
path: root/Init.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-25 18:17:32 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-25 18:17:54 -0400
commita0f689bcd87c63fe6efdc5ad112a44241d74259e (patch)
treee6fc62c9a058e7dd37ff440c4f9252f1f5a34ccb /Init.hs
parent2ae218333249132c54360013c7c7f8c07594fa67 (diff)
Use USER and HOME environment when set, and only fall back to getpwent, which doesn't work with LDAP or NIS.
Diffstat (limited to 'Init.hs')
-rw-r--r--Init.hs8
1 files changed, 2 insertions, 6 deletions
diff --git a/Init.hs b/Init.hs
index aae10160d..0b3605e41 100644
--- a/Init.hs
+++ b/Init.hs
@@ -20,20 +20,16 @@ import qualified Annex.Branch
import Logs.UUID
import Annex.Version
import Annex.UUID
-
-import System.Posix.User
+import Utility.UserInfo
genDescription :: Maybe String -> Annex String
genDescription (Just d) = return d
genDescription Nothing = do
hostname <- maybe "" id <$> liftIO getHostname
let at = if null hostname then "" else "@"
- username <- clicketyclickety
+ username <- liftIO myUserName
reldir <- liftIO . relHome =<< fromRepo Git.repoPath
return $ concat [username, at, hostname, ":", reldir]
- where
- clicketyclickety = liftIO $ userName <$>
- (getUserEntryForID =<< getEffectiveUserID)
initialize :: Maybe String -> Annex ()
initialize mdescription = do