extras-repoclosure rc-modified,1.24,1.25

Michael Schwendt mschwendt at fedoraproject.org
Thu Apr 2 20:46:56 UTC 2009


Author: mschwendt

Update of /cvs/fedora/extras-repoclosure
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26777

Modified Files:
	rc-modified 
Log Message:
Add --rawhidehack option (off by default) to handle i386->i586 updates
in Rawhide (Fedora 11 Development) and 3rd party repos.

Yes, it's a hack, as a hot-fix was necessary for a 3rd party repo.
Theory of operation is as follows. We still need to resolve deps for i386
packages, but i386 packages must not satisfy a dependency if there is a
newer i586 build of the package. And we must not examine an i386 build of
a package if it has an i586 update. In other words, we need to ignore all
i386 packages that have i586 updates. There are many ways to do
it,... probably even an elegant solution somewhere in the Yum API.




Index: rc-modified
===================================================================
RCS file: /cvs/fedora/extras-repoclosure/rc-modified,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- rc-modified	7 Dec 2008 09:52:30 -0000	1.24
+++ rc-modified	2 Apr 2009 20:46:56 -0000	1.25
@@ -59,6 +59,8 @@
                       help="check only the newest packages in the repos")
     parser.add_option("", "--nomultilibhack", default=False, action="store_true",
                       help="disable multi-lib hack")
+    parser.add_option("", "--rawhidehack", default=False, action="store_true",
+                      help="Fedora 11 does i386->i586 updates")
     (opts, args) = parser.parse_args()
     return (opts, args)
 
@@ -76,6 +78,7 @@
             self.repos._selectSackType()
 
         self.guessMultiLibProbs = True
+        self.rawhidehack = False
 
     def evrTupletoVer(self,tuple):
         """convert and evr tuple to a version string, return None if nothing
@@ -139,6 +142,18 @@
         # and therefore be the only one in newestpkgtuplist.
         return True
 
+    def hasupdate(self, pkg):
+        # Ugly hack for the i386->i586 switch in F11 development.
+        (n,a,e,v,r) = pkg.pkgtup
+        for provpkg in self.pkgSack.returnNewestByName(n):
+            prov_a = provpkg.pkgtup[1]
+            if prov_a=='i586':
+                (prov_e, prov_v, prov_r) = provpkg.pkgtup[2:]
+                vercmp = rpmUtils.miscutils.compareEVR( (prov_e,prov_v,prov_r), (e,v,r) )
+                if vercmp>0:  # provpkg is newer, i586 updates i386
+                    return True
+        return False  # there is no update for the i386 pkg
+
     def getBrokenDeps(self, newest=False):
         unresolved = {}
         resolved = {}
@@ -172,6 +187,9 @@
             print 'WARNING: rpmUtils.updates.checkForObsolete missing!'
 
         for pkg in pkgs:
+            if self.rawhidehack and pkg.pkgtup[1]=='i386' and self.hasupdate(pkg):
+                print 'WARNING: Skipping', pkg
+                continue
             thispkgobsdict = {}
             if haveCheckForObsolete:
                 try:
@@ -222,8 +240,13 @@
                                 pass
                         
                         if po.pkgtup in pkgtuplist:
-                            resolved_by_newest = True
-                            break
+                            if not self.rawhidehack:
+                                resolved_by_newest = True
+                                break
+                            # In F11 devel i386 pkgs are updated by i586.
+                            elif po.pkgtup[1]!='i386' or not self.hasupdate(po):
+                                resolved_by_newest = True
+                                break
 
                     if resolved_by_newest:                    
                         resolved[(req,flags,ver)] = 1
@@ -244,6 +267,7 @@
     (opts, cruft) = parseArgs()
     my = RepoClosure(arch = opts.arch, config = opts.config)
     my.guessMultiLibProbs = not opts.nomultilibhack
+    my.rawhidehack = opts.rawhidehack
     
     if opts.repoid:
         for repo in my.repos.repos.values():




More information about the fedora-extras-commits mailing list