Merged from trunk 7698:7705
authorFabian Groffen <grobian@gentoo.org>
Mon, 27 Aug 2007 19:41:03 +0000 (19:41 -0000)
committerFabian Groffen <grobian@gentoo.org>
Mon, 27 Aug 2007 19:41:03 +0000 (19:41 -0000)
   | 7699     | remove $Id$ as it gives us nothing useful                   |
   | SpankMan |                                                             |

   | 7700     | Bug #190214 - Make the rpm phase use /usr/src/rpm instead   |
   | zmedico  | of /usr/src/redhat. Bug #190144 - Use the realpath of       |
   |          | DISTDIR so that things like subversion.eclass are           |
   |          | compatible with sandbox.                                    |

   | 7701     | Move blocker handling from depgraph.create() to             |
   | zmedico  | select_dep().                                               |

   | 7702     | change directory to / in case $PWD doesnt exist             |
   | SpankMan |                                                             |

   | 7705     | Bug #190406 - Filter the myheaders list so that it doesn't  |
   | zmedico  | include binary blobs added to cvs with the -kb option.      |

svn path=/main/branches/prefix/; revision=7707

bin/etc-update
bin/misc-functions.sh
bin/repoman
cnf/etc-update.conf
pym/emerge/__init__.py
pym/portage/__init__.py
pym/portage/cvstree.py

index 7fef4366ed9d4e6e44765e13d35b04d0d70889e2..e99cd08737fc9b9ecbc0618bf37784319139e018 100755 (executable)
@@ -1,5 +1,5 @@
 #!@BASH@
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -10,6 +10,8 @@
 # Leo Lipelis <aeoo@gentoo.org>
 # Karl Trygve Kalleberg <karltk@gentoo.org>
 
+cd /
+
 if type -P gsed >/dev/null ; then
        function sed() { gsed "$@"; }
 fi
index c9e2588cdb3b28571a01ab6ad29f822c26acfaba..008f31bdc61ce85ef16badc2a3642971f020b1a8 100644 (file)
@@ -578,7 +578,9 @@ dyn_package() {
 }
 
 dyn_spec() {
-       tar czf "/usr/src/redhat/SOURCES/${PF}.tar.gz" "${O}/${PF}.ebuild" "${O}/files" || die "Failed to create base rpm tarball."
+       tar czf "/usr/src/rpm/SOURCES/${PF}.tar.gz" \
+               "${O}/${PF}.ebuild" "${O}/files" || \
+               die "Failed to create base rpm tarball."
 
        cat <<__END1__ > ${PF}.spec
 Summary: ${DESCRIPTION}
@@ -610,11 +612,13 @@ __END1__
 }
 
 dyn_rpm() {
-       addwrite /usr/src/redhat/
-       addwrite ${RPMDIR}
+       addwrite /usr/src/rpm
+       addwrite "${RPMDIR}"
        dyn_spec
        rpmbuild -bb "${PF}.spec" || die "Failed to integrate rpm spec file"
-       install -D "/usr/src/redhat/RPMS/i386/${PN}-${PV}-${PR}.i386.rpm" "${RPMDIR}/${CATEGORY}/${PN}-${PV}-${PR}.rpm" || die "Failed to move rpm"
+       install -D "/usr/src/rpm/RPMS/i386/${PN}-${PV}-${PR}.i386.rpm" \
+               "${RPMDIR}/${CATEGORY}/${PN}-${PV}-${PR}.rpm" || \
+               die "Failed to move rpm"
 }
 
 if [ -n "${MISC_FUNCTIONS_ARGS}" ]; then
index e3d0fc4b39be68a3e4aa536ba0e82bc5940407f0..4e390deea1c1030b47a76f1417919376232fdbdc 100755 (executable)
@@ -1767,11 +1767,15 @@ elif "--pretend" not in myoptions:
                print
                sys.exit(1)
 
-       if isCvs:
+       if True:
                mycvstree=portage.cvstree.getentries("./",recursive=1)
                mychanged=portage.cvstree.findchanged(mycvstree,recursive=1,basedir="./")
                mynew=portage.cvstree.findnew(mycvstree,recursive=1,basedir="./")
                myremoved=portage.cvstree.findremoved(mycvstree,recursive=1,basedir="./")
+               bin_blob_pattern = re.compile("^-kb$")
+               bin_blobs = set(portage.cvstree.findoption(mycvstree,
+                       bin_blob_pattern, recursive=1, basedir="./"))
+
        if isSvn:
                svnstatus = os.popen("svn status").readlines()
                mychanged = [ elem.rstrip()[7:] for elem in svnstatus if elem.startswith("M") ]
