Improved error message in case CRX is not found.

This commit is contained in:
Achim D. Brucker 2017-08-18 13:27:17 +01:00
parent 112ef74e9f
commit 623ddf57a3
1 changed files with 9 additions and 2 deletions

View File

@ -106,14 +106,21 @@ def main(argv):
etag = last_etag(os.path.join(basedir, "data"), extid, last)
else:
etag = None
tar = os.path.join(basedir, "data",
get_local_archive_dir(extid), extid + ".tar")
if last != "":
tar = os.path.join(basedir, "data",
get_local_archive_dir(extid), extid + ".tar")
if os.path.exists(tar):
if verbose:
print("Extracting "+os.path.join(output, last))
with tarfile.open(tar, 'r') as archive:
archive.extractall(path=output, members=get_tarinfo(archive, last, winfs, etag))
elif verbose:
print("Cannot find archive " + tar)
elif verbose:
if os.path.exists(tar):
print("CRX not in archive" + tar)
else:
print("CRX does not exist: cannot find archive " + tar)
if __name__ == "__main__":
main(sys.argv[1:])