unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Using guile-ssh
@ 2014-08-15 16:44 R Sidhu
  2014-08-16 12:12 ` Taylan Ulrich Bayirli/Kammer
  0 siblings, 1 reply; 4+ messages in thread
From: R Sidhu @ 2014-08-15 16:44 UTC (permalink / raw)
  To: guile-user

[-- Attachment #1: Type: text/plain, Size: 916 bytes --]

I am interested in using guile-ssh for file transfer. Ran into the
following issues:

1. 'git clone
https://github.com/artyom-poptsov/guile-ssh/releases/tag/v0.6.0' fails with:
fatal:
https://github.com/artyom-poptsov/guile-ssh/releases/tag/v0.6.0/info/refs
not valid: is this a git repository?

2. INSTALL file suggests './configure' but its missing

3. Installation instructions in doc/ directory (texinfo files) suggest
'autoreconf -if' which fails with:
configure.ac:55: error: possibly undefined macro: AC_DEFINE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

4. While initial steps seem clear (establishing session, authenticating and
creating channel), not clear how to perform file transfer.

Appreciate work done on guile-ssh so far. Look forward to help re above.

Regards
sidhu1f

[-- Attachment #2: Type: text/html, Size: 1320 bytes --]

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

* Re: Using guile-ssh
  2014-08-15 16:44 Using guile-ssh R Sidhu
@ 2014-08-16 12:12 ` Taylan Ulrich Bayirli/Kammer
  2014-08-17 10:49   ` R Sidhu
  0 siblings, 1 reply; 4+ messages in thread
From: Taylan Ulrich Bayirli/Kammer @ 2014-08-16 12:12 UTC (permalink / raw)
  To: R Sidhu; +Cc: guile-user

R Sidhu <sidhu1f@gmail.com> writes:

> I am interested in using guile-ssh for file transfer. Ran into the
> following issues:
>
> 1. 'git clone
> https://github.com/artyom-poptsov/guile-ssh/releases/tag/v0.6.0' fails
> with:
> fatal:
> https://github.com/artyom-poptsov/guile-ssh/releases/tag/v0.6.0/info/refs
> not valid: is this a git repository?

Tags on GitHub can be downloaded as a .tar.gz or ZIP, but not cloned if
I'm not mistaken.

> 2. INSTALL file suggests './configure' but its missing

Short story: you need to run either ./autogen.sh, or if that doesn't
exist, run "autoreconf -fi" in the source directory.

Long story:

The ./configure script of a software package is what needs to be run on
the install-site to configure the package for the machine on which it
will be compiled and installed, but this ./configure script is rarely
written by hand, because it must be in the Bourne shell language to be
highly portable across Unix machines, which is a horrible language.
Most commonly, there is a configure.ac file which is written in the more
special-purpose and high-level autoconf language, and the software's
author runs the autoconf command to turn this into a ./configure script
before packaging and shipping the software.  Therefore, when you fetch
the bare source code of a project, you usually have a configure.ac file
but not the ./configure script which it would generate.  Often for
convenience there is a tiny ./autogen.sh script which runs autoconf and
maybe some other things for you (specifically automake), but nowadays
usually running "autoreconf -fi" is the only thing that needs to be
done.

> 3. Installation instructions in doc/ directory (texinfo files) suggest
> 'autoreconf -if' which fails with:
> configure.ac:55: error: possibly undefined macro: AC_DEFINE
> If this token and others are legitimate, please use m4_pattern_allow.
> See the Autoconf documentation.
> autoreconf: /usr/bin/autoconf failed with exit status: 1

I had this problem more than once already but keep forgetting what the
solution was.

Do you have pkg-config installed?  Do you have pkg-config files in
non-standard places, like $HOME/usr/lib/pkgconfig, or
$HOME/.guix-profile/lib/pkgconfig?  If so you'll need to set
PKG_CONFIG_PATH to a colon-separated list of such directories.  (Best to
'export' that in ~/.profile or ~/.bash_login or so.)

Do you have a recent version of GNU m4 installed?

> 4. While initial steps seem clear (establishing session,
> authenticating and creating channel), not clear how to perform file
> transfer.

I've never used guile-ssh so this is a shot in the dark: maybe a simple
read-char / write-char loop to read and write the bytes in a file one by
one?

> Appreciate work done on guile-ssh so far. Look forward to help re
> above.
>
> Regards
> sidhu1f

Hope someone can clear questions 3 and 4.

Taylan



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

* Re: Using guile-ssh
  2014-08-16 12:12 ` Taylan Ulrich Bayirli/Kammer