@@ -1803,6 +1807,8 @@ elif "--pretend" not in myoptions:
        headerstring="'\$(Header|Id)"
        headerstring+=".*\$'"
        for myfile in myupdates:
+               if myfile in bin_blobs:
+                       continue
                myout=getstatusoutput("egrep -q "+headerstring+" "+myfile)
                if myout[0]==0:
                        myheaders.append(myfile)
index 06c46ad74cb096897d8960036ad3d1361d9ee940..12396b3b4bf6b42116ab4193baccd582109438bc 100644 (file)
@@ -1,5 +1,5 @@
+# /etc/etc-update.conf: config file for `etc-update` utility
 # edit the lines below to your liking
-# $Id: etc-update.conf 3483 2006-06-10 21:40:40Z genone $
 
 # mode - 0 for text, 1 for menu (support incomplete)
 # note that you need dev-util/dialog installed
index 075e2eb878309b67d381f44678bb62938b095e4f..1de6f8ae1f46c343a2b38a7d7d16395ac35daea4 100644 (file)
@@ -1170,16 +1170,6 @@ class depgraph(object):
 
                mytype, myroot, mykey = mybigkey
 
-               if mytype == "blocks":
-                       if myparent and \
-                               "--buildpkgonly" not in self.myopts and \
-                               "--nodeps" not in self.myopts and \
-                               myparent not in self._slot_collision_nodes:
-                               mybigkey[1] = myparent[1]
-                               self.blocker_parents.setdefault(
-                                       tuple(mybigkey), set()).add(myparent)
-                       return 1
-
                # select the correct /var database that we'll be checking against
                vardbapi = self.trees[myroot]["vartree"].dbapi
                portdb = self.trees[myroot]["porttree"].dbapi
@@ -1725,8 +1715,17 @@ class depgraph(object):
                        print "Candidates:",mymerge
                for x in mymerge:
                        selected_pkg = None
-                       if x[0]=="!":
-                               selected_pkg = (["blocks", myroot, x[1:]], None)
+                       if x.startswith("!"):
+                               if "--buildpkgonly" not in self.myopts and \
+                                       "--nodeps" not in self.myopts and \
+                                       myparent not in self._slot_collision_nodes:
+                                       p_type, p_root, p_key, p_status = myparent
+                                       if  p_type != "installed" and p_status != "merge":
+                                               # It's safe to ignore blockers from --onlydeps nodes.
+                                               continue
+                                       self.blocker_parents.setdefault(
+                                               ("blocks", p_root, x[1:]), set()).add(myparent)
+                               continue
                        else:
                                #We are not processing a blocker but a normal dependency
                                if myparent:
index 924be6f699a2a5fe8ebf3a3a7f865441600861d0..cd1ff69aa48c5a5dafcc8e0b5f1cdf22c3329e2f 100644 (file)
@@ -3353,6 +3353,9 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, m
        mysettings["PF"]       = mypv
 
        mysettings["PORTDIR"] = os.path.realpath(mysettings["PORTDIR"])
+       mysettings["DISTDIR"] = os.path.realpath(mysettings["DISTDIR"])
+       mysettings["RPMDIR"]  = os.path.realpath(mysettings["RPMDIR"])
+
        mysettings["ECLASSDIR"]   = mysettings["PORTDIR"]+"/eclass"
        mysettings["SANDBOX_LOG"] = mycpv.replace("/", "_-_")
 
index ca94d3512433c4268b87c92fd4f8b9e73041e7aa..f74ecd4acdca2f16ff651220923be8f7a8628fb1 100644 (file)
@@ -72,7 +72,24 @@ def findnew(entries,recursive=0,basedir=""):
                for mydir in entries["dirs"]:
                        mylist+=findnew(entries["dirs"][mydir],recursive,basedir+mydir)
        return mylist
-                                       
+
+def findoption(entries, pattern, recursive=0, basedir=""):
+       """(entries, pattern, recursive=0, basedir="")
+       Iterate over paths of cvs entries for which the pattern.search() method
+       finds a match. Returns a list of paths, optionally prepended with a
+       basedir."""
+       if not basedir.endswith("/"):
+               basedir += "/"
+       for myfile, mydata in entries["files"].iteritems():
+               if "cvs" in mydata["status"]:
+                       if pattern.search(mydata["flags"]):
+                               yield basedir+myfile
+       if recursive:
+               for mydir, mydata in entries["dirs"].iteritems():
+                       for x in findoption(mydata, pattern,
+                               recursive, basedir+mydir):
+                               yield x
+
 def findchanged(entries,recursive=0,basedir=""):
        """(entries,recursive=0,basedir="")
        Recurses the entries tree to find all elements that exist in the cvs tree