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 > Gentoo > Gentoo Portage Developer

 
 
LinkBack Thread Tools
 
Old 01-29-2009, 07:10 AM
Amit Dor-Shifer
 
Default use of sftp/scp transfer protocol in ebuilds.

Hi.

I'm trying to make a package that downloads the distfile using a secured
transfer protocol and ssh's pubkey authentication.


I've modified /etc/make.conf:

amit0 myapp # grep SFTP /etc/make.conf
FETCHCOMMAND_SFTP="/usr/bin/sftp ${URI} ${DISTDIR}"

When I'm setting SRC_URI like this:

amit0 myapp # grep SRC_UR myapp-1.0.ebuild
SRC_URI="sftp://my.server.com:/home/public/mydistfile.tar.gz"

seems like the URL is passed as-is to the sftp-client, which can't
handle the "sftp://" prefix:


amit0 myapp # ebuild --debug myapp-1.0.ebuild digest
<SNIP>
>>> Downloading 'sftp://my.server.com:/home/public/mydistfile.tar.gz'
Connecting to sftp...
ssh: sftp: Name or service not known
Couldn't read packet: Connection reset by peer
No digest file available and download failed.

!!! Couldn't download 'mydistfile.tar.gz'. Aborting.
!!! File mydistfile.tar.gz doesn't exist, can't update Manifest
<SNIP>

Seems then to me I'm not on the right track. Should I be using a
different method? Or is this method supposed to work? If not, would
rsync be my favored approach? How is rsync transfer configured?


Thanks,
Amit
 
Old 01-29-2009, 07:29 AM
Zac Medico
 
Default use of sftp/scp transfer protocol in ebuilds.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Amit Dor-Shifer wrote:
> seems like the URL is passed as-is to the sftp-client, which can't
> handle the "sftp://" prefix:

Then you should use a shell script for FETCHCOMMAND and make the
shell script strip the protocol. Something like this should work:

FETCHCOMMAND="/usr/local/bin/sftp-fetchcommand
"${DISTDIR}/${FILE}" "${URI}""

#!/bin/bash

filename=$1
uri=$2
exec sftp-client "${uri#sftp://}" "$filename"

- --
Thanks,
Zac
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAkmBaPAACgkQ/ejvha5XGaMsgACdEq8F5sM37KQCXz64Mr8acLH9
n34AnjFO8Zp3/0u1rZ/uHvR2OcB0Ffm2
=VbmC
-----END PGP SIGNATURE-----
 

Thread Tools




All times are GMT. The time now is 07:15 PM.

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