*) set -x ;;
esac
+fail () {
+ echo >&2 "dgit-mirror-rsync: $*"; exit 127
+}
+
+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
cd $repos
queue=_mirror-queue
-fail () {
- echo >&2 "dgit-mirror-rsync: $*"; exit 127
-}
-
case "$remoterepos" in
*:/*|/*) ;;
'') fail "remoterepos config not set" ;;
exec \
"$@" \
- "$0" "$distrodir" "reinvoke$newaction" "$package"
+ "$self" "$distrodir" "reinvoke$newaction" "$package"
}
check-package-mirrorable () {
attempt () {
exec >"$queue/$package.err" 2>&1
if actually; then
- rm "$queue/$package.a"
+ rm -f "$queue/$package.a"
mv -f "$queue/$package.err" "$queue/$package.log"
rm "$queue/$package.lock"
else