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).
This commit is contained in:
parent
9a8633bb59
commit
5c5223d46b
@ -43,8 +43,10 @@ releaseTools.sourceTarball rec {
|
|||||||
echo 'abort "Illegal use of <nixpkgs> in Nixpkgs."' > $TMPDIR/barf.nix
|
echo 'abort "Illegal use of <nixpkgs> in Nixpkgs."' > $TMPDIR/barf.nix
|
||||||
|
|
||||||
# Make sure that Nixpkgs does not use <nixpkgs>
|
# Make sure that Nixpkgs does not use <nixpkgs>
|
||||||
if (find pkgs -type f -name '*.nix' -print | xargs grep '<nixpkgs\/'); then
|
badFiles=$(find pkgs -type f -name '*.nix' -print | xargs grep -l '^[^#]*<nixpkgs\/' || true)
|
||||||
|
if [[ -n $badFiles ]]; then
|
||||||
echo "Nixpkgs is not allowed to use <nixpkgs> to refer to itself."
|
echo "Nixpkgs is not allowed to use <nixpkgs> to refer to itself."
|
||||||
|
echo "The offending files: $badFiles"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user