From eb5386f17a0c6b6799316bd0afa3378098e7b772 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Thu, 7 Feb 2008 14:17:32 +0000 Subject: [PATCH] - pisi check should check missing files and act accordingly - ("/" + f.path) usage turned into unicode safe ("/%s" % f.path) fixed by caglar --- pisi/api.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/pisi/api.py b/pisi/api.py index d9b9ae9c..066672ad 100644 --- a/pisi/api.py +++ b/pisi/api.py @@ -432,17 +432,20 @@ def check(package): md, files = info(package, True) corrupt = [] for f in files.list: - if f.hash and f.type != "config" \ - and not os.path.islink('/' + f.path): - ctx.ui.info(_("Checking /%s ") % f.path, noln=True, verbose=True) - try: - if f.hash != pisi.util.sha1_file('/' + f.path): - corrupt.append(f) - ctx.ui.error(_("\nCorrupt file: %s") % f) - else: - ctx.ui.info(_("OK"), verbose=True) - except pisi.util.FileError,e: - ctx.ui.error("\n%s" % e) + ctx.ui.info(_("Checking /%s ") % f.path, noln=True, verbose=True) + if os.path.exists("/%s" % f.path): + if f.hash and f.type != "config" and not os.path.islink("/%s" % f.path): + try: + if f.hash != pisi.util.sha1_file("/%s" % f.path): + corrupt.append(f) + ctx.ui.error(_("\nCorrupt file: %s") % ("/%s" %f.path)) + else: + ctx.ui.info(_("OK"), verbose=True) + except pisi.util.FileError,e: + ctx.ui.error("\n%s" % e) + else: + corrupt.append(f) + ctx.ui.error(_("\nMissing file: %s") % ("/%s" % f.path)) return corrupt def index(dirs=None, output='pisi-index.xml', skip_sources=False, skip_signing=False):