rpms/yum/FC-6 yum-3.0-misc-fixes.patch, 1.4, 1.5 yum.spec, 1.134, 1.135

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Oct 13 21:10:18 UTC 2006


Author: pjones

Update of /cvs/dist/rpms/yum/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv18793

Modified Files:
	yum-3.0-misc-fixes.patch yum.spec 
Log Message:
- backport paul's change from -devel


yum-3.0-misc-fixes.patch:
 cli.py               |    8 ++---
 yum-updatesd.py      |    4 +-
 yum/__init__.py      |    2 -
 yum/depsolve.py      |    4 +-
 yum/logginglevels.py |    4 ++
 yum/packageSack.py   |    6 ++--
 yum/packages.py      |   76 ++++++++++++++++++++++++++++++---------------------
 yum/parser.py        |    2 -
 yum/yumRepo.py       |    9 ++++--
 9 files changed, 67 insertions(+), 48 deletions(-)

Index: yum-3.0-misc-fixes.patch
===================================================================
RCS file: /cvs/dist/rpms/yum/FC-6/yum-3.0-misc-fixes.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- yum-3.0-misc-fixes.patch	13 Oct 2006 01:26:42 -0000	1.4
+++ yum-3.0-misc-fixes.patch	13 Oct 2006 21:10:16 -0000	1.5
@@ -1,11 +1,5 @@
-Index: yum-updatesd.py
-===================================================================
-RCS file: /home/groups/yum/cvs/yum/yum-updatesd.py,v
-retrieving revision 1.22
-retrieving revision 1.23
-diff -u -r1.22 -r1.23
---- yum-updatesd.py	28 Sep 2006 20:23:02 -0000	1.22
-+++ yum-updatesd.py	5 Oct 2006 13:34:13 -0000	1.23
+--- ./yum-updatesd.py.misc	2006-09-29 01:20:29.000000000 +0100
++++ ./yum-updatesd.py	2006-10-13 14:23:44.000000000 +0100
 @@ -43,8 +43,8 @@
  import yum
  import yum.Errors
@@ -17,14 +11,8 @@
  from yum.constants import *
  from yum.update_md import UpdateMetadata
  
-Index: yum/yumRepo.py
-===================================================================
-RCS file: /home/groups/yum/cvs/yum/yum/yumRepo.py,v
-retrieving revision 1.23
-retrieving revision 1.24
-diff -u -r1.23 -r1.24
---- yum/yumRepo.py	14 Sep 2006 07:05:26 -0000	1.23
-+++ yum/yumRepo.py	6 Oct 2006 02:24:18 -0000	1.24
+--- ./yum/yumRepo.py.misc	2006-09-16 12:13:27.000000000 +0100
++++ ./yum/yumRepo.py	2006-10-13 14:23:44.000000000 +0100
 @@ -458,8 +458,10 @@
      def getPackage(self, package, checkfunc = None, text = None, cache = True):
          remote = package.returnSimple('relativepath')
@@ -49,14 +37,8 @@
                          reget=None, end=end, checkfunc=checkfunc, copy_local=1,
                          cache=cache,
                          )
-Index: yum/parser.py
-===================================================================
-RCS file: /home/groups/yum/cvs/yum/yum/parser.py,v
-retrieving revision 1.8
-retrieving revision 1.9
-diff -u -r1.8 -r1.9
---- yum/parser.py	2 Oct 2006 03:46:57 -0000	1.8
-+++ yum/parser.py	6 Oct 2006 02:23:06 -0000	1.9
+--- ./yum/parser.py.misc	2006-10-02 04:36:13.000000000 +0100
++++ ./yum/parser.py	2006-10-13 14:23:44.000000000 +0100
 @@ -387,7 +387,7 @@
          
          # at this point we have a line from the topmost file on the stack
@@ -66,31 +48,8 @@
              return varReplace(line, self._vars)
          return line
      
