[Solved]RE: IO.popen puts




Hi,

-----Original Message-----
From: Jan Svitok [mailto:jan.svitok@xxxxxxxxx]
Sent: Monday, March 05, 2007 12:48 PM
To: ruby-talk ML
Subject: Re: IO.popen puts

On 3/5/07, Rebhan, Gilbert <Gilbert.Rebhan@xxxxxxxxxxxxx> wrote:

Hi,

i want to do a cvs login for a list of cvsrepositories
with IO.popen

the normal login via Windows shell looks like =

Y:\>cvs -d :pserver:username@cvshost:d:/cvsrepos/test login
Logging in to :pserver:username@cvshost:2401:d:/cvsrepos/test
CVS password: ********


i tried with =

cvsrepos=%w[test,test1,test2]
cvsrepos.each {|x|
IO.popen("#{CVSEXE} -d #{CVSROOT}/#{x} login", 'r+') do |pipe|
pipe << "password"
pipe.close_write
puts pipe.read
end
}

but the script hangs with the output
CVS password:

What went wrong ?

/*
just a guess:
1. try adding newline
2. try redirecting stdin on the command line without ruby (maybe cvs
reads the keyboard directly)
*/


Found a working solution that is much simpler =

cvsrepos=%w[...]
cvspass=gets.chomp

cvsrepos.each {|x|
puts "Login CVS Repository >> #{x} ..."
IO.popen("#{CVSEXE} -d
:pserver:#{ENV["USERNAME"]}:#{cvspass}@cvshost:d:/cvsrepos/#{x} login")
}


the CVSROOT string takes a password too


Regards, Gilbert


.



Relevant Pages

  • [SLE] CVS connection refused
    ... Below is the configuration of my CVS ... port 2401 ... - try with cvs login enter the password ... CVS password: ...
    (SuSE)
  • Re: Question on CVS Branches
    ... However the cvs login requires a password to ... Is there any way to automate this? ... Is it possible to specify the password on the command line with cvs login (it ... How exactly do i set up password-less authentication over SSH? ...
    (freebsd-questions)
  • RE: FC4 cvs pserver login issue
    ... The following is the audit result when I tried execute "cvs login" ... On Tue, 20 Sep 2005, Chan, Eddie wrote: ... FC4 cvs pserver login issue ... > However when I try to run the cvs login, ...
    (Fedora)
  • Re: [SLE] OK, I got past Gzip - now ?
    ... I usually check out firebird from CVS and then compile it myself. ... cvs login ... More instructions could be found on mozilla web site. ... For additional commands send e-mail to suse-linux-e-help@suse.com ...
    (SuSE)
  • cant connect to sourceforge anon. cvs.
    ... I'm trying to connect to the sourceforge CVS server to get the ... cvs login: CVSROOT may only specify a positive, non-zero, integer port (not ... html mail or attachments will go in the spam ...
    (comp.os.linux.development.apps)