diff options
author | Pol Dellaiera <pol.dellaiera@protonmail.com> | 2023-10-17 08:48:12 +0200 |
---|---|---|
committer | Pol Dellaiera <pol.dellaiera@protonmail.com> | 2023-10-17 08:48:12 +0200 |
commit | 207d5b4910b17b08b47a85d417bdbae00c6febf2 (patch) | |
tree | 274ab6a5e4bb0bf6a000f5a4795e80de6c66a78b | |
parent | 22e61b14022b261a83fbb7e38c4b3c6760e840af (diff) | |
download | nixpkgs-207d5b4910b17b08b47a85d417bdbae00c6febf2.tar nixpkgs-207d5b4910b17b08b47a85d417bdbae00c6febf2.tar.gz nixpkgs-207d5b4910b17b08b47a85d417bdbae00c6febf2.tar.bz2 nixpkgs-207d5b4910b17b08b47a85d417bdbae00c6febf2.tar.lz nixpkgs-207d5b4910b17b08b47a85d417bdbae00c6febf2.tar.xz nixpkgs-207d5b4910b17b08b47a85d417bdbae00c6febf2.tar.zst nixpkgs-207d5b4910b17b08b47a85d417bdbae00c6febf2.zip |
php/build-support: fix usage of diff condition
Remove double brackets and replace `diff` with `cmp`
-rw-r--r-- | pkgs/build-support/php/hooks/composer-install-hook.sh | 2 | ||||
-rw-r--r-- | pkgs/build-support/php/hooks/default.nix | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/pkgs/build-support/php/hooks/composer-install-hook.sh b/pkgs/build-support/php/hooks/composer-install-hook.sh index 49ff0449719..09bd19e69b2 100644 --- a/pkgs/build-support/php/hooks/composer-install-hook.sh +++ b/pkgs/build-support/php/hooks/composer-install-hook.sh @@ -49,7 +49,7 @@ composerInstallConfigureHook() { fi echo "Validating consistency between composer.lock and ${composerRepository}/composer.lock" - if [[! @diff@ composer.lock "${composerRepository}/composer.lock"]]; then + if ! @cmp@ -s "composer.lock" "${composerRepository}/composer.lock"; then echo echo "ERROR: vendorHash is out of date" echo diff --git a/pkgs/build-support/php/hooks/default.nix b/pkgs/build-support/php/hooks/default.nix index c19bc757581..4bd95f856d9 100644 --- a/pkgs/build-support/php/hooks/default.nix +++ b/pkgs/build-support/php/hooks/default.nix @@ -1,5 +1,6 @@ { lib , makeSetupHook +, diffutils , jq , moreutils , makeBinaryWrapper @@ -23,7 +24,7 @@ substitutions = { # Specify the stdenv's `diff` by abspath to ensure that the user's build # inputs do not cause us to find the wrong `diff`. - diff = "${lib.getBin buildPackages.diffutils}/bin/diff"; + cmp = "${lib.getBin buildPackages.diffutils}/bin/cmp"; }; } ./composer-install-hook.sh; } |