FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > RPM Package Manager

 
 
LinkBack Thread Tools
 
Old 04-10-2008, 09:09 PM
Toralf Lund
 
Default rpm user input

nived g wrote:

Hello,

I need to build an RPM that requires the user to input some values
during install time. I've searched regarding this and came to know
that RPM doesn't support interactive installation. But I've seen
certain RPMs which, for example, requires the user to accept license
during install time. Is there any way to do this? The installation of
the software that I'm trying to package will always be manual.
You can enter any program/command in the %pre and %post sections of the
spec, including ones that ask for user input. These sections are
essentially scripts that get executed before and after the files are
installed, respectively. If the %pre script(let) exits with a "false"
(non-0) status, the rpm won't actually be installed.


- Toralf

Thanks.

Regards,
Nived

------------------------------------------------------------------------

_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list


_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 04-10-2008, 09:13 PM
"Brian J. Murrell"
 
Default rpm user input

On Thu, 2008-04-10 at 23:09 +0200, Toralf Lund wrote:
> You can enter any program/command in the %pre and %post sections of the
> spec, including ones that ask for user input. These sections are
> essentially scripts that get executed before and after the files are
> installed, respectively. If the %pre script(let) exits with a "false"
> (non-0) status, the rpm won't actually be installed.

Ehm. I thought interactivity in rpm scripts was verboten. I thought
one of the primary tenets of RPM packages is that they MUST do their
work without any interaction as interaction may not always be possible
(think batch installation).

b.

_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 04-10-2008, 09:20 PM
Jos Vos
 
Default rpm user input

On Thu, Apr 10, 2008 at 11:09:41PM +0200, Toralf Lund wrote:

> You can enter any program/command in the %pre and %post sections of the
> spec, including ones that ask for user input. These sections are
> essentially scripts that get executed before and after the files are
> installed, respectively. If the %pre script(let) exits with a "false"
> (non-0) status, the rpm won't actually be installed.

Yes, but be aware that this is "not-done" and that such an RPM will
always be considered an example of bad packaging (and the author will
be flamed forever ;-)).

--
-- Jos Vos <jos@xos.nl>
-- X/OS Experts in Open Systems BV | Phone: +31 20 6938364
-- Amsterdam, The Netherlands | Fax: +31 20 6948204

_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 04-10-2008, 11:16 PM
seth vidal
 
Default rpm user input

On Thu, 2008-04-10 at 23:20 +0200, Jos Vos wrote:
> On Thu, Apr 10, 2008 at 11:09:41PM +0200, Toralf Lund wrote:
>
> > You can enter any program/command in the %pre and %post sections of the
> > spec, including ones that ask for user input. These sections are
> > essentially scripts that get executed before and after the files are
> > installed, respectively. If the %pre script(let) exits with a "false"
> > (non-0) status, the rpm won't actually be installed.
>
> Yes, but be aware that this is "not-done" and that such an RPM will
> always be considered an example of bad packaging (and the author will
> be flamed forever ;-)).

There may also be beatings.

And Nobody expects the spanish inquisition.

-sv




_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 04-11-2008, 05:34 AM
"nived g"
 
Default rpm user input

On Fri, Apr 11, 2008 at 4:46 AM, seth vidal <skvidal@fedoraproject.org> wrote:

On Thu, 2008-04-10 at 23:20 +0200, Jos Vos wrote:

> On Thu, Apr 10, 2008 at 11:09:41PM +0200, Toralf Lund wrote:

>

> > You can enter any program/command in the %pre and %post sections of the

> > spec, including ones that ask for user input. These sections are

> > essentially scripts that get executed before and after the files are

> > installed, respectively. If the %pre script(let) exits with a "false"

> > (non-0) status, the rpm won't actually be installed.

I've tried doing that and it didn't work. I ran a script to get some input from user at %pre, but its not prompting for input during install time.


-Nived

_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 04-11-2008, 06:43 AM
Toralf Lund
 
Default rpm user input

Brian J. Murrell wrote:

On Thu, 2008-04-10 at 23:09 +0200, Toralf Lund wrote:

You can enter any program/command in the %pre and %post sections of the
spec, including ones that ask for user input. These sections are
essentially scripts that get executed before and after the files are
installed, respectively. If the %pre script(let) exits with a "false"
(non-0) status, the rpm won't actually be installed.



Ehm. I thought interactivity in rpm scripts was verboten. I thought
one of the primary tenets of RPM packages is that they MUST do their
work without any interaction as interaction may not always be possible
(think batch installation).

Depends on how you see it and what you mean. Yes, in guidelines for good
& proper packaging, interactivity is probably forbidden. Technically, in
terms of how rpm actually works, it is allowed, as far as I know. Or to
be more precise, rpm doesn't impose any extra restrictions, so
interactivity works, if and only if, it does in the environment rpm is
executed from.


Also, I didn't say *I* would do this, did I?

- Toralf


_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 04-11-2008, 07:40 AM
Toralf Lund
 
Default rpm user input

nived g wrote:
On Fri, Apr 11, 2008 at 4:46 AM, seth vidal <skvidal@fedoraproject.org
<mailto:skvidal@fedoraproject.org>> wrote:


On Thu, 2008-04-10 at 23:20 +0200, Jos Vos wrote:
> On Thu, Apr 10, 2008 at 11:09:41PM +0200, Toralf Lund wrote:
>
> > You can enter any program/command in the %pre and %post
sections of the
> > spec, including ones that ask for user input. These sections are
> > essentially scripts that get executed before and after the
files are
> > installed, respectively. If the %pre script(let) exits with a
"false"
> > (non-0) status, the rpm won't actually be installed.


I've tried doing that and it didn't work. I ran a script to get some
input from user at %pre, but its not prompting for input during
install time.
Well, even though rpm doesn't go out of the way to prevent interactive
execution, you can perhaps not expect the standard input to be connected
to your terminal like in a normal interactive shell, so you may have to
use a command that gets its input in some other way. Something like


%pre
zenity --warning --text "Do you really want to open a dialog in an rpm
scriptlet?"


should if you have and an X display (and the program...)

Also, you could try "read < /dev/tty" or similar.

- T




-Nived
------------------------------------------------------------------------

_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list


_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 

Thread Tools




All times are GMT. The time now is 01:22 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org