php/build-support: fix usage of diff condition

Remove double brackets and replace `diff` with `cmp`
This commit is contained in:
Pol Dellaiera 2023-10-17 08:48:12 +02:00
parent 22e61b1402
commit 207d5b4910
No known key found for this signature in database
GPG key ID: D476DFE9C67467CA
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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;
}