Overview

Request 856054 superseded

- Attempt to migrate modified configuration file rather than just
replacing it by default configuration
- The apache subpackage must require the main package, otherwise it
will not be uninstalled when the main package is uninstalled
- Generate blowfish secret and enable Apache modules/flags only on
install
- Only empty temporary directory on upgrade/uninstall (not remove)
to prevent RPM warnings/errors
- Don't empty directories not owned by this package (these should
have been cleaned up by previous versions that owned them)

Loading...

Arjen de Korte's avatar
author target maintainer

After a directory change (/srv/www/htdocs -> /usr/share) or addition of the /var/cache/phpMyAdmin directory we should at least try to migrate a configuration that was modified by a user (rather than just replacing it by the package default). Of course this doesn't have a 100% success rate, but it is better than nothing.

Of course no migration is needed if the user never modified the configuration, as in that case the configuration file will just be replaced.

Again apologies for totally missing the fact that the previous migration indeed checked if the /srv/www/htdocs directory existed. If that didn't exist, it was indeed not run and changing to %config from %config(noreplace) was inappropriate.



Eric Schirra's avatar

Okay have understand your answer about my last question. but another question.

Why "+- Replace convoluted backup of /etc/apache2/conf.d/phpMyAdmin.conf 14+ by changing from %config(noreplace) to %config"

When i have change something in this files i want not that it will be overwrite.


Arjen de Korte's avatar
author target maintainer

That may be, but that is not what is currently happening. Upon installation, the %{apache_sysconfdir}/conf.d/%{name}.conf file will be backed up and then will be overwritten by %{apache_sysconfdir}/conf.d/%{name}.conf.rpmnew in the %post script (it has been like that for a considerable time already).


Arjen de Korte's avatar
author target maintainer

Essentially, changing %config(noreplace) to %config in this request changes nothing in the behavior: both before and after the change, the new file will take precedence and the old one (potentially with changes) is backed up.


Eric Schirra's avatar

When i read here: https://docs.fedoraproject.org/ro/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s05s03.html

"Use this option to help protect local modifications. If you use %config(noreplace), the file will not overwrite an existing file that has been modified. If the file has not been modified on disk, the rpm command will overwrite the file. But, if the file has been modified on disk, the rpm command will copy the new file with an extra file-name extension of .rpmnew. "

I want not that my modified local confgifile will be overwrite. And i want only a .rpmnew file.

So config{noreplace} should be stay there.


Arjen de Korte's avatar
author target maintainer

Apologies, I stand corrected: it would only do this if it detected the old %{ap_docroot_old} directory in the %{apache_sysconfdir}/conf.d/%{name}.conf configuration file on disk.


Eric Schirra's avatar

Why old? This is actually.

This is in your request:

155 %files apache 156-%config(noreplace) %{apache_sysconfdir}/conf.d/%{name}.conf 157-%config(noreplace) %{apache_sysconfdir}/conf.d/%{name}.inc 158+%config %{apache_sysconfdir}/conf.d/%{name}.conf 159+%config %{apache_sysconfdir}/conf.d/%{name}.inc

But "%{apache_sysconfdir}/conf.d/%{name}.conf" is not old and has nothing todo with backup. It is actually configuration.


Arjen de Korte's avatar
author target maintainer

I meant that it will only overwrite the existing %{apache_sysconfdir}/conf.d/%{name}.conf on the system, if it detects the %{ap_docroot_old} directory in that file. In that case, it must either update the configuration or (like was done previously) backup the old configuration and treat it like %config. This isn't pretty either though.

I'll amend the request later today to deal with this in a better way.

Request History
Arjen de Korte's avatar

adkorte created request

- Attempt to migrate modified configuration file rather than just
replacing it by default configuration
- The apache subpackage must require the main package, otherwise it
will not be uninstalled when the main package is uninstalled
- Generate blowfish secret and enable Apache modules/flags only on
install
- Only empty temporary directory on upgrade/uninstall (not remove)
to prevent RPM warnings/errors
- Don't empty directories not owned by this package (these should
have been cleaned up by previous versions that owned them)


openSUSE Build Service is sponsored by