Permalink
Browse files

Fix problematic tar entries for TS upload.

  • Loading branch information...
jmchilton committed Apr 29, 2015
1 parent fe93aba commit a2ee135b0258f49d44e794f99d08ab9773a3a981
Showing with 12 additions and 1 deletion.
  1. +6 −1 planemo/shed.py
  2. +6 −0 tests/test_shed_upload.py
@@ -401,7 +401,12 @@ def build_tarball(realized_path, **kwds):
try:
tar = tarfile.open(temp_path, "w:gz", dereference=True)
try:
tar.add(realized_path, arcname=".", recursive=True)
for name in os.listdir(realized_path):
tar.add(
os.path.join(realized_path, name),
arcname=name,
recursive=True,
)
finally:
tar.close()
finally:
@@ -235,6 +235,12 @@ def _untar(self, f, path):
tar = tarfile.open(path, "r:gz")
tar.extractall(path=target)
tar.close()
tar = tarfile.open(path, "r:gz")
for tar_info in tar.getmembers():
# These entries cause problems with TS.
assert tar_info.name != "."
assert tar_info.name != ""
tar.close()
return target


0 comments on commit a2ee135

Please sign in to comment.