From: Fabian Groffen Date: Tue, 1 Apr 2008 18:22:48 +0000 (-0000) Subject: Merged from trunk 9619:9637 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=b0db344fe41ed0c391f484dde2a6b951578eb10d;p=portage.git Merged from trunk 9619:9637 | 9621 | Move the AUTOCLEAN code into dblink.treewalk since it's | | zmedico | already partially supported there anyway (for replacement of | | | identical cpv). This has the benefit of guaranteeing that | | | the order of installation and removal phases is always the | | | same. | | 9623 | Bug #211365 - Use catpkgsplit() instead of pkgsplit() for a | | zmedico | cpv. | | 9625 | Bug #211365 - Use catpkgsplit() instead of pkgsplit() for a | | zmedico | cpv. | | 9628 | Make doins clean up it's own temp files. This solves an odd | | zmedico | issue in dyn_package() when portage 2.1.x is installing | | | portage-2.2 and temp python module files from doins are | | | imported instead of the expected ones. | | 9630 | Fix display code that can triger a 'Invalid category' | | zmedico | exception when it is given a blocker. It's only supposed to | | | execute for normal packages. | | 9632 | Fix typos. Thanks to Arfrever Frehtes Taifersar Arahesis | | zmedico | . | | 9634 | * Fix broken return value for doins. * Make newins cleanup | | zmedico | temp files after itself. | | 9636 | Make sure the all resume lists are deleted when a stale one | | zmedico | is encountered. | | 9637 | When dblink.treewalk() queries for other packages in the | | zmedico | same slot, filter out old-style virtual matches since they | | | are not desired. | svn path=/main/branches/prefix/; revision=9667 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 49f316f96..c107bbce3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -22,7 +22,7 @@ portage-2.2 used without the prefix) - they may currently only include simple and versioned atoms or other sets, use conditionals or any-of constructs aren't possible yet - - emerge makes no difference atm wether you pass a setname or all atoms contained + - emerge makes no difference atm whether you pass a setname or all atoms contained in the set to it, this means that without options packages will be remerged if already installed, or in the case of --unmerge all atoms in a set will be unmerged even if they are depended upon by other packages. This may change in diff --git a/bin/doins b/bin/doins index 26496a8bb..9b2d9f413 100755 --- a/bin/doins +++ b/bin/doins @@ -36,14 +36,18 @@ fi [[ ! -d ${ED}${INSDESTTREE} ]] && dodir "${INSDESTTREE}" _doins() { - local mysrc="$1" mydir="$2" + local mysrc="$1" mydir="$2" cleanup="" rval if [ -L "$mysrc" ] ; then cp "$mysrc" "${T}" mysrc="${T}/${mysrc##*/}" + cleanup=${mysrc} fi install ${INSOPTIONS} "${mysrc}" "${ED}${INSDESTTREE}/${mydir}" + rval=$? + [[ -n ${cleanup} ]] && rm -f "${cleanup}" + return $rval } _xdoins() { @@ -52,6 +56,8 @@ _xdoins() { done } +success=0 + for x in "$@" ; do if [ -d "$x" ] ; then if [ "${DOINSRECUR}" == "n" ] ; then @@ -69,7 +75,10 @@ for x in "$@" ; do find "${x##*/}" -type d -exec dodir "${INSDESTTREE}/{}" \; find "${x##*/}" \( -type f -or -type l \) -print0 | _xdoins popd >/dev/null + ((++success)) else - _doins "${x}" + _doins "${x}" && ((++success)) fi done + +[ $success -gt 0 ] && exit 0 || exit 1 diff --git a/bin/md5check.py b/bin/md5check.py index 39941a253..0b8395078 100755 --- a/bin/md5check.py +++ b/bin/md5check.py @@ -79,7 +79,7 @@ for mycpv in hugelist: if (md5_list[mybn]["MD5"] != md5sums[mybn]["MD5"]) or \ (md5_list[mybn]["size"] != md5sums[mybn]["size"]): - # This associates teh md5 with each file. [md5/size] + # This associates the md5 with each file. [md5/size] md5joins = md5_list[mybn][2].split(",") md5joins = (" ["+md5_list[mybn][0]+"/"+md5_list[mybn][1]+"],").join(md5joins) md5joins += " ["+md5_list[mybn][0]+"/"+md5_list[mybn][1]+"]" diff --git a/bin/newins b/bin/newins index 6d5774cd1..f6ba21b8c 100755 --- a/bin/newins +++ b/bin/newins @@ -8,6 +8,9 @@ if [[ -z ${T} ]] || [[ -z ${2} ]] ; then exit 1 fi -rm -rf "${T}/${2}" && \ -cp -f "${1}" "${T}/${2}" && \ -exec doins "${T}/${2}" +rm -rf "${T}/${2}" || exit $? +cp -f "${1}" "${T}/${2}" || exit $? +doins "${T}/${2}" +ret=$? +rm -rf "${T}/${2}" +exit $ret diff --git a/bin/repoman b/bin/repoman index 5bbe86e15..2e2a87e1c 100755 --- a/bin/repoman +++ b/bin/repoman @@ -222,9 +222,9 @@ def ParseArgs(args, qahelp): if opts.mode == 'commit' and not (opts.force or opts.pretend): if opts.ignore_masked: - parser.error('Commit mode and --ignore-masked are not compatable') + parser.error('Commit mode and --ignore-masked are not compatible') if opts.without_mask: - parser.error('Commit mode and --without-mask are not compatable') + parser.error('Commit mode and --without-mask are not compatible') # Use the verbosity and quiet options to fiddle with the loglevel appropriately for val in range(opts.verbosity): @@ -1123,7 +1123,7 @@ for x in scanlist: fails["KEYWORDS.stupid"].append(x+"/"+y+".ebuild") """ - Ebuilds that inherit a "Live" eclasss (darcs,subversion,git,cvs,etc..) should + Ebuilds that inherit a "Live" eclass (darcs,subversion,git,cvs,etc..) should not be allowed to be marked stable """ if set(["darcs","cvs","subversion","git"]).intersection( diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 46d2e2fd4..14de63149 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -640,7 +640,7 @@ class search(object): self.portdb.xmatch("match-all",match)) elif mtype == "desc": full_package = match - match = portage.pkgsplit(match)[0] + match = portage.cpv_getkey(match) elif mtype == "set": print green("*")+" "+white(match) print " ", darkgreen("Description:")+" ", self.sdict[match].getMetadata("DESCRIPTION") @@ -3921,7 +3921,8 @@ class depgraph(object): show_repos = True verboseadd += teal("[%s]" % repoadd) - xs = list(portage.pkgsplit(x[2])) + xs = [portage.cpv_getkey(pkg_key)] + \ + list(portage.catpkgsplit(pkg_key)[2:]) if xs[2] == "r0": xs[2] = "" else: @@ -4037,22 +4038,23 @@ class depgraph(object): myprint="["+pkgprint(pkg_type)+" "+addl+"] "+indent+pkgprint(pkg_key)+" "+myoldbest+" "+verboseadd p.append(myprint) - mysplit = portage.pkgsplit(x[2]) - if "--tree" not in self.myopts and mysplit and \ - len(mysplit) == 3 and mysplit[0] == "sys-apps/portage" and \ - x[1] == "/": - - if mysplit[2] == "r0": - myversion = mysplit[1] - else: - myversion = "%s-%s" % (mysplit[1], mysplit[2]) - - if myversion != portage.VERSION and "--quiet" not in self.myopts: - if mylist_index < len(mylist) - 1 and EPREFIX == BPREFIX: - p.append(colorize("WARN", "*** Portage will stop merging at this point and reload itself,")) - p.append(colorize("WARN", " then resume the merge.")) - print - del mysplit + mysplit = [portage.cpv_getkey(pkg_key)] + \ + list(portage.catpkgsplit(pkg_key)[2:]) + if "--tree" not in self.myopts and mysplit and \ + len(mysplit) == 3 and mysplit[0] == "sys-apps/portage" and \ + x[1] == "/": + + if mysplit[2] == "r0": + myversion = mysplit[1] + else: + myversion = "%s-%s" % (mysplit[1], mysplit[2]) + + if myversion != portage.VERSION and "--quiet" not in self.myopts: + if mylist_index < len(mylist) - 1: + p.append(colorize("WARN", "*** Portage will stop merging at this point and reload itself,")) + p.append(colorize("WARN", " then resume the merge.")) + print + del mysplit for x in p: print x @@ -4827,24 +4829,10 @@ class MergeTask(object): if "--pretend" not in self.myopts and \ "--fetchonly" not in self.myopts and \ "--fetch-all-uri" not in self.myopts: - # Clean the old package that we have merged over top of it. - if pkgsettings.get("AUTOCLEAN", "yes") == "yes": - xsplit=portage.pkgsplit(x[2]) - emergelog(xterm_titles, " >>> AUTOCLEAN: " + xsplit[0]) - retval = unmerge(self.trees[myroot]["root_config"], - self.myopts, - "clean", [xsplit[0]], ldpath_mtimes, autoclean=1) - if not retval: - emergelog(xterm_titles, - " --- AUTOCLEAN: Nothing unmerged.") - else: - portage.writemsg_stdout(colorize("WARN", "WARNING:") - + " AUTOCLEAN is disabled. This can cause serious" - + " problems due to overlapping packages.\n") # Figure out if we need a restart. - mysplit=portage.pkgsplit(x[2]) - if mysplit[0] == "sys-apps/portage" and x[1] == "/": + if myroot == "/" and \ + portage.dep_getkey(pkg_key) == "sys-apps/portage": if len(mymergelist) > mergecount and EPREFIX == BPREFIX: emergelog(xterm_titles, " ::: completed emerge ("+ \ @@ -6980,7 +6968,11 @@ def action_build(settings, trees, mtimedb, out.eerror("Error: The resume list contains packages that are no longer") out.eerror(" available to be emerged. Please restart/continue") out.eerror(" the merge operation manually.") - del mtimedb["resume"] + + # delete the current list and also the backup + # since it's probably stale too. + for k in ("resume", "resume_backup"): + mtimedb.pop(k, None) mtimedb.commit() return 1 if show_spinner: diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index c079e404e..0155cea6d 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -21,7 +21,7 @@ from portage.versions import pkgsplit, catpkgsplit, catsplit, best, pkgcmp from portage import listdir, dep_expand, flatten, key_expand, \ doebuild_environment, doebuild, env_update, prepare_build_dirs, \ - abssymlink, movefile, _movefile, bsd_chflags + abssymlink, movefile, _movefile, bsd_chflags, cpv_getkey from portage.elog import elog_process from portage.elog.messages import ewarn @@ -1871,8 +1871,11 @@ class dblink(object): for v in self.vartree.dbapi.cp_list(self.mysplit[0]): otherversions.append(v.split("/")[1]) - slot_matches = self.vartree.dbapi.match( - "%s:%s" % (self.mysplit[0], slot)) + # filter any old-style virtual matches + slot_matches = [cpv for cpv in self.vartree.dbapi.match( + "%s:%s" % (cpv_getkey(self.mycpv), slot)) \ + if cpv_getkey(cpv) == cpv_getkey(self.mycpv)] + if self.mycpv not in slot_matches and \ self.vartree.dbapi.cpv_exists(self.mycpv): # handle multislot or unapplied slotmove @@ -2163,11 +2166,11 @@ class dblink(object): "portage" == pkgsplit(self.pkg)[0]: reinstall_self = True + autoclean = self.settings.get("AUTOCLEAN", "yes") == "yes" for dblnk in list(others_in_slot): if dblnk is self: continue - if dblnk.mycpv != self.mycpv and \ - not reinstall_self: + if not (autoclean or dblnk.mycpv == self.mycpv or reinstall_self): continue writemsg_stdout(">>> Safely unmerging already-installed instance...\n") others_in_slot.remove(dblnk) # dblnk will unmerge itself now @@ -2176,8 +2179,12 @@ class dblink(object): # TODO: Check status and abort if necessary. dblnk.delete() writemsg_stdout(">>> Original instance of package unmerged safely.\n") - if not reinstall_self: - break + + if len(others_in_slot) > 1: + from portage.output import colorize + writemsg_stdout(colorize("WARN", "WARNING:") + + " AUTOCLEAN is disabled. This can cause serious" + + " problems due to overlapping packages.\n") # We hold both directory locks. self.dbdir = self.dbpkgdir diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py index 359eb9565..910c03d18 100644 --- a/pym/portage/manifest.py +++ b/pym/portage/manifest.py @@ -262,7 +262,7 @@ class Manifest(object): del self.fhashdict[ftype][fname] def hasFile(self, ftype, fname): - """ Return wether the Manifest contains an entry for the given type,filename pair """ + """ Return whether the Manifest contains an entry for the given type,filename pair """ return (fname in self.fhashdict[ftype]) def findFile(self, fname):