Package: debpartial-mirror
Version: 0.2.99
Severity: grave

(Normally important, but bumped to RC because it's breaking for
security updates on squeeze and that needs to not happen)

If a Packages file contains two entries for the same package name,
debpartial-mirror will die with this exception:

Traceback (most recent call last):
 File "/usr/bin/debpartial-mirror", line 177, in <module>
   main()
 File "/usr/bin/debpartial-mirror", line 169, in main
   controller.executeCommand(cmnd)
 File "/usr/lib/pymodules/python2.6/debpartial_mirror/Controller.py", line 34, 
in executeCommand
   self._commands.get(commandName)()
 File "/usr/lib/pymodules/python2.6/debpartial_mirror/Controller.py", line 38, 
in doAll
   if self._load():
 File "/usr/lib/pymodules/python2.6/debpartial_mirror/Controller.py", line 72, 
in _load
   if not b.load():
 File "/usr/lib/pymodules/python2.6/debpartial_mirror/Backend.py", line 111, in 
load
   return self._dists.load()
 File "/usr/lib/pymodules/python2.6/debpartial_mirror/Dists.py", line 186, in 
load
   processTagFile(index_filename, addPackage)
 File "/usr/lib/pymodules/python2.6/debpartial_mirror/Dists.py", line 487, in 
processTagFile
   sectionHandler(section)
 File "/usr/lib/pymodules/python2.6/debpartial_mirror/Dists.py", line 182, in 
addPackage
   pkglist.add(package)
 File "/usr/lib/pymodules/python2.6/cdd/PackageList.py", line 167, in add
   raise PackageAlreadyExists, package['Package']
cdd.PackageList.PackageAlreadyExists

Trivial patch follows which only mirrors the most recent version
(which is probably what you wanted, and anyway much better than
failing).

diff -b -x debian -x DEBIAN -x build -ruN 
debpartial-mirror-0.2.99//debpartial_mirror/Dists.py 
/home/asuffield/src/debpartial-mirror-0.2.99//debpartial_mirror/Dists.py
--- debpartial-mirror-0.2.99//debpartial_mirror/Dists.py        2010-10-22 
21:58:37.000000000 +0100
+++ /home/asuffield/src/debpartial-mirror-0.2.99//debpartial_mirror/Dists.py    
2011-10-14 10:37:56.207266435 +0100
@@ -179,6 +179,14 @@
                        def addPackage(section):
                                package = pkg(section)
                                package.releaseInfo = releaseInfo
+                                name = package['Package']
+                                if name in pkglist:
+                                        oldver = pkglist[name]['Version']
+                                        newver = package['Version']
+                                        if apt_pkg.version_compare(oldver, 
newver) < 1:
+                                                pkglist.remove(name)
+                                                pkglist.add(package)
+                                else:
                                pkglist.add(package)
 
                        index_filename = os.path.join(self._filesystem.base(), 
file)


Right now, security.debian.org has duplicates on amd64 for these packages:
Package: openjdk-6-doc
Package: openjdk-6-jre-lib
Package: openjdk-6-source

Thijs Kinkhorst observed that this is because openjdk is hard to build
on all architectures and they still don't have the latest update on
powerpc and sparc, and suggested that this is just something that will
happen from time to time.

Also it's probably going to happen all the time for sid. I'm surprised
this wasn't noticed and fixed before now.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to