Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-31 Thread Nikolay Molchanov
> It is hackery because you are placing special behaviour into how input > is read from stdin for the sole purpose of supporting a deficiency in > the design of the program. What is the deficiency in the design of the "pkgrm" program? I don't suggest to change its interface, because I don't see h

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-31 Thread James Carlson
Nikolay Molchanov writes: > I'm not suggesting to change stdio, I'm suggesting to change pkgrm code to > use > "read(0, buf, 1);" Don't forget that pkgadd and pkgrm exec many other programs (as part of the scripting interfaces, among other reasons), none of which will have your special changes.

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-31 Thread Shawn Walker
On 31/10/2007, Nikolay Molchanov <[EMAIL PROTECTED]> wrote: > > Shawn Walker wrote: > On 31/10/2007, Nikolay Molchanov <[EMAIL PROTECTED]> wrote: > > > I'm not suggesting to change stdio, I'm suggesting to change pkgrm code to > use > "read(0, buf, 1);" > in loop to read 1 byte from standard inp

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-31 Thread Nikolay Molchanov
Shawn Walker wrote: On 31/10/2007, Nikolay Molchanov <[EMAIL PROTECTED]> wrote: I'm not suggesting to change stdio, I'm suggesting to change pkgrm code to use "read(0, buf, 1);" in loop to read 1 byte from standard input until the end of line or EOF happens. Basically it is the same loop as i

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-31 Thread Frank . Hofmann
On Wed, 31 Oct 2007, Shawn Walker wrote: > On 31/10/2007, Nikolay Molchanov <[EMAIL PROTECTED]> wrote: >> I'm not suggesting to change stdio, I'm suggesting to change pkgrm code to >> use >> "read(0, buf, 1);" >> in loop to read 1 byte from standard input until the end of line or EOF >> happens.

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-31 Thread Jennifer Pioch
On 10/31/07, Nikolay Molchanov <[EMAIL PROTECTED]> wrote: > I'm not suggesting to change stdio, I'm suggesting to change pkgrm code to use > "read(0, buf, 1);" > in loop to read 1 byte from standard input until the end of line or EOF > happens. > Basically it is the same loop as it uses to write i

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-31 Thread Shawn Walker
On 31/10/2007, Nikolay Molchanov <[EMAIL PROTECTED]> wrote: > I'm not suggesting to change stdio, I'm suggesting to change pkgrm code to use > "read(0, buf, 1);" > in loop to read 1 byte from standard input until the end of line or EOF > happens. > Basically it is the same loop as it uses to write

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-31 Thread Nikolay Molchanov
I'm not suggesting to change stdio, I'm suggesting to change pkgrm code to use "read(0, buf, 1);" in loop to read 1 byte from standard input until the end of line or EOF happens. Basically it is the same loop as it uses to write its questions: 12580:write(2, " D", 1)= 1 1258

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-31 Thread Nikolay Molchanov
Jennifer Pioch wrote: On 10/31/07, Nikolay Molchanov <[EMAIL PROTECTED]> wrote: Thank you very much, guys, for giving this example: % yes | pkgrm ... It really works! But it is absolutely not understandable why a standard Unix solution does not work: % echo "y" | echo "y" | pkgrm ...

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-31 Thread Jennifer Pioch
On 10/31/07, Nikolay Molchanov <[EMAIL PROTECTED]> wrote: > Thank you very much, guys, for giving this example: > > % yes | pkgrm ... > > It really works! But it is absolutely not understandable why a standard Unix > solution > does not work: > > % echo "y" | echo "y" | pkgrm ... The pipe is wron

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-31 Thread James Carlson
Nikolay Molchanov writes: > 12580:read(0, " y\n y\n", 4096) = 4 [...] > 12585:read(0, 0x080FC1E4, 4096) = 0 > > Obviously at this moment there is no way to get "y" from the input file. > A suggested fix is to read only one line in /usr/sb

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-31 Thread Casper . Dik
>Quoting Nikolay Molchanov <[EMAIL PROTECTED]>: > >> I tried another way to pass 2 "y" replies: >> >> rm -f /tmp/yes.txt >> touch /tmp/yes.txt >> echo "y" >> /tmp/yes.txt >> echo "y" >> /tmp/yes.txt >> cat /tmp/yes.txt | pkgrm SPROprfnx > >Also you can try - > printf "y\ny\n" | pkgrm SPROprfnx

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-30 Thread Nikolay Molchanov
Good idea! Unfortunately it also does not work, and I suspect the root of the problem is a bug in /usr/sbin/pkgrm command. Here is the output: # printf "y\ny\n" y y # printf "y\ny\n" | pkgrm SPROprfnx The following package is currently installed: SPROprfnx Sun Studio 12 Non-ship 64-bit com

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-30 Thread dougs
Quoting Nikolay Molchanov <[EMAIL PROTECTED]>: > I tried another way to pass 2 "y" replies: > > rm -f /tmp/yes.txt > touch /tmp/yes.txt > echo "y" >> /tmp/yes.txt > echo "y" >> /tmp/yes.txt > cat /tmp/yes.txt | pkgrm SPROprfnx Also you can try - printf "y\ny\n" | pkgrm SPROprfnx Doug _

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-30 Thread Nikolay Molchanov
I tried another way to pass 2 "y" replies: rm -f /tmp/yes.txt touch /tmp/yes.txt echo "y" >> /tmp/yes.txt echo "y" >> /tmp/yes.txt cat /tmp/yes.txt | pkgrm SPROprfnx And it also does not work. It reads fisrt "y", but ignores the second "y". At the same time /usr/sbin/pkgadd works just fine. It al

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-30 Thread Ignacio Marambio Catán
On 10/30/07, Nikolay Molchanov <[EMAIL PROTECTED]> wrote: > Thank you very much, guys, for giving this example: > > % yes | pkgrm ... > > It really works! But it is absolutely not understandable why a standard Unix > solution > does not work: > > % echo "y" | echo "y" | pkgrm ... > > What is inter

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-30 Thread John Brewer
Using the admin script is great for pkgadd / pkgrm for jumpstart & kickstart and automated updates via scripts, A lot of venders have not kept up with this , here is man entry note form zoneadm: "The act of installing a new non-global zone is a fresh ins- tallation of the Solaris op

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-30 Thread Nikolay Molchanov
Thank you very much, guys, for giving this example: % yes | pkgrm ... It really works! But it is absolutely not understandable why a standard Unix solution does not work: % echo "y" | echo "y" | pkgrm ... What is interesting, the first "y" works, but the second "y" does not. Why? Is it a bug?

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-15 Thread UNIX admin
> However, I am just fortunate that all the answers to > the pkgadd/pkgrm prompts are yes, apparently, a > better way is to use [b]pkgask[/b] to prepare all the > yes/no answers in a file for package installation and > removal. > > I successfully created one, [b]install_rsp100.[/b] For what it's

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-15 Thread UNIX admin
> Using an admin file works! Here is my admin file > which is in the same directory as package file: Yes, but not always. There are certain scenarios where pkg* tools will either exit, or still want to interact even if the admin file instructs not to do so. The best way is to combine the admin f

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-12 Thread Oleksandr Karpenko
This type of questions are controlled by admin file. Just create one and try pkgadd -a your_admin_file -r install_rsp100 -d qla_D100.i386 QLA This message posted from opensolaris.org ___ opensolaris-discuss mailing list opensolaris-discuss@opensolari

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-11 Thread Tom Chen
Using an admin file works! Here is my admin file which is in the same directory as package file: #cat admin mail= instance=unique partial=nocheck runlevel=nocheck idepend=nocheck rdepend=nocheck space=nocheck conflict=nocheck setuid=nocheck action=nocheck basedir=default To add package: pkgadd -

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-11 Thread Tom Chen
Thanks everybody for helping me! The easiest solution is : yes | pkgadd -d qla_D100.i386 QLA yes | pkgrm QLA (where qla_D100.i386 is the package file name and QLA is the package instance name) However, I am just fortunate that all the answers to the pkgadd/pkgrm prompts are yes, apparently,

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-10 Thread Wilson Kwok
You can use pkgask Tom Chen wrote: > Hello, > > The default pkgadd/pkgrm work in interactive mode and there are multiple > prompts to answer. How do I write a shell script to answer all these prompts > automatically? > > I googled and tried the following, > pkgrm -n mypkg and > pkgrm mypkg < y

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-10 Thread Anoop Rajendra
# yes | pkgrm -a On 10/10/07, Tom Chen <[EMAIL PROTECTED]> wrote: > sorry, the second method is > [b]echo y | echo y | pfexec pkgrm mypkg[/b] , assuming that [b]pkgrm[/b] > requires two prompts and the answer is [b]y[/b] for both. However, it looks > like only one y is accepted . > > > This me

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-10 Thread Jan Spitalnik
Hello Tom, -n will stop if interaction is needed. Instead of echoing y's into pkgrm use admin file. pkgrm: http://docs.sun.com/app/docs/doc/816-5166/pkgrm-1m?l=en&a=view admin file: http://docs.sun.com/app/docs/doc/816-5174/6mbb98uc9?l=en&a=view Cheers, Jan On 11.10.2007, at 0:44, Sherry Moo

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-10 Thread Sherry Moore
Or you could just use the "-n" option. Sherry On Wed, Oct 10, 2007 at 03:35:28PM -0700, Tom Chen wrote: > Hello, > > The default pkgadd/pkgrm work in interactive mode and there are multiple > prompts to answer. How do I write a shell script to answer all these prompts > automatically? > > I

Re: [osol-discuss] package add and remove in non-interactive mode

2007-10-10 Thread Tom Chen
sorry, the second method is [b]echo y | echo y | pfexec pkgrm mypkg[/b] , assuming that [b]pkgrm[/b] requires two prompts and the answer is [b]y[/b] for both. However, it looks like only one y is accepted . This message posted from opensolaris.org

[osol-discuss] package add and remove in non-interactive mode

2007-10-10 Thread Tom Chen
Hello, The default pkgadd/pkgrm work in interactive mode and there are multiple prompts to answer. How do I write a shell script to answer all these prompts automatically? I googled and tried the following, pkgrm -n mypkg and pkgrm mypkg <