public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] use of sftp/scp transfer protocol in ebuilds.
@ 2009-01-29  8:10 Amit Dor-Shifer
  2009-01-29  8:29 ` Zac Medico
  0 siblings, 1 reply; 2+ messages in thread
From: Amit Dor-Shifer @ 2009-01-29  8:10 UTC (permalink / raw
  To: gentoo-portage-dev

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [gentoo-portage-dev] use of sftp/scp transfer protocol in ebuilds.
  2009-01-29  8:10 [gentoo-portage-dev] use of sftp/scp transfer protocol in ebuilds Amit Dor-Shifer
@ 2009-01-29  8:29 ` Zac Medico
  0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2009-01-29  8:29 UTC (permalink / raw
  To: gentoo-portage-dev

-----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-----



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-29  8:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-29  8:10 [gentoo-portage-dev] use of sftp/scp transfer protocol in ebuilds Amit Dor-Shifer
2009-01-29  8:29 ` Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox