Merged from trunk 9619:9637
authorFabian Groffen <grobian@gentoo.org>
Tue, 1 Apr 2008 18:22:48 +0000 (18:22 -0000)
committerFabian Groffen <grobian@gentoo.org>
Tue, 1 Apr 2008 18:22:48 +0000 (18:22 -0000)
   | 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 | <Arfrever.FTA@GMail.Com>.                                    |

   | 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

RELEASE-NOTES
bin/doins
bin/md5check.py
bin/newins
bin/repoman
pym/_emerge/__init__.py
pym/portage/dbapi/vartree.py
pym/portage/manifest.py

index 49f316f96f6cbda32f75d3f758085213dcdf9afd..c107bbce3dc0da24613b44730a9972360857d461 100644 (file)
@@ -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 
index 26496a8bb19e2abdae00a54d9677bd73ea159d12..9b2d9f4135e1264ecae21d8a77bb54c1924ed655 100755 (executable)
--- 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
index 39941a253bc85563508b2ab8c52134787847a28b..0b8395078758fafbaf69ad1926f5e1c69ac2332a 100755 (executable)
@@ -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]+"]"
index 6d5774cd155ce1715d3305a499fc3ba78a9f47fa..f6ba21b8c127c658d2af3ced3b28a2fb4808ad52 100755 (executable)
@@ -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
index 5bbe86e159c298daa245f076679565ce3e714815..2e2a87e1ca212834c11e374cfcef75f93817d434 100755 (executable)
@@ -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(
index 46d2e2fd47d3bfa0aa4a0288ecdf55e6b5631f35..14de631490119cae6f42bcd6af4517edb3d161a3 100644 (file)
@@ -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:
index c079e404eba0afe8349f6b4dceb11cc4341a1802..0155cea6d1680b59f45d2014a40df42caa907cee 100644 (file)
@@ -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
index 359eb9565527063f31770504eb66e4231208cfb2..910c03d18ddd706bd026207a87be17ea33361118 100644 (file)
@@ -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):