Skip to content

Commit

Permalink
dependency_script: cp rather than symlink to $DOWNLOAD_CACHE
Browse files Browse the repository at this point in the history
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 c2204b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions planemo/shed2tap/base.py
Expand Up @@ -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.
Expand Down

0 comments on commit c2204b3

Please sign in to comment.