[opensuse-packaging] How do I....
![](https://seccdn.libravatar.org/avatar/ed5b1491aa79201a8eaf93bf57193584.jpg?s=120&d=mm&r=g)
Hi, How do I skip something during the install test of a package build in the build service? The package needs contain a %post in this section during regular install a script gets executed that modifies files in the root file system when installed on a running system. During package build these files are not there and thus %post fails during the install test. I've tried %if ! 0%{?opensuse_bs} %post oslogin /sbin/ldconfig %{_bindir}/myscript %endif but that didn't do the trick as "myscript" still gets executed and then the build fails. So "myscript" should not run during install test in OBS but should run when the package is installed on a running system. I have done this years ago but forgot the package where I needed to do this an dobviousy forgot how to do it as well. Help is appreciated. Thanks, Robert -- Robert Schweikert MAY THE SOURCE BE WITH YOU Distinguished Architect LINUX Team Lead Public Cloud rjschwei@suse.com IRC: robjo
![](https://seccdn.libravatar.org/avatar/bc67c2666cfb0f5c7770293291610cc9.jpg?s=120&d=mm&r=g)
On Fri, Jun 16, 2017 at 04:08:41PM +0200, Olaf Hering wrote:
Am Fri, 16 Jun 2017 10:06:53 -0400 schrieb Robert Schweikert
: How do I skip something during the install test of a package build in the build service?
test -e /.build.log && exit 0
Bad advice. Do not test for /.build.log, the standard way is to test for existence of the /.buildenv file. Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/ed5b1491aa79201a8eaf93bf57193584.jpg?s=120&d=mm&r=g)
Hi, On 06/19/2017 05:16 AM, Michael Schroeder wrote:
On Fri, Jun 16, 2017 at 04:08:41PM +0200, Olaf Hering wrote:
Am Fri, 16 Jun 2017 10:06:53 -0400 schrieb Robert Schweikert
: How do I skip something during the install test of a package build in the build service?
test -e /.build.log && exit 0
Bad advice. Do not test for /.build.log, the standard way is to test for existence of the /.buildenv file.
OK, thanks that does the trick :) Next question is how do I combine noarch with arch specific builds? The primary package is noarch, i.e. BuildArch: noarch but the subpackage has architecture specific code. The sub-package definition inherits the "noarch" setting. Do I have to redefine BuildArch or is there some "reset to default"? Thanks, Robert -- Robert Schweikert MAY THE SOURCE BE WITH YOU Distinguished Architect LINUX Team Lead Public Cloud rjschwei@suse.com IRC: robjo -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/bc67c2666cfb0f5c7770293291610cc9.jpg?s=120&d=mm&r=g)
On Mon, Jun 19, 2017 at 05:48:44AM -0400, Robert Schweikert wrote:
On 06/19/2017 05:16 AM, Michael Schroeder wrote:
On Fri, Jun 16, 2017 at 04:08:41PM +0200, Olaf Hering wrote:
Am Fri, 16 Jun 2017 10:06:53 -0400 schrieb Robert Schweikert
: How do I skip something during the install test of a package build in the build service?
test -e /.build.log && exit 0
Bad advice. Do not test for /.build.log, the standard way is to test for existence of the /.buildenv file.
OK, thanks that does the trick :)
Next question is how do I combine noarch with arch specific builds?
The primary package is noarch, i.e.
BuildArch: noarch
That won't work. The only supported way is an arch dependend primary package with noarch subpackages. Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/833649deea07c68de42500ad14c257f6.jpg?s=120&d=mm&r=g)
On Jun 19 2017, Robert Schweikert
The primary package is noarch, i.e.
BuildArch: noarch
but the subpackage has architecture specific code. The sub-package definition inherits the "noarch" setting. Do I have to redefine BuildArch or is there some "reset to default"?
You can't do that. Either make an arch specific package the primary package, or add a dummy primary package. Then you can add noarch subpackages. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/bff0c215e01f23fcee6fe49e65fae458.jpg?s=120&d=mm&r=g)
On Fri, Jun 16, 2017 at 10:06:53AM -0400, Robert Schweikert wrote:
Hi,
How do I skip something during the install test of a package build in the build service?
The package needs contain a %post in this section during regular install a script gets executed that modifies files in the root file system when installed on a running system. During package build these files are not there and thus %post fails during the install test.
I've tried
%if ! 0%{?opensuse_bs} %post oslogin /sbin/ldconfig %{_bindir}/myscript %endif
but that didn't do the trick as "myscript" still gets executed and then the build fails. So "myscript" should not run during install test in OBS but should run when the package is installed on a running system.
I have done this years ago but forgot the package where I needed to do this an dobviousy forgot how to do it as well.
So what are you really trying to achieve? This is usually somethign that will break transactional updates and friends. Ciao, Marcus -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/bce881f00c17a1bf997473f19b54e1d4.jpg?s=120&d=mm&r=g)
On Fri, Jun 16, Robert Schweikert wrote:
Hi,
How do I skip something during the install test of a package build in the build service?
The package needs contain a %post in this section during regular install a script gets executed that modifies files in the root file system when installed on a running system. During package build these files are not there and thus %post fails during the install test.
I've tried
%if ! 0%{?opensuse_bs} %post oslogin /sbin/ldconfig %{_bindir}/myscript %endif
but that didn't do the trick as "myscript" still gets executed and then the build fails. So "myscript" should not run during install test in OBS but should run when the package is installed on a running system.
test -x %{_bindir}/myscript && %{_bindir}/myscript Thorsten -- Thorsten Kukuk, Distinguished Engineer, Senior Architect SLES & CaaSP SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/833649deea07c68de42500ad14c257f6.jpg?s=120&d=mm&r=g)
On Jun 16 2017, Robert Schweikert
The package needs contain a %post in this section during regular install a script gets executed that modifies files in the root file system when installed on a running system. During package build these files are not there and thus %post fails during the install test.
Why are the files not present? That looks like a missing dependency. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/ed5b1491aa79201a8eaf93bf57193584.jpg?s=120&d=mm&r=g)
On 06/19/2017 03:20 AM, Andreas Schwab wrote:
On Jun 16 2017, Robert Schweikert
wrote: The package needs contain a %post in this section during regular install a script gets executed that modifies files in the root file system when installed on a running system. During package build these files are not there and thus %post fails during the install test.
Why are the files not present? That looks like a missing dependency.
Yes and no. Yes because I could add the "missing" packages as BuildRequires, no because that is not sufficient the %post script that runs also reaches out to the cloud framework metadata server which we will not have in the BuildService, so the "missing" build requires is somewhat of a moot point as the script will not ever work inside the Build Service, I just really need to disable it during the install test in the Build Service. How do I get that done? Thanks, Robert -- Robert Schweikert MAY THE SOURCE BE WITH YOU Distinguished Architect LINUX Team Lead Public Cloud rjschwei@suse.com IRC: robjo -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/833649deea07c68de42500ad14c257f6.jpg?s=120&d=mm&r=g)
On Jun 19 2017, Robert Schweikert
Yes because I could add the "missing" packages as BuildRequires
They need to be Requires(post). Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (6)
-
Andreas Schwab
-
Marcus Meissner
-
Michael Schroeder
-
Olaf Hering
-
Robert Schweikert
-
Thorsten Kukuk