From fdd079f3d542dbce6898512298b4271eb9e7d0d9 Mon Sep 17 00:00:00 2001 From: Joel Teichroeb Date: Sun, 4 May 2014 09:31:53 -0700 Subject: Remove broken unknown arguments check and fix usage If getopts comes across an unknown argument, $arg it set to '?' and $OPTARG is unset. Therefore the getopts line detecting unknown arguments doesn't work. Arguments to pass to makepkg are already handled by passing all the aguments after the end-of-options marker (--), but this wasn't documented in the usage text. Signed-off-by: Pierre Schmitz --- makechrootpkg.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'makechrootpkg.in') diff --git a/makechrootpkg.in b/makechrootpkg.in index d03b703..9db0ddd 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -35,8 +35,8 @@ src_owner=${SUDO_USER:-$USER} usage() { echo "Usage: ${0##*/} [options] -r [--] [makepkg args]" echo ' Run this script in a PKGBUILD dir to build a package inside a' - echo ' clean chroot. All unrecognized arguments passed to this script' - echo ' will be passed to makepkg.' + echo ' clean chroot. Arguments passed to this script after the' + echo ' end-of-options marker (--) will be passed to makepkg.' echo '' echo ' The chroot dir consists of the following directories:' echo ' /{root, copy} but only "root" is required' @@ -78,7 +78,6 @@ while getopts 'hcur:I:l:nTD:d:' arg; do l) copy="$OPTARG" ;; n) run_namcap=true; makepkg_args="$makepkg_args -i" ;; T) temp_chroot=true; copy+="-$$" ;; - *) makepkg_args="$makepkg_args -$arg $OPTARG" ;; esac done -- cgit v1.2.3 From 0b2ae245f1d18e4b0702b5ca1cec323308daef0c Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Sun, 4 May 2014 05:07:46 +0200 Subject: Update mtime of chroot when building Makes the chroot mtime a useful indicator of last usage. Signed-off-by: Pierre Schmitz --- makechrootpkg.in | 3 +++ 1 file changed, 3 insertions(+) (limited to 'makechrootpkg.in') diff --git a/makechrootpkg.in b/makechrootpkg.in index 9db0ddd..47c6ac9 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -157,6 +157,9 @@ create_chroot() { # Drop the read lock again exec 8>&- fi + + # Update mtime + touch "$copydir" } clean_temporary() { -- cgit v1.2.3 From 03611dc63e3e44d0504f0d05c3129fbc0b2d1510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Wed, 8 Jan 2014 01:15:37 +0100 Subject: Switch to root when started as regular user In collaborative builder machine, these scripts are often allowed to become root via sudo. This patch avoid to prefix them by sudo each time or call su. Signed-off-by: Pierre Schmitz --- makechrootpkg.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'makechrootpkg.in') diff --git a/makechrootpkg.in b/makechrootpkg.in index 47c6ac9..97c7780 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -81,7 +81,7 @@ while getopts 'hcur:I:l:nTD:d:' arg; do esac done -(( EUID != 0 )) && die 'This script must be run as root.' +check_root "$0" "$@" [[ ! -f PKGBUILD && -z "${install_pkgs[*]}" ]] && die 'This must be run in a directory containing a PKGBUILD.' -- cgit v1.2.3