[yum-cvs] yum/yum mdcache.py, 1.5, 1.6 mdparser.py, 1.4, 1.5 packages.py, 1.40, 1.41 sqlitecache.py, 1.10, 1.11 sqlitesack.py, 1.26, 1.27

Paul Nasrat pnasrat at login.linux.duke.edu
Thu Dec 8 21:50:16 UTC 2005


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

Modified Files:
	mdcache.py mdparser.py packages.py sqlitecache.py 
	sqlitesack.py 
Log Message:
Add location base/url to sqlite cache

Index: mdcache.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/mdcache.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- mdcache.py	2 Mar 2005 22:18:43 -0000	1.5
+++ mdcache.py	8 Dec 2005 21:50:14 -0000	1.6
@@ -193,7 +193,7 @@
         }
         self.time = {'file': None, 'build': None}
         self.size = {'package': None, 'installed': None, 'archive': None}
-        self.location = {'href': None, 'value': None}
+        self.location = {'href': None, 'value': None, 'base': None}
         self.hdrange = {'start': None, 'end': None}
         self.prco = {}
         self.files = {}

Index: mdparser.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/mdparser.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- mdparser.py	8 Mar 2005 09:22:22 -0000	1.4
+++ mdparser.py	8 Dec 2005 21:50:14 -0000	1.5
@@ -91,12 +91,13 @@
         return out.getvalue()
 
     def _bn(self, qn):
+        if qn.find('}') == -1: return qn 
         return qn.split('}')[1]
         
     def _prefixprops(self, elem, prefix):
         ret = {}
         for key in elem.attrib.keys():
-            ret[prefix + '_' + key] = elem.attrib[key]
+            ret[prefix + '_' + self._bn(key)] = elem.attrib[key]
         return ret
 
 class PrimaryEntry(BaseEntry):
@@ -123,6 +124,8 @@
             elif name in ('checksum', 'location'): 
                 p.update(self._prefixprops(child, name))
                 p[name + '_value'] = child.text
+                if name == 'location' and not p.has_key("location_base"):
+                    p["location_base"] = None
             
             elif name == 'format': 
                 self.setFormat(child)

Index: packages.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/packages.py,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- packages.py	6 Dec 2005 20:22:33 -0000	1.40
+++ packages.py	8 Dec 2005 21:50:14 -0000	1.41
@@ -393,11 +393,11 @@
             self.simple['installedsize'] = pkgdict.size['installed']
         
         if hasattr(pkgdict, 'location'):
-            if pkgdict.location['value'] == '':
+            if pkgdict.location['base'] == '':
                 url = None
             else:
-                url = pkgdict.location['value']
-            
+                url = pkgdict.location['base']
+
             self.simple['basepath'] = url
             self.simple['relativepath'] = pkgdict.location['href']
         

Index: sqlitecache.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/sqlitecache.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- sqlitecache.py	13 Mar 2005 09:24:28 -0000	1.10
+++ sqlitecache.py	8 Dec 2005 21:50:14 -0000	1.11
@@ -27,7 +27,7 @@
 # This version refers to the internal structure of the sqlite cache files
 # increasing this number forces all caches of a lower version number
 # to be re-generated
-dbversion = '6'
+dbversion = '7'
 
 class RepodataParserSqlite:
     def __init__(self, storedir, repoid, callback=None):
@@ -430,6 +430,7 @@
             'size_installed',
             'size_archive',
             'location_href',
+            'location_base',
             'checksum_type',
             'checksum_value',
             )

Index: sqlitesack.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/sqlitesack.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- sqlitesack.py	8 Nov 2005 10:39:10 -0000	1.26
+++ sqlitesack.py	8 Dec 2005 21:50:14 -0000	1.27
@@ -366,7 +366,7 @@
       if (nevra_only):
         return y
       y.hdrange = {'start': db.rpm_header_start,'end': db.rpm_header_end}
-      y.location = {'href': db.location_href,'value':''}
+      y.location = {'href': db.location_href,'value': '', 'base': db.location_base}
       y.checksum = {'pkgid': 'YES','type': db.checksum_type, 
                     'value': db.checksum_value }
       y.time = {'build': db.time_build, 'file': db.time_file }




More information about the Yum-cvs-commits mailing list