How do I....

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I....

Robert Schweikert-6
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
[hidden email]
IRC: robjo


signature.asc (484 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How do I....

Olaf Hering-2
Am Fri, 16 Jun 2017 10:06:53 -0400
schrieb Robert Schweikert <[hidden email]>:

> How do I skip something during the install test of a package build in
> the build service?

test -e /.build.log && exit 0

Olaf

attachment0 (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How do I....

Marcus Meissner
In reply to this post by Robert Schweikert-6
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: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How do I....

Thorsten Kukuk
In reply to this post by Robert Schweikert-6
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: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How do I....

Andreas Schwab-2
In reply to this post by Robert Schweikert-6
On Jun 16 2017, Robert Schweikert <[hidden email]> 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.

Andreas.

--
Andreas Schwab, SUSE Labs, [hidden email]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How do I....

Robert Schweikert-6


On 06/19/2017 03:20 AM, Andreas Schwab wrote:
> On Jun 16 2017, Robert Schweikert <[hidden email]> 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
[hidden email]
IRC: robjo
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How do I....

Andreas Schwab-2
On Jun 19 2017, Robert Schweikert <[hidden email]> wrote:

> Yes because I could add the "missing" packages as BuildRequires

They need to be Requires(post).

Andreas.

--
Andreas Schwab, SUSE Labs, [hidden email]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How do I....

Michael Schroeder-4
In reply to this post by Olaf Hering-2
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 <[hidden email]>:
>
> > 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                                   [hidden email]
SUSE LINUX GmbH,           GF Jeff Hawn, HRB 16746 AG Nuernberg
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How do I....

Robert Schweikert-6
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 <[hidden email]>:
>>
>>> 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
[hidden email]
IRC: robjo
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How do I....

Michael Schroeder-4
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 <[hidden email]>:
> >>
> >>> 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                                   [hidden email]
SUSE LINUX GmbH,           GF Jeff Hawn, HRB 16746 AG Nuernberg
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How do I....

Andreas Schwab-2
In reply to this post by Robert Schweikert-6
On Jun 19 2017, Robert Schweikert <[hidden email]> wrote:

> 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, [hidden email]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]