Permalink
Browse files

dependency_script: cp rather than symlink to $DOWNLOAD_CACHE

When the downloaded file is an archive which gets unpacked in
the working directory, this is harmless. However, when the
download file is moved directly to $INSTALL_DIR (e.g. JAR files)
this leaves the installation with a symlink pointing at the
cache - which might get deleted.

Also, some tools will look for their own dependencies relative
to the real file (and not the symlink) which will point them
at $DOWNLOAD_CACHE rather than $INSTALL_DIR.
  • Loading branch information...
peterjc committed Aug 23, 2016
1 parent 8699242 commit c2204b32081ce6def2ed271f31ccc3ad2f695f7d
Showing with 2 additions and 2 deletions.
  1. +2 −2 planemo/shed2tap/base.py
@@ -516,11 +516,11 @@ def _commands_and_downloaded_file(url, target_filename=None, sha256sum=None):
'elif [[ -f "$DOWNLOAD_CACHE/%s" ]]' % downloaded_filename,
'then',
' echo "Reusing cached %s"' % downloaded_filename,
' ln -s "$DOWNLOAD_CACHE/%s" "%s"' % (downloaded_filename, target_filename),
' cp "$DOWNLOAD_CACHE/%s" "%s"' % (downloaded_filename, target_filename),
'else',
' echo "Downloading %s"' % downloaded_filename,
' curl -L -o "$DOWNLOAD_CACHE/%s" "%s"' % (downloaded_filename, url),
' ln -s "$DOWNLOAD_CACHE/%s" "%s"' % (downloaded_filename, target_filename),
' cp "$DOWNLOAD_CACHE/%s" "%s"' % (downloaded_filename, target_filename),
]
if sha256sum:
# This is inserted into the if-else for a fresh download only.

0 comments on commit c2204b3

Please sign in to comment.