autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't exec "autopoint": No such file or directory


From: Ralf Wildenhues
Subject: Re: Can't exec "autopoint": No such file or directory
Date: Sun, 16 Mar 2008 13:26:24 +0100
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

Hi Bruce,

* Bruce Korb wrote on Tue, Mar 04, 2008 at 12:09:06AM CET:
> On Mon, Mar 3, 2008 at 2:48 PM, Ralf Wildenhues <address@hidden> wrote:
> >  * Bruce Korb wrote on Fri, Oct 26, 2007 at 02:45:17AM CEST:
> >  >
> >  > I don't necessarily know that it is a "gettext" program.
> >  > I certainly don't want to have to know.  Can this please
> >  > trigger a message that says, "your distro packager left
> >  > out the "gettext" stuff, so you are hosed."  It's easier
> >  > to cope with messages like that.  Thank you.
> >
> >  > P.S. it is the result of running "autoreconf".
> >
> >  Thanks for the report, and sorry for the long delay.  Here's a cheap
> >  patch.  Would this be sufficient?  It requires you to use -v aka.
> >  --verbose in order to see the message.
[...]
> Anyway, the short answer:  No.  I'd still be getting some sort of
> "command 'autopoint' not found" message without any clue about
> what issue might be triggering it.  Unless I knew a priori to autoreconf
> with the --verbose option.  I think the messages should lead me to the
> answer without having to request verbose output.

You're fully right in expecting better.  What about this?  OK to apply?

Cheers, and sorry for the delay, hope you haven't lost context again ;-)
Ralf

2008-03-16  Ralf Wildenhues  <address@hidden>

        * lib/Autom4te/FileUtils.pm (handle_exec_errors): New argument
        $hint, show if the executing program does not exist.
        (xsystem_hint): New function, like xsystem but allows to pass
        a hint.
        * bin/autoreconf.in: Use xsystem_hint for spawning autopoint and
        libtoolize.
        Report by Bruce Korb.

diff --git a/bin/autoreconf.in b/bin/autoreconf.in
index 66da78e..65ef014 100644
--- a/bin/autoreconf.in
+++ b/bin/autoreconf.in
@@ -364,7 +364,7 @@ sub autoreconf_current_directory ()
     }
   else
     {
-      xsystem "$autopoint";
+      xsystem_hint ("autopoint is needed because this package uses Gettext", 
"$autopoint");
     }
 
 
@@ -528,7 +528,7 @@ sub autoreconf_current_directory ()
        {
          $libtoolize .= " --ltdl";
        }
-      xsystem ($libtoolize);
+      xsystem ("libtoolize is needed because this package uses Libtool", 
$libtoolize);
       $rerun_aclocal = 1;
     }
   else
diff --git a/lib/Autom4te/FileUtils.pm b/lib/Autom4te/FileUtils.pm
index 819a7c3..e236820 100644
--- a/lib/Autom4te/FileUtils.pm
+++ b/lib/Autom4te/FileUtils.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2003, 2004, 2005, 2006, 2007  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, 
Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -47,7 +47,7 @@ use vars qw (@ISA @EXPORT);
 @EXPORT = qw (&open_quote &contents
              &find_file &mtime
              &update_file &up_to_date_p
-             &xsystem &xqx &dir_has_case_matching_file &reset_dir_cache);
+             &xsystem &xsystem_hint &xqx &dir_has_case_matching_file 
&reset_dir_cache);
 
 
 =item C<open_quote ($file_name)>
@@ -231,23 +231,32 @@ sub up_to_date_p ($@)
 }
 
 
-=item C<handle_exec_errors ($command, [$expected_exit_code = 0])>
+=item C<handle_exec_errors ($command, [$expected_exit_code = 0], [$hint])>
 
 Display an error message for C<$command>, based on the content of
 C<$?> and C<$!>.  Be quiet if the command exited normally
-with C<$expected_exit_code>.
+with C<$expected_exit_code>.  If C<$hint> is given, display that as well,
+if the command failed to run at all.
 
 =cut
 
-sub handle_exec_errors ($;$)
+sub handle_exec_errors ($;$$)
 {
-  my ($command, $expected) = @_;
+  my ($command, $expected, $hint) = @_;
   $expected = 0 unless defined $expected;
+  if (defined $hint)
+    {
+      $hint = "\n" . $hint;
+    }
+  else
+    {
+      $hint = '';
+    }
 
   $command = (split (' ', $command))[0];
   if ($!)
     {
-      fatal "failed to run $command: $!";
+      fatal "failed to run $command: $!" . $hint;
     }
   else
     {
@@ -316,6 +325,25 @@ sub xsystem (@)
 }
 
 
+=item C<xsystem_hint ($msg, @argv)>
+
+Same as C<system>, but fails on errors, and reports the C<@argv>
+in verbose mode.
+
+=cut
+
+sub xsystem_hint (@)
+{
+  my ($hint, @command) = @_;
+
+  verb "running: @command";
+
+  $! = 0;
+  handle_exec_errors "@command", 0, $hint
+    if system @command;
+}
+
+
 =item C<contents ($file_name)>
 
 Return the contents of C<$file_name>.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]