autoimport: fix version check to actually work
authorHelmut Grohne <helmut@subdivi.de>
Fri, 22 Feb 2013 18:59:00 +0000 (19:59 +0100)
committerHelmut Grohne <helmut@subdivi.de>
Fri, 22 Feb 2013 18:59:00 +0000 (19:59 +0100)
Don't fail on new packages and skip versions already processed again.

autoimport.py

index f80c57d..c662008 100755 (executable)
@@ -23,7 +23,8 @@ def main():
     for pkg in deb822.Packages.iter_paragraphs(io.BytesIO(pkglist)):
         name = pkg["Package"]
         distpkgs.add(name)
-        if version_compare(pkg["Version"], knownpkgs.get(name, ())) < 0:
+        if name in knownpkgs and \
+                version_compare(pkg["Version"], knownpkgs[name]) <= 0:
             continue
         pkgurl = "%s/%s" % (urlbase, pkg["Filename"])
         print("importing %s" % name)