68928-spawn-command-isabs-zmedico.patch (spawn included "." in PATH)
authorJason Stubbs <jstubbs@gentoo.org>
Thu, 1 Sep 2005 14:42:25 +0000 (14:42 -0000)
committerJason Stubbs <jstubbs@gentoo.org>
Thu, 1 Sep 2005 14:42:25 +0000 (14:42 -0000)
98727_sleep_locale_cleanup.patch (sleep was defined twice for "." and "," locales)
98827_lchown_normal_files.patch (lchown was being used on known-to-be-regular files)
98827_darwin_noop_lchown.patch (lchwon was aliased to chown on darwin)
99101_ccache_perms_adjust.patch (perms test and adjustment didn't match)
99120_uid_gid_mixup.patch (portage gid used in place of uid)
99418_merge_retcode_ignored.patch (dispatch-conf ignored result of merge command)
100382_incomplete_world.patch (versioned atoms were not being added to world)
broken-stat-perms.patch (result of conditional execution being unconditionally tested)

svn path=/main/branches/2.0/; revision=1960

bin/dispatch-conf
bin/ebuild.sh
bin/emerge
pym/portage.py
pym/portage_data.py
pym/portage_exec.py

index 0d316126a9bb9a039d05e4b5801c2ca4196c63b4..5007353fc82840b90c52cf2796d2dc2bd6f7a87c 100755 (executable)
@@ -186,7 +186,10 @@ class dispatch:
                 elif c == 'm':
                     merged = SCRATCH_DIR+"/"+os.path.basename(conf['current'])
                     print
-                    os.system (self.options['merge'] % (merged, conf ['current'], newconf))
+                    ret = os.system (self.options['merge'] % (merged, conf ['current'], newconf))
+                    if ret:
+                        print "Failure running 'merge' command"
+                        continue
                     shutil.copyfile(merged, mrgconf)
                     os.remove(merged)
                     mystat = os.lstat(conf['new'])
index ab3e05c73d0ae08e94d8d859961e7c1f0598f02b..ffb2c25d98079bd8c54583709c25ec0cd5fafcb6 100755 (executable)
@@ -867,15 +867,11 @@ dyn_compile() {
                echo "!!! that you know what you are doing... You have 5 seconds to abort..."
                echo
 
-               echo -ne "\a"; sleep 0.25 &>/dev/null; echo -ne "\a"; sleep 0.25 &>/dev/null
-               echo -ne "\a"; sleep 0.25 &>/dev/null; echo -ne "\a"; sleep 0.25 &>/dev/null
-               echo -ne "\a"; sleep 0.25 &>/dev/null; echo -ne "\a"; sleep 0.25 &>/dev/null
-               echo -ne "\a"; sleep 0.25 &>/dev/null; echo -ne "\a"; sleep 0.25 &>/dev/null
-
-               echo -ne "\a"; sleep 0,25 &>/dev/null; echo -ne "\a"; sleep 0,25 &>/dev/null
-               echo -ne "\a"; sleep 0,25 &>/dev/null; echo -ne "\a"; sleep 0,25 &>/dev/null
-               echo -ne "\a"; sleep 0,25 &>/dev/null; echo -ne "\a"; sleep 0,25 &>/dev/null
-               echo -ne "\a"; sleep 0,25 &>/dev/null; echo -ne "\a"; sleep 0,25 &>/dev/null
+               for x in 1 2 3 4 5 6 7 8; do
+                       echo -ne "\a"
+                       LC_ALL=C sleep 0.25
+               done
+
                sleep 3
        fi
 
@@ -1129,10 +1125,12 @@ dyn_install() {
        local count=0
        find "${D}/" -user  portage | while read file; do
                count=$(( $count + 1 ))
-               [[ ! -L "${file}" ]] && s=$(stat_perms "$file")
-               if [ -z "${s}" ]; then
-                       ewarn "failed stat_perm'ing $file.  User intervention during install isn't wise..."
-                       continue
+               if [ ! -L "${file}" ]; then
+                       s=$(stat_perms "$file")
+                       if [ -z "${s}" ]; then
+                               ewarn "failed stat_perm'ing $file.  User intervention during install isn't wise..."
+                               continue
+                       fi
                fi
                chown root "$file"
                [[ ! -L "${file}" ]] && chmod "$s" "$file"
@@ -1144,10 +1142,12 @@ dyn_install() {
        count=0
        find "${D}/" -group portage | while read file; do
                count=$(( $count + 1 ))
-               [[ ! -L "${file}" ]] && s=$(stat_perms "$file")
-               if [ -z "${s}" ]; then
-                       echo "failed stat_perm'ing '$file' . User intervention during install isn't wise..."
-                       continue
+               if [ ! -L "${file}" ]; then
+                       s=$(stat_perms "$file")
+                       if [ -z "${s}" ]; then
+                               echo "failed stat_perm'ing '$file' . User intervention during install isn't wise..."
+                               continue
+                       fi
                fi
                chgrp 0 "${file}"
                [[ ! -L "${file}" ]] && chmod "$s" "$file"
index 987c37df31f35f2502595a0cc597634f4cafdf72..e749b53563a63b58b5b2af7d48ab09f9d7fd5078 100755 (executable)
@@ -1114,7 +1114,7 @@ class depgraph:
                                if not self.mysd:
                                        return (0,myfavorites)
                                elif not "--oneshot" in myopts:
-                                       myfavorites.append(mykey)
+                                       myfavorites.append(portage.dep_getkey(mykey))
 
                missing=0
                if "--usepkgonly" in myopts:
index f986e2817311b73e22c809fb44ae97ce5dedc356..d264ef68eaa661c9c83a4a2616a83cebaab0952a 100644 (file)
@@ -2530,19 +2530,19 @@ def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,clea
                                        os.makedirs(mysettings["CCACHE_DIR"])
                                mystat = os.stat(mysettings["CCACHE_DIR"])
                                if ("userpriv" in features):
-                                       if mystat[stat.ST_UID] != portage_gid or ((mystat[stat.ST_MODE]&02070)!=02070):
+                                       if mystat[stat.ST_UID] != portage_uid or ((mystat[stat.ST_MODE]&02070)!=02070):
                                                writemsg("* Adjusting permissions on ccache in %s\n" % mysettings["CCACHE_DIR"])
                                                spawn("chgrp -R "+str(portage_gid)+" "+mysettings["CCACHE_DIR"], mysettings, free=1)
                                                spawn("chown "+str(portage_uid)+":"+str(portage_gid)+" "+mysettings["CCACHE_DIR"], mysettings, free=1)
                                                spawn("chmod -R ug+rw "+mysettings["CCACHE_DIR"], mysettings, free=1)
-                                               spawn("find "+mysettings["CCACHE_DIR"]+" -type d -exec chmod g+s \{\} \;", mysettings, free=1)
+                                               spawn("find "+mysettings["CCACHE_DIR"]+" -type d -exec chmod g+xs \{\} \;", mysettings, free=1)
                                else:
                                        if mystat[stat.ST_UID] != 0 or ((mystat[stat.ST_MODE]&02070)!=02070):
                                                writemsg("* Adjusting permissions on ccache in %s\n" % mysettings["CCACHE_DIR"])
                                                spawn("chgrp -R "+str(portage_gid)+" "+mysettings["CCACHE_DIR"], mysettings, free=1)
                                                spawn("chown 0:"+str(portage_gid)+" "+mysettings["CCACHE_DIR"], mysettings, free=1)
                                                spawn("chmod -R ug+rw "+mysettings["CCACHE_DIR"], mysettings, free=1)
-                                               spawn("find "+mysettings["CCACHE_DIR"]+" -type d -exec chmod g+s \{\} \;", mysettings, free=1)
+                                               spawn("find "+mysettings["CCACHE_DIR"]+" -type d -exec chmod g+xs \{\} \;", mysettings, free=1)
                except OSError, e:
                        print "!!! File system problem. (ReadOnly? Out of space?)"
                        print "!!! Perhaps: rm -Rf",mysettings["BUILD_PREFIX"]
@@ -2872,7 +2872,10 @@ def movefile(src,dest,newmtime=None,sstat=None,mysettings=None):
                                        return None # failure
                try:
                        if didcopy:
-                               lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
+                               if stat.S_ISLNK(sstat[stat.ST_MODE]):
+                                       lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
+                               else
+                                       os.chown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
                                os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown
                                os.unlink(src)
                except SystemExit, e:
@@ -6745,7 +6748,7 @@ class dblink:
                                                if bsd_chflags:
                                                        bsd_chflags.lchflags(mydest, dflags)
                                                os.chmod(mydest,mystat[0])
-                                               lchown(mydest,mystat[4],mystat[5])
+                                               os.chown(mydest,mystat[4],mystat[5])
                                                print ">>>",mydest+"/"
                                else:
                                        #destination doesn't exist
@@ -6757,7 +6760,7 @@ class dblink:
                                        os.chmod(mydest,mystat[0])
                                        if bsd_chflags:
                                                bsd_chflags.lchflags(mydest, bsd_chflags.lgetflags(mysrc))
-                                       lchown(mydest,mystat[4],mystat[5])
+                                       os.chown(mydest,mystat[4],mystat[5])
                                        print ">>>",mydest+"/"
                                outfile.write("dir "+myrealdest+"\n")
                                # recurse and merge this directory
index a0f055a80f1b3a80d5446283621269143bb7bd84..2afd0466771f61e09523ca50d9d0b52ada17bfb1 100644 (file)
@@ -16,8 +16,9 @@ if ostype=="Linux" or ostype.lower().endswith("gnu"):
        os.environ["XARGS"]="xargs -r"
 elif ostype == "Darwin":
        userland="Darwin"
-       os.environ["XARGS"]="xargs"     
-       lchown=os.chown
+       os.environ["XARGS"]="xargs"
+       def lchown(*pos_args, **key_args):
+               pass
 elif ostype in ["FreeBSD","OpenBSD"]:
        userland="BSD"
        os.environ["XARGS"]="xargs"
index 18cfc0c6968d03a4c848cf879748c7b740ef6f42..8a92c7ae2c642117da92e2fb18e700e30c89a11d 100644 (file)
@@ -70,7 +70,7 @@ def spawn(mycommand,env={},opt_name=None,fd_pipes=None,returnpid=False,uid=None,
        if type(mycommand)==types.StringType:
                mycommand=mycommand.split()
        myc = mycommand[0]
-       if not os.access(myc, os.X_OK):
+       if not os.path.isabs(myc) or not os.access(myc, os.X_OK):
                if not path_lookup:
                        return None
                myc = find_binary(myc)