]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
naoki: Fix epoch property of packages.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 18 Sep 2010 09:33:58 +0000 (11:33 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 18 Sep 2010 09:33:58 +0000 (11:33 +0200)
This could be an empty string. We need to catch this case.

naoki/packages.py

index b6d746e142ffdc9e6dc23ebbd19390ba763647ab..1b7c71b91f61ed653a2631b9a1d8ad2ffe1b1236 100644 (file)
@@ -48,7 +48,10 @@ class Package(object):
 
        @property
        def epoch(self):
-               return int(self._info.get("PKG_EPOCH", 0))
+               epoch = self._info.get("PKG_EPOCH", None)
+               if not epoch:
+                       epoch = 0
+               return int(epoch)
 
        @property
        def name(self):