git.iko.soy/typeable/nixpkgs
on master help sign in
make-tarball.nix: Fix <nixpkgs> check

This was broken by 6bcf1944494973029071411bb378d4262ce2a678, which caused the result of the check to be ignored (since xargs will return a non-zero exit status if *any* grep doesn't find a match).

commit5c5223d46b5d159e6c297feeb0ee277536e9e158 authorEelco Dolstra <edolstra@gmail.com> dateThu 7 Dec 2017, 15:57 (9 years ago) parent9a8633b
1 file changed+3−1
pkgs/top-level/make-tarball.nix+3−1
pkgs/top-level/make-tarball.nix+3−1
@@ -43,8 +43,10 @@ releaseTools.sourceTarball rec {
4343 echo 'abort "Illegal use of <nixpkgs> in Nixpkgs."' > $TMPDIR/barf.nix
4444
4545 # Make sure that Nixpkgs does not use <nixpkgs>
46− if (find pkgs -type f -name '*.nix' -print | xargs grep '<nixpkgs\/'); then
46+ badFiles=$(find pkgs -type f -name '*.nix' -print | xargs grep -l '^[^#]*<nixpkgs\/' || true)
47+ if [[ -n $badFiles ]]; then
4748 echo "Nixpkgs is not allowed to use <nixpkgs> to refer to itself."
49+ echo "The offending files: $badFiles"
4850 exit 1
4951 fi
5052