Skip to content

Commit

Permalink
rebuild-amount.sh: add --print option (PR #33693)
Browse files Browse the repository at this point in the history
to allow additionally listing all the rebuilt packages.
  • Loading branch information
vcunat committed Jan 14, 2018
1 parent a904ffa commit 4de01b6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion 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
Expand Down Expand Up @@ -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

0 comments on commit 4de01b6

Please sign in to comment.