Skip to content

Conversation

@muhme
Copy link

@muhme muhme commented Apr 24, 2024

Workaround for #60. Replaces eight times sed in-place editing for configuration.php by writing to the tmp file configuration.tmp and then moving it.

Workaround for Digital-Peak#60.
Replaces eight times sed in-place editing for configuration.php by writing to the tmp file `configuration.tmp` and then moving it.
@laoneo
Copy link
Member

laoneo commented Apr 24, 2024

There are many more cases where we use sed, not sure but I think all of them should be fixed. or what do you think?

@muhme
Copy link
Author

muhme commented Apr 24, 2024

Yes, there are 10 more places:

$ find . -name \*.sh | xargs grep 'sed -i'
./tests/scripts/exec-joomla-system-tests.sh:sed -i "s/{SITE}/$1/g" cypress.config.js
./tests/scripts/exec-joomla-system-tests.sh:sed -i "s/{DB}/$2-test/g" cypress.config.js
./tests/scripts/exec-joomla-system-tests.sh:	sed -i "s/{DBTYPE}/MySQLi/g" cypress.config.js
./tests/scripts/exec-joomla-system-tests.sh:	sed -i "s/{DBTYPE}/PostgreSQL\ \(PDO\)/g" cypress.config.js
./tests/scripts/exec-system-tests.sh:sudo sed -i "s/debug = '1'/debug = 0/g" /var/www/html/joomla/configuration.php
./tests/scripts/exec-system-tests.sh:sudo sed -i "s/sef = '1'/sef = 0/g" /var/www/html/joomla/configuration.php
./tests/scripts/exec-system-tests.sh:sudo sed -i "s/smtphost = 'mailcatcher'/smtphost = 'mailcatcher-test'/g" /var/www/html/joomla/configuration.php
./webserver/scripts/install-joomla.sh:# prevent the use of inplace sed -i as it creates unreadable tmp file inside the Docker container on Intel macOS
./build/scripts/exec-build.sh:	find $workingDir/$extension -type f -name "*.xml" -exec sed -i "s/DP_DEPLOY_VERSION/$version/g" {} +
./build/scripts/exec-build.sh:	find $workingDir/$extension -type f -name "*.xml" -exec sed -i "s/DP_DEPLOY_DATE/$(LANG=en_us_88591; date "+%Y-%m")/g" {} +
./build/scripts/exec-build.sh:find $workingDir/$extension -type f -name "*.ini" -exec sed -i "/^;/d;/^$/d" {} +

Should I create one more PR for this? Another option would be to update sed in the image(s) to >= version 4.8.

@laoneo
Copy link
Member

laoneo commented Apr 24, 2024

I think it is better to update sed in the image. But for this I need to see if this is even possible as we are still using ubuntu 20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants