From 4de01b67238829a1cb089f98447ee0057ef4a782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Wed, 10 Jan 2018 09:36:59 +0100 Subject: [PATCH] rebuild-amount.sh: add --print option (PR #33693) to allow additionally listing all the rebuilt packages. --- maintainers/scripts/rebuild-amount.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/maintainers/scripts/rebuild-amount.sh b/maintainers/scripts/rebuild-amount.sh index 098a8c88cb7..1a54cada8af 100755 --- a/maintainers/scripts/rebuild-amount.sh +++ b/maintainers/scripts/rebuild-amount.sh @@ -1,9 +1,16 @@ #!/usr/bin/env bash set -e +# --print: avoid dependency on environment +optPrint= +if [ "$1" == "--print" ]; then + optPrint=true + shift +fi + if [ "$#" != 1 ] && [ "$#" != 2 ]; then cat <<-EOF - Usage: $0 commit-spec [commit-spec] + Usage: $0 [--print] commit-spec [commit-spec] You need to be in a git-controlled nixpkgs tree. The current state of the tree will be used if the second commit is missing. EOF @@ -113,3 +120,8 @@ newPkgs "${tree[1]}" "${tree[2]}" '--argstr system "x86_64-linux"' > "$newlist" sed -n 's/\([^. ]*\.\)*\([^. ]*\) .*$/\2/p' < "$newlist" \ | sort | uniq -c +if [ -n "$optPrint" ]; then + echo + cat "$newlist" +fi +