rebuild-amount.sh: add --print option (PR #33693)

to allow additionally listing all the rebuilt packages.
This commit is contained in:
Vladimír Čunát 2018-01-10 09:36:59 +01:00
parent a904ffa756
commit 4de01b6723
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
1 changed files with 13 additions and 1 deletions

View File

@ -1,9 +1,16 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
# --print: avoid dependency on environment
optPrint=
if [ "$1" == "--print" ]; then
optPrint=true
shift
fi
if [ "$#" != 1 ] && [ "$#" != 2 ]; then if [ "$#" != 1 ] && [ "$#" != 2 ]; then
cat <<-EOF 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. 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. The current state of the tree will be used if the second commit is missing.
EOF EOF
@ -113,3 +120,8 @@ newPkgs "${tree[1]}" "${tree[2]}" '--argstr system "x86_64-linux"' > "$newlist"
sed -n 's/\([^. ]*\.\)*\([^. ]*\) .*$/\2/p' < "$newlist" \ sed -n 's/\([^. ]*\.\)*\([^. ]*\) .*$/\2/p' < "$newlist" \
| sort | uniq -c | sort | uniq -c
if [ -n "$optPrint" ]; then
echo
cat "$newlist"
fi