From 6dce935b99389713cf5b8a5b698b1abd6670c916 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 10 May 2014 22:22:04 -0400 Subject: archbuild: Fix a variable name mistake. ($copydir -> $copy) It tried to lock `$copydir.lock`, which was the ONLY mention of $copydir in the entire file. Surely it meant `$copy.lock`; the line was probably originally copy/pasted from makechrootpkg or similar, where $copydir is used. --- archbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'archbuild.in') diff --git a/archbuild.in b/archbuild.in index ae2f511..dc45c7f 100644 --- a/archbuild.in +++ b/archbuild.in @@ -49,7 +49,7 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then [[ -d $copy ]] || continue msg2 "Deleting chroot copy '$(basename "${copy}")'..." - lock 9 "$copydir.lock" "Locking chroot copy '$copy'" + lock 9 "$copy.lock" "Locking chroot copy '$copy'" if [[ "$(stat -f -c %T "${copy}")" == btrfs ]]; then { type -P btrfs && btrfs subvolume delete "${copy}"; } &>/dev/null -- cgit v1.2.3-54-g00ecf From bf7dc83bab4f002a29866fd30b1574b6fbca36aa Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 19 Oct 2014 16:06:31 -0400 Subject: save and reuse original argv when auto-elevating Fixes FS#42277. --- arch-nspawn.in | 4 +++- archbuild.in | 6 ++++-- makechrootpkg.in | 6 ++++-- mkarchroot.in | 4 +++- 4 files changed, 14 insertions(+), 6 deletions(-) (limited to 'archbuild.in') diff --git a/arch-nspawn.in b/arch-nspawn.in index b85d360..19f1410 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -26,6 +26,8 @@ usage() { exit 1 } +orig_argv=("$@") + while getopts 'hC:M:c:' arg; do case "$arg" in C) pac_conf="$OPTARG" ;; @@ -38,7 +40,7 @@ done shift $(($OPTIND - 1)) (( $# < 1 )) && die 'You must specify a directory.' -check_root "$0" "$@" +check_root "$0" "${orig_argv[@]}" working_dir=$(readlink -f "$1") shift 1 diff --git a/archbuild.in b/archbuild.in index dc45c7f..9c5d706 100644 --- a/archbuild.in +++ b/archbuild.in @@ -29,6 +29,8 @@ usage() { exit 1 } +orig_argv=("$@") + while getopts 'hcr:' arg; do case "${arg}" in c) clean_first=true ;; @@ -37,11 +39,11 @@ while getopts 'hcr:' arg; do esac done +check_root "$0" "${orig_argv[@]}" + # Pass all arguments after -- right to makepkg makechrootpkg_args+=("${@:$OPTIND}") -check_root "$0" "$@" - if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then msg "Creating chroot for [${repo}] (${arch})..." diff --git a/makechrootpkg.in b/makechrootpkg.in index a340116..8957974 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -66,6 +66,8 @@ usage() { exit 1 } +orig_argv=("$@") + while getopts 'hcur:I:l:nTD:d:' arg; do case "$arg" in h) usage ;; @@ -81,10 +83,10 @@ while getopts 'hcur:I:l:nTD:d:' arg; do esac done -check_root "$0" "$@" - [[ ! -f PKGBUILD && -z "${install_pkgs[*]}" ]] && die 'This must be run in a directory containing a PKGBUILD.' +check_root "$0" "${orig_argv[@]}" + # Canonicalize chrootdir, getting rid of trailing / chrootdir=$(readlink -e "$passeddir") [[ ! -d $chrootdir ]] && die "No chroot dir defined, or invalid path '%s'" "$passeddir" diff --git a/mkarchroot.in b/mkarchroot.in index 5f3d6fe..78384da 100644 --- a/mkarchroot.in +++ b/mkarchroot.in @@ -24,6 +24,8 @@ usage() { exit 1 } +orig_argv=("$@") + while getopts 'hC:M:c:' arg; do case "$arg" in C) pac_conf="$OPTARG" ;; @@ -37,7 +39,7 @@ shift $(($OPTIND - 1)) (( $# < 2 )) && die 'You must specify a directory and one or more packages.' -check_root "$0" "$@" +check_root "$0" "${orig_argv[@]}" working_dir="$(readlink -f $1)" shift 1 -- cgit v1.2.3-54-g00ecf