Add rootuid to configure options. Finish up wheelgid support. Thanks to Ivan Jager...
authorKito <kito@gentoo.org>
Mon, 27 Feb 2006 18:38:11 +0000 (18:38 -0000)
committerKito <kito@gentoo.org>
Mon, 27 Feb 2006 18:38:11 +0000 (18:38 -0000)
svn path=/main/branches/prefix/; revision=2799

configure.in
pym/portage_const_autotool.py
pym/portage_data.py

index d1c9222b93a775c33803e6d1adb4f980a60d9a03..e3a3ff13f195fefd24aec55e4b16e59744a974b0 100644 (file)
@@ -194,13 +194,19 @@ AC_HELP_STRING([--with-rootuser=me],[allows 'me' to do root tasks (default root)
 esac],
 [rootuser=root])
 
+AC_ARG_WITH(rootuid,
+AC_HELP_STRING([--with-rootuid=me],[allows uid 'me' to do root tasks (default 0)]),
+[case "${withval}" in
+  ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-rootuid);;
+  *) rootuid=${withval};;
+esac],
+[rootuid=0])
+
 AC_ARG_WITH(offset-prefix, 
-AC_HELP_STRING([--with-offset-prefix], [specify the offset prefix, defaults to /]),
+AC_HELP_STRING([--with-offset-prefix], [specify the installation prefix for all packages , defaults to /]),
 [DOMAIN_PREFIX=$withval],
 [DOMAIN_PREFIX='/'])
 
-
-
 if test x$enable_missingos = xauto
 then
   pyver=[`python -c 'import sys;print sys.version[0:3]';`]
@@ -239,7 +245,9 @@ AC_CONFIG_FILES([ cnf/Makefile ])
 AC_SUBST(portageuser)
 AC_SUBST(portagegroup)
 AC_SUBST(wheelgroup)
+AC_SUBST(wheelgid)
 AC_SUBST(rootuser)
+AC_SUBST(rootuid)
 AC_SUBST(DOMAIN_PREFIX)
 AC_SUBST(ARCH)
 AC_SUBST(PORTAGE_BASE,['${libdir}/portage'])
index 5a7a361862c8ce66d57b79ee7498610a3553bc84..efea55a605764b4a773634dfce798917bcd86bc6 100644 (file)
@@ -5,7 +5,7 @@
 
 # all vars that are to wind up in portage_const must have their name listed in __all__
 
-__all__ = ["PREFIX", "SYSCONFDIR", "PORTAGE_BASE", "portageuser", "portagegroup", "rootuser", "wheelgid", "wheelgroup"]
+__all__ = ["PREFIX", "SYSCONFDIR", "PORTAGE_BASE", "portageuser", "portagegroup", "rootuser", "rootuid", "wheelgid", "wheelgroup"]
 
 from os import path
 
@@ -15,5 +15,6 @@ PORTAGE_BASE=path.normpath("@PORTAGE_BASE@")
 portagegroup="@portagegroup@"
 portageuser="@portageuser@"
 rootuser="@rootuser@"
+rootuid="@rootuid@"
 wheelgid="@wheelgid@"
 wheelgroup="@wheelgroup@"
index cecdbfc59e63f60e5274e589ec12bff403a1bf92..ea8eacf468a439a156afb9b65d5b7963cee6a248 100644 (file)
@@ -47,16 +47,17 @@ secpass=0
 
 uid=os.getuid()
 wheelgid=portage_const.wheelgid
+wheelgroup=portage_const.wheelgroup
 
-if uid==0:
+if uid==0 or uid==portage_const.rootuid:
        secpass=2
 try:
-       wheelgid=grp.getgrnam("wheel")[2]
+       wheelgid=grp.getgrnam(wheelgroup)[2]
        if (not secpass) and (wheelgid in os.getgroups()):
                secpass=1
 except KeyError:
-       writemsg("portage initialization: your system doesn't have a 'wheel' group.\n")
-       writemsg("Please fix this as it is a normal system requirement. 'wheel' is GID 10\n")
+       writemsg("portage initialization: your system doesn't have a '%s' group.\n" % wheelgroup)
+       writemsg("Please fix this as it is a normal system requirement. '%s' is GID %d\n" % (wheelgroup, wheelgid))
        writemsg("'emerge baselayout' and an 'etc-update' should remedy this problem.\n")
        pass