Re: [PATCH] mig: Drop the Perl runtime dependency

2014-07-22 Thread Thomas Schwinge
Hi!

On Fri, 18 Jul 2014 19:29:07 -0400, David Michael fedora@gmail.com wrote:
 I tried running mig on a system without Perl ealier with bad results.
 Perl seems to be used only for functionality that is also provided by
 GNU coreutils (which is already required, e.g. for dirname).  Does it
 make sense to drop the Perl command in favor of using realpath here?

 -libexecdir_rel=$(perl -MFile::Spec -e 'print 
 File::Spec-abs2rel('$libexecdir','$bindir')')
 +libexecdir_rel=$(realpath --relative-to=$bindir $libexecdir)

Thanks for the patch, and I'd be happy to apply that, however, on four
arbitrary (Debian, Ubuntu, Trisquel) systems that I just tried, I either
see: »realpath: unrecognized option '--relative-to'«, or »bash: realpath:
command not found«, whereas the Perl variant works on all of these.


Grüße,
 Thomas


pgp5ZWrZCBfNo.pgp
Description: PGP signature


Re: [PATCH] mig: Drop the Perl runtime dependency

2014-07-22 Thread David Michael
Hi,

On Tue, Jul 22, 2014 at 9:12 AM, Thomas Schwinge
tho...@codesourcery.com wrote:
 Hi!

 On Fri, 18 Jul 2014 19:29:07 -0400, David Michael fedora@gmail.com 
 wrote:
 I tried running mig on a system without Perl ealier with bad results.
 Perl seems to be used only for functionality that is also provided by
 GNU coreutils (which is already required, e.g. for dirname).  Does it
 make sense to drop the Perl command in favor of using realpath here?

 -libexecdir_rel=$(perl -MFile::Spec -e 'print 
 File::Spec-abs2rel('$libexecdir','$bindir')')
 +libexecdir_rel=$(realpath --relative-to=$bindir $libexecdir)

 Thanks for the patch, and I'd be happy to apply that, however, on four
 arbitrary (Debian, Ubuntu, Trisquel) systems that I just tried, I either
 see: »realpath: unrecognized option '--relative-to'«, or »bash: realpath:
 command not found«, whereas the Perl variant works on all of these.

Okay, I didn't realize that it had only been two or three years since
a coreutils release first included this functionality.  Sorry for the
noise.

David



Re: [PATCH] mig: Drop the Perl runtime dependency

2014-07-22 Thread Guillem Jover
Hi!

On Tue, 2014-07-22 at 15:12:55 +0200, Thomas Schwinge wrote:
 On Fri, 18 Jul 2014 19:29:07 -0400, David Michael fedora@gmail.com 
 wrote:
  I tried running mig on a system without Perl ealier with bad results.
  Perl seems to be used only for functionality that is also provided by
  GNU coreutils (which is already required, e.g. for dirname).  Does it
  make sense to drop the Perl command in favor of using realpath here?
 
  -libexecdir_rel=$(perl -MFile::Spec -e 'print 
  File::Spec-abs2rel('$libexecdir','$bindir')')
  +libexecdir_rel=$(realpath --relative-to=$bindir $libexecdir)
 
 Thanks for the patch, and I'd be happy to apply that, however, on four
 arbitrary (Debian, Ubuntu, Trisquel) systems that I just tried, I either
 see: »realpath: unrecognized option '--relative-to'«, or »bash: realpath:
 command not found«, whereas the Perl variant works on all of these.

On Debian-based systems the tool is provided in the realpath package.
There's an experimental version switching to the coreutils version to
see what breaks, but it's not clear when and iff that will be switched
over to the coreutils version in unstable.

  
http://metadata.ftp-master.debian.org/changelogs//main/r/realpath/realpath_1.19.coreutils.1_changelog

Thanks,
Guillem



Re: [PATCH] mig: Drop the Perl runtime dependency

2014-07-22 Thread Thomas Schwinge
Hi!

On Tue, 22 Jul 2014 09:58:51 -0400, David Michael fedora@gmail.com wrote:
 On Tue, Jul 22, 2014 at 9:12 AM, Thomas Schwinge
 tho...@codesourcery.com wrote:
  On Fri, 18 Jul 2014 19:29:07 -0400, David Michael fedora@gmail.com 
  wrote:
  I tried running mig on a system without Perl ealier with bad results.
  Perl seems to be used only for functionality that is also provided by
  GNU coreutils (which is already required, e.g. for dirname).  Does it
  make sense to drop the Perl command in favor of using realpath here?
 
  -libexecdir_rel=$(perl -MFile::Spec -e 'print 
  File::Spec-abs2rel('$libexecdir','$bindir')')
  +libexecdir_rel=$(realpath --relative-to=$bindir $libexecdir)
 
  Thanks for the patch, and I'd be happy to apply that, however, on four
  arbitrary (Debian, Ubuntu, Trisquel) systems that I just tried, I either
  see: »realpath: unrecognized option '--relative-to'«, or »bash: realpath:
  command not found«, whereas the Perl variant works on all of these.
 
 Okay, I didn't realize that it had only been two or three years since
 a coreutils release first included this functionality.  Sorry for the
 noise.

Not noise at all -- we always welcome such cleanup/simplification
patches, so keep these coming.  Heh, and I'll set a note in my calendar
for 2020, to revisit this.  :-) (In the Hurd project, we're never in a
hurry.)


Grüße,
 Thomas


pgpkmZJl2H4Yt.pgp
Description: PGP signature


[PATCH] mig: Drop the Perl runtime dependency

2014-07-18 Thread David Michael
* mig.in (libexecdir_rel): Compute with realpath instead of perl.
---

Hi,

I tried running mig on a system without Perl ealier with bad results.
Perl seems to be used only for functionality that is also provided by
GNU coreutils (which is already required, e.g. for dirname).  Does it
make sense to drop the Perl command in favor of using realpath here?

Thanks.

David

 mig.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mig.in b/mig.in
index 63e0269..16a9cf2 100644
--- a/mig.in
+++ b/mig.in
@@ -29,7 +29,7 @@ prefix=@prefix@
 exec_prefix=@exec_prefix@
 bindir=@bindir@
 libexecdir=@libexecdir@
-libexecdir_rel=$(perl -MFile::Spec -e 'print 
File::Spec-abs2rel('$libexecdir','$bindir')')
+libexecdir_rel=$(realpath --relative-to=$bindir $libexecdir)
 bindir_real=$(dirname $0)
 bindir_real=$(cd $bindir_real/  pwd)
 libexecdir=$bindir_real/$libexecdir_rel
-- 
1.9.3