summaryrefslogtreecommitdiff
path: root/rpmdircmp
diff options
context:
space:
mode:
authorThomas Arendsen Hein <thomas@intevation.de>2008-05-21 16:30:16 (GMT)
committerThomas Arendsen Hein <thomas@intevation.de>2008-05-21 16:30:16 (GMT)
commit1e72cbd8e85911d4c4b68950dbb94aa74b1098d2 (patch)
tree711c2b3042b8b3d1f235c118e2cb7ed14deea6eb /rpmdircmp
parent5ba4627df43aab99cef0985de3987dca36aa9269 (diff)
downloadserver-1e72cbd8e85911d4c4b68950dbb94aa74b1098d2.tar.gz
rpmdircmp: allow extension to be specified with or without leading dot.
Diffstat (limited to 'rpmdircmp')
-rwxr-xr-xrpmdircmp4
1 files changed, 3 insertions, 1 deletions
diff --git a/rpmdircmp b/rpmdircmp
index 86de671..78b2406 100755
--- a/rpmdircmp
+++ b/rpmdircmp
@@ -44,7 +44,7 @@ def rpmdir2list(rpmdir, ext):
sys.stderr.write("%d ... \r" % todo)
todo -= 1
if rpm.endswith(ext):
- entry = rpm[:-len(ext)-1].rsplit('-', 2)
+ entry = rpm[:-len(ext)].rsplit('-', 2)
entry.append(rpmpackager(rpmdir, rpm))
rpms.append(tuple(entry))
sys.stderr.write('OK. \n')
@@ -63,6 +63,8 @@ def rpmsets(rpmdir, ext):
def main(olddir, newdir, ext=None):
if not ext:
ext = '.src.rpm'
+ elif not ext.startswith('.'):
+ ext = ".%s" % ext
oldrpms, oldnames, olddict = rpmsets(olddir, ext)
newrpms, newnames, newdict = rpmsets(newdir, ext)