Don't try to create user if we're installing outside /
authorPaul Crowley <paul@lshift.net>
Sun, 08 Mar 2009 15:13:02 +0000
changeset 91 69dd70e1d844
parent 90 03004026cbac
child 92 647c3e61bc95
Don't try to create user if we're installing outside /
install
--- a/install	Sun Mar 08 15:12:43 2009 +0000
+++ b/install	Sun Mar 08 15:13:02 2009 +0000
@@ -67,11 +67,13 @@
         os.seteuid(p.pw_uid)
     return become
 
-try:
-   pwd.getpwnam('hg')
-except KeyError:
-    subprocess.check_call(
-        "adduser --system --shell /bin/sh --group --disabled-password".split() + 
-        ["--gecos", "Mercurial repositories", "hg"])
-    subprocess.check_call([dest + '/init/hginit'], preexec_fn = becomeFunc('hg'))
+if options.root == '':
+    try:
+       pwd.getpwnam('hg')
+    except KeyError:
+        subprocess.check_call(
+            "adduser --system --shell /bin/sh --group --disabled-password".split() + 
+            ["--gecos", "Mercurial repositories", "hg"])
+        subprocess.check_call([options.prefix + '/lib/mercurial-server/init/hginit'],
+            preexec_fn = becomeFunc('hg'))