[yum-cvs] yum/yum packages.py,1.35,1.36 sqlitecache.py,1.9,1.10

Seth Vidal skvidal at login.linux.duke.edu
Sun Mar 13 09:24:30 UTC 2005


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

Modified Files:
	packages.py sqlitecache.py 
Log Message:

add a requiresList method to YumAvailablePackage to make it match
YumInstalledPackage. Fix up a case where sqlitecache would traceback if the
db file was not writable and we wanted to delete it.


Index: packages.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/packages.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- packages.py	14 Feb 2005 06:00:20 -0000	1.35
+++ packages.py	13 Mar 2005 09:24:28 -0000	1.36
@@ -397,7 +397,7 @@
         if flag is None:
             return name
         
-        base = 'name '
+        base = '%s %s ' % (name, flags[flag])
         if e not in [0, '0', None]:
             base += '%s:' % e
         if v is not None:
@@ -406,7 +406,18 @@
             base += '-%s' % r
         
         return base
-
+    
+    def requiresList(self):
+        """return a list of requires in normal rpm format"""
+        
+        reqlist = []
+        
+        for prcoTuple in self.returnPrco('requires'):
+            prcostr = self.prcoPrintable(prcoTuple)
+            reqlist.append(prcostr)
+        
+        return reqlist
+        
     def importFromDict(self, pkgdict, repoid):
         """handles an mdCache package dictionary item to populate out 
            the package information"""

Index: sqlitecache.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/sqlitecache.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- sqlitecache.py	9 Mar 2005 16:03:52 -0000	1.9
+++ sqlitecache.py	13 Mar 2005 09:24:28 -0000	1.10
@@ -220,7 +220,10 @@
         # If it exists, remove it as we were asked to create a new one
         if (os.path.exists(filename)):
             self.log(3, "Warning: cache already exists, removing old version")
-            os.unlink(filename)
+            try:
+                os.unlink(filename)
+            except OSError:
+                pass
 
         # Try to create the databse in filename, or use in memory when
         # this fails




More information about the Yum-cvs-commits mailing list