summary refs log tree commit diff
path: root/pkgs/build-support/php
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/php')
-rw-r--r--pkgs/build-support/php/hooks/composer-install-hook.sh2
-rw-r--r--pkgs/build-support/php/hooks/default.nix3
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;
 }