[opensuse-packaging] Packaging scheme major change — how to?
Hi to all. I maintain monster-rpg-2 package at games repo. The game provided some files at /usr/share/%name but now it should provide the single zip file there. So I just updated the spec, rebuild packages and installed them. For some reason /usr/share/%name' files weren't purged! So game tries to load both files and zip file and fails. Any tips please? -- Best regards, Dmitriy DA(P).DarkneSS Perlow @ Linux x64 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Tue, 26 May 2015 21:10, Dmitriy Perlow <dap@...> wrote:
Hi to all.
I maintain monster-rpg-2 package at games repo. The game provided some files at /usr/share/%name but now it should provide the single zip file there. So I just updated the spec, rebuild packages and installed them. For some reason /usr/share/%name' files weren't purged! So game tries to load both files and zip file and fails.
Any tips please?
Hi, Dmitriy If you are sure that ALL files in /usr/share/%name are replaced, I'd use a %preinstall scriptlet to remove the whole dir, just to be sure. Necessary for this: your package "owns" (brings) the /usr/share/%name directory, and all the files in it. Thinking more on it, maybe the following as %preinstall scriptlet would be better / cleaner: [code] #!/usr/bin/sh # Cleanup in /usr/share/%name BEFORE install / update # due to change from discrete files to zipped archive PATH=/usr/bin/:$PATH # no dir, nothing to do test -d /usr/share/%name || exit files=`rpm -ql %name|grep /usr/share/%name|tr ' ' '?'|sed 's,/usr/share/%name/,./,'` # no files, nothing to do test -z $files && exit # change into dir, just to make sure cd /usr/share/%name test -n $files && rm $files #EOF [/code] - Yamaban -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Yamaban <foerster@lisas.de> Tue, 26 May 2015 22:23:03 +0300:
On Tue, 26 May 2015 21:10, Dmitriy Perlow <dap@...> wrote:
Hi to all.
I maintain monster-rpg-2 package at games repo. The game provided some files at /usr/share/%name but now it should provide the single zip file there. So I just updated the spec, rebuild packages and installed them. For some reason /usr/share/%name' files weren't purged! So game tries to load both files and zip file and fails.
Any tips please?
Hi, Dmitriy
If you are sure that ALL files in /usr/share/%name are replaced, I'd use a %preinstall scriptlet to remove the whole dir, just to be sure.
I am.
Necessary for this: your package "owns" (brings) the /usr/share/%name directory, and all the files in it.
Of course.
Thinking more on it, maybe the following as %preinstall scriptlet would be better / cleaner:
[code] #!/usr/bin/sh # Cleanup in /usr/share/%name BEFORE install / update # due to change from discrete files to zipped archive PATH=/usr/bin/:$PATH # no dir, nothing to do test -d /usr/share/%name || exit files=`rpm -ql %name|grep /usr/share/%name|tr ' ' '?'|sed 's,/usr/share/%name/,./,'` # no files, nothing to do test -z $files && exit # change into dir, just to make sure cd /usr/share/%name test -n $files && rm $files #EOF [/code]
- Yamaban
Seems to be nice but where may it be placed into the spec file? -- Best regards, Dmitriy DA(P).DarkneSS Perlow @ Linux x64 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Tue, 26 May 2015 22:50, Dmitriy Perlow wrote:
Yamaban on Tue, 26 May 2015 22:23:03 +0300:
On Tue, 26 May 2015 21:10, Dmitriy Perlow wrote:
Hi to all.
I maintain monster-rpg-2 package at games repo. The game provided some files at /usr/share/%name but now it should provide the single zip file there. So I just updated the spec, rebuild packages and installed them. For some reason /usr/share/%name' files weren't purged! So game tries to load both files and zip file and fails.
Any tips please?
Hi, Dmitriy
If you are sure that ALL files in /usr/share/%name are replaced, I'd use a %preinstall scriptlet to remove the whole dir, just to be sure.
I am.
Necessary for this: your package "owns" (brings) the /usr/share/%name directory, and all the files in it.
Of course.
Thinking more on it, maybe the following as %preinstall scriptlet would be better / cleaner:
[code] # !/usr/bin/sh # Cleanup in /usr/share/%name BEFORE install / update # due to change from discrete files to zipped archive PATH=/usr/bin/:$PATH # no dir, nothing to do test -d /usr/share/%name || exit files=`rpm -ql %name|grep /usr/share/%name|tr ' ' '?'|sed 's,/usr/share/%name/,./,'` # no files, nothing to do test -z $files && exit # change into dir, just to make sure cd /usr/share/%name test -n $files && rm $files #EOF [/code]
- Yamaban
Seems to be nice but where may it be placed into the spec file?
Huh? Normally, I put it after the %install and before the %files section of the spec file. Types: %pre = before install / update %preun = before uninstall (e.g. use for remove info-docs handling) %post = after install / update %postun = after uninstall usage here, simplified : [code] %install [...] %pre # Cleanup in /usr/share/%name BEFORE install / update # due to change from discrete files to zipped archive # no dir, nothing to do test -d %_datadir/%name || exit 0 rm %_datadir/%name/* %_datadir/%name/.??* exit 0 %files [...] [/code] References: [0] https://en.opensuse.org/openSUSE:Packaging_scriptlet_snippets [1] http://rpm5.org/docs/rpm-guide.html#id3103565 [2] http://www.rpm.org/max-rpm-snapshot/ - Yamaban. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Yamaban <foerster@lisas.de> Wed, 27 May 2015 00:08:37 +0300:
On Tue, 26 May 2015 22:50, Dmitriy Perlow wrote:
Yamaban on Tue, 26 May 2015 22:23:03 +0300:
Hi to all. I maintain monster-rpg-2 package at games repo. The game provided some > files at /usr/share/%name but now it should provide the single zip file > there. So I just updated the spec, rebuild packages and installed them. > For some reason /usr/share/%name' files weren't
On Tue, 26 May 2015 21:10, Dmitriy Perlow wrote: purged! So game tries to > load both files and zip file and fails.
Any tips please? Hi, Dmitriy If you are sure that ALL files in /usr/share/%name are replaced, I'd use a %preinstall scriptlet to remove the whole dir, just to be sure.
I am.
Necessary for this: your package "owns" (brings) the /usr/share/%name directory, and all the files in it.
Of course.
Thinking more on it, maybe the following as %preinstall scriptlet would be better / cleaner: [code] # !/usr/bin/sh # Cleanup in /usr/share/%name BEFORE install / update # due to change from discrete files to zipped archive PATH=/usr/bin/:$PATH # no dir, nothing to do test -d /usr/share/%name || exit files=`rpm -ql %name|grep /usr/share/%name|tr ' ' '?'|sed 's,/usr/share/%name/,./,'` # no files, nothing to do test -z $files && exit # change into dir, just to make sure cd /usr/share/%name test -n $files && rm $files #EOF [/code]
- Yamaban
Seems to be nice but where may it be placed into the spec file?
Huh? Normally, I put it after the %install and before the %files section of the spec file.
Types: %pre = before install / update %preun = before uninstall (e.g. use for remove info-docs handling)
These are new for me, thank you!
%post = after install / update %postun = after uninstall
Already known :)
usage here, simplified : [code] %install [...] %pre # Cleanup in /usr/share/%name BEFORE install / update # due to change from discrete files to zipped archive # no dir, nothing to do test -d %_datadir/%name || exit 0 rm %_datadir/%name/* %_datadir/%name/.??* exit 0
%files [...] [/code]
References: [0] https://en.opensuse.org/openSUSE:Packaging_scriptlet_snippets [1] http://rpm5.org/docs/rpm-guide.html#id3103565 [2] http://www.rpm.org/max-rpm-snapshot/
- Yamaban.
-- Best regards, Dmitriy DA(P).DarkneSS Perlow @ Linux x64 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Am 26.05.2015 um 21:23 schrieb Yamaban:
On Tue, 26 May 2015 21:10, Dmitriy Perlow <dap@...> wrote:
I maintain monster-rpg-2 package at games repo. The game provided some files at /usr/share/%name but now it should provide the single zip file there. So I just updated the spec, rebuild packages and installed them. For some reason /usr/share/%name' files weren't purged! So game tries to load both files and zip file and fails.
Any tips please?
Hi, Dmitriy
If you are sure that ALL files in /usr/share/%name are replaced, I'd use a %preinstall scriptlet to remove the whole dir, just to be sure.
Necessary for this: your package "owns" (brings) the /usr/share/%name directory, and all the files in it.
Thinking more on it, maybe the following as %preinstall scriptlet would be better / cleaner:
[code] #!/usr/bin/sh # Cleanup in /usr/share/%name BEFORE install / update # due to change from discrete files to zipped archive PATH=/usr/bin/:$PATH # no dir, nothing to do test -d /usr/share/%name || exit files=`rpm -ql %name|grep /usr/share/%name|tr ' ' '?'|sed 's,/usr/share/%name/,./,'` # no files, nothing to do test -z $files && exit # change into dir, just to make sure cd /usr/share/%name test -n $files && rm $files #EOF [/code]
Wtf? Don't do that. If the files in /usr/share/%name are owned by rpms they will be removed if all owners are uninstalled. That's a core job of rpm. There is no need for such ugly scripts. cu Ludwig -- (o_ Ludwig Nussel //\ V_/_ http://www.suse.de/ SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Ludwig Nussel <ludwig.nussel@suse.de> Wed, 27 May 2015 10:52:10 +0300:
Am 26.05.2015 um 21:23 schrieb Yamaban:
On Tue, 26 May 2015 21:10, Dmitriy Perlow <dap@...> wrote:
I maintain monster-rpg-2 package at games repo. The game provided some files at /usr/share/%name but now it should provide the single zip file there. So I just updated the spec, rebuild packages and installed them. For some reason /usr/share/%name' files weren't purged! So game tries to load both files and zip file and fails.
Any tips please?
Hi, Dmitriy
If you are sure that ALL files in /usr/share/%name are replaced, I'd use a %preinstall scriptlet to remove the whole dir, just to be sure.
Necessary for this: your package "owns" (brings) the /usr/share/%name directory, and all the files in it.
Thinking more on it, maybe the following as %preinstall scriptlet would be better / cleaner:
[code] #!/usr/bin/sh # Cleanup in /usr/share/%name BEFORE install / update # due to change from discrete files to zipped archive PATH=/usr/bin/:$PATH # no dir, nothing to do test -d /usr/share/%name || exit files=`rpm -ql %name|grep /usr/share/%name|tr ' ' '?'|sed 's,/usr/share/%name/,./,'` # no files, nothing to do test -z $files && exit # change into dir, just to make sure cd /usr/share/%name test -n $files && rm $files #EOF [/code]
Wtf? Don't do that. If the files in /usr/share/%name are owned by rpms they will be removed if all owners are uninstalled.
But not when updated.
That's a core job of rpm. There is no need for such ugly scripts.
When package is updated rpm just will (install new one) (not (remove old one and install new one))!
cu Ludwig
-- Best regards, Dmitriy DA(P).DarkneSS Perlow @ Linux x64 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
В Wed, 27 May 2015 17:54:46 +0300 "Dmitriy Perlow" <dap@open.by> пишет:
Wtf? Don't do that. If the files in /usr/share/%name are owned by rpms they will be removed if all owners are uninstalled.
But not when updated.
That's a core job of rpm. There is no need for such ugly scripts.
When package is updated rpm just will (install new one) (not (remove old one and install new one))!
Sorry, this is nonsense. RPM removes all files that were listed as part of old version and are no more present in new version. The only reason it may not do it is if files are marked specially, like %config. Looking at your RPM, /usr/share/%name is part of %name-data RPM, not of %name. Are you sure you updated both at the same time? Also this makes your %pre script plain wrong - it is for %name RPM which does not even own directory you remove. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Andrei Borzenkov <arvidjaar@gmail.com> Wed, 27 May 2015 19:42:38 +0300:
В Wed, 27 May 2015 17:54:46 +0300 "Dmitriy Perlow" <dap@open.by> пишет:
Wtf? Don't do that. If the files in /usr/share/%name are owned by rpms they will be removed if all owners are uninstalled.
But not when updated.
That's a core job of rpm. There is no need for such ugly scripts.
When package is updated rpm just will (install new one) (not (remove old one and install new one))!
Sorry, this is nonsense. RPM removes all files that were listed as part of old version and are no more present in new version. The only reason it may not do it is if files are marked specially, like %config.
Looking at your RPM, /usr/share/%name is part of %name-data RPM, not of %name.
Yes.
Are you sure you updated both at the same time?
Of course: see the strict dependency.
Also this makes your %pre script plain wrong - it is for %name RPM which does not even own directory you remove.
%name is always monster-rpg-2 and so it does just I would like to get. It isn't the only update I found bad rpm practice not to delete obsoleted files. But this update cause runtime issue because of rpm laziness. -- Best regards, Dmitriy DA(P).DarkneSS Perlow @ Linux x64 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
В Wed, 27 May 2015 22:27:54 +0300 "Dmitriy Perlow" <dap@open.by> пишет:
Andrei Borzenkov <arvidjaar@gmail.com> Wed, 27 May 2015 19:42:38 +0300:
В Wed, 27 May 2015 17:54:46 +0300 "Dmitriy Perlow" <dap@open.by> пишет:
Wtf? Don't do that. If the files in /usr/share/%name are owned by rpms they will be removed if all owners are uninstalled.
But not when updated.
That's a core job of rpm. There is no need for such ugly scripts.
When package is updated rpm just will (install new one) (not (remove old one and install new one))!
Sorry, this is nonsense. RPM removes all files that were listed as part of old version and are no more present in new version. The only reason it may not do it is if files are marked specially, like %config.
Looking at your RPM, /usr/share/%name is part of %name-data RPM, not of %name.
Yes.
Are you sure you updated both at the same time?
Of course: see the strict dependency.
Also this makes your %pre script plain wrong - it is for %name RPM which does not even own directory you remove.
%name is always monster-rpg-2 and so it does just I would like to get.
If %name-data is installed before %name, %name will happily wipe out just installed files.
It isn't the only update I found bad rpm practice not to delete obsoleted files. But this update cause runtime issue because of rpm laziness.
I find it hard to believe in gremlins. If you have versions of your RPM before and after switch to zip (but without rm -rf) I'd be interested to look. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Andrei Borzenkov <arvidjaar@gmail.com> Wed, 27 May 2015 22:32:24 +0300:
В Wed, 27 May 2015 22:27:54 +0300 "Dmitriy Perlow" <dap@open.by> пишет:
Andrei Borzenkov <arvidjaar@gmail.com> Wed, 27 May 2015 19:42:38 +0300:
В Wed, 27 May 2015 17:54:46 +0300 "Dmitriy Perlow" <dap@open.by> пишет:
Wtf? Don't do that. If the files in /usr/share/%name are owned by rpms they will be removed if all owners are uninstalled.
But not when updated.
That's a core job of rpm. There is no need for such ugly scripts.
When package is updated rpm just will (install new one) (not (remove old one and install new one))!
Sorry, this is nonsense. RPM removes all files that were listed as part of old version and are no more present in new version. The only reason it may not do it is if files are marked specially, like %config.
Looking at your RPM, /usr/share/%name is part of %name-data RPM, not of %name.
Yes.
Are you sure you updated both at the same time?
Of course: see the strict dependency.
Also this makes your %pre script plain wrong - it is for %name RPM which does not even own directory you remove.
%name is always monster-rpg-2 and so it does just I would like to get.
If %name-data is installed before %name, %name will happily wipe out just installed files.
It will not, new data file isn't wiped by design.
It isn't the only update I found bad rpm practice not to delete obsoleted files. But this update cause runtime issue because of rpm laziness.
I find it hard to believe in gremlins. If you have versions of your RPM before and after switch to zip (but without rm -rf) I'd be interested to look.
4.11.3. OpenSUSE 13.2' default one. Of course some versions before this one. -- Best regards, Dmitriy DA(P).DarkneSS Perlow @ Linux x64 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
В Tue, 26 May 2015 22:10:35 +0300 "Dmitriy Perlow" <dap@open.by> пишет:
Hi to all.
I maintain monster-rpg-2 package at games repo. The game provided some files at /usr/share/%name but now it should provide the single zip file there. So I just updated the spec, rebuild packages and installed them. For some reason /usr/share/%name' files weren't purged! So game tries to load both files and zip file and fails.
Any tips please?
Were those files listed in previous version spec? -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Andrei Borzenkov <arvidjaar@gmail.com> Wed, 27 May 2015 07:07:24 +0300:
В Tue, 26 May 2015 22:10:35 +0300 "Dmitriy Perlow" <dap@open.by> пишет:
Hi to all.
I maintain monster-rpg-2 package at games repo. The game provided some files at /usr/share/%name but now it should provide the single zip file there. So I just updated the spec, rebuild packages and installed them. For some reason /usr/share/%name' files weren't purged! So game tries to load both files and zip file and fails.
Any tips please?
Were those files listed in previous version spec?
The whole /usr/share/%name was. -- Best regards, Dmitriy DA(P).DarkneSS Perlow @ Linux x64 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (4)
-
Andrei Borzenkov
-
Dmitriy Perlow
-
Ludwig Nussel
-
Yamaban