Skip to content

Commit

Permalink
Fix problematic tar entries for TS upload.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Apr 29, 2015
1 parent fe93aba commit a2ee135
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion planemo/shed.py
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions tests/test_shed_upload.py
Expand Up @@ -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


Expand Down

0 comments on commit a2ee135

Please sign in to comment.