From 29e62278a7379336e5972df5bad751c973872039 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 17 Jun 2013 11:02:45 +0200 Subject: arch-nspawn: remove leading - from the machine name/hostname Signed-off-by: Florian Pritz Signed-off-by: Pierre Schmitz --- arch-nspawn.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch-nspawn.in b/arch-nspawn.in index 8ef39ed..441b502 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -98,8 +98,11 @@ copy_hostconf eval $(grep '^CARCH=' "$working_dir/etc/makepkg.conf") +machine_name="${working_dir//\//-}" +machine_name="${machine_name#-}" + exec ${CARCH:+setarch "$CARCH"} systemd-nspawn 2>/dev/null \ -D "$working_dir" \ - --machine "${working_dir//\//-}" \ + --machine "$machine_name" \ "${mount_args[@]}" \ "$@" -- cgit v1.2.3-54-g00ecf From fb30cabe61862f640f0e99f214dc2777a8ec1b35 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 30 Jul 2013 11:00:54 -0400 Subject: common: Properly forward arguments from die to error Also allow this function to be called without arguments, in which case, don't call error at all. Some uses of this function wrongly assumed that this was already allowed. Signed-off-by: Dave Reisner Signed-off-by: Pierre Schmitz --- lib/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common.sh b/lib/common.sh index 9446ff5..3ec26ff 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -82,7 +82,7 @@ trap_exit() { } die() { - error "$*" + (( $# )) && error "$@" cleanup 1 } -- cgit v1.2.3-54-g00ecf From be3c71fa81e6d35a1fae0612a8b7b4b613d7d2f6 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 30 Jul 2013 15:24:48 -0400 Subject: avoid injecting code into the format string Now that die() properly forwards arguments to error(), we can expect that the first arg is a format string and not the entirety of the output. Signed-off-by: Dave Reisner Signed-off-by: Pierre Schmitz --- arch-nspawn.in | 4 ++-- archco.in | 2 +- archrelease.in | 6 +++--- checkpkg.in | 4 ++-- commitpkg.in | 10 +++++----- crossrepomove.in | 2 +- find-libdeps.in | 2 +- makechrootpkg.in | 14 +++++++------- mkarchroot.in | 4 ++-- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/arch-nspawn.in b/arch-nspawn.in index 441b502..a05ca1c 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -88,9 +88,9 @@ umask 0022 # Sanity check if [[ ! -f "$working_dir/.arch-chroot" ]]; then - die "'$working_dir' does not appear to be a Arch chroot." + die "'%s' does not appear to be a Arch chroot." "$working_dir" elif [[ $(cat "$working_dir/.arch-chroot") != $CHROOT_VERSION ]]; then - die "chroot '$working_dir' is not at version $CHROOT_VERSION. Please rebuild." + die "chroot '%s' is not at version %s. Please rebuild." "$working_dir" "$CHROOT_VERSION" fi build_mount_args diff --git a/archco.in b/archco.in index 1ee977e..5bdc4e6 100644 --- a/archco.in +++ b/archco.in @@ -15,7 +15,7 @@ case $scriptname in communityco) SVNURL="svn+ssh://svn-community@nymeria.archlinux.org/srv/repos/svn-community/svn";; *) - die "Couldn't find svn url for $scriptname" + die "Couldn't find svn url for %s" "$scriptname" ;; esac diff --git a/archrelease.in b/archrelease.in index 2e742c2..6f52dbc 100644 --- a/archrelease.in +++ b/archrelease.in @@ -8,8 +8,8 @@ FORCE= while getopts ':f' flag; do case $flag in f) FORCE=1 ;; - :) die "Option requires an argument -- '$OPTARG'" ;; - \?) die "Invalid option -- '$OPTARG'" ;; + :) die "Option requires an argument -- '%s'" "$OPTARG" ;; + \?) die "Invalid option -- '%s'" "$OPTARG" ;; esac done shift $(( OPTIND - 1 )) @@ -23,7 +23,7 @@ fi if [[ -z $FORCE ]]; then for tag in "$@"; do if ! in_array "$tag" "${_tags[@]}"; then - die 'archrelease: Invalid tag: "'$tag'" (use -f to force release)' + die "archrelease: Invalid tag: '%s' (use -f to force release)" "$tag" fi done fi diff --git a/checkpkg.in b/checkpkg.in index 95bf049..8e0f574 100644 --- a/checkpkg.in +++ b/checkpkg.in @@ -41,13 +41,13 @@ for _pkgname in "${pkgname[@]}"; do pkgurl=$(pacman -Spdd --print-format '%l' --noconfirm "$_pkgname") if [[ $? -ne 0 ]]; then - die "Couldn't download previous package for $_pkgname." + die "Couldn't download previous package for %s." "$_pkgname" fi oldpkg=${pkgurl##*://*/} if [[ ${oldpkg##*/} = ${pkgfile##*/} ]]; then - die "The built package ($_pkgname) is the one in the repo right now!" + die "The built package (%s) is the one in the repo right now!" "$_pkgname" fi if [[ ! -f $oldpkg ]]; then diff --git a/commitpkg.in b/commitpkg.in index db78517..ad1005b 100644 --- a/commitpkg.in +++ b/commitpkg.in @@ -58,7 +58,7 @@ esac # check if all local source files are under version control for s in "${source[@]}"; do if [[ $s != *://* ]] && ! svn status -v "$s@" | grep -q '^[ AMRX~]'; then - die "$s is not under version control" + die "%s is not under version control" "$s" fi done @@ -68,7 +68,7 @@ for i in 'changelog' 'install'; do # evaluate any bash variables used eval file=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\" if ! svn status -v "${file}" | grep -q '^[ AMRX~]'; then - die "${file} is not under version control" + die "%s is not under version control" "$file" fi done < <(sed -n "s/^[[:space:]]*$i=//p" PKGBUILD) done @@ -81,8 +81,8 @@ while getopts ':l:a:s:f' flag; do s) server=$OPTARG ;; l) rsyncopts+=("--bwlimit=$OPTARG") ;; a) commit_arch=$OPTARG ;; - :) die "Option requires an argument -- '$OPTARG'" ;; - \?) die "Invalid option -- '$OPTARG'" ;; + :) die "Option requires an argument -- '%s'" "$OPTARG" ;; + \?) die "Invalid option -- '%s'" "$OPTARG" ;; esac done shift $(( OPTIND - 1 )) @@ -164,7 +164,7 @@ for _arch in ${arch[@]}; do gpg --detach-sign --use-agent ${SIGNWITHKEY} "${pkgfile}" || die fi if ! gpg --verify "$sigfile" >/dev/null 2>&1; then - die "Signature ${pkgfile}.sig is incorrect!" + die "Signature %s.sig is incorrect!" "$pkgfile" fi uploads+=("$sigfile") done diff --git a/crossrepomove.in b/crossrepomove.in index 1d4ae6c..912504f 100644 --- a/crossrepomove.in +++ b/crossrepomove.in @@ -25,7 +25,7 @@ case $scriptname in target_repo='extra' ;; *) - die "Couldn't find configuration for $scriptname" + die "Couldn't find configuration for %s" "$scriptname" ;; esac diff --git a/find-libdeps.in b/find-libdeps.in index 36e2c43..c9b451e 100644 --- a/find-libdeps.in +++ b/find-libdeps.in @@ -16,7 +16,7 @@ script_mode=${0##*/find-lib} case $script_mode in deps|provides) true;; - *) die "Unknown mode $script_mode" ;; + *) die "Unknown mode %s" "$script_mode" ;; esac if [[ -z $1 ]]; then diff --git a/makechrootpkg.in b/makechrootpkg.in index d7d3ecf..1cd08fb 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -81,8 +81,8 @@ done # Canonicalize chrootdir, getting rid of trailing / chrootdir=$(readlink -e "$passeddir") -[[ ! -d $chrootdir ]] && die "No chroot dir defined, or invalid path '$passeddir'" -[[ ! -d $chrootdir/root ]] && die "Missing chroot dir root directory. Try using: mkarchroot $chrootdir/root base-devel" +[[ ! -d $chrootdir ]] && die "No chroot dir defined, or invalid path '%s'" "$passeddir" +[[ ! -d $chrootdir/root ]] && die "Missing chroot dir root directory. Try using: mkarchroot %s/root base-devel" "$chrootdir" # Detect chrootdir filesystem type chroottype=$(stat -f -c %T "$chrootdir") @@ -136,10 +136,10 @@ create_chroot() { if [[ "$chroottype" == btrfs ]]; then if [[ -d $copydir ]]; then btrfs subvolume delete "$copydir" >/dev/null || - die "Unable to delete subvolume $copydir" + die "Unable to delete subvolume %s" "$copydir" fi btrfs subvolume snapshot "$chrootdir/root" "$copydir" >/dev/null || - die "Unable to create subvolume $copydir" + die "Unable to create subvolume %s" "$copydir" else mkdir -p "$copydir" rsync -a --delete -q -W -x "$chrootdir/root/" "$copydir" @@ -155,11 +155,11 @@ clean_temporary() { stat_busy "Removing temporary copy [$copy]" if [[ "$chroottype" == btrfs ]]; then btrfs subvolume delete "$copydir" >/dev/null || - die "Unable to delete subvolume $copydir" + die "Unable to delete subvolume %s" "$copydir" else # avoid change of filesystem in case of an umount failure rm --recursive --force --one-file-system "$copydir" || - die "Unable to delete $copydir" + die "Unable to delete %s" "$copydir" fi # remove lock file @@ -362,7 +362,7 @@ if (( ret != 0 )); then if $temp_chroot; then die "Build failed" else - die "Build failed, check $copydir/build" + die "Build failed, check %s/build" "$copydir" fi else true diff --git a/mkarchroot.in b/mkarchroot.in index 970bbb9..7cdb274 100644 --- a/mkarchroot.in +++ b/mkarchroot.in @@ -51,7 +51,7 @@ fi umask 0022 -[[ -e $working_dir ]] && die "Working directory '$working_dir' already exists" +[[ -e $working_dir ]] && die "Working directory '%s' already exists" "$working_dir" mkdir -p "$working_dir" @@ -60,7 +60,7 @@ lock 9 "${working_dir}.lock" "Locking chroot" if [[ $(stat -f -c %T "$working_dir") == btrfs ]]; then rmdir "$working_dir" if ! btrfs subvolume create "$working_dir"; then - die "Couldn't create subvolume for '$working_dir'" + die "Couldn't create subvolume for '%s'" "$working_dir" fi chmod 0755 "$working_dir" fi -- cgit v1.2.3-54-g00ecf From 0fa2536957dfd24ee676cc8b621bcdf166317635 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 30 Jul 2013 15:24:49 -0400 Subject: Makefile: validate generated files as part of build For example... $ make GEN checkpkg GEN commitpkg GEN archco archco: line 179: unexpected EOF while looking for matching `"' archco: line 181: syntax error: unexpected end of file make: *** [archco] Error 2 Signed-off-by: Dave Reisner Signed-off-by: Pierre Schmitz --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 674d656..c7e8064 100644 --- a/Makefile +++ b/Makefile @@ -77,6 +77,7 @@ edit = sed -e "s|@pkgdatadir[@]|$(DESTDIR)$(PREFIX)/share/devtools|g" @m4 -P $@.in | $(edit) >$@ @chmod a-w "$@" @chmod +x "$@" + @bash -O extglob -n "$@" clean: rm -f $(BINPROGS) bash_completion zsh_completion -- cgit v1.2.3-54-g00ecf From b12d5eaf85ae970e37fce961cdb6393e3a22e9d3 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 8 Aug 2013 22:50:19 +0200 Subject: Update makepkg.conf from pacman 4.1.2 --- makepkg-i686.conf | 2 ++ makepkg-x86_64.conf | 2 ++ 2 files changed, 4 insertions(+) diff --git a/makepkg-i686.conf b/makepkg-i686.conf index 0b1c1cb..96cdea6 100644 --- a/makepkg-i686.conf +++ b/makepkg-i686.conf @@ -109,6 +109,8 @@ PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod) #SRCDEST=/home/sources #-- Source packages: specify a fixed directory where all src packages will be placed #SRCPKGDEST=/home/srcpackages +#-- Log files: specify a fixed directory where all log files will be placed +#LOGDEST=/home/makepkglogs #-- Packager: name/email of the person or organization building packages #PACKAGER="John Doe " #-- Specify a key to use for package signing diff --git a/makepkg-x86_64.conf b/makepkg-x86_64.conf index 04e20a6..b89d72b 100644 --- a/makepkg-x86_64.conf +++ b/makepkg-x86_64.conf @@ -109,6 +109,8 @@ PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod) #SRCDEST=/home/sources #-- Source packages: specify a fixed directory where all src packages will be placed #SRCPKGDEST=/home/srcpackages +#-- Log files: specify a fixed directory where all log files will be placed +#LOGDEST=/home/makepkglogs #-- Packager: name/email of the person or organization building packages #PACKAGER="John Doe " #-- Specify a key to use for package signing -- cgit v1.2.3-54-g00ecf From 8dbb02de4f50aeb05c5df2ef8d9c8cf394b4f9ac Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 8 Aug 2013 22:51:14 +0200 Subject: Prepare release --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c7e8064..269b3a3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -V=20130525 +V=20130808 PREFIX = /usr/local -- cgit v1.2.3-54-g00ecf