Commit b30ea5edc83 for php
commit b30ea5edc8381609e20dc9992a4b46bffe01ce56
Author: Jérôme Tamarelle <jerome@tamarelle.net>
Date: Thu Sep 3 21:01:57 2026 +0200
phpize: Use cp -f when copying build files
Many PHP installations, for example Homebrew, Nix and distribution
packages, install lib/php/build/* and run-tests.php read-only. Plain cp
creates the destination with the source mode on the first phpize run. On
later runs in the same project, cp cannot open the read-only destination
for writing and fails with "Permission denied".
cp -f unlinks and recreates the destination, so it only needs write
permission on the directory, not on the target file.
diff --git a/scripts/phpize.in b/scripts/phpize.in
index 4e9db6ec415..3a904607616 100644
--- a/scripts/phpize.in
+++ b/scripts/phpize.in
@@ -148,8 +148,8 @@ phpize_copy_files()
{
test -d build || mkdir build
- (cd "$phpdir" && cp $FILES_BUILD "$builddir"/build)
- (cd "$phpdir" && cp $FILES "$builddir")
+ (cd "$phpdir" && cp -f $FILES_BUILD "$builddir"/build)
+ (cd "$phpdir" && cp -f $FILES "$builddir")
}
phpize_replace_prefix()