Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   RPM Package Manager (http://www.linux-archive.org/rpm-package-manager/)
-   -   rpm user input (http://www.linux-archive.org/rpm-package-manager/67818-rpm-user-input.html)

Toralf Lund 04-10-2008 09:09 PM

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

"Brian J. Murrell" 04-10-2008 09:13 PM

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

Jos Vos 04-10-2008 09:20 PM

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

seth vidal 04-10-2008 11:16 PM

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

"nived g" 04-11-2008 05:34 AM

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

Toralf Lund 04-11-2008 06:43 AM

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

Toralf Lund 04-11-2008 07:40 AM

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


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

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.