You are not logged in.

#1 2008-10-07 16:01:45

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

how to use ssh in cvs PKGBUILD

dear guys,

In my claws-mail PKGBUILD I have lines:

_cvsroot=":pserver:cvs@sunsite.dk:/pack/anoncvs"
_cvsmod="claws"

build() {
  cd $startdir/src
  export CVS_RSH=ssh
  
  if [ -d $_cvsmod/CVS ]; then
    msg "updating local sources..."
    cd $_cvsmod
    cvs -z3 update -dPR > /dev/null 2>&1 
  else 
      msg "creating local sources..."
    cd $startdir/src
      cvs -z3 -d:ext:cvs@scm.dotsrc.org:/srv/cvs/claws-mail co -r gtk2 claws > /dev/null 2>&1 
  fi
  cd $startdir/src/$_cvsmod

the problem is: when I run: makepkg as user it always says:

==> updating local sources...
The authenticity of host 'scm.dotsrc.org (130.225.254.114)' can't be established.
RSA key fingerprint is d7:2c:58:a7:a8:96:5b:fc:fa:24:bc:52:c4:39:c6:3b.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/root/.ssh/known_hosts).
You are connected to `ran.dotsrc.org'.
All access is logged.

which means quite obvious for me: user cannot add this hosts to root's known_hosts
so how to avoid this "yes" world to put manualy always ?
of course when I run: "makepkg --asroot" it is ok, but that should not be build as root - right ?
why makepkg connects as root to server - or better: why does it want to change /root/.ssh/known_hosts instead of ~/.ssh/known_hosts

I believe there is simple answer for my question - just I cannot get it wink
thanks in advance


Zygfryd Homonto

Offline

#2 2008-10-07 20:37:34

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: how to use ssh in cvs PKGBUILD

Try putting

yes "yes"|

in front of the cvs lines.

Offline

#3 2008-10-07 23:46:44

Garns
Member
Registered: 2008-05-28
Posts: 239

Re: how to use ssh in cvs PKGBUILD

Not sure if that works. If it does you would still get the error message tongue .

I thinkmakepkg tries to connect as root, because it enters fakeroot just before it enters the build function.

If Stefans proposal doesn't work, you could use -o "StrictHostKeyChecking no" to avoid the question. There is only one problem, CVS_RSH doesn't accept arguments...

There is one UGLY workaround I can think of:

You put this at the beginning of the build function

tmp=$(mktemp)
cat <<EOF > $tmp
#! /bin/sh
exec ssh -q -o "StrictHostKeyChecking no "  ${1+"$@"}
EOF
chmod +x $tmp

then you replace CVS_RSH=ssh with CVS_RSH="$tmp" and it should work. It might not, because this is totally untested tongue. and it might be easier to type yes tongue.

Offline

#4 2008-10-08 03:55:36

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

Re: how to use ssh in cvs PKGBUILD

thanks guys, will try and let you know
btw I tried yes "yes"| before this post but nada ;-(
so will try with script then


Zygfryd Homonto

Offline

Board footer

Powered by FluxBB