diff options
author | Erich Eckner <git@eckner.net> | 2020-07-01 08:59:43 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-07-01 08:59:43 +0200 |
commit | 53d7b0090ffa3b85af1acb6851c0bd8b917bde62 (patch) | |
tree | e5f05a6f653d6465c3aab0721e3a9b7377eab6e0 /bumpPkgrel | |
parent | 4fad3821d01243c2161e1162dedfa0a1a107f146 (diff) | |
download | archlinuxewe-53d7b0090ffa3b85af1acb6851c0bd8b917bde62.tar.xz |
bumpPkgrel: -a new
Diffstat (limited to 'bumpPkgrel')
-rwxr-xr-x | bumpPkgrel | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/bumpPkgrel b/bumpPkgrel index ad5b73577..06fba8046 100755 --- a/bumpPkgrel +++ b/bumpPkgrel @@ -1,25 +1,30 @@ #!/bin/bash usage() { - >&2 echo 'usage: bumpPkgrel [-n] [-p /tmp/provided] $pkg1 $pkg2 $pkg3 ...' + >&2 echo 'usage: bumpPkgrel [-a] [-n] [-p /tmp/provided] $pkg1 $pkg2 $pkg3 ...' + >&2 echo ' -a: auto-detect packages' >&2 echo ' -n: do not commit' >&2 echo ' -p: use this temporary file' exit 1 } eval set -- "$( - getopt -o np: \ + getopt -o anp: \ -n "$(basename "$0")" \ -- "$@" \ || echo "usage" )" +auto_detect=false commit=true commit_flag='' provided='' while true; do case "$1" in + '-a') + auto_detect=true + ;; '-n') commit=false commit_flag='-n' @@ -39,7 +44,7 @@ while true; do shift done -if [ $# -eq 0 ]; then +if [ $# -eq 0 ] && ! ${auto_detect}; then usage fi @@ -69,10 +74,16 @@ pin_dependency() { ' } -if [ $# -ne 1 ]; then +if [ $# -ne 1 ] || ${auto_detect}; then - printf '%s\n' "$@" \ - | xargs -rn1 "$0" ${commit_flag} -p "${provided}" + { + printf '%s\n' "$@" + if ${auto_detect}; then + "${0%/*}/checkPinnedDependencies -m" + fi + } \ + | sort -u \ + | xargs -rn1 "$0" ${commit_flag} -p "${provided}" else |