OBS runs %post during the build process (?)

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

OBS runs %post during the build process (?)

Alex Naumov
Hi,

can somebody remind me how to add some piece of code to spec that will
*NOT* run during the build process (I need it at installation only).
As I remember, it was %post... but OBS run %post during the build.


Thank you,
Alex
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OBS runs %post during the build process (?)

Matwey V. Kornilov

OBS may run %post during checks after the actual build. Please, show us your
logs.



Alex Naumov wrote:

> Hi,
>
> can somebody remind me how to add some piece of code to spec that will
> *NOT* run during the build process (I need it at installation only).
> As I remember, it was %post... but OBS run %post during the build.
>
>
> Thank you,
> Alex


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OBS runs %post during the build process (?)

Henne Vogelsang-2
In reply to this post by Alex Naumov
Hey,

On 13.01.2013 00:18, Alex Naumov wrote:

> can somebody remind me how to add some piece of code to spec that will
> *NOT* run during the build process (I need it at installation only).
> As I remember, it was %post... but OBS run %post during the build.

It installs packages after the build succeeds. RPM runs %post during
that install, of course. So whatever you have in %post runs only during
package installation....

Henne

--
Henne Vogelsang
http://www.opensuse.org
Everybody has a plan, until they get hit.
        - Mike Tyson
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OBS runs %post during the build process (?)

Claudio Freire
On Mon, Jan 14, 2013 at 7:25 AM, Henne Vogelsang <[hidden email]> wrote:
>> can somebody remind me how to add some piece of code to spec that will
>> *NOT* run during the build process (I need it at installation only).
>> As I remember, it was %post... but OBS run %post during the build.
>
> It installs packages after the build succeeds. RPM runs %post during
> that install, of course. So whatever you have in %post runs only during
> package installation....