-Index: yum/__init__.py
-===================================================================
-RCS file: /home/groups/yum/cvs/yum/yum/__init__.py,v
-retrieving revision 1.259
-retrieving revision 1.260
-diff -u -r1.259 -r1.260
---- yum/__init__.py	5 Oct 2006 01:58:32 -0000	1.259
-+++ yum/__init__.py	11 Oct 2006 02:32:56 -0000	1.260
-@@ -602,7 +602,7 @@
-             
-         if not po.verifyLocalPkg():
-             if raiseError:
--                raise 
-+                raise URLGrabError(-1, 'Package does not match intended download')
-             else:
-                 return False
- 
-Index: yum/logginglevels.py
-===================================================================
-RCS file: /home/groups/yum/cvs/yum/yum/logginglevels.py,v
-retrieving revision 1.5
-retrieving revision 1.6
-diff -u -r1.5 -r1.6
---- yum/logginglevels.py	14 Sep 2006 21:16:03 -0000	1.5
-+++ yum/logginglevels.py	13 Oct 2006 01:16:58 -0000	1.6
+--- ./yum/logginglevels.py.misc	2006-09-16 12:13:27.000000000 +0100
++++ ./yum/logginglevels.py	2006-10-13 14:23:44.000000000 +0100
 @@ -113,13 +113,15 @@
      filelogger.propagate = False
  
@@ -108,55 +67,8 @@
  
      if debuglevel is not None:
          setDebugLevel(debuglevel)
-? dbus-shite.py
-? foo
-? foo.py
-? out
-? tar-1.15.91-1.i386.rpm
-? yum-updatesd.py.debug
-? yum/foo.py
-Index: cli.py
-===================================================================
-RCS file: /home/groups/yum/cvs/yum/cli.py,v
-retrieving revision 1.241
-diff -u -u -r1.241 cli.py
---- cli.py	29 Sep 2006 05:41:07 -0000	1.241
-+++ cli.py	13 Oct 2006 01:23:56 -0000
-@@ -564,15 +564,15 @@
-                 # go through each package 
-                 if len(comparable) > 0:
-                     for instpo in comparable:
--                        if pkg > instpo: # we're newer - this is an update, pass to them
-+                        if pkg.EVR > instpo.EVR: # we're newer - this is an update, pass to them
-                             if instpo.name in exactarchlist:
-                                 if pkg.arch == instpo.arch:
-                                     passToUpdate.append(pkg.pkgtup)
-                             else:
-                                 passToUpdate.append(pkg.pkgtup)
--                        elif pkg == instpo: # same, ignore
-+                        elif pkg.EVR == instpo.EVR: # same, ignore
-                             continue
--                        elif pkg < instpo: # lesser, check if the pkgtup is an exactmatch
-+                        elif pkg.EVR < instpo.EVR: # lesser, check if the pkgtup is an exactmatch
-                                            # if so then add it to be installed
-                                            # if it can be multiply installed
-                                            # this is where we could handle setting 
-@@ -775,7 +775,7 @@
-                 continue
- 
-             for installed_pkg in installedByKey:
--                if po > installed_pkg: # we're newer - this is an update, pass to them
-+                if po.EVR > installed_pkg.EVR: # we're newer - this is an update, pass to them
-                     if installed_pkg.name in self.conf.exactarchlist:
-                         if po.arch == installed_pkg.arch:
-                             updatepkgs.append((po, installed_pkg))
-Index: yum/packageSack.py
-===================================================================
-RCS file: /home/groups/yum/cvs/yum/yum/packageSack.py,v
-retrieving revision 1.18
-diff -u -u -r1.18 packageSack.py
---- yum/packageSack.py	29 Sep 2006 04:40:10 -0000	1.18
-+++ yum/packageSack.py	13 Oct 2006 01:23:57 -0000
+--- ./yum/packageSack.py.misc	2006-09-29 05:31:48.000000000 +0100
++++ ./yum/packageSack.py	2006-10-13 14:23:44.000000000 +0100
 @@ -560,7 +560,7 @@
                  highdict[(pkg.name, pkg.arch)] = pkg
              else:
@@ -178,13 +90,8 @@
                      highdict[pkg.name].append(pkg)
                  
          if name:
-Index: yum/packages.py
-===================================================================
-RCS file: /home/groups/yum/cvs/yum/yum/packages.py,v
-retrieving revision 1.73
-diff -u -u -r1.73 packages.py
---- yum/packages.py	2 Oct 2006 14:42:55 -0000	1.73
-+++ yum/packages.py	13 Oct 2006 01:23:57 -0000
+--- ./yum/packages.py.misc	2006-10-02 22:06:42.000000000 +0100
++++ ./yum/packages.py	2006-10-13 14:27:38.000000000 +0100
 @@ -171,6 +171,7 @@
          for (csumtype, csum, csumid) in self.checksums:
              if csumid:
@@ -193,7 +100,7 @@
                  
  class RpmBase:
      """return functions and storage for rpm-specific data"""
-@@ -188,34 +189,13 @@
+@@ -188,37 +189,8 @@
          self._changelog = [] # (ctime, cname, ctext)
          self.licenses = []
  
@@ -218,34 +125,37 @@
 -            return True
 -        return False
 -
-     def __eq__(self, other):
+-    def __eq__(self, other):
 -        if comparePoEVR(self, other) == 0:
-+        if comparePoEVR(self, other) == 0 and self.arch == other.arch:
-             return True
-         return False
- 
-     def __ne__(self, other):
+-            return True
+-        return False
+-
+-    def __ne__(self, other):
 -        if comparePoEVR(self, other) != 0:
