Skip to content

Commit

Permalink
Logs to report when files are missing with chroot
Browse files Browse the repository at this point in the history
  • Loading branch information
remram44 committed Feb 11, 2015
1 parent f10ea0e commit 6f9cf3f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions reprounzip/reprounzip/unpackers/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ def chroot_create(args):
"\nWill copy files from HOST SYSTEM",
''.join('\n %s' % pkg
for pkg in packages_not_packed))
missing_files = False
for pkg in packages_not_packed:
for f in pkg.files:
f = Path(f.path)
Expand All @@ -433,6 +434,7 @@ def chroot_create(args):
"Missing file %s (from package %s) on host, "
"experiment will probably miss it",
f, pkg.name)
missing_files = True
continue
dest = join_root(root, f)
dest.parent.mkdir(parents=True)
Expand All @@ -443,6 +445,8 @@ def chroot_create(args):
if restore_owner:
stat = f.stat()
dest.chown(stat.st_uid, stat.st_gid)
if missing_files:
record_usage(chroot_mising_files=True)

# Unpacks files
if any('..' in m.name or m.name.startswith('/') for m in tar.getmembers()):
Expand Down

0 comments on commit 6f9cf3f

Please sign in to comment.