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).

+3 -1
+3 -1
pkgs/top-level/make-tarball.nix
··· 43 echo 'abort "Illegal use of <nixpkgs> in Nixpkgs."' > $TMPDIR/barf.nix 44 45 # Make sure that Nixpkgs does not use <nixpkgs> 46 - if (find pkgs -type f -name '*.nix' -print | xargs grep '<nixpkgs\/'); then 47 echo "Nixpkgs is not allowed to use <nixpkgs> to refer to itself." 48 exit 1 49 fi 50
··· 43 echo 'abort "Illegal use of <nixpkgs> in Nixpkgs."' > $TMPDIR/barf.nix 44 45 # Make sure that Nixpkgs does not use <nixpkgs> 46 + badFiles=$(find pkgs -type f -name '*.nix' -print | xargs grep -l '^[^#]*<nixpkgs\/' || true) 47 + if [[ -n $badFiles ]]; then 48 echo "Nixpkgs is not allowed to use <nixpkgs> to refer to itself." 49 + echo "The offending files: $badFiles" 50 exit 1 51 fi 52