Skip to content

Commit b30ea5e

Browse files
GromNaNLamentXU123
authored andcommitted
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.
1 parent 39ee018 commit b30ea5e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎scripts/phpize.in‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ phpize_copy_files()
148148
{
149149
test -d build || mkdir build
150150

151-
(cd "$phpdir" && cp $FILES_BUILD "$builddir"/build)
152-
(cd "$phpdir" && cp $FILES "$builddir")
151+
(cd "$phpdir" && cp -f $FILES_BUILD "$builddir"/build)
152+
(cd "$phpdir" && cp -f $FILES "$builddir")
153153
}
154154

155155
phpize_replace_prefix()

0 commit comments

Comments
 (0)