OBS also build-requires the requires(pre/post), which might be
unexpected (there's an issue with this in postgres for instance, which
creates circular dependencies that aren't apparent).
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OBS runs %post during the build process (?)

Alex Naumov
In reply to this post by Matwey V. Kornilov
On Sun, Jan 13, 2013 at 12:40 PM, Matwey V.  Kornilov
<[hidden email]> wrote:
>
> OBS may run %post during checks after the actual build.
>
Is the way to say OBS "forget about this code and don't run it. I will
care about it" ?

>
> Please, show us your logs.
>

This project located on my own OBS, but I can reproduce it at some test package:

OBS Log:
https://build.opensuse.org/package/live_build_log?arch=i586&package=fpns&project=home%3AAlexander_Naumov&repository=openSUSE_12.2

Spec:
https://build.opensuse.org/package/view_file?expand=1&file=funnyPNS.spec&package=fpns&project=home%3AAlexander_Naumov


On Mon, Jan 14, 2013 at 11:25 AM, Henne Vogelsang <[hidden email]> wrote:
> Hey,
>

Hey Henne,

> On 13.01.2013 00:18, Alex Naumov wrote:
>
>> can somebody remind me how to add some piece of code to spec that will
>> *NOT* run during the build process (I need it at installation only).
>> As I remember, it was %post... but OBS run %post during the build.
>
> It installs packages after the build succeeds. RPM runs %post during
> that install, of course. So whatever you have in %post runs only during
> package installation....
>

The problem is that I need to run curl and check configuration of some
components in the system.
I want to automate the configuration process: package will configure
itself after installation.
I know how to do this, but OBS should ignore (don't run) this piece of code.

>
> --
> To unsubscribe, e-mail: [hidden email]
> To contact the owner, e-mail: [hidden email]
>
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OBS runs %post during the build process (?)

Křištof Želechovski-3
Dnia piątek, 18 stycznia 2013 22:02:55 Alex Naumov pisze:
> On Sun, Jan 13, 2013 at 12:40 PM, Matwey V.  Kornilov
>
> <[hidden email]> wrote:
> > OBS may run %post during checks after the actual build.
>
> Is the way to say OBS "forget about this code and don't run it. I will
> care about it" ?

%if 0
this code
%endif

HTH,
Chris

> The problem is that I need to run curl and check configuration of some
> components in the system.
> I want to automate the configuration process: package will configure
> itself after installation.
> I know how to do this, but OBS should ignore (don't run) this piece of code.

Why?


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OBS runs %post during the build process (?)

Alex Naumov
On Sat, Jan 19, 2013 at 10:47 AM, Krzysztof Żelechowski
<[hidden email]> wrote:

> Dnia piątek, 18 stycznia 2013 22:02:55 Alex Naumov pisze:
>> On Sun, Jan 13, 2013 at 12:40 PM, Matwey V. Kornilov <[hidden email]> wrote:
>> > OBS may run %post during checks after the actual build.
>>
>> Is the way to say OBS "forget about this code and don't run it. I will
>> care about it" ?
>
> %if 0
> this code
> %endif
>

Thank you very much! That's exactly what I need.

>
>> The problem is that I need to run curl and check configuration of some
>> components in the system.
>> I want to automate the configuration process: package will configure
>> itself after installation.
>> I know how to do this, but OBS should ignore (don't run) this piece of code.
>
> Why?
>

For example, I want to configure USB printer via CUPS.
In this case device should be there in this time. If not, build
process will be just froze.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OBS runs %post during the build process (?)

Dominique Leuenberger / DimStar
On Sat, 2013-01-19 at 12:26 +0100, Alex Naumov wrote:

> >> The problem is that I need to run curl and check configuration of some
> >> components in the system.
> >> I want to automate the configuration process: package will configure
> >> itself after installation.
> >> I know how to do this, but OBS should ignore (don't run) this piece of code.
> >
> > Why?
> >
>
> For example, I want to configure USB printer via CUPS.
> In this case device should be there in this time. If not, build
> process will be just froze.

And if the package is being installed while the printer is not there on
the end machine, the install process will just freeze?

Sounds like a very bad usecase and not resilient enough to go into any
prod environment... That script likely should be 'smarter'.

Dominique

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OBS runs %post during the build process (?)

Alex Naumov
On Sat, Jan 19, 2013 at 12:38 PM, Dimstar / Dominique Leuenberger
<[hidden email]> wrote:

> On Sat, 2013-01-19 at 12:26 +0100, Alex Naumov wrote:
>> >> The problem is that I need to run curl and check configuration of some
>> >> components in the system.
>> >> I want to automate the configuration process: package will configure
>> >> itself after installation.
>> >> I know how to do this, but OBS should ignore (don't run) this piece of code.
>> >
>> > Why?
>> >
>>
>> For example, I want to configure USB printer via CUPS.
>> In this case device should be there in this time. If not, build
>> process will be just froze.
>
> And if the package is being installed while the printer is not there on
> the end machine, the install process will just freeze?
>
> Sounds like a very bad usecase and not resilient enough to go into any
> prod environment... That script likely should be 'smarter'.
>
> Dominique
>

Yes, but it should work exactly like this.

Imagine such situation: you have 100 (or more) machines and they have
the same printers. You just install this package and it configure the
system (via CUPS) to use these printers. Yes, for "home-desktop-users"
it will be redundant (they can configure it manually), but for
industrial use that's exactly what we need.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OBS runs %post during the build process (?)

Dominique Leuenberger / DimStar
On Sat, 2013-01-19 at 14:55 +0100, Alex Naumov wrote:

> Yes, but it should work exactly like this.
>
> Imagine such situation: you have 100 (or more) machines and they have
> the same printers. You just install this package and it configure the
> system (via CUPS) to use these printers. Yes, for "home-desktop-users"
> it will be redundant (they can configure it manually), but for
> industrial use that's exactly what we need.

I doubt that what you want in an 'industrial' setup is to have your
machines all hang in an rpm task trying to find a printer which
vanished...

you want a setup that installs the logic and the executes the logic
decoupled from the package installation (maybe a cron job firing up).

Just imagine you rollout this package to a large park, configuring 'your
printer', the cleaning lady passed the printer, pulls the plug: your
entire industrial park is in a hanging rpm transaction... surely this is
not what  you want.

Dominique

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OBS runs %post during the build process (?)

Alex Naumov
On Sat, Jan 19, 2013 at 3:07 PM, Dimstar / Dominique Leuenberger
<[hidden email]> wrote:

> On Sat, 2013-01-19 at 14:55 +0100, Alex Naumov wrote:
>
>> Yes, but it should work exactly like this.
>>
>> Imagine such situation: you have 100 (or more) machines and they have
>> the same printers. You just install this package and it configure the
>> system (via CUPS) to use these printers. Yes, for "home-desktop-users"
>> it will be redundant (they can configure it manually), but for
>> industrial use that's exactly what we need.
>
> I doubt that what you want in an 'industrial' setup is to have your
> machines all hang in an rpm task trying to find a printer which
> vanished...
>

Printers are there. If printers are not connected that's not a my problem.
My task as a packager is just to create a package that will make all
stuff (sources+configurations) and put it to the repo.

> you want a setup that installs the logic and the executes the logic
> decoupled from the package installation (maybe a cron job firing up).
>

Yes, packaging is just a packaging, but what I do is the full
automatically printer-system configuration (without some extra setup).


> Just imagine you rollout this package to a large park, configuring 'your
> printer', the cleaning lady passed the printer, pulls the plug: your
> entire industrial park is in a hanging rpm transaction... surely this is
> not what  you want.
>

I understand what you mean, but such situations will never happen :)
And again: I'm not going to use such logic for desktop-users packages.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OBS runs %post during the build process (?)

Alex Naumov
In reply to this post by Alex Naumov
On Sat, Jan 19, 2013 at 12:26 PM, Alex Naumov
<[hidden email]> wrote:

> On Sat, Jan 19, 2013 at 10:47 AM, Krzysztof Żelechowski
> <[hidden email]> wrote:
>> Dnia piątek, 18 stycznia 2013 22:02:55 Alex Naumov pisze:
>>> On Sun, Jan 13, 2013 at 12:40 PM, Matwey V. Kornilov <[hidden email]> wrote:
>>> > OBS may run %post during checks after the actual build.
>>>
>>> Is the way to say OBS "forget about this code and don't run it. I will
>>> care about it" ?
>>
>> %if 0
>> this code
>> %endif
>>
>
> Thank you very much! That's exactly what I need.
>

Oh... it was a bit premature.
OBS did not show this echo-string (that I added to $post as example),
but during installation it was also not there...

https://build.opensuse.org/package/view_file?expand=1&file=funnyPNS.spec&package=fpns&project=home%3AAlexander_Naumov
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OBS runs %post during the build process (?)

Srinidhi B
 >>> On 19/1/2013 at 08:38 PM, Alex Naumov <[hidden email]> wrote:

> On Sat, Jan 19, 2013 at 12:26 PM, Alex Naumov
> <[hidden email]> wrote:
> > On Sat, Jan 19, 2013 at 10:47 AM, Krzysztof *elechowski
> > <[hidden email]> wrote:
> >> Dnia pi*tek, 18 stycznia 2013 22:02:55 Alex Naumov pisze:
> >>> On Sun, Jan 13, 2013 at 12:40 PM, Matwey V. Kornilov
> <[hidden email]> wrote:
> >>> > OBS may run %post during checks after the actual build.
> >>>
> >>> Is the way to say OBS "forget about this code and don't run it. I will
> >>> care about it" ?
> >>
> >> %if 0
> >> this code
> >> %endif
> >>
> >
> > Thank you very much! That's exactly what I need.
> >
>
> Oh... it was a bit premature.
> OBS did not show this echo-string (that I added to $post as example),
> but during installation it was also not there...
>
> https://build.opensuse.org/package/view_file?expand=1&file=funnyPNS.spec&packa
> ge=fpns&project=home%3AAlexander_Naumov

You probably need this (answering your specific question of "can I?" and not commenting on "should I?"):

http://en.opensuse.org/openSUSE:Build_Service_Tips_and_Tricks#Handling_builds_inside_the_Build_Service_specially

HTH,
Srinidhi.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: OBS runs %post during the build process (?)

Yamaban
In reply to this post by Alex Naumov
On Sat, 19 Jan 2013 16:08, Alex Naumov <alexander_naumov@...> wrote:

> On Sat, Jan 19, 2013 12:26, Alex Naumov <alexander_naumov@...> wrote:
>> On Sat, Jan 19, 2013 10:47, Krzysztof Żelechowski <giecrilj@...> wrote:
>>> Dnia piątek, 18 stycznia 2013 22:02:55 Alex Naumov pisze:
>>>> On Sun, Jan 13, 2013 12:40, Matwey V. Kornilov <matwey.kornilov@...> wrote:
>>>>> OBS may run %post during checks after the actual build.
>>>>
>>>> Is the way to say OBS "forget about this code and don't run it. I will
>>>> care about it" ?
>>>
>>> %if 0
>>> this code
>>> %endif
>>>
>> Thank you very much! That's exactly what I need.
>
> Oh... it was a bit premature.
> OBS did not show this echo-string (that I added to $post as example),
> but during installation it was also not there...
Well, a bit of logic says the line 'this code' will NEVER EVER be executed.

No, there should be an other way around the issue.
Perhaps an environment variable that only exits inside OBS,
and check for that in your %post script(-let)?

I'm no rpm / obs guru, but they should exist around here, ne?

  Yamaban.
Reply | Threaded
Open this post in threaded view
|

Re: OBS runs %post during the build process (?)

Marcus Meissner
In reply to this post by Alex Naumov
On Sun, Jan 13, 2013 at 12:18:30AM +0100, Alex Naumov wrote:
> Hi,
>
> can somebody remind me how to add some piece of code to spec that will
> *NOT* run during the build process (I need it at installation only).
> As I remember, it was %post... but OBS run %post during the build.

For USB devices probably check /dev/bus/usb presence before doing stuff.

That said, its the wrong way round as other people have said, it should
not be done by the package but by udev rules or similar.

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: OBS runs %post during the build process (?)

Marcus Meissner
In reply to this post by Alex Naumov
On Fri, Jan 18, 2013 at 10:02:55PM +0100, Alex Naumov wrote:

> On Sun, Jan 13, 2013 at 12:40 PM, Matwey V.  Kornilov
> <[hidden email]> wrote:
> >
> > OBS may run %post during checks after the actual build.
> >
> Is the way to say OBS "forget about this code and don't run it. I will
> care about it" ?
>
> >
> > Please, show us your logs.
> >
>
> This project located on my own OBS, but I can reproduce it at some test package:
>
> OBS Log:
> https://build.opensuse.org/package/live_build_log?arch=i586&package=fpns&project=home%3AAlexander_Naumov&repository=openSUSE_12.2
>
> Spec:
> https://build.opensuse.org/package/view_file?expand=1&file=funnyPNS.spec&package=fpns&project=home%3AAlexander_Naumov

Please be aware that you cannot comment out RPM macros using leading "#",
they will still get executed, including %if etc.

Also "%ifarch = x86_64" ... is bad syntax, = is wrong there, %ifarch takes a list.

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: Re: Re: OBS runs %post during the build process (?)

Křištof Želechovski-3
In reply to this post by Yamaban
Dnia sobota, 19 stycznia 2013 16:36:12 Yamaban pisze:
> On Sat, 19 Jan 2013 16:08, Alex Naumov <alexander_naumov@...> wrote:
> > On Sat, Jan 19, 2013 12:26, Alex Naumov <alexander_naumov@...> wrote:
> >> On Sat, Jan 19, 2013 10:47, Krzysztof Żelechowski <giecrilj@...> wrote:
> >>> Dnia piątek, 18 stycznia 2013 22:02:55 Alex Naumov pisze:
> >>>> On Sun, Jan 13, 2013 12:40, Matwey V. Kornilov <matwey.kornilov@...>
wrote:

> >>>>> OBS may run %post during checks after the actual build.
> >>>>
> >>>> Is the way to say OBS "forget about this code and don't run it. I will
> >>>> care about it" ?
> >>>
> >>> %if 0
> >>> this code
> >>> %endif
> >>
> >> Thank you very much! That's exactly what I need.
> >
> > Oh... it was a bit premature.
> > OBS did not show this echo-string (that I added to $post as example),
> > but during installation it was also not there...
>
> Well, a bit of logic says the line 'this code' will NEVER EVER be executed.
>
> No, there should be an other way around the issue.
> Perhaps an environment variable that only exits inside OBS,
> and check for that in your %post script(-let)?
>
> I'm no rpm / obs guru, but they should exist around here, ne?

Ne.  OBS needs to make sure the package is installed correctly on the
customer’s machine, that means it must install the package exactly the same
way; otherwise its evaluation would be meaningless.

IMHO,
Chris
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OBS runs %post during the build process (?)

Křištof Želechovski-3
In reply to this post by Alex Naumov
Dnia sobota, 19 stycznia 2013 14:55:17 Alex Naumov pisze:

> On Sat, Jan 19, 2013 at 12:38 PM, Dimstar / Dominique Leuenberger
>
> <[hidden email]> wrote:
> > On Sat, 2013-01-19 at 12:26 +0100, Alex Naumov wrote:
> >> >> The problem is that I need to run curl and check configuration of some
> >> >> components in the system.
> >> >> I want to automate the configuration process: package will configure
> >> >> itself after installation.
> >> >> I know how to do this, but OBS should ignore (don't run) this piece of
> >> >> code.>> >
> >> > Why?
> >>
> >> For example, I want to configure USB printer via CUPS.
> >> In this case device should be there in this time. If not, build
> >> process will be just froze.
> >
> > And if the package is being installed while the printer is not there on
> > the end machine, the install process will just freeze?
> >
> > Sounds like a very bad usecase and not resilient enough to go into any
> > prod environment... That script likely should be 'smarter'.
> >
> > Dominique
>
> Yes, but it should work exactly like this.
>
> Imagine such situation: you have 100 (or more) machines and they have
> the same printers. You just install this package and it configure the
> system (via CUPS) to use these printers. Yes, for "home-desktop-users"
> it will be redundant (they can configure it manually), but for
> industrial use that's exactly what we need.

RPM is for installing software packages, not for (remotely) configuring
workstations in an enterprise environment.  I suppose Novell has a product
that better suits your needs in their enterprise portfolio.

Chris
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OBS runs %post during the build process (?)

Andreas Schwab-2
In reply to this post by Alex Naumov
Alex Naumov <[hidden email]> writes:

> Printers are there. If printers are not connected that's not a my problem.

But freezing installations are your problem.

> I understand what you mean, but such situations will never happen :)

Everything can happen.

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: OBS runs %post during the build process (?)

Adam Spiers
Andreas Schwab ([hidden email]) wrote:
> Alex Naumov <[hidden email]> writes:
>
> > Printers are there. If printers are not connected that's not a my problem.
>
> But freezing installations are your problem.
>
> > I understand what you mean, but such situations will never happen :)
>
> Everything can happen.

I agree with Andreas.  That sounds like a really bad design.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]