From 95c220287fbf401e7b88b4e799e65b0c59c10360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Tue, 27 Sep 2005 16:57:34 +0000 Subject: [PATCH] * eski paket dosyaadi aranirken daha akilli davran * akilli ol diyorum --- pisi/build.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pisi/build.py b/pisi/build.py index 69856ff8..eed5afd4 100644 --- a/pisi/build.py +++ b/pisi/build.py @@ -345,13 +345,22 @@ class PisiBuild: def calc_build_no(self, package_name): """Calculate build number""" + def found_package(fn): + "did we find the filename we were looking for?" + if fn.startswith(package_name + '-'): + if fn.endswith(ctx.const.package_prefix): + verstr = fn[len(package_name): + len(fn)-len(ctx.const.package_prefix)] + if s.count('-') <= 2: + return True + return False + # find previous build in ctx.config.options.output_dir found = [] for root, dirs, files in os.walk(ctx.config.options.output_dir): for fn in files: fn = fn.decode('utf-8') - if fn.startswith(package_name + '-') and \ - fn.endswith(ctx.const.package_prefix): + if found_package(fn): old_package_fn = os.path.join(root, fn) ctx.ui.info('(found old version %s)' % old_package_fn) old_pkg = Package(old_package_fn, 'r')