]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: fix invalid gnulib patch
authorPádraig Brady <P@draigBrady.com>
Tue, 3 Feb 2015 03:15:10 +0000 (03:15 +0000)
committerPádraig Brady <P@draigBrady.com>
Tue, 3 Feb 2015 10:18:28 +0000 (10:18 +0000)
* gl/lib/tempname.c.diff: Fix recent breakage so it applies again.
Invalid patch was noticed at http://hydra.nixos.org/eval/1172233
* cfg.mk: Exempt diff files from these "id_est" syntax checks.
(sc_ensure_gl_diffs_apply): A new syntax check, to ensure all
patches under gl/ apply cleanly.  Note we use --fuzz=0 to check
patches apply cleanly for safety, due to the patch(1) issue detailed
in commit v8.21-117-g46f7e05
* gl/lib/regcomp.c.diff: Rediffed.
* gl/lib/regex_internal.c.diff: Likewise.
* gl/lib/regex_internal.h.diff: Likewise.
* gl/lib/regexec.c.diff: Likewise.
* gl/lib/tempname.h.diff: Likewise.

cfg.mk
gl/lib/regcomp.c.diff
gl/lib/regex_internal.c.diff
gl/lib/regex_internal.h.diff
gl/lib/regexec.c.diff
gl/lib/tempname.c.diff
gl/lib/tempname.h.diff

diff --git a/cfg.mk b/cfg.mk
index 21a00d318cd313d40e0307e66d3f02d50903c20c..f5be6de75524af34cbafa4110b8a2f7ed117df91 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -122,6 +122,14 @@ sc_tests_executable:
          | sed -e "s/^/$(ME): Please make test executable: /" | grep . \
            && exit 1; :
 
+# Ensure all gnulib patches apply cleanly
+sc_ensure_gl_diffs_apply_cleanly:
+       @find gl/ -name '*.diff' | while read p; do                     \
+         patch --fuzz=0 -f -s -d gnulib/ -p1 --dry-run < "$$p" >&2     \
+           || { echo "$$p" >&2; echo 'To refresh all gl patches run:'  \
+                'make refresh-gnulib-patches' >&2; exit 1; }           \
+       done
+
 # Avoid :>file which doesn't propagate errors
 sc_prohibit_colon_redirection:
        @cd $(srcdir)/tests && GIT_PAGER= git grep -n ': *>.*||' \
@@ -364,15 +372,15 @@ sc_prohibit_uppercase_id_est:
          $(_sc_search_regexp)
 
 # Enforce double-space before "I.e." at the beginning of a sentence.
-sc_ensure_double_space_after_dot_before_id_est:
-       @prohibit='\. I\.e\.'                           \
+sc_ensure_dblspace_after_dot_before_id_est:
+       @prohibit='\. I\.e\.'                                           \
        halt='Single space after dot before "i.e."; use ".  i.e." instead' \
          $(_sc_search_regexp)
 
 # Enforce comma after "i.e." (at least before a blank or at EOL).
 sc_ensure_comma_after_id_est:
-       @prohibit='[Ii]\.e\.( |$$)'                             \
-       halt='Missing comma after "i.e."; use "i.e.," instead' \
+       @prohibit='[Ii]\.e\.( |$$)'                                     \
+       halt='Missing comma after "i.e."; use "i.e.," instead'          \
          $(_sc_search_regexp)
 
 # The SEE ALSO section of a man page should not be terminated with
@@ -691,6 +699,10 @@ exclude_file_name_regexp--sc_prohibit_atoi_atof = ^src/make-prime-list\.c$$
 # Exception here as we don't want __attribute elided on non GCC
 exclude_file_name_regexp--sc_prohibit-gl-attributes = ^src/libstdbuf\.c$$
 
+exclude_file_name_regexp--sc_prohibit_uppercase_id_est = \.diff$
+exclude_file_name_regexp--sc_ensure_dblspace_after_dot_before_id_est = \.diff$$
+exclude_file_name_regexp--sc_ensure_comma_after_id_est = \.diff$
+
 # Augment AM_CFLAGS to include our per-directory options:
 AM_CFLAGS += $($(@D)_CFLAGS)
 
index 9042a6e47159fc409e251a4437ca56d9e055bd4d..cc6649f2ef8e338583e6efeecc6046d4253c515c 100644 (file)
@@ -1,8 +1,8 @@
 diff --git a/lib/regcomp.c b/lib/regcomp.c
-index 6d5525a..c9331d4 100644
+index 840220f..192632c 100644
 --- a/lib/regcomp.c
 +++ b/lib/regcomp.c
-@@ -539,7 +539,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
+@@ -540,7 +540,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
      size_t errbuf_size;
  #else /* size_t might promote */
  size_t
