From: Kito Date: Sat, 25 Mar 2006 03:47:54 +0000 (-0000) Subject: Move portage user/group to globals. Fix a few bad path.joins. X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=347c79e1233dc8d648c072270de87b031d361753;p=portage.git Move portage user/group to globals. Fix a few bad path.joins. svn path=/main/branches/prefix/; revision=3000 --- diff --git a/bin/ebuild.sh b/bin/ebuild.sh index e3b2cec5b..68ec8655c 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -1743,7 +1743,7 @@ if [ -n "$myarg" ] && [ "$myarg" != "clean" ]; then # Save current environment and touch a success file. (echo for success) umask 002 set | @EGREP@ -v "^SANDBOX_" > "${T}/environment" 2>/dev/null - chown @portageuser@:@portagegroup@ "${T}/environment" &>/dev/null + chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/environment" &>/dev/null chmod g+w "${T}/environment" &>/dev/null fi diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 35a734944..952cd4825 100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -217,7 +217,7 @@ install_qa_check() { local file s local count=0 - find "${D}/" -user @portageuser@ | while read file; do + find "${D}/" -user ${PORTAGE_USER:-portage} | while read file; do count=$(( $count + 1 )) if [ -L "${file}" ]; then lchown ${PORTAGE_INST_UID:-0} "${file}" @@ -232,11 +232,11 @@ install_qa_check() { fi done if (( $count > 0 )); then - ewarn "$count files were installed with user @portageuser@!" + ewarn "$count files were installed with user ${PORTAGE_USER:-portage}!" fi count=0 - find "${D}/" -group @portagegroup@ | while read file; do + find "${D}/" -group ${PORTAGE_GROUP:-portage}| while read file; do count=$(( $count + 1 )) if [ -L "${file}" ]; then lchgrp ${PORTAGE_INST_GID:-0} "${file}" @@ -251,7 +251,7 @@ install_qa_check() { fi done if (( $count > 0 )); then - ewarn "$count files were installed with group @portagegroup@!" + ewarn "$count files were installed with group ${PORTAGE_GROUP:-portage}!" fi unset -f stat_perms diff --git a/cnf/make.globals b/cnf/make.globals index 2f53e9318..bafa508c1 100644 --- a/cnf/make.globals +++ b/cnf/make.globals @@ -62,8 +62,13 @@ CONFIG_PROTECT="@DOMAIN_PREFIX@/etc" # Disable auto-use USE_ORDER="env:pkg:conf:defaults" +# Default portage user/group +PORTAGE_USER="@portageuser@" +PORTAGE_GROUP="@portagegroup@" + # Default ownership of installed files. PORTAGE_INST_UID="@rootuid@" +PORTAGE_INST_USER="@rootuser@" PORTAGE_INST_GID="@wheelgid@" # Default PATH for ebuild env diff --git a/pym/portage.py b/pym/portage.py index 57ceebdfb..09bec1bf1 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -578,7 +578,7 @@ def env_update(makelinks=1): newld=specials["LDPATH"] if (oldld!=newld): #ld.so.conf needs updating and ldconfig needs to be run - myfd = atomic_ofstream(os.path.join(root, portage_const.EPREFIX, "etc", "ld.so.conf")) + myfd = atomic_ofstream(os.path.join(root+portage_const.EPREFIX, "etc", "ld.so.conf")) myfd.write("# ld.so.conf autogenerated by env-update; make all changes to\n") myfd.write("# contents of "+portage_const.EPREFIX+"/etc/env.d directory\n") for x in specials["LDPATH"]: @@ -588,7 +588,7 @@ def env_update(makelinks=1): # Update prelink.conf if we are prelink-enabled if prelink_capable: - newprelink = atomic_ofstream(os.path.join(root, portage_const.EPREFIX, "etc", "prelink.conf")) + newprelink = atomic_ofstream(os.path.join(root+portage_const.EPREFIX, "etc", "prelink.conf")) newprelink.write("# prelink.conf autogenerated by env-update; make all changes to\n") newprelink.write("# contents of "+portage_const.EPREFIX+"/etc/env.d directory\n") @@ -2409,7 +2409,7 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, t # due to how it's coded... Don't overwrite this so we can use it. mysettings["PORTAGE_DEBUG"]=str(debug) - mysettings["ROOT"] = os.path.normpath(myroot+portage_const.EPREFIX) + mysettings["ROOT"] = normalize_path(myroot+portage_const.EPREFIX) mysettings["STARTDIR"] = getcwd() mysettings["EBUILD"] = ebuild_path @@ -6531,7 +6531,7 @@ if root != "/": os.umask(0) if not os.path.exists(root+portage_const.EPREFIX+"/tmp"): writemsg(">>> "+root+portage_const.EPREFIX+"/tmp doesn't exist, creating it...\n") - os.mkdir(root+portage_const.EPREFIX+"/tmp",01777) + os.makedirs(root+portage_const.EPREFIX+"/tmp",01777) if not os.path.exists(root+portage_const.EPREFIX+"/var/tmp"): writemsg(">>> "+root+portage_const.EPREFIX+"/var/tmp doesn't exist, creating it...\n") try: