[yum-cvs] yum callback.py,1.19,1.20 cli.py,1.153,1.154

Seth Vidal skvidal at login.linux.duke.edu
Mon Feb 14 06:00:22 UTC 2005


Update of /home/groups/yum/cvs/yum
In directory login:/tmp/cvs-serv2762

Modified Files:
	callback.py cli.py 
Log Message:

- added in Terje's new patch for the rpm callback
- setup some background for some items in transactioninfo.py - specifically
storing the package object in the transaction member object.
- made pkgtup an attribute of every package object rather than a callable
method.


Index: callback.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/callback.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- callback.py	10 Feb 2005 07:58:41 -0000	1.19
+++ callback.py	14 Feb 2005 06:00:20 -0000	1.20
@@ -30,7 +30,7 @@
         self.installed_pkg_names = []
         self.total_removed = 0
         self.mark = "#"
-        self.marks = 34
+        self.marks = 27
         self.filelog = None
 
         self.myprocess = { 'updating': 'Updating', 'erasing': 'Erasing',
@@ -70,10 +70,10 @@
         fmt_bar = "%-" + width + "s"
         if progress:
             bar = fmt_bar % (self.mark * int(marks * (percent / 100.0)), )
-            fmt = "\r  %-3.3s: %-28.28s " + bar + " " + done
+            fmt = "\r  %-10.10s: %-28.28s " + bar + " " + done
         else:
             bar = fmt_bar % (self.mark * marks, )
-            fmt = "  %-3.3s: %-28.28s "  + bar + " " + done
+            fmt = "  %-10.10s: %-28.28s "  + bar + " " + done
         return fmt
 
     def _logPkgString(self, hdr):
@@ -172,7 +172,7 @@
                 if h not in self.installed_pkg_names:
                     process = "Removing"
                 else:
-                    process = "Updating"
+                    process = "Cleanup"
                 percent = 100
                 fmt = self._makefmt(percent, False)
                 msg = fmt % (process, h)

Index: cli.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/cli.py,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -r1.153 -r1.154
--- cli.py	11 Feb 2005 09:10:54 -0000	1.153
+++ cli.py	14 Feb 2005 06:00:20 -0000	1.154
@@ -887,7 +887,7 @@
             # we look through each returned possibility and rule out the
             # ones that we obviously can't use
             for pkg in installable:
-                if pkg.pkgtup() in installed:
+                if pkg.pkgtup in installed:
                     self.log(6, 'Package %s is already installed, skipping' % pkg)
                     continue
                 
@@ -910,9 +910,9 @@
                         if rc < 0: # we're newer - this is an update, pass to them
                             if exactarch:
                                 if pkg.arch == a2:
-                                    passToUpdate.append(pkg.pkgtup())
+                                    passToUpdate.append(pkg.pkgtup)
                             else:
-                                passToUpdate.append(pkg.pkgtup())
+                                passToUpdate.append(pkg.pkgtup)
                         elif rc == 0: # same, ignore
                             continue
                         elif rc > 0: # lesser, check if the pkgtup is an exactmatch
@@ -920,13 +920,13 @@
                                         # the user explicitly wants this version
                                         # FIXME this is untrue if the exactmatch
                                         # does not include a version-rel section
-                            if pkg.pkgtup() in exactmatch:
+                            if pkg.pkgtup in exactmatch:
                                 if not toBeInstalled.has_key(pkg.name): toBeInstalled[pkg.name] = []
-                                toBeInstalled[pkg.name].append(pkg.pkgtup())
+                                toBeInstalled[pkg.name].append(pkg.pkgtup)
                 else: # we've not got any installed that match n or n+a
                     self.log(4, 'No other %s installed, adding to list for potential install' % pkg.name)
                     if not toBeInstalled.has_key(pkg.name): toBeInstalled[pkg.name] = []
-                    toBeInstalled[pkg.name].append(pkg.pkgtup())
+                    toBeInstalled[pkg.name].append(pkg.pkgtup)
         
         
         # this is where I could catch the installs of compat and multilib 
@@ -1026,7 +1026,7 @@
             updateMatches = yum.misc.unique(matched + exactmatch)
             for po in updateMatches:
                 for (new, old) in updates:
-                    if po.pkgtup() == new:
+                    if po.pkgtup == new:
                         updated_pkg = YumInstalledPackage(self.rpmdb.returnHeaderByTuple(old)[0])
                         self.tsInfo.addUpdate(po, updated_pkg)
 
@@ -1112,8 +1112,8 @@
 
             for instTup in installedByKey:
                 installed_pkg = YumInstalledPackage(self.rpmdb.returnHeaderByTuple(instTup)[0])
-                (n, a, e, v, r) = po.pkgtup()
-                (n2, a2, e2, v2, r2) = installed_pkg.pkgtup()
+                (n, a, e, v, r) = po.pkgtup
+                (n2, a2, e2, v2, r2) = installed_pkg.pkgtup
                 rc = compareEVR((e2, v2, r2), (e, v, r))
                 if rc < 0: # we're newer - this is an update, pass to them
                     if self.conf.exactarch:
@@ -1301,7 +1301,7 @@
         installed = self.rpmdb.getPkgList()
         availablepackages = {}
         for po in self.pkgSack.returnPackages():
-            if po.pkgtup() not in installed:
+            if po.pkgtup not in installed:
                     availablepackages[po.name] = 1
 
         for group in grouplist:




More information about the Yum-cvs-commits mailing list