@@ -11,7 +11,7 @@ index 6d5525a..c9331d4 100644
          char *_Restrict_ errbuf, size_t errbuf_size)
  #endif
  {
-@@ -1421,7 +1421,7 @@ calc_first (void *extra, bin_tree_t *node)
+@@ -1427,7 +1427,7 @@ calc_first (void *extra, bin_tree_t *node)
 
  /* Pass 2: compute NEXT on the tree.  Preorder visit.  */
  static reg_errcode_t
@@ -20,7 +20,7 @@ index 6d5525a..c9331d4 100644
  {
    switch (node->token.type)
      {
-@@ -2807,8 +2807,10 @@ build_range_exp (const reg_syntax_t syntax,
+@@ -2820,8 +2820,10 @@ build_range_exp (const reg_syntax_t syntax,
  static reg_errcode_t
  internal_function
  # ifdef RE_ENABLE_I18N
@@ -33,7 +33,7 @@ index 6d5525a..c9331d4 100644
  # else /* not RE_ENABLE_I18N */
  build_collating_symbol (bitset_t sbcset, const unsigned char *name)
  # endif /* not RE_ENABLE_I18N */
-@@ -3392,7 +3394,8 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
+@@ -3389,7 +3391,8 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
 
  static reg_errcode_t
  parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp,
@@ -43,7 +43,7 @@ index 6d5525a..c9331d4 100644
                       reg_syntax_t syntax, bool accept_hyphen)
  {
  #ifdef RE_ENABLE_I18N
-@@ -3479,8 +3482,10 @@ parse_bracket_symbol (bracket_elem_t *elem, re_string_t *regexp,
+@@ -3476,8 +3479,10 @@ parse_bracket_symbol (bracket_elem_t *elem, re_string_t *regexp,
 
  static reg_errcode_t
  #ifdef RE_ENABLE_I18N
@@ -56,7 +56,7 @@ index 6d5525a..c9331d4 100644
  #else /* not RE_ENABLE_I18N */
  build_equiv_class (bitset_t sbcset, const unsigned char *name)
  #endif /* not RE_ENABLE_I18N */
-@@ -3886,7 +3891,7 @@ free_token (re_token_t *node)
+@@ -3883,7 +3888,7 @@ free_token (re_token_t *node)
     and its children. */
 
  static reg_errcode_t
index a27f67218c3f0fe9aed91c5e6879dfa95feb0b50..355cadb42143be7d14a51b02ebcccc2c8e6e0929 100644 (file)
@@ -1,17 +1,17 @@
 diff --git a/lib/regex_internal.c b/lib/regex_internal.c
-index 7e8c1bc..e68c9da 100644
+index 36ae6ab..c11ff09 100644
 --- a/lib/regex_internal.c
 +++ b/lib/regex_internal.c
-@@ -16,6 +16,8 @@
-    You should have received a copy of the GNU General Public License along
-    with this program; if not, see <http://www.gnu.org/licenses/>.  */
+@@ -17,6 +17,8 @@
+    License along with the GNU C Library; if not, see
+    <http://www.gnu.org/licenses/>.  */
 
 +#include "verify.h"
 +#include "intprops.h"
  static void re_string_construct_common (const char *str, Idx len,
                                        re_string_t *pstr,
                                        RE_TRANSLATE_TYPE trans, bool icase,
-@@ -1393,7 +1395,10 @@ static void
+@@ -1389,7 +1391,10 @@ static void
  internal_function
  re_node_set_remove_at (re_node_set *set, Idx idx)
  {
index f410882c7f453bfce9c9ccbbbe68b51d01c62538..a4d78af2179bcd4097d9dbe28a89e7fa722f4cf2 100644 (file)
@@ -1,8 +1,8 @@
 diff --git a/lib/regex_internal.h b/lib/regex_internal.h
-index 439444c..7242084 100644
+index ff486bb..ff85ac8 100644
 --- a/lib/regex_internal.h
 +++ b/lib/regex_internal.h
-@@ -827,7 +827,8 @@ re_string_wchar_at (const re_string_t *pstr, Idx idx)
+@@ -863,7 +863,8 @@ re_string_wchar_at (const re_string_t *pstr, Idx idx)
  # ifndef NOT_IN_libc
  static int
  internal_function __attribute__ ((pure, unused))
index 897d2483958f6891d961cd078150f56c2f01046c..1aa3c2477d52d9894f78d71fbded51211e4ee726 100644 (file)
@@ -1,17 +1,17 @@
 diff --git a/lib/regexec.c b/lib/regexec.c
-index 7d130a0..a58d454 100644
+index d3920c4..a8152b5 100644
 --- a/lib/regexec.c
 +++ b/lib/regexec.c
-@@ -16,6 +16,8 @@
-    You should have received a copy of the GNU General Public License along
-    with this program; if not, see <http://www.gnu.org/licenses/>.  */
+@@ -17,6 +17,8 @@
+    License along with the GNU C Library; if not, see
+    <http://www.gnu.org/licenses/>.  */
 
 +#include "verify.h"
 +#include "intprops.h"
  static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags,
                                     Idx n) internal_function;
  static void match_ctx_clean (re_match_context_t *mctx) internal_function;
-@@ -374,8 +376,11 @@ re_search_2_stub (struct re_pattern_buffer *bufp,
+@@ -373,8 +375,11 @@ re_search_2_stub (struct re_pattern_buffer *bufp,
    Idx len = length1 + length2;
    char *s = NULL;
 
@@ -25,7 +25,7 @@ index 7d130a0..a58d454 100644
 
    /* Concatenate the strings.  */
    if (length2 > 0)
-@@ -426,11 +431,14 @@ re_search_stub (struct re_pattern_buffer *bufp,
+@@ -423,11 +428,14 @@ re_search_stub (struct re_pattern_buffer *bufp,
    Idx last_start = start + range;
 
    /* Check for out-of-range.  */
@@ -42,4 +42,4 @@ index 7d130a0..a58d454 100644
 +  else if (BE (/* last_start < 0 || */ (range < 0 && start <= last_start), 0))
      last_start = 0;
 
-   __libc_lock_lock (dfa->lock);
+   lock_lock (dfa->lock);
index 7cf923043d43c8df287b698af2c577d8e664a224..5138df29b10ef3d0beb7868472a6adfd01ee4a30 100644 (file)
@@ -1,5 +1,5 @@
 diff --git a/lib/tempname.c b/lib/tempname.c
-index 26a38ce..5944ee0 100644
+index 088b224..e9a6c0c 100644
 --- a/lib/tempname.c
 +++ b/lib/tempname.c
 @@ -20,6 +20,7 @@
@@ -18,7 +18,7 @@ index 26a38ce..5944ee0 100644
  #include <stddef.h>
  #include <stdlib.h>
  #include <string.h>
-@@ -175,14 +177,21 @@ __path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
+@@ -172,14 +174,21 @@ __path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
  }
  #endif /* _LIBC */
 
@@ -33,7 +33,7 @@ index 26a38ce..5944ee0 100644
  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
 
  /* Generate a temporary file name based on TMPL.  TMPL must match the
--   rules for mk[s]temp (i.e., end in "XXXXXX", possibly with a suffix).
+-   rules for mk[s]temp (i.e. end in "XXXXXX", possibly with a suffix).
 +   rules for mk[s]temp (i.e., end in at least X_SUFFIX_LEN "X"s,
 +   possibly with a suffix).
     The name constructed does not exist at the time of the call to
@@ -42,7 +42,7 @@ index 26a38ce..5944ee0 100644
 
     KIND may be one of:
     __GT_NOCREATE:       simply verify that the name does not exist
-@@ -193,23 +202,24 @@ static const char letters[] =
+@@ -190,23 +199,24 @@ static const char letters[] =
 
     We use a clever algorithm to get hard-to-predict names. */
  int
@@ -72,7 +72,7 @@ index 26a38ce..5944ee0 100644
  #define ATTEMPTS_MIN (62 * 62 * 62)
 
    /* The number of times to attempt to generate a temporary file.  To
-@@ -221,43 +231,28 @@ __gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
+@@ -218,43 +228,28 @@ __gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
  #endif
 
    len = strlen (tmpl);
@@ -128,7 +128,7 @@ index 26a38ce..5944ee0 100644
 
        switch (kind)
          {
-@@ -272,7 +267,7 @@ __gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
+@@ -269,7 +264,7 @@ __gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
            break;
 
          case __GT_NOCREATE:
@@ -137,7 +137,7 @@ index 26a38ce..5944ee0 100644
               succeeds if __xstat fails because the name does not exist.
               Note the continue to bypass the common logic at the bottom
               of the loop.  */
-@@ -281,11 +276,15 @@ __gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
+@@ -278,11 +273,15 @@ __gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
                if (errno == ENOENT)
                  {
                    __set_errno (save_errno);
@@ -156,7 +156,7 @@ index 26a38ce..5944ee0 100644
              }
            continue;
 
-@@ -297,13 +296,32 @@ __gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
+@@ -294,13 +293,32 @@ __gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
        if (fd >= 0)
          {
            __set_errno (save_errno);
index 2e885e185ede2612000fcb729220c4217454838b..ec70a473d7b735631f36e51673ab1dd0e07139ad 100644 (file)
@@ -1,5 +1,5 @@
 diff --git a/lib/tempname.h b/lib/tempname.h
-index 7972562..7ced9a9 100644
+index b560ee5..6e162c3 100644
 --- a/lib/tempname.h
 +++ b/lib/tempname.h
 @@ -46,5 +46,7 @@