Take -D parameter into account when checking files
This commit is contained in:
@@ -5,7 +5,8 @@
|
|||||||
directory is "/" and fix exceptions when an old file is not
|
directory is "/" and fix exceptions when an old file is not
|
||||||
found.
|
found.
|
||||||
* pisi/operations/check.py: Show missing files in the "check"
|
* 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ı <fatih@pardus.org.tr>
|
2010-02-27 Fatih Aşıcı <fatih@pardus.org.tr>
|
||||||
* pisi/archive.py: Install files into correct paths when the old
|
* pisi/archive.py: Install files into correct paths when the old
|
||||||
|
|||||||
@@ -18,11 +18,12 @@ __trans = gettext.translation('pisi', fallback=True)
|
|||||||
_ = __trans.ugettext
|
_ = __trans.ugettext
|
||||||
|
|
||||||
def file_corrupted(pfile):
|
def file_corrupted(pfile):
|
||||||
if os.path.islink("/%s" % pfile.path):
|
path = os.path.join(ctx.config.dest_dir(), pfile.path)
|
||||||
if pisi.util.sha1_data(os.readlink("/%s" % pfile.path)) != pfile.hash:
|
if os.path.islink(path):
|
||||||
|
if pisi.util.sha1_data(os.readlink(path)) != pfile.hash:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
if pisi.util.sha1_file("/%s" % pfile.path) != pfile.hash:
|
if pisi.util.sha1_file(path) != pfile.hash:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -34,7 +35,8 @@ def check_files(files, check_config=False):
|
|||||||
if not f.hash:
|
if not f.hash:
|
||||||
continue
|
continue
|
||||||
ctx.ui.info(_("Checking /%s ") % f.path, noln=True, verbose=True)
|
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 file_corrupted(f):
|
||||||
if f.type == "config":
|
if f.type == "config":
|
||||||
msg = _("\nChanged config file: %s")
|
msg = _("\nChanged config file: %s")
|
||||||
|
|||||||
Reference in New Issue
Block a user