From da407ac7e651ea581110f08a21fa475a2cd08ef0 Mon Sep 17 00:00:00 2001 From: B Stack Date: Sun, 23 Jul 2017 14:59:02 -0400 Subject: Fixed deploy.sh: allow packages to be saved to a symlinked directory. --- usr/share/doc/mirror/README.txt | 1 + usr/share/mirror/deploy.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'usr/share') 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}" ]]; -- cgit