|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-11-06 12:39 UTC] php at shyim dot de
Description: ------------ Before running ./configure cat main/php_version.h /* automatically generated by configure */ /* edit configure.ac to change version number */ #define PHP_MAJOR_VERSION 7 #define PHP_MINOR_VERSION 4 #define PHP_RELEASE_VERSION 0 #define PHP_EXTRA_VERSION "RC5" #define PHP_VERSION "7.4.0RC5" #define PHP_VERSION_ID 70400 After running ./configure cat main/php_version.h /* automatically generated by configure */ /* edit configure.ac to change version number */ #define PHP_MAJOR_VERSION linux #define PHP_MINOR_VERSION gnu #define PHP_RELEASE_VERSION #define PHP_EXTRA_VERSION "" #define PHP_VERSION "linux.gnu." #define PHP_VERSION_ID Should this file not readonly / fixed to version? Test script: --------------- cat main/php_version.h ./configure cat main/php_version.h Expected result: ---------------- ./configure does not modify main/php_version.h PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 23:00:01 2025 UTC |
The problem seems to be some missing escaping when using relative paths, and changing the IFS to ".": $ cat tmp.sh #!/bin/bash executable_sed=$(which sed) relative_sed_location=$(realpath --relative-to="." "${executable_sed}") relative_executable_sed=./${relative_sed_location} echo ${executable_sed} echo ${relative_sed_location} echo ${relative_executable_sed} version=7.4.0RC5 echo ${version} | ${sed_location} 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' echo ${version} | ./${relative_sed_location} 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' IFS="." echo ${version} | ${sed_location} 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' echo ${version} | ${relative_executable_sed} 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' echo "${relative_executable_sed}" echo ${relative_executable_sed} echo ${version} | "${executable_sed}" 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' echo ${version} | "${relative_executable_sed}" 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' $ ./tmp.sh /usr/bin/sed ../../usr/bin/sed ./../../usr/bin/sed ./tmp.sh: Zeile 12: s/\([[0-9\.]]*\)\(.*\)/\1\.\2/: Datei oder Verzeichnis nicht gefunden 7..4.0RC5 ./tmp.sh: Zeile 16: s/\([[0-9\.]]*\)\(.*\)/\1\.\2/: Datei oder Verzeichnis nicht gefunden ./tmp.sh: Zeile 17: : Kommando nicht gefunden. ./../../usr/bin/sed / / /usr/bin/sed 7. 4 0RC5 7. 4 0RC5 version=7.4.0RC5 echo ${version} | ${sed_location} 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' echo ${version} | ./${relative_sed_location} 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' IFS="." echo ${version} | ${sed_location} 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' echo ${version} | ${relative_executable_sed} 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' echo "${relative_executable_sed}" echo ${relative_executable_sed} echo ${version} | "${executable_sed}" 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' echo ${version} | "${relative_executable_sed}" 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/'Sorry I messed up the console output and sent the wrong output -.- Here is the corrected one: $ cat tmp.sh #!/bin/bash executable_sed=$(which sed) relative_sed_location=$(realpath --relative-to="." "${executable_sed}") relative_executable_sed=./${relative_sed_location} echo ${executable_sed} echo ${relative_sed_location} echo ${relative_executable_sed} version=7.4.0RC5 echo ${version} | ${executable_sed} 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' echo ${version} | ./${relative_sed_location} 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' IFS="." echo ${version} | ${executable_sed} 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' echo ${version} | ${relative_executable_sed} 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' echo "${relative_executable_sed}" echo ${relative_executable_sed} echo ${version} | "${executable_sed}" 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' echo ${version} | "${relative_executable_sed}" 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/' $ ./tmp.sh /usr/bin/sed ../../usr/bin/sed ./../../usr/bin/sed 7..4.0RC5 7..4.0RC5 7. 4 0RC5 ./tmp.sh: Zeile 17: : Kommando nicht gefunden. ./../../usr/bin/sed / / /usr/bin/sed 7. 4 0RC5 7. 4 0RC5