From c2204b32081ce6def2ed271f31ccc3ad2f695f7d Mon Sep 17 00:00:00 2001
From: peterjc
Date: Tue, 23 Aug 2016 11:43:27 +0100
Subject: [PATCH] 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.
---
planemo/shed2tap/base.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/planemo/shed2tap/base.py b/planemo/shed2tap/base.py
index e3d6eb407..9d096d2d4 100644
--- a/planemo/shed2tap/base.py
+++ b/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.