Author: neronus-guest
Date: 2008-06-29 11:46:33 +0000 (Sun, 29 Jun 2008)
New Revision: 904

Modified:
   udd/src/test.yaml
   udd/src/udd/packages_gatherer.py
   udd/src/udd/sources_gatherer.py
Log:
Now existing entries are deleted from the tables


Modified: udd/src/test.yaml
===================================================================
--- udd/src/test.yaml   2008-06-29 11:24:35 UTC (rev 903)
+++ udd/src/test.yaml   2008-06-29 11:46:33 UTC (rev 904)
@@ -1,5 +1,5 @@
 general:
-  dbname: udd-test
+  dbname: udd
   types:
     sources: module udd.sources_gatherer
     packages: module udd.packages_gatherer

Modified: udd/src/udd/packages_gatherer.py
===================================================================
--- udd/src/udd/packages_gatherer.py    2008-06-29 11:24:35 UTC (rev 903)
+++ udd/src/udd/packages_gatherer.py    2008-06-29 11:46:33 UTC (rev 904)
@@ -1,5 +1,5 @@
 #/usr/bin/env python
-# Last-Modified: <Sat Jun 28 17:17:05 2008>
+# Last-Modified: <Sun Jun 29 11:34:11 2008>
 
 import debian_bundle.deb822
 import gzip
@@ -148,6 +148,8 @@
 
     # For every part and every architecture, import the packages into the DB
     for comp in src_cfg['components']:
+      cur.execute("DELETE FROM packages WHERE distribution = '%s' AND release 
= '%s' AND component = '%s'" %\
+       (self._distr, src_cfg['release'], comp))
       for arch in src_cfg['archs']:
        path = os.path.join(src_cfg['directory'], comp, 'binary-' + arch, 
'Packages.gz')
        try:

Modified: udd/src/udd/sources_gatherer.py
===================================================================
--- udd/src/udd/sources_gatherer.py     2008-06-29 11:24:35 UTC (rev 903)
+++ udd/src/udd/sources_gatherer.py     2008-06-29 11:46:33 UTC (rev 904)
@@ -1,5 +1,5 @@
 #/usr/bin/env python
-# Last-Modified: <Sun Jun 29 10:48:17 2008>
+# Last-Modified: <Sun Jun 29 11:28:15 2008>
 
 import debian_bundle.deb822
 import gzip
@@ -96,6 +96,9 @@
 
     for comp in src_cfg['components']:
       path = os.path.join(src_cfg['directory'], comp, 'source', 'Sources.gz')
+      cur.execute("DELETE from sources WHERE Distribution = '%s' AND\
+       release = '%s' AND component = '%s'"\
+       % (src_cfg['distribution'], src_cfg['release'], comp))
       try:
        query = """PREPARE source_insert as INSERT INTO sources
          (Package, Version, Maintainer, Format, Files, Uploaders, Bin,


_______________________________________________
Collab-qa-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/collab-qa-commits

Reply via email to