Commit 44ad8f96 authored by Spyros Argyropoulos's avatar Spyros Argyropoulos
Browse files

Fix bug when copying links pointing to eos

parent 2c540711
Pipeline #1730457 passed with stages
in 2 minutes and 17 seconds
......@@ -110,6 +110,7 @@ bookDSIDs() {
for link in "${links[@]}" ; do
# Read where the link is pointing to
oldLinkedFile=$(readlink $link)
if [[ $oldLinkedFile =~ /eos ]] ; then continue ; fi # Nothing to be done for links pointing to eos
# Extract the directory where the link is pointing to
oldDir=$(echo $oldLinkedFile | sed 's|.*\([0-9]\{6\}\).*|\1|') # this will retain only the 6-digit DSID
# Find the corresponding new directory from the dictionary
......@@ -119,7 +120,7 @@ bookDSIDs() {
relPath=$(python -c "import os.path; print(os.path.relpath('$newDir/$(basename $oldLinkedFile)', '${oldDir:0:3}xxx/$oldDir]'))") # linked file in different DSID directory
else
relPath="./$oldLinkedFile" # Linked file in same DSID directory
echo "ERROR: $link is pointing to a file in the same DSID directory. Avoid the link and consider renaming the original file."
echo "ERROR: $link is not a relative link or is pointing to a file in the same directory"
exit 20
fi
# Replace old link with new one
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment