From 1b1f845635a1542fc2b7fda43d8dc44e55a8fded Mon Sep 17 00:00:00 2001 From: Jason Stubbs Date: Thu, 1 Sep 2005 14:42:25 +0000 Subject: 68928-spawn-command-isabs-zmedico.patch (spawn included "." in PATH) 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 | 5 ++++- bin/ebuild.sh | 34 +++++++++++++++++----------------- bin/emerge | 2 +- pym/portage.py | 15 +++++++++------ pym/portage_data.py | 5 +++-- pym/portage_exec.py | 2 +- 6 files changed, 35 insertions(+), 28 deletions(-) diff --git a/bin/dispatch-conf b/bin/dispatch-conf index 0d316126a..5007353fc 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -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']) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index ab3e05c73..ffb2c25d9 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -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" diff --git a/bin/emerge b/bin/emerge index 987c37df3..e749b5356 100755 --- a/bin/emerge +++ b/bin/emerge @@ -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: diff --git a/pym/portage.py b/pym/portage.py index f986e2817..d264ef68e 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -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 diff --git a/pym/portage_data.py b/pym/portage_data.py index a0f055a80..2afd04667 100644 --- a/pym/portage_data.py +++ b/pym/portage_data.py @@ -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" diff --git a/pym/portage_exec.py b/pym/portage_exec.py index 18cfc0c69..8a92c7ae2 100644 --- a/pym/portage_exec.py +++ b/pym/portage_exec.py @@ -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) -- cgit v1.2.3-1-g7c22