From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0C83D158018 for ; Mon, 4 Oct 2021 22:05:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 617DEE0878; Mon, 4 Oct 2021 22:05:17 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 47890E0878 for ; Mon, 4 Oct 2021 22:05:17 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 33E55342FEA for ; Mon, 4 Oct 2021 22:05:16 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9EE2CEC for ; Mon, 4 Oct 2021 22:05:14 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1633383962.e296d7ac9b45c75499dbfa89cfd4e2341303d2e2.vapier@gentoo> Subject: [gentoo-commits] proj/pax-utils:master commit in: / X-VCS-Repository: proj/pax-utils X-VCS-Files: autogen.sh make-tarball.sh X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: e296d7ac9b45c75499dbfa89cfd4e2341303d2e2 X-VCS-Branch: master Date: Mon, 4 Oct 2021 22:05:14 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 8e72902f-52e8-4a96-b5dd-6c18909c86bb X-Archives-Hash: 8447bcdda136fce45069ef6d6c335860 commit: e296d7ac9b45c75499dbfa89cfd4e2341303d2e2 Author: Mike Frysinger chromium org> AuthorDate: Mon Oct 4 21:46:02 2021 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Mon Oct 4 21:46:02 2021 +0000 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=e296d7ac build: add --debug for easy shell script tracing Improve the CLI parser slightly so we can add a --debug option. This makes it easy to get shell script tracing with a -x option rather than having to override the shebang/shell interpreter. Signed-off-by: Mike Frysinger gentoo.org> autogen.sh | 26 ++++++++++++++++++++++++-- make-tarball.sh | 13 ++++++++++--- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/autogen.sh b/autogen.sh index 42e8a8c..a21b8e5 100755 --- a/autogen.sh +++ b/autogen.sh @@ -2,11 +2,33 @@ . "${0%/*}"/travis/lib.sh +# NB: This script is normally run in a GNU environment (e.g. Linux), but we also run it on other +# systems (e.g. macOS) as part of our automated CI. So a little care must be taken. + +cd "${0%/*}" || exit 1 + m4dir="autotools/m4" +: ${MAKE:=make} + +FROM_TOOL= +while [[ $# -gt 0 ]] ;do + case $1 in + --from=*) FROM_TOOL=${1#*=};; + -x|--debug) set -x;; + *) break;; + esac + shift +done + +if [[ $# -ne 0 ]] ; then + echo "Usage: $0" >&2 + exit 1 +fi + v rm -rf autotools -if [[ $1 != "--from=make" ]] ; then - v ${MAKE:-make} autotools-update +if [[ ${FROM_TOOL} != "make" ]] ; then + v ${MAKE} autotools-update fi # reload the gnulib code if possible diff --git a/make-tarball.sh b/make-tarball.sh index 04f778d..3cd3219 100755 --- a/make-tarball.sh +++ b/make-tarball.sh @@ -1,5 +1,8 @@ #!/bin/bash +# NB: This script is expected to be run in a GNU environment (e.g. Linux). +# So it is not written to be completely POSIX compliant. + set -e if ! . /etc/init.d/functions.sh 2>/dev/null ; then @@ -13,10 +16,14 @@ v() { printf '\t%s\n' "$*"; "$@"; } : ${MAKE:=make} CHECK=false -if [[ $1 == "--check" ]] ; then - CHECK=true +while [[ $# -gt 0 ]] ;do + case $1 in + --check) CHECK=true;; + -x|--debug) set -x;; + *) break;; + esac shift -fi +done if [[ $# -ne 1 ]] ; then die "Usage: $0 "