Move portage user/group to globals. Fix a few bad path.joins.
authorKito <kito@gentoo.org>
Sat, 25 Mar 2006 03:47:54 +0000 (03:47 -0000)
committerKito <kito@gentoo.org>
Sat, 25 Mar 2006 03:47:54 +0000 (03:47 -0000)
svn path=/main/branches/prefix/; revision=3000

bin/ebuild.sh
bin/misc-functions.sh
cnf/make.globals
pym/portage.py

index e3b2cec5b887b40ed171e4c493ecb08d447a98fc..68ec8655c74657c1a6d607d9407c5237d6c044ab 100755 (executable)
@@ -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
 
index 35a7349448b67a3a9c649039573c01ade465a32d..952cd48256eefbe2f551990a4362a098d68e6b14 100644 (file)
@@ -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
index 2f53e9318f27865f36be1726a3593c2279afac3c..bafa508c131438360dedb3e5c3c4fe99c5529540 100644 (file)
@@ -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
index 57ceebdfb21edfe24e75165d4471988ed84ab887..09bec1bf12aa5b16d2fdfba2568fd04ca5577e0c 100644 (file)
@@ -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: