diff --git a/pkgs/build-support/php/hooks/composer-install-hook.sh b/pkgs/build-support/php/hooks/composer-install-hook.sh index 49ff0449719a..09bd19e69b27 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 c19bc757581f..4bd95f856d98 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; }