@ 2014-08-17 10:49   ` R Sidhu
  0 siblings, 0 replies; 4+ messages in thread
From: R Sidhu @ 2014-08-17 10:49 UTC (permalink / raw)
  To: guile-user

[-- Attachment #1: Type: text/plain, Size: 3257 bytes --]

Thanks Taylan, managed to get guile-ssh 0.6 installed.

Re file transfer, I could cook up something of my own, unless someone
already has working code?

Regards
sidhu1f


On Sat, Aug 16, 2014 at 5:42 PM, Taylan Ulrich Bayirli/Kammer <
taylanbayirli@gmail.com> wrote:

> R Sidhu <sidhu1f@gmail.com> writes:
>
> > I am interested in using guile-ssh for file transfer. Ran into the
> > following issues:
> >
> > 1. 'git clone
> > https://github.com/artyom-poptsov/guile-ssh/releases/tag/v0.6.0' fails
> > with:
> > fatal:
> >
> https://github.com/artyom-poptsov/guile-ssh/releases/tag/v0.6.0/info/refs
> > not valid: is this a git repository?
>
> Tags on GitHub can be downloaded as a .tar.gz or ZIP, but not cloned if
> I'm not mistaken.
>
> > 2. INSTALL file suggests './configure' but its missing
>
> Short story: you need to run either ./autogen.sh, or if that doesn't
> exist, run "autoreconf -fi" in the source directory.
>
> Long story:
>
> The ./configure script of a software package is what needs to be run on
> the install-site to configure the package for the machine on which it
> will be compiled and installed, but this ./configure script is rarely
> written by hand, because it must be in the Bourne shell language to be
> highly portable across Unix machines, which is a horrible language.
> Most commonly, there is a configure.ac file which is written in the more
> special-purpose and high-level autoconf language, and the software's
> author runs the autoconf command to turn this into a ./configure script
> before packaging and shipping the software.  Therefore, when you fetch
> the bare source code of a project, you usually have a configure.ac file
> but not the ./configure script which it would generate.  Often for
> convenience there is a tiny ./autogen.sh script which runs autoconf and
> maybe some other things for you (specifically automake), but nowadays
> usually running "autoreconf -fi" is the only thing that needs to be
> done.
>
> > 3. Installation instructions in doc/ directory (texinfo files) suggest
> > 'autoreconf -if' which fails with:
> > configure.ac:55: error: possibly undefined macro: AC_DEFINE
> > If this token and others are legitimate, please use m4_pattern_allow.
> > See the Autoconf documentation.
> > autoreconf: /usr/bin/autoconf failed with exit status: 1
>
> I had this problem more than once already but keep forgetting what the
> solution was.
>
> Do you have pkg-config installed?  Do you have pkg-config files in
> non-standard places, like $HOME/usr/lib/pkgconfig, or
> $HOME/.guix-profile/lib/pkgconfig?  If so you'll need to set
> PKG_CONFIG_PATH to a colon-separated list of such directories.  (Best to
> 'export' that in ~/.profile or ~/.bash_login or so.)
>
> Do you have a recent version of GNU m4 installed?
>
> > 4. While initial steps seem clear (establishing session,
> > authenticating and creating channel), not clear how to perform file
> > transfer.
>
> I've never used guile-ssh so this is a shot in the dark: maybe a simple
> read-char / write-char loop to read and write the bytes in a file one by
> one?
>
> > Appreciate work done on guile-ssh so far. Look forward to help re
> > above.
> >
> > Regards
> > sidhu1f
>
> Hope someone can clear questions 3 and 4.
>
> Taylan
>

[-- Attachment #2: Type: text/html, Size: 4556 bytes --]

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

* Re: Using guile-ssh
       [not found] <mailman.81.1408291224.11683.guile-user@gnu.org>
@ 2014-08-17 20:25 ` Artyom Poptsov
  0 siblings, 0 replies; 4+ messages in thread
From: Artyom Poptsov @ 2014-08-17 20:25 UTC (permalink / raw)
  To: guile-user

Hi sidhu1f,

sorry, I overlooked your previous mails on Guile-SSH.  Glad to see that
Taylan helped you with some of the questions.  Thanks, Taylan.

> Re file transfer, I could cook up something of my own, unless someone
> already has working code?

Guile-SSH 0.6 represents channels as Guile ports, so you can use
standard Guile I/O procedures [1] to transfer data through channels (as
Taylan rightly pointed out).

Here is one of the possible implementations of file transferring:
  https://gist.github.com/artyom-poptsov/dfa428b1e6baa4030f00

I made it quickly and the code might be a bit ugly, but nevertheless it
should give you an idea how to use Guile-SSH channels for transferring
of data.  The example was tested with Guile-SSH 0.6 and libssh 0.5.5.
It works as follows:

  - The client sends file name to the server, then reads the given file
    line-by-line in the plain text mode and sends it to the server too.

  - The server reads file name from the channel, then reads the file
    contents and writes the received file to the same path as the
    original file.

On the server:

--8<---------------cut here---------------start------------->8---
$ ./server.scm -r ~/src/projects/guile-ssh/tests/rsakey  \
  -d ~/src/projects/guile-ssh/tests/dsakey -p 12345
--8<---------------cut here---------------end--------------->8---

Note that I used test SSH keys that come with Guile-SSH.  Your path to
these keys may differ from mine.

On the client:

--8<---------------cut here---------------start------------->8---
$ ./client.scm -i ~/src/projects/guile-ssh/tests/rsakey \
  -p 12345 127.0.0.1 /tmp/test-file
--8<---------------cut here---------------end--------------->8---

Replace 127.0.0.1 with IP address of your server.

Also take a look on the `examples' directory in the repo -- it contains
working examples of Guile-SSH usage.

Hope this helps,

- Artyom

[1] https://www.gnu.org/software/guile/manual/html_node/Input-and-Output.html#Input-and-Output

-- 
Artyom V. Poptsov <poptsov.artyom@gmail.com>
Home page: http://poptsov-artyom.narod.ru/



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

end of thread, other threads:[~2014-08-17 20:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-15 16:44 Using guile-ssh R Sidhu
2014-08-16 12:12 ` Taylan Ulrich Bayirli/Kammer
2014-08-17 10:49   ` R Sidhu
     [not found] <mailman.81.1408291224.11683.guile-user@gnu.org>
2014-08-17 20:25 ` Artyom Poptsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).