-+        if comparePoEVR(self, other) != 0 and self.arch != other.arch:
-             return True
-         return False
-        
-@@ -347,9 +327,51 @@
+-            return True
+-        return False
+-       
++    def returnEVR(self):
++        return PackageEVR(self.epoch,self.ver,self.rel)
+     
+     def __hash__(self):
+         mystr = '%s - %s:%s-%s-%s.%s' % (self.repo.id, self.epoch, self.name,
+@@ -347,8 +319,50 @@
      conflicts_print = property(fget=lambda self: self.returnPrco('conflicts', True))
      obsoletes_print = property(fget=lambda self: self.returnPrco('obsoletes', True))
      changelog = property(fget=lambda self: self.returnChangelog())
 +    EVR = property(fget=lambda self: self.returnEVR())
-     
-+class PackageEVR:
 +    
-+    def init(self,e,v,r):
++class PackageEVR:
+     
++    def __init__(self,e,v,r):
 +        self.epoch = e
 +        self.ver = v
-+        self.release
++        self.rel = r
 +        
 +    def compare(self,other):
 +        return rpmUtils.miscutils.compareEVR((self.epoch, self.ver, self.rel), (other.epoch, other.ver, other.rel))
-+    
+     
 +    def __lt__(self, other):
 +        if self.compare(other) < 0:
 +            return True
@@ -276,9 +186,69 @@
 +        if self.compare(other) != 0:
 +            return True
 +        return False
-     
- 
++    
 +
+ 
  class YumAvailablePackage(PackageObject, RpmBase):
      """derived class for the  packageobject and RpmBase packageobject yum
-        uses this for dealing with packages in a repository"""
+--- ./yum/depsolve.py.misc	2006-10-13 14:27:31.000000000 +0100
++++ ./yum/depsolve.py	2006-10-13 14:27:34.000000000 +0100
+@@ -588,7 +588,7 @@
+                 # from ts
+                 tspkgs = self.tsInfo.matchNaevr(name=pkg.name, arch=pkg.arch)
+                 for tspkg in tspkgs:
+-                    if tspkg.po > pkg:
++                    if tspkg.po.EVR > pkg.EVR:
+                         msg = 'Potential resolving package %s has newer instance in ts.' % pkg
+                         self.verbose_logger.log(logginglevels.DEBUG_2, msg)
+                         provSack.delPackage(pkg)
+@@ -597,7 +597,7 @@
+                 # from rpmdb
+                 dbpkgs = self.rpmdb.searchNevra(name=pkg.name, arch=pkg.arch)
+                 for dbpkg in dbpkgs:
+-                    if dbpkg > pkg:
++                    if dbpkg.EVR > pkg.EVR:
+                         msg = 'Potential resolving package %s has newer instance installed.' % pkg
+                         self.verbose_logger.log(logginglevels.DEBUG_2, msg)
+                         provSack.delPackage(pkg)
+--- ./yum/__init__.py.misc	2006-10-05 03:00:56.000000000 +0100
++++ ./yum/__init__.py	2006-10-13 14:23:44.000000000 +0100
+@@ -602,7 +602,7 @@
+             
+         if not po.verifyLocalPkg():
+             if raiseError:
+-                raise 
++                raise URLGrabError(-1, 'Package does not match intended download')
+             else:
+                 return False
+ 
+--- ./cli.py.misc	2006-10-03 06:44:14.000000000 +0100
++++ ./cli.py	2006-10-13 14:23:44.000000000 +0100
+@@ -564,15 +564,15 @@
+                 # go through each package 
+                 if len(comparable) > 0:
+                     for instpo in comparable:
+-                        if pkg > instpo: # we're newer - this is an update, pass to them
++                        if pkg.EVR > instpo.EVR: # we're newer - this is an update, pass to them
+                             if instpo.name in exactarchlist:
+                                 if pkg.arch == instpo.arch:
+                                     passToUpdate.append(pkg.pkgtup)
+                             else:
+                                 passToUpdate.append(pkg.pkgtup)
+-                        elif pkg == instpo: # same, ignore
++                        elif pkg.EVR == instpo.EVR: # same, ignore
+                             continue
+-                        elif pkg < instpo: # lesser, check if the pkgtup is an exactmatch
++                        elif pkg.EVR < instpo.EVR: # lesser, check if the pkgtup is an exactmatch
+                                            # if so then add it to be installed
+                                            # if it can be multiply installed
+                                            # this is where we could handle setting 
+@@ -775,7 +775,7 @@
+                 continue
+ 
+             for installed_pkg in installedByKey:
+-                if po > installed_pkg: # we're newer - this is an update, pass to them
++                if po.EVR > installed_pkg.EVR: # we're newer - this is an update, pass to them
+                     if installed_pkg.name in self.conf.exactarchlist:
+                         if po.arch == installed_pkg.arch:
+                             updatepkgs.append((po, installed_pkg))


Index: yum.spec
===================================================================
RCS file: /cvs/dist/rpms/yum/FC-6/yum.spec,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -r1.134 -r1.135
--- yum.spec	13 Oct 2006 01:26:42 -0000	1.134
+++ yum.spec	13 Oct 2006 21:10:16 -0000	1.135
@@ -3,7 +3,7 @@
 Summary: RPM installer/updater
 Name: yum
 Version: 3.0
-Release: 5
+Release: 6
 License: GPL
 Group: System Environment/Base
 Source0: http://linux.duke.edu/projects/yum/download/3.0/yum-%{version}.tar.gz
@@ -117,6 +117,9 @@
 
 
 %changelog
+* Fri Oct 13 2006 Paul Nasrat <pnasrat at redhat.com> - 3.0-6
+- fix package comparison for available packages
+
 * Thu Oct 12 2006 Jeremy Katz <katzj at redhat.com> - 3.0-5
 - fix traceback when syslog not available (#208773)
 - fix package comparison not properly handling different arches (#210316)




More information about the fedora-cvs-commits mailing list