From: Kito Date: Sun, 5 Feb 2006 04:10:05 +0000 (-0000) Subject: Merge with trunk - r2636:2661 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=cb4d115ba7d35c34222f01c7f67c73fd3cf3e1be;p=portage.git Merge with trunk - r2636:2661 svn path=/main/branches/prefix/; revision=2662 --- diff --git a/bin/dobin b/bin/dobin index c14e9cc73..79075946a 100755 --- a/bin/dobin +++ b/bin/dobin @@ -3,26 +3,30 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/dobin,v 1.13 2004/10/04 13:56:50 vapier Exp $ -if [ ${#} -lt 1 ] ; then - echo "${0}: at least one argument needed" +if [[ $# -lt 1 ]] ; then + echo "$0: at least one argument needed" 1>&2 exit 1 fi -if [ ! -d "${D}${DESTTREE}/bin" ] ; then +if [[ ! -d ${D}${DESTTREE}/bin ]] ; then install -d "${D}${DESTTREE}/bin" || exit 2 fi +case ${CHOST} in + *-freebsd*) group=wheel ;; + *) group=root ;; +esac + +ret=0 + for x in "$@" ; do - if [ -x "${x}" ] ; then - #if executable, use existing perms - install "${x}" "${D}${DESTTREE}/bin" || exit 3 + if [[ -e ${x} ]] ; then + install -m0755 -o root -g ${group} "${x}" "${D}${DESTTREE}/bin" else - #otherwise, use reasonable defaults - echo ">>> dobin: making ${x} executable..." - if [ "$USERLAND" == "GNU" ]; then - install -m0755 -o root -g root "${x}" "${D}${DESTTREE}/bin" || exit 4 - else - install -m0755 -o root -g wheel "${x}" "${D}${DESTTREE}/bin" || exit 4 - fi + echo "!!! ${0##*/}: ${x} does not exist" 1>&2 + false fi + ((ret+=$?)) done + +exit ${ret} diff --git a/bin/doconfd b/bin/doconfd index 23576f0ae..4ee72ad4c 100755 --- a/bin/doconfd +++ b/bin/doconfd @@ -3,13 +3,12 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/doconfd,v 1.2.2.1 2005/01/13 04:51:56 vapier Exp $ -if [ ${#} -lt 1 ] ; then - echo "doconfd: at least one argument needed" +if [[ $# -lt 1 ]] ; then + echo "$0: at least one argument needed" 1>&2 exit 1 fi -tmp_INSDESTTREE="${INSDESTTREE}" -INSDESTTREE=/etc/conf.d/ +exec \ +env \ +INSDESTTREE="/etc/conf.d/" \ doins "$@" -INSDESTTREE="${tmp_INSDESTTREE}" -unset tmp_INSDESTTREE diff --git a/bin/dodir b/bin/dodir index c4cd0f66c..6c45b59c2 100755 --- a/bin/dodir +++ b/bin/dodir @@ -3,6 +3,5 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/dodir,v 1.5 2004/10/04 13:56:50 vapier Exp $ -for x in "$@" ; do - install -d ${DIROPTIONS} "${D}${x}" -done +slash=/ +exec install -d ${DIROPTIONS} "${@/#${slash}/${D}${slash}}" diff --git a/bin/doenvd b/bin/doenvd index e9adc7941..038a583bf 100755 --- a/bin/doenvd +++ b/bin/doenvd @@ -3,13 +3,12 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/doenvd,v 1.2.2.1 2005/01/13 04:51:56 vapier Exp $ -if [ ${#} -lt 1 ] ; then - echo "doenvd: at least one argument needed" +if [[ $# -lt 1 ]] ; then + echo "$0: at least one argument needed" 1>&2 exit 1 fi -tmp_INSDESTTREE="${INSDESTTREE}" -INSDESTTREE=/etc/env.d/ +exec \ +env \ +INSDESTTREE="/etc/env.d/" \ doins "$@" -INSDESTTREE="${tmp_INSDESTTREE}" -unset tmp_INSDESTTREE diff --git a/bin/dohard b/bin/dohard index ebe23afd4..97c46495a 100755 --- a/bin/dohard +++ b/bin/dohard @@ -3,11 +3,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/dohard,v 1.6 2004/10/04 13:56:50 vapier Exp $ -if [ ${#} -ne 2 ] ; then - echo "${0}: two arguments needed" +if [[ $# -ne 2 ]] ; then + echo "$0: two arguments needed" 1>&2 exit 1 fi -mysrc="${1}" -mydest="${2}" -ln -f "${D}${mysrc}" "${D}${mydest}" +target=$1 +linkname=$2 +exec ln -f "${D}${target}" "${D}${linkname}" diff --git a/bin/doinitd b/bin/doinitd index 8f2926f83..3f579462d 100755 --- a/bin/doinitd +++ b/bin/doinitd @@ -3,13 +3,12 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/doinitd,v 1.2.2.1 2005/01/13 04:51:56 vapier Exp $ -if [ ${#} -lt 1 ] ; then - echo "doinitd: at least one argument needed" +if [[ $# -lt 1 ]] ; then + echo "$0: at least one argument needed" 1>&2 exit 1 fi -tmp_EXEDESTTREE="${EXEDESTTREE}" -EXEDESTTREE=/etc/init.d/ +exec \ +env \ +EXEDESTTREE="/etc/init.d/" \ doexe "$@" -EXEDESTTREE="${tmp_EXEDESTTREE}" -unset tmp_EXEDESTTREE diff --git a/bin/dosbin b/bin/dosbin index 65df3aab3..14ff27f15 100755 --- a/bin/dosbin +++ b/bin/dosbin @@ -3,25 +3,30 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/dosbin,v 1.11 2004/10/04 13:56:50 vapier Exp $ -if [ ${#} -lt 1 ] ; then - echo "${0}: at least one argument needed" +if [[ $# -lt 1 ]] ; then + echo "$0: at least one argument needed" 1>&2 exit 1 fi -if [ ! -d "${D}${DESTTREE}/sbin" ] ; then + +if [[ ! -d ${D}${DESTTREE}/sbin ]] ; then install -d "${D}${DESTTREE}/sbin" || exit 2 fi +case ${CHOST} in + *-freebsd*) group=wheel ;; + *) group=root ;; +esac + +ret=0 + for x in "$@" ; do - if [ -x "${x}" ] ; then - #if executable, use existing perms - install -m0755 "${x}" "${D}${DESTTREE}/sbin" || exit 3 + if [[ -e ${x} ]] ; then + install -m0755 -o root -g ${group} "${x}" "${D}${DESTTREE}/sbin" else - #otherwise, use reasonable defaults - echo ">>> dosbin: making ${x} executable..." - if [ "$USERLAND" == "GNU" ]; then - install -m0755 -o root -g root "${x}" "${D}${DESTTREE}/sbin" || exit 4 - else - install -m0755 -o root -g wheel "${x}" "${D}${DESTTREE}/sbin" || exit 4 - fi + echo "!!! ${0##*/}: ${x} does not exist" 1>&2 + false fi + ((ret+=$?)) done + +exit ${ret} diff --git a/bin/dosym b/bin/dosym index 18efade4f..5a5cd287f 100755 --- a/bin/dosym +++ b/bin/dosym @@ -4,7 +4,7 @@ # $Id: /var/cvsroot/gentoo-src/portage/bin/dosym,v 1.7 2004/10/04 13:56:50 vapier Exp $ if [[ $# -ne 2 ]] ; then - echo "${0}: two arguments needed" + echo "$0: two arguments needed" 1>&2 exit 1 fi diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 3041eab80..bf6b9c3f4 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -58,7 +58,7 @@ set_colors # the sandbox is disabled by default except when overridden in the relevant stages export SANDBOX_ON="0" -# sandbox support functions; defined prior to profile.bashrc srcing, since the profile might need to add a default exception (/usr/lib64/conftest fex, bug #60147) +# sandbox support functions; defined prior to profile.bashrc srcing, since the profile might need to add a default exception (/usr/lib64/conftest fex) addread() { export SANDBOX_READ="$SANDBOX_READ:$1" } @@ -2006,8 +2006,8 @@ export TMPDIR="${T}" # That will test for unset *or* NULL (""). We want just to set for unset... #turn off glob expansion from here on in to prevent *'s and ? in the DEPEND -#syntax from getting expanded :) Fixes bug #1473 -#check eclass rdepends also. bug #58819 +#syntax from getting expanded :) +#check eclass rdepends also. set -f if [ "${RDEPEND-unset}" == "unset" ] && [ "${E_RDEPEND-unset}" == "unset" ] ; then export RDEPEND="${DEPEND} ${E_DEPEND}" diff --git a/bin/emerge b/bin/emerge index 946f67624..4c16742a3 100755 --- a/bin/emerge +++ b/bin/emerge @@ -76,7 +76,14 @@ if "candy" in portage.settings.features: if (not sys.stdout.isatty()) or (portage.settings["NOCOLOR"] in ["yes","true"]): nocolor() + + def normpath(mystr): + """ + os.path.normpath("//foo") returns "//foo" instead of "/foo" + We dislike this behavior so we create our own normpath func + to fix it. + """ if mystr and (mystr[0]=='/'): return os.path.normpath("///"+mystr) else: @@ -1140,14 +1147,14 @@ class depgraph: portage.writemsg("\n\n!!! A missing gpg signature is preventing portage from calculating the\n") portage.writemsg("!!! required dependencies. This is a security feature enabled by the admin\n") portage.writemsg("!!! to aid in the detection of malicious intent.\n\n") - portage.writemsg("!!! THIS IS A POSSIBLE INDICATION OF A TAMPERED FILES -- CHECK CAREFULLY.\n") + portage.writemsg("!!! THIS IS A POSSIBLE INDICATION OF TAMPERED FILES -- CHECK CAREFULLY.\n") portage.writemsg("!!! Affected file: %s\n" % (e)) sys.exit(1) except portage_exception.InvalidSignature, e: portage.writemsg("\n\n!!! An invalid gpg signature is preventing portage from calculating the\n") portage.writemsg("!!! required dependencies. This is a security feature enabled by the admin\n") portage.writemsg("!!! to aid in the detection of malicious intent.\n\n") - portage.writemsg("!!! THIS IS A POSSIBLE INDICATION OF A TAMPERED FILES -- CHECK CAREFULLY.\n") + portage.writemsg("!!! THIS IS A POSSIBLE INDICATION OF TAMPERED FILES -- CHECK CAREFULLY.\n") portage.writemsg("!!! Affected file: %s\n" % (e)) sys.exit(1) except SystemExit, e: @@ -1347,7 +1354,7 @@ class depgraph: binpkguseflags=portage.db[portage.root]["bintree"].get_use(myeb_pkg) myk=["binary",myroot,myeb_pkg] else: - sys.stderr.write("!!! Confused... Don't know what I'm using for dependency info. :(\n") + sys.stderr.write("!!! Confused... Don't know what's being used for dependency info. :(\n") sys.exit(1) #if "--usepkg" in myopts: @@ -1870,8 +1877,8 @@ class depgraph: if ("--fetchonly" not in myopts) and ("--buildpkgonly" not in myopts): for x in mylist: if x[0]=="blocks": - print "\n!!! Error: the "+x[2]+" package conflicts with another package." - print "!!! both can't be installed on the same system together." + print "\n!!! Error: the "+x[2]+" package conflicts with another package;" + print "!!! the two packages cannot be installed on the same system together." print "!!! Please use 'emerge --pretend' to determine blockers." print if ("--pretend" not in myopts): @@ -1975,8 +1982,8 @@ class depgraph: pkgindex=3 y=portage.portdb.findname(x[pkgindex]) if not "--pretend" in myopts: - print ">>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+")",x[pkgindex],"to",x[1] - emergelog(" >>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" to "+x[1]) + print ">>> Emerging ("+str(mergecount)+" of "+str(len(mymergelist))+")",x[pkgindex],"to",x[1] + emergelog(" >>> Emerging ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" to "+x[1]) self.pkgsettings["EMERGE_FROM"] = x[0][:] self.pkgsettings.backup_changes("EMERGE_FROM") @@ -2268,7 +2275,7 @@ def unmerge(unmerge_action, unmerge_files): candidate_catpkgs.append("="+string.join(sp_absx[sp_vdb_len:],"/")) if (("--pretend" in myopts) or ("--ask" in myopts)) and not ("--quiet" in myopts): - print darkgreen("\n>>> These are the packages that I would unmerge:") + print darkgreen("\n>>> These are the packages that would be unmerged:") pkgmap={} numselected=0 @@ -2331,7 +2338,7 @@ def unmerge(unmerge_action, unmerge_files): return 0 if not numselected: - print "\n>>>",unmerge_action+": No packages selected for removal.\n" + print "\n>>> No packages selected for removal by",unmerge_action+".\n" return 0 for x in pkgmap.keys(): @@ -2668,15 +2675,15 @@ if myaction in ["sync","rsync","metadata"] and (not "--help" in myopts): print "Quitting." print sys.exit(0) - emergelog(">>> starting rsync with "+dosyncuri) + emergelog(">>> Starting rsync with "+dosyncuri) if "--quiet" not in myopts: - print ">>> starting rsync with "+dosyncuri+"..." + print ">>> Starting rsync with "+dosyncuri+"..." else: emergelog(">>> Starting retry %d of %d with %s" % (retries,maxretries,dosyncuri)) print "\n\n>>> Starting retry %d of %d with %s" % (retries,maxretries,dosyncuri) if "--quiet" not in myopts: - print ">>> checking server timestamp ..." + print ">>> Checking server timestamp ..." mycommand=rsynccommand+" "+dosyncuri+"/metadata/timestamp.chk "+tmpservertimestampdir exitcode=portage.spawn(mycommand,portage.settings,free=1) if (exitcode==0): @@ -2715,7 +2722,7 @@ if myaction in ["sync","rsync","metadata"] and (not "--help" in myopts): retries=retries+1 if retries<=maxretries: - print ">>> retry ..." + print ">>> Retrying..." time.sleep(11) else: # over retries @@ -2756,7 +2763,7 @@ if myaction in ["sync","rsync","metadata"] and (not "--help" in myopts): cvsdir=os.path.dirname(myportdir) if not os.path.exists(myportdir+"/CVS"): #initial checkout - print ">>> starting initial cvs checkout with "+syncuri+"..." + print ">>> Starting initial cvs checkout with "+syncuri+"..." if not portage.spawn("cd "+cvsdir+"; cvs -d "+cvsroot+" login",portage.settings,free=1): print "!!! cvs login error; exiting." sys.exit(1) @@ -2771,7 +2778,7 @@ if myaction in ["sync","rsync","metadata"] and (not "--help" in myopts): sys.exit(0) else: #cvs update - print ">>> starting cvs update with "+syncuri+"..." + print ">>> Starting cvs update with "+syncuri+"..." sys.exit(portage.spawn("cd "+myportdir+"; cvs -z0 -q update -dP",portage.settings,free=1)) else: print "!!! rsync setting: ",syncuri,"not recognized; exiting." @@ -2902,7 +2909,8 @@ if myaction in ["sync","rsync","metadata"] and (not "--help" in myopts): print print red(" * ")+bold("An update to portage is available.")+" It is _highly_ recommended" print red(" * ")+"that you update portage now, before any other packages are updated." - print red(" * ")+"Please do so and then update "+bold("ALL")+" of your configuration files." + print red(" * ")+"Please run 'emerge portage' and then update "+bold("ALL")+" of your" + print red(" * ")+"configuration files." print elif myaction=="regen": emergelog(" === regen") @@ -3135,7 +3143,9 @@ elif "depclean"==myaction: print "\n!!! Proceeding will break your installation.\n" countdown(EMERGE_WARNING_DELAY, ">>> Depclean") - emergelog(" >>> depclean") + if not "--pretend" in myopts: #just check pretend, since --ask implies pretend + emergelog(" >>> depclean") + mydepgraph=depgraph(myaction,myopts) if not ("--quiet" in myopts): @@ -3144,7 +3154,7 @@ elif "depclean"==myaction: print "\n!!! Failed to create deptree." sys.exit(1) if not ("--quiet" in myopts): - print "\b\b ... done!" + print "\b\b... done!" if ("--usepkgonly" in myopts) and mydepgraph.missingbins: sys.stderr.write(red("The following binaries are not available for merging...\n")) @@ -3219,14 +3229,19 @@ elif "depclean"==myaction: else: favorites=[] syslist=getlist("system") - if ((("--pretend" in myopts) and not ("--fetchonly" in myopts or "--fetch-all-uri" in myopts)) or ("--ask" in myopts)) and not ("--quiet" in myopts): - if "--tree" in myopts: + if ("--ask" in myopts or "--pretend" in myopts) and not "--quiet" in myopts: + action = "" + if "--fetchonly" in myopts or "--fetch-all-uri" in myopts: + action = "fetched" + else: + action = "merged" + if "--tree" in myopts and action != "fetched": # Tree doesn't work with fetching print - print darkgreen("These are the packages that I would merge, in reverse order:") + print darkgreen("These are the packages that would be %s, in reverse order:") % action print else: print - print darkgreen("These are the packages that I would merge, in order:") + print darkgreen("These are the packages that would be %s, in order:") % action print if ("--resume" in myopts) and portage.mtimedb.has_key("resume"): @@ -3258,7 +3273,7 @@ else: print "!!! Depgraph creation failed." sys.exit(1) if not ("--quiet" in myopts): - print "\b\b ...done!" + print "\b\b... done!" else: if not myfiles: print "emerge: please tell me what to do." @@ -3272,7 +3287,7 @@ else: if not retval: sys.exit(1) if not ("--quiet" in myopts): - print "\b\b ...done!" + print "\b\b... done!" if ("--usepkgonly" in myopts) and mydepgraph.missingbins: sys.stderr.write(red("The following binaries are not available for merging...\n")) @@ -3296,7 +3311,7 @@ else: #check for blocking dependencies if x[0]=="blocks" and "--fetchonly" not in myopts and "--fetch-all-uri" not in myopts: print "\n!!! Error: The above package list contains packages which cannot be installed" - print "!!! on the same system." + print "!!! at the same time on the same system." print sys.exit(1) if mergecount==0: @@ -3357,6 +3372,6 @@ else: if portage.mtimedb.has_key("resume"): del portage.mtimedb["resume"] if portage.settings["AUTOCLEAN"] and "yes"==portage.settings["AUTOCLEAN"]: - print ">>> Auto-cleaning packages ..." + print ">>> Auto-cleaning packages..." unmerge("clean", ["world"]) post_emerge() diff --git a/bin/newbin b/bin/newbin index c3f291b87..e035fec3c 100755 --- a/bin/newbin +++ b/bin/newbin @@ -3,11 +3,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/newbin,v 1.7 2004/10/04 13:56:50 vapier Exp $ -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Nothing defined to do." +if [[ -z ${T} ]] || [[ -z ${2} ]] ; then + echo "$0: Need two arguments, old file and new file" 1>&2 exit 1 fi -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -dobin "${T}/${2}" +rm -rf "${T}/${2}" && \ +cp -f "${1}" "${T}/${2}" && \ +exec dobin "${T}/${2}" diff --git a/bin/newconfd b/bin/newconfd index dcb57ce7a..5b04002ae 100755 --- a/bin/newconfd +++ b/bin/newconfd @@ -3,11 +3,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/newconfd,v 1.2 2004/10/04 13:56:50 vapier Exp $ -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Nothing defined to do." +if [[ -z ${T} ]] || [[ -z ${2} ]] ; then + echo "$0: Need two arguments, old file and new file" 1>&2 exit 1 fi -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -doconfd "${T}/${2}" +rm -rf "${T}/${2}" && \ +cp -f "${1}" "${T}/${2}" && \ +exec doconfd "${T}/${2}" diff --git a/bin/newdoc b/bin/newdoc index 38d5424fe..37bdca157 100755 --- a/bin/newdoc +++ b/bin/newdoc @@ -3,11 +3,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/newdoc,v 1.7 2004/10/04 13:56:50 vapier Exp $ -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Nothing defined to do." +if [[ -z ${T} ]] || [[ -z ${2} ]] ; then + echo "$0: Need two arguments, old file and new file" 1>&2 exit 1 fi -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -dodoc "${T}/${2}" +rm -rf "${T}/${2}" && \ +cp -f "${1}" "${T}/${2}" && \ +exec dodoc "${T}/${2}" diff --git a/bin/newenvd b/bin/newenvd index 452add109..54a58f870 100755 --- a/bin/newenvd +++ b/bin/newenvd @@ -3,11 +3,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/newenvd,v 1.2 2004/10/04 13:56:50 vapier Exp $ -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Nothing defined to do." +if [[ -z ${T} ]] || [[ -z ${2} ]] ; then + echo "$0: Need two arguments, old file and new file" 1>&2 exit 1 fi -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -doenvd "${T}/${2}" +rm -rf "${T}/${2}" && \ +cp -f "${1}" "${T}/${2}" && \ +exec doenvd "${T}/${2}" diff --git a/bin/newexe b/bin/newexe index f4ddf67d4..aef2d8145 100755 --- a/bin/newexe +++ b/bin/newexe @@ -3,11 +3,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/newexe,v 1.7 2004/10/04 13:56:50 vapier Exp $ -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Nothing defined to do." +if [[ -z ${T} ]] || [[ -z ${2} ]] ; then + echo "$0: Need two arguments, old file and new file" 1>&2 exit 1 fi -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -doexe "${T}/${2}" +rm -rf "${T}/${2}" && \ +cp -f "${1}" "${T}/${2}" && \ +exec doexe "${T}/${2}" diff --git a/bin/newinitd b/bin/newinitd index 62de7b075..92cce843b 100755 --- a/bin/newinitd +++ b/bin/newinitd @@ -3,11 +3,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/newinitd,v 1.2 2004/10/04 13:56:50 vapier Exp $ -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Nothing defined to do." +if [[ -z ${T} ]] || [[ -z ${2} ]] ; then + echo "$0: Need two arguments, old file and new file" 1>&2 exit 1 fi -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -doinitd "${T}/${2}" +rm -rf "${T}/${2}" && \ +cp -f "${1}" "${T}/${2}" && \ +exec doinitd "${T}/${2}" diff --git a/bin/newins b/bin/newins index 72c084ea3..2824c6315 100755 --- a/bin/newins +++ b/bin/newins @@ -3,11 +3,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/newins,v 1.7 2004/10/04 13:56:50 vapier Exp $ -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Error: Nothing defined to do." +if [[ -z ${T} ]] || [[ -z ${2} ]] ; then + echo "$0: Need two arguments, old file and new file" 1>&2 exit 1 fi -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -doins "${T}/${2}" +rm -rf "${T}/${2}" && \ +cp -f "${1}" "${T}/${2}" && \ +exec doins "${T}/${2}" diff --git a/bin/newlib.a b/bin/newlib.a index 7f9d80d58..973c504a6 100755 --- a/bin/newlib.a +++ b/bin/newlib.a @@ -3,11 +3,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/newlib.a,v 1.7 2004/10/04 13:56:50 vapier Exp $ -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Error: Nothing defined to do." +if [[ -z ${T} ]] || [[ -z ${2} ]] ; then + echo "$0: Need two arguments, old file and new file" 1>&2 exit 1 fi -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -dolib.a "${T}/${2}" +rm -rf "${T}/${2}" && \ +cp -f "${1}" "${T}/${2}" && \ +exec dolib.a "${T}/${2}" diff --git a/bin/newlib.so b/bin/newlib.so index 1aa6747fb..2c1e1ed4a 100755 --- a/bin/newlib.so +++ b/bin/newlib.so @@ -3,11 +3,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/newlib.so,v 1.7 2004/10/04 13:56:50 vapier Exp $ -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Error: Nothing defined to do." +if [[ -z ${T} ]] || [[ -z ${2} ]] ; then + echo "$0: Need two arguments, old file and new file" 1>&2 exit 1 fi -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -dolib.so "${T}/${2}" +rm -rf "${T}/${2}" && \ +cp -f "${1}" "${T}/${2}" && \ +exec dolib.so "${T}/${2}" diff --git a/bin/newman b/bin/newman index ce817a622..76ef9a83f 100755 --- a/bin/newman +++ b/bin/newman @@ -3,11 +3,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/newman,v 1.7 2004/10/04 13:56:50 vapier Exp $ -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Nothing defined to do." +if [[ -z ${T} ]] || [[ -z ${2} ]] ; then + echo "$0: Need two arguments, old file and new file" 1>&2 exit 1 fi -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -doman "${T}/${2}" +rm -rf "${T}/${2}" && \ +cp -f "${1}" "${T}/${2}" && \ +exec doman "${T}/${2}" diff --git a/bin/newsbin b/bin/newsbin index 985a62330..2cd42065a 100755 --- a/bin/newsbin +++ b/bin/newsbin @@ -3,11 +3,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/newsbin,v 1.7 2004/10/04 13:56:50 vapier Exp $ -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Nothing defined to do." +if [[ -z ${T} ]] || [[ -z ${2} ]] ; then + echo "$0: Need two arguments, old file and new file" 1>&2 exit 1 fi -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -dosbin "${T}/${2}" +rm -rf "${T}/${2}" && \ +cp -f "${1}" "${T}/${2}" && \ +exec dosbin "${T}/${2}" diff --git a/cnf/etc-update.conf b/cnf/etc-update.conf index 379dd1636..647af1270 100644 --- a/cnf/etc-update.conf +++ b/cnf/etc-update.conf @@ -21,12 +21,17 @@ cp_opts="-i" pager="less" #pager="" +# For emacs-users +# diff_command="eval emacs -nw --eval=\(ediff\ \"%file1\"\ \"%file2\"\)" +#using_editor=1 + # vim-users: you CAN use vimdiff for diff_command. (see NOTE_1) -diff_command="diff -uN %file1 %file2" -using_editor=0 #diff_command="vim -d %file1 %file2" #using_editor=1 +diff_command="diff -uN %file1 %file2" +using_editor=0 + # vim-users: don't use vimdiff for merging (see NOTE_1) merge_command="sdiff -s -o %merged %orig %new" @@ -68,4 +73,3 @@ merge_command="sdiff -s -o %merged %orig %new" # choose while using those programs) # NOTE_2: Make sure pager is set to "" when using an editor as diff_command! - diff --git a/pym/portage.py b/pym/portage.py index f12209525..64e9d85c1 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -1721,12 +1721,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", pass else: if try_mirrors: - for x in mysettings["GENTOO_MIRRORS"].split(): - if x: - if x[-1] == '/': - mymirrors += [x[:-1]] - else: - mymirrors += [x] + mymirrors += [x.rstrip("/") for x in mysettings["GENTOO_MIRRORS"].split() if x] mydigests = {} digestfn = mysettings["FILESDIR"]+"/digest-"+mysettings["PF"] @@ -2140,7 +2135,7 @@ def digestgen(myarchives,mysettings,overwrite=1,manifestonly=0): if (not overwrite) and os.path.exists(digestfn): return 1 - print green(">>> Generating digest file...") + print green(">>> Generating the digest file...") # Track the old digest so we can assume checksums without requiring # all files to be downloaded. 'Assuming' @@ -2176,7 +2171,7 @@ def digestgen(myarchives,mysettings,overwrite=1,manifestonly=0): except Exception,e: print e - print green(">>> Generating manifest file...") + print green(">>> Generating the manifest file...") mypfiles=listdir(pbasedir,recursive=1,filesonly=1,ignorecvs=1,EmptyOnError=1) mypfiles=cvstree.apply_cvsignore_filter(mypfiles) mypfiles.sort() @@ -4096,7 +4091,6 @@ class dbapi: if mycpv: mysplit = pkgsplit(mycpv) for x in self.match(mysplit[0],use_cache=0): - # fixed bug #41062 if x==mycpv: continue try: @@ -6080,7 +6074,7 @@ class dblink: self.dbdir = self.dbpkgdir self.unmerge(oldcontents,trimworld=0) self.dbdir = self.dbtmpdir - writemsg_stdout(">>> original instance of package unmerged safely.\n") + writemsg_stdout(">>> Original instance of package unmerged safely.\n") # We hold both directory locks. self.dbdir = self.dbpkgdir @@ -6384,7 +6378,7 @@ class dblink: zing="---" if self.settings["USERLAND"] == "Darwin" and myrealdest[-2:] == ".a": - # XXX kludge, bug #58848; can be killed when portage stops relying on + # XXX kludge, can be killed when portage stops relying on # md5+mtime, and uses refcounts # alright, we've fooled w/ mtime on the file; this pisses off static archives # basically internal mtime != file's mtime, so the linker (falsely) thinks @@ -6522,7 +6516,7 @@ def pkgmerge(mytbz2,myroot,mysettings): shutil.rmtree(tmploc+"/"+mypkg,1) os.makedirs(pkgloc) os.makedirs(infloc) - writemsg_stdout(">>> extracting info\n") + writemsg_stdout(">>> Extracting info\n") xptbz2.unpackinfo(infloc) # run pkg_setup early, so we can bail out early # (before extracting binaries) if there's a problem @@ -6531,10 +6525,10 @@ def pkgmerge(mytbz2,myroot,mysettings): mysettings.configdict["pkg"]["CATEGORY"] = mycat; a=doebuild(myebuild,"setup",myroot,mysettings,tree="bintree") - writemsg_stdout(">>> extracting %s\n" % mypkg) + writemsg_stdout(">>> Extracting %s\n" % mypkg) notok=spawn("bzip2 -dqc -- '"+mytbz2+"' | tar xpf -",mysettings,free=1) if notok: - print "!!! Error extracting",mytbz2 + print "!!! Error Extracting",mytbz2 cleanup_pkgmerge(mypkg,origdir) return None