From: Kito Date: Mon, 27 Feb 2006 18:38:11 +0000 (-0000) Subject: Add rootuid to configure options. Finish up wheelgid support. Thanks to Ivan Jager... X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=afa1f71aa0ebdfae0ea6576b772f365a4dede492;p=portage.git Add rootuid to configure options. Finish up wheelgid support. Thanks to Ivan Jager svn path=/main/branches/prefix/; revision=2799 --- diff --git a/configure.in b/configure.in index d1c9222b9..e3a3ff13f 100644 --- a/configure.in +++ b/configure.in @@ -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']) diff --git a/pym/portage_const_autotool.py b/pym/portage_const_autotool.py index 5a7a36186..efea55a60 100644 --- a/pym/portage_const_autotool.py +++ b/pym/portage_const_autotool.py @@ -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@" diff --git a/pym/portage_data.py b/pym/portage_data.py index cecdbfc59..ea8eacf46 100644 --- a/pym/portage_data.py +++ b/pym/portage_data.py @@ -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