[PATCH] gnulib-tool: Fallback to wget when rsync fails

2014-09-02 Thread Mathieu Anquetin
Current implementation only tries to rsync PO files when rsync is
installed on the host. In case of error, no files are downloaded even
if they are available. This leads to bootstrap problems for hosts
that lie behind a restrictive firewall.

This patch always tries to rsync by default, falling back to wget if
an error occurs.

Signed-off-by: Mathieu Anquetin math...@anquetin.eu
---
 gnulib-tool |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnulib-tool b/gnulib-tool
index 7353920..5031041 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -5029,10 +5029,10 @@ s,//*$,/,'
 { # Prefer rsync over wget if it is available, since it consumes
 # less network bandwidth, due to compression.
 if type rsync 2/dev/null | grep /  /dev/null; then
-  rsync -Lrtz ${TP_RSYNC_URI}gnulib/ .
-else
-  wget --no-verbose -r -l1 -nd -np -A.po ${TP_URL}gnulib/
+  rsync -Lrtz ${TP_RSYNC_URI}gnulib/ .  return
 fi
+
+wget --no-verbose -r -l1 -nd -np -A.po ${TP_URL}gnulib/
   }
   )
 else
-- 
1.7.10.4




Re: [PATCH] gnulib-tool: Fallback to wget when rsync fails

2014-09-02 Thread Ben Pfaff
On Tue, Sep 02, 2014 at 12:22:54PM +0200, Mathieu Anquetin wrote:
 Current implementation only tries to rsync PO files when rsync is
 installed on the host. In case of error, no files are downloaded even
 if they are available. This leads to bootstrap problems for hosts
 that lie behind a restrictive firewall.
 
 This patch always tries to rsync by default, falling back to wget if
 an error occurs.
 
 Signed-off-by: Mathieu Anquetin math...@anquetin.eu

Looking at wget(1), I'm a little surprised that the selected options
appear to avoid clobbering files whose names conflict.  I would have
expected that we'd want to overwrite them, to get the fresher version.
But the existing wget invocation does the same thing, so maybe it's
intentional?



Re: [PATCH] gnulib-tool: Fallback to wget when rsync fails

2014-09-02 Thread Ben Pfaff
On Tue, Sep 02, 2014 at 05:15:16PM +0200, Bernhard Voelker wrote:
 On 09/02/2014 05:06 PM, Ben Pfaff wrote:
 Looking at wget(1), I'm a little surprised that the selected options
 appear to avoid clobbering files whose names conflict.  I would have
 expected that we'd want to overwrite them, to get the fresher version.
 But the existing wget invocation does the same thing, so maybe it's
 intentional?
 
 clobbering is implicitly disabled with the -nd option:
 
   -nd
--no-directories
Do not create a hierarchy of directories when retrieving
recursively.  With this option turned on, all files will
get saved to the current directory, without clobbering (if
a name shows up more than once, the filenames will get
extensions .n).

Yes.  As I said, I'm a little surprised that the selected options appear
to avoid clobbering files whose names conflict.



Re: [PATCH] gnulib-tool: Fallback to wget when rsync fails

2014-09-02 Thread Bernhard Voelker

On 09/02/2014 05:06 PM, Ben Pfaff wrote:

Looking at wget(1), I'm a little surprised that the selected options
appear to avoid clobbering files whose names conflict.  I would have
expected that we'd want to overwrite them, to get the fresher version.
But the existing wget invocation does the same thing, so maybe it's
intentional?


clobbering is implicitly disabled with the -nd option:

  -nd
   --no-directories
   Do not create a hierarchy of directories when retrieving
   recursively.  With this option turned on, all files will
   get saved to the current directory, without clobbering (if
   a name shows up more than once, the filenames will get
   extensions .n).

Have a nice day,
Berny




Re: [PATCH] gnulib-tool: Fallback to wget when rsync fails

2014-09-02 Thread Bernhard Voelker

On 09/02/2014 05:17 PM, Ben Pfaff wrote:

On Tue, Sep 02, 2014 at 05:15:16PM +0200, Bernhard Voelker wrote:

On 09/02/2014 05:06 PM, Ben Pfaff wrote:

Looking at wget(1), I'm a little surprised that the selected options
appear to avoid clobbering files whose names conflict.  I would have
expected that we'd want to overwrite them, to get the fresher version.
But the existing wget invocation does the same thing, so maybe it's
intentional?


clobbering is implicitly disabled with the -nd option:

   -nd
--no-directories
Do not create a hierarchy of directories when retrieving
recursively.  With this option turned on, all files will
get saved to the current directory, without clobbering (if
a name shows up more than once, the filenames will get
extensions .n).


Yes.  As I said, I'm a little surprised that the selected options appear
to avoid clobbering files whose names conflict.


