summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2017-07-23 14:59:02 -0400
committerB Stack <bgstack15@gmail.com>2017-07-23 14:59:02 -0400
commitda407ac7e651ea581110f08a21fa475a2cd08ef0 (patch)
treed1c981b1eceac89f034b83ec0857697930e78d71
parentupdated udpate-{deb,rpm,tar}.sh scripts (diff)
downloadmirror-da407ac7e651ea581110f08a21fa475a2cd08ef0.tar.gz
mirror-da407ac7e651ea581110f08a21fa475a2cd08ef0.tar.bz2
mirror-da407ac7e651ea581110f08a21fa475a2cd08ef0.zip
Fixed deploy.sh: allow packages to be saved to a symlinked directory.
-rw-r--r--usr/share/doc/mirror/README.txt1
-rwxr-xr-xusr/share/mirror/deploy.sh4
2 files changed, 3 insertions, 2 deletions
diff --git a/usr/share/doc/mirror/README.txt b/usr/share/doc/mirror/README.txt
index 14c65e7..41bbf2f 100644
--- a/usr/share/doc/mirror/README.txt
+++ b/usr/share/doc/mirror/README.txt
@@ -137,3 +137,4 @@ Changed deploy.conf to use package directories for deployment
- Added update-tar example script.
- Fixed deb repo html guide to have correct pathname for /etc/apt/sources.list.d/.
- Fixed update-{deb,rpm,tar} scripts to match syntax, and chown files.
+- Fixed deploy.sh: allow packages to be saved to a symlinked directory.
diff --git a/usr/share/mirror/deploy.sh b/usr/share/mirror/deploy.sh
index 2e7adba..5c8e8ff 100755
--- a/usr/share/mirror/deploy.sh
+++ b/usr/share/mirror/deploy.sh
@@ -245,7 +245,7 @@ do line=$( echo "${line}" | sed -e 's/^\s*//;s/\s*$//;/^[#$]/d;s/\s*[^\]#.*$//;'
debuglev 5 && ferror "sourcetarfile=${sourcetarfile}"
# CALCULATE DESTINATION FILE
- destinationdir=$( { find "${thispackagedir}" -maxdepth 0 -type d; find "${thislocation}" -maxdepth 0 -type d; } 2>/dev/null | grep -viE "^$" | head -n1 )
+ destinationdir="$( { test -d "$( readlink -f "$( find "${thispackagedir}" -maxdepth 0 \( -type d -o -type l \) )" )" && echo "${thispackagedir}"; find "${thislocation}" -maxdepth 0 -type d; } 2>/dev/null | grep -viE "^$" | head -n1 )"
#debuglev 5 && ferror "destinationdir=${destinationdir}"
[[ ! -d "${destinationdir}" ]] && ferror "Skipped ${thiszone} file ${sourcefile}: cannot be copied to invalid directory \"${destinationdir}\"." && continue
destinationfile=$( echo "${destinationdir}/$( basename "${sourcefile}" )" | sed -e 's!\/\+!\/!g;' )
@@ -289,7 +289,7 @@ do line=$( echo "${line}" | sed -e 's/^\s*//;s/\s*$//;/^[#$]/d;s/\s*[^\]#.*$//;'
if test "${noupdate}" = "1";
then
# told to not execute any update scripts at all.
- ferror "Skipping any execute scripts for ${thiszone}."
+ debuglev 1 && ferror "Skipping any execute scripts for ${thiszone}."
else
[[ -n "${thisupdatescript}" ]] && {
if [[ ! -x "${thisupdatescript}" ]];
bgstack15