From: Ian Jackson Date: Sat, 11 Jul 2015 16:36:34 +0000 (+0100) Subject: Mirroring: dgit-mirror-rsync copes with invocation via relative pathname X-Git-Tag: debian/1.0~34 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=37bf4bc96cb4d67b9e22177e77c6d99283354e66 Mirroring: dgit-mirror-rsync copes with invocation via relative pathname --- diff --git a/infra/dgit-mirror-rsync b/infra/dgit-mirror-rsync index 5b54d16c..9afd39f1 100755 --- a/infra/dgit-mirror-rsync +++ b/infra/dgit-mirror-rsync @@ -37,6 +37,13 @@ fail () { if [ $# -lt 2 ]; then fail "too few arguments"; fi self=$0 + +case "$self" in +/*) ;; +*/*) self="$PWD/$self" ;; +*) ;; +esac + distrodir=$1; shift action=$1; shift package=$1 @@ -79,7 +86,7 @@ reinvoke () { exec \ "$@" \ - "$0" "$distrodir" "reinvoke$newaction" "$package" + "$self" "$distrodir" "reinvoke$newaction" "$package" } check-package-mirrorable () {