From 63e6498b5f7a02f0414d98a0696de7b9480fc5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20A=C5=9F=C4=B1c=C4=B1?= Date: Sun, 28 Feb 2010 18:50:18 +0000 Subject: [PATCH] Take -D parameter into account when checking files --- ChangeLog | 3 ++- pisi/operations/check.py | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd83b381..78fd2e34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,7 +5,8 @@ directory is "/" and fix exceptions when an old file is not found. * pisi/operations/check.py: Show missing files in the "check" - command output. + command output. Take "-D" parameter into account when checking + files. 2010-02-27 Fatih Aşıcı * pisi/archive.py: Install files into correct paths when the old diff --git a/pisi/operations/check.py b/pisi/operations/check.py index 3c5aaab4..27a5ad34 100644 --- a/pisi/operations/check.py +++ b/pisi/operations/check.py @@ -18,11 +18,12 @@ __trans = gettext.translation('pisi', fallback=True) _ = __trans.ugettext def file_corrupted(pfile): - if os.path.islink("/%s" % pfile.path): - if pisi.util.sha1_data(os.readlink("/%s" % pfile.path)) != pfile.hash: + path = os.path.join(ctx.config.dest_dir(), pfile.path) + if os.path.islink(path): + if pisi.util.sha1_data(os.readlink(path)) != pfile.hash: return True else: - if pisi.util.sha1_file("/%s" % pfile.path) != pfile.hash: + if pisi.util.sha1_file(path) != pfile.hash: return True return False @@ -34,7 +35,8 @@ def check_files(files, check_config=False): if not f.hash: continue ctx.ui.info(_("Checking /%s ") % f.path, noln=True, verbose=True) - if os.path.lexists("/%s" % f.path): + path = os.path.join(ctx.config.dest_dir(), f.path) + if os.path.lexists(path): if file_corrupted(f): if f.type == "config": msg = _("\nChanged config file: %s")