Interestingly, the build-aux/bootstrap script uses slightly different
wget(1) options [0]:

  po_download_command_format2=\
  wget --mirror -nd -q -np -A.po -P '%s' \
   http://translationproject.org/latest/%s/;

[0]
http://git.sv.gnu.org/cgit/gnulib.git/tree/build-aux/bootstrap?id=157c42eff7#n129

Have a nice day,
Berny



[PATCH] gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++

2014-09-02 Thread Paul Eggert
* m4/gnulib-common.m4 (AC_C_RESTRICT):
Override AC_C_RESTRICT unconditionally.
Update from autoconf, incorporating:
2014-09-02 autoconf: port 'restrict' to GCC 4.2.1
2009-01-28 Fix AC_C_RESTRICT for Sun Studio 12 C++.
---
 ChangeLog   |  9 +
 m4/gnulib-common.m4 | 48 +---
 2 files changed, 34 insertions(+), 23 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ac039fb..b138dc2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2014-09-02  Paul Eggert  egg...@cs.ucla.edu
+
+   gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
+   * m4/gnulib-common.m4 (AC_C_RESTRICT):
+   Override AC_C_RESTRICT unconditionally.
+   Update from autoconf, incorporating:
+   2014-09-02 autoconf: port 'restrict' to GCC 4.2.1
+   2009-01-28 Fix AC_C_RESTRICT for Sun Studio 12 C++.
+
 2014-09-01  Paul Eggert  egg...@cs.ucla.edu
 
manywarnings: add GCC 4.9 warnings
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 35f6195..31e5f94 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 35
+# gnulib-common.m4 serial 36
 dnl Copyright (C) 2007-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -319,26 +319,28 @@ m4_ifdef([AC_PROG_MKDIR_P], [
 ])
 
 # AC_C_RESTRICT
-# This definition overrides the AC_C_RESTRICT macro from autoconf 2.60..2.61,
-# so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++
-# works.
-# This definition can be removed once autoconf = 2.62 can be assumed.
-# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
-m4_ifndef([AC_AUTOCONF_VERSION],[
+# This definition is copied from post-2.69 Autoconf and overrides the
+# AC_C_RESTRICT macro from autoconf 2.60..2.69.  It can be removed
+# once autoconf = 2.70 can be assumed.  It's painful to check version
+# numbers, and in practice this macro is more up-to-date than Autoconf
+# is, so override Autoconf unconditionally.
 AC_DEFUN([AC_C_RESTRICT],
 [AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
   [ac_cv_c_restrict=no
# The order here caters to the fact that C++ does not require restrict.
for ac_kw in __restrict __restrict__ _Restrict restrict; do
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-  [[typedef int * int_ptr;
-int foo (int_ptr $ac_kw ip) {
-return ip[0];
-   }]],
-  [[int s[1];
-int * $ac_kw t = s;
-t[0] = 0;
-return foo(t)]])],
+ AC_COMPILE_IFELSE(
+  [AC_LANG_PROGRAM(
+[[typedef int *int_ptr;
+  int foo (int_ptr $ac_kw ip) { return ip[0]; }
+  int bar (int [$ac_kw]); /* Catch GCC bug 14050.  */
+  int bar (int ip[$ac_kw]) { return ip[0]; }
+]],
+[[int s[1];
+  int *$ac_kw t = s;
+  t[0] = 0;
+  return foo (t) + bar (t);
+]])],
   [ac_cv_c_restrict=$ac_kw])
  test $ac_cv_c_restrict != no  break
done
@@ -348,21 +350,21 @@ AC_DEFUN([AC_C_RESTRICT],
nothing if this is not supported.  Do not define if restrict is
supported directly.  */
 #undef restrict
-/* Work around a bug in Sun C++: it does not support _Restrict, even
-   though the corresponding Sun C compiler does, which causes
-   #define restrict _Restrict in the previous line.  Perhaps some future
-   version of Sun C++ will work with _Restrict; if so, it'll probably
-   define __RESTRICT, just as Sun C does.  */
+/* Work around a bug in Sun C++: it does not support _Restrict or
+   __restrict__, even though the corresponding Sun C compiler ends up with
+   #define restrict _Restrict or #define restrict __restrict__ in the
+   previous line.  Perhaps some future version of Sun C++ will work with
+   restrict; if so, hopefully it defines __RESTRICT like Sun C does.  */
 #if defined __SUNPRO_CC  !defined __RESTRICT
 # define _Restrict
+# define __restrict__
 #endif])
  case $ac_cv_c_restrict in
restrict) ;;
no) AC_DEFINE([restrict], []) ;;
*)  AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
  esac
-])
-])
+])# AC_C_RESTRICT
 
 # gl_BIGENDIAN
 # is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd.
-- 
1.9.3