[opensuse-packaging] Howto protect files from removing after uninstall of a rpm?
Hello, I try to build a RPM. All is working fine. But I need that after uninstall of the rpm two files always should be left on disk. If the package is updated, file should be replaced with the file from new rpm and replaced renamed as .rpmsave. Is there a way to do this in the spec file? Thanks Meike -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Hello, 2013/4/26 Meike Stone <meike.stone@googlemail.com>:
Hello,
I try to build a RPM. All is working fine. But I need that after uninstall of the rpm two files always should be left on disk. If the package is updated, file should be replaced with the file from new rpm and replaced renamed as .rpmsave.
Is there a way to do this in the spec file?
Thanks Meike
No one how can help? Thanks Meike -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Meike Stone (meike.stone@googlemail.com) wrote:
Hello,
2013/4/26 Meike Stone <meike.stone@googlemail.com>:
Hello,
I try to build a RPM. All is working fine. But I need that after uninstall of the rpm two files always should be left on disk. If the package is updated, file should be replaced with the file from new rpm and replaced renamed as .rpmsave.
Is there a way to do this in the spec file?
No one how can help?
Isn't that what the %config macro is for? https://en.opensuse.org/openSUSE:Specfile_guidelines#Configuration_files -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Tue, 30 Apr 2013 13:05, Meike Stone <meike.stone@...> wrote:
2013/4/26 Meike Stone <meike.stone@googlemail.com>:
Hello,
I try to build a RPM. All is working fine. But I need that after uninstall of the rpm two files always should be left on disk. If the package is updated, file should be replaced with the file from new rpm and replaced renamed as .rpmsave.
Is there a way to do this in the spec file?
In general: define the file as %config(noreplace) ..... in your %files section (to make it work, it needs touch, chmod in %post-install) http://rpm.org (Base) http://rpm.org/wiki/Docs (offical Docs, info and more) Esp: http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_... (http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_...) Near Bottom. old: http://www.rpm.org/max-rpm-snapshot/ (http://www.rpm.org/max-rpm-snapshot/s1-rpm-inside-files-list-directives.html) even older: http://www.gurulabs.com/downloads/GURULABS-RPM-LAB/GURULABS-RPM-GUIDE-v1.0.P... (if missing use archive.org) http://web.archive.org/web/20110711135253/http://www.gurulabs.com/downloads/... - Yamaban. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
В Tue, 30 Apr 2013 13:45:51 +0200 (CEST) Yamaban <foerster@lisas.de> пишет:
On Tue, 30 Apr 2013 13:05, Meike Stone <meike.stone@...> wrote:
2013/4/26 Meike Stone <meike.stone@googlemail.com>:
Hello,
I try to build a RPM. All is working fine. But I need that after uninstall of the rpm two files always should be left on disk. If the package is updated, file should be replaced with the file from new rpm and replaced renamed as .rpmsave.
Is there a way to do this in the spec file?
In general: define the file as %config(noreplace)
Was not the question how to *replace* files during installation? -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Wed, 1 May 2013 17:27, Andrey Borzenkov <arvidjaar@...> wrote:
В Tue, 30 Apr 2013 13:45:51 +0200 (CEST) Yamaban <foerster@lisas.de> пишет:
On Tue, 30 Apr 2013 13:05, Meike Stone <meike.stone@...> wrote:
2013/4/26 Meike Stone <meike.stone@googlemail.com>:
Hello,
I try to build a RPM. All is working fine. But I need that after uninstall of the rpm two files always should be left on disk. If the package is updated, file should be replaced with the file from new rpm and replaced renamed as .rpmsave.
Is there a way to do this in the spec file?
In general: define the file as %config(noreplace)
Was not the question how to *replace* files during installation?
Please look up what EXACTLY the added noreplace does. in short: if file changed during prior install (e.g. changed file / filemode / timestamp) (see rpm --verify) the file is moved to {filename}.rpmsave, and the new file from the package is put into place. Trouble comes in the form of "location not allowed to be used as %config" or similar due to added rpmlint / rpm-macros in the Distro. "nacked" rpm does not imply such rules, the added Distro definitions do that. And yes, I already fell afoul this trouble.
В Wed, 1 May 2013 18:13:49 +0200 (CEST) Yamaban <foerster@lisas.de> пишет:
On Wed, 1 May 2013 17:27, Andrey Borzenkov <arvidjaar@...> wrote:
В Tue, 30 Apr 2013 13:45:51 +0200 (CEST) Yamaban <foerster@lisas.de> пишет:
On Tue, 30 Apr 2013 13:05, Meike Stone <meike.stone@...> wrote:
2013/4/26 Meike Stone <meike.stone@googlemail.com>:
Hello,
I try to build a RPM. All is working fine. But I need that after uninstall of the rpm two files always should be left on disk. If the package is updated, file should be replaced with the file from new rpm and replaced renamed as .rpmsave.
Is there a way to do this in the spec file?
In general: define the file as %config(noreplace)
Was not the question how to *replace* files during installation?
Please look up what EXACTLY the added noreplace does.
What makes you believe I do not know it?
in short: if file changed during prior install (e.g. changed file / filemode / timestamp) (see rpm --verify) the file is moved to {filename}.rpmsave, and the new file from the package is put into place.
that's what %config (without noreplace) does. The only caveat is - RPM does not create .rpmsave if file was not changed in package (unless it changed recently). It may or may not be what is required.
Trouble comes in the form of "location not allowed to be used as %config" or similar due to added rpmlint / rpm-macros in the Distro. "nacked" rpm does not imply such rules, the added Distro definitions do that.
And yes, I already fell afoul this trouble. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Hello, On May 1 20:27 Andrey Borzenkov wrote (excerpt):
I try to build a RPM. All is working fine. But I need that after uninstall of the rpm two files always should be left on disk. If the package is updated, file should be replaced with the file from new rpm and replaced renamed as .rpmsave. ...
2013/4/26 Meike Stone <meike.stone@googlemail.com>: that's what %config (without noreplace) does. The only caveat is - RPM does not create .rpmsave if file was not changed in package (unless it changed recently). It may or may not be what is required.
See http://www-uxsup.csx.cam.ac.uk/~jw35/docs/rpm_config.html and http://www.rpm.org/max-rpm/s1-rpm-erase-and-config-files.html Therefore one has to enforce that the file on disk gets changed e.g. by something appropriate in the RPM post install scriptlet. But even then, "rpm -e" would not leave the file as is on disk because it would be kept as file.rpmsave. And I don't know what happens if "rpm -i / rpm -e" are run multiple times like: # rpm -i package.rpm (installs file and modifies it via %post) # rpm -e package (keeps file as file.rpmsave) # rpm -i package.rpm (installs file and modifies it via %post) # rpm -e package (what exactly is now in file.rpmsave?) Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH -- Maxfeldstrasse 5 -- 90409 Nuernberg -- Germany HRB 16746 (AG Nuernberg) GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Wed, May 1, 2013 at 11:27 AM, Andrey Borzenkov <arvidjaar@gmail.com> wrote:
В Tue, 30 Apr 2013 13:45:51 +0200 (CEST) Yamaban <foerster@lisas.de> пишет:
On Tue, 30 Apr 2013 13:05, Meike Stone <meike.stone@...> wrote:
2013/4/26 Meike Stone <meike.stone@googlemail.com>:
Hello,
I try to build a RPM. All is working fine. But I need that after uninstall of the rpm two files always should be left on disk. If the package is updated, file should be replaced with the file from new rpm and replaced renamed as .rpmsave.
Is there a way to do this in the spec file?
In general: define the file as %config(noreplace)
Was not the question how to *replace* files during installation? -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
I think the harder question was how to not delete them on uninstallation of the rpm. I would probably try to install them to a base location, then copy them to the final location in the %postin section, but I don't know if that would work or not. Greg -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
В Wed, 1 May 2013 12:16:32 -0400 Greg Freemyer <greg.freemyer@gmail.com> пишет:
On Wed, May 1, 2013 at 11:27 AM, Andrey Borzenkov <arvidjaar@gmail.com> wrote:
В Tue, 30 Apr 2013 13:45:51 +0200 (CEST) Yamaban <foerster@lisas.de> пишет:
On Tue, 30 Apr 2013 13:05, Meike Stone <meike.stone@...> wrote:
2013/4/26 Meike Stone <meike.stone@googlemail.com>:
Hello,
I try to build a RPM. All is working fine. But I need that after uninstall of the rpm two files always should be left on disk. If the package is updated, file should be replaced with the file from new rpm and replaced renamed as .rpmsave.
Is there a way to do this in the spec file?
In general: define the file as %config(noreplace)
Was not the question how to *replace* files during installation? -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
I think the harder question was how to not delete them on uninstallation of the rpm.
It should be saved as .rpmold; is it not enough? But again, only if file was changed, so you cannot be sure it is always present.
I would probably try to install them to a base location, then copy them to the final location in the %postin section, but I don't know if that would work or not.
Greg
-- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Hello, On May 1 20:29 Andrey Borzenkov wrote (excerpt):
It should be saved as .rpmold
I only know about .rpmnew and .rpmsave but not about .rpmold. Is .rpmold a typo? If not, could you provide an URL for documentation about .rpmold. Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH -- Maxfeldstrasse 5 -- 90409 Nuernberg -- Germany HRB 16746 (AG Nuernberg) GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
2013/5/1 Greg Freemyer <greg.freemyer@gmail.com>:
On Wed, May 1, 2013 at 11:27 AM, Andrey Borzenkov <arvidjaar@gmail.com> wrote:
В Tue, 30 Apr 2013 13:45:51 +0200 (CEST) Yamaban <foerster@lisas.de> пишет:
On Tue, 30 Apr 2013 13:05, Meike Stone <meike.stone@...> wrote:
2013/4/26 Meike Stone <meike.stone@googlemail.com>:
Hello,
I try to build a RPM. All is working fine. But I need that after uninstall of the rpm two files always should be left on disk. If the package is updated, file should be replaced with the file from new rpm and replaced renamed as .rpmsave.
Is there a way to do this in the spec file?
In general: define the file as %config(noreplace)
Was not the question how to *replace* files during installation? -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
I think the harder question was how to not delete them on uninstallation of the rpm.
Yes that's my problem., the config file, that must remain on the disk must not be renamed, while removing the rpm.
I would probably try to install them to a base location, then copy them to the final location in the %postin section, but I don't know if that would work or not.
I think your method sounds good, a possible solution from the dilemma :-) Thanks Meike -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (6)
-
Adam Spiers
-
Andrey Borzenkov
-
Greg Freemyer
-
Johannes Meixner
-
Meike Stone
-
Yamaban