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]';`]
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'])
# 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
portagegroup="@portagegroup@"
portageuser="@portageuser@"
rootuser="@rootuser@"
+rootuid="@rootuid@"
wheelgid="@wheelgid@"
wheelgroup="@wheelgroup@"
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