Subject: Re: bug#35639: 27.0.50; tramp fails to use ssh on LibreCMC (no base64 encoder available, and not mentioned in tramp manual)

From: Jeronimo Pellegrini <[email-masked]>
Date: Fri, 10 May 2019 06:49:31 -0300

Hello Michael,
Thank you for your comments!

On Fri, May 10, 2019 at 10:40:00AM +0200, Michael Albinus wrote:
> Jeronimo Pellegrini <[email-masked]> writes:
> > +(defconst tramp-hexdump-awk-coding-test
> > +  "test -c /dev/zero && \
> > +busybox hexdump -v -e '16/1 \" %02x\" \"\\n\"' < /dev/null && \
> 
> This must be "hexdump", not "busybox hexdump".

The original tramp-awk-encode uses "busybux awk". Is there a particular 
reason for that, or could it also be changed to "awk"?

As far as I can remember, devices with busybox installed will usually
have symlinks for the usual binary names, like

  awk -> busybox,

and so on, so if busybox is called and argv[0] is "awk" it knows
the user's intention. So, using "busybox awk" and "busybox hexdump" 
would guarantee that this encoding scheme works on devices where the 
symlinks are not available (I've never seen one actually); on the other 
hand, it would break the encoding method for computers which do have 
awk and hexdump, but no busybox... What do we do? Duplicate the 
functions again?

tramp-busybox-od-awk-encode
tramp-busybox-hexdump-awk-encode
tramp-busybox-awk-decode

tramp-od-awk-encode
tramp-hexdump-awk-encode
tramp-awk-decode

I feel like that would be a too large amount of duplicated code...
Or is that ok?

Thank you for your patience!
J.