From ee6b46901d512098cc2c193da2ae1afa162ad0bc Mon Sep 17 00:00:00 2001 From: fbrosson Date: Sun, 7 Oct 2018 23:47:48 +0000 Subject: [PATCH] patch: bump to 2.7.6, switch to tar.xz, add gcc2 patch. (#3200) The 2nd patch in patch-2.7.6-gcc2.patchset is almost identical to the 2nd one in tar-1.30-gcc2.patchset, and the files they patch: * tar-1.30/gnu/backupfile.c * tar-1.30/gnu/parse-datetime.y * patch-2.7.6/lib/backupfile.c * patch-2.7.6/lib/parse-datetime.y are identical before and after the patch. There is only one diff, in line 3: we have a "2017" for tar and a "2018" for patch. --- ...{patch-2.7.5.recipe => patch-2.7.6.recipe} | 23 +- .../patch/patches/patch-2.7.6-gcc2.patchset | 1460 +++++++++++++++++ ...ch-2.7.5.patchset => patch-2.7.6.patchset} | 4 +- 3 files changed, 1476 insertions(+), 11 deletions(-) rename sys-devel/patch/{patch-2.7.5.recipe => patch-2.7.6.recipe} (54%) create mode 100644 sys-devel/patch/patches/patch-2.7.6-gcc2.patchset rename sys-devel/patch/patches/{patch-2.7.5.patchset => patch-2.7.6.patchset} (91%) diff --git a/sys-devel/patch/patch-2.7.5.recipe b/sys-devel/patch/patch-2.7.6.recipe similarity index 54% rename from sys-devel/patch/patch-2.7.5.recipe rename to sys-devel/patch/patch-2.7.6.recipe index 13eb1a1f4..a46abbf51 100644 --- a/sys-devel/patch/patch-2.7.5.recipe +++ b/sys-devel/patch/patch-2.7.6.recipe @@ -1,15 +1,20 @@ SUMMARY="Utility to apply diffs to files" -DESCRIPTION=" -Patch takes a patch file containing a difference listing produced by the diff \ -program and applies those differences to one or more original files, producing \ -patched versions." -HOMEPAGE="http://www.gnu.org/software/patch/" -COPYRIGHT="2012-2015 Free Software Foundation, Inc." +DESCRIPTION="Patch takes a patch file containing a difference listing produced \ +by the diff program and applies those differences to one or more original \ +files, producing patched versions." +HOMEPAGE="https://savannah.gnu.org/projects/patch/" +COPYRIGHT="2012-2018 Free Software Foundation, Inc." LICENSE="GNU GPL v3" -REVISION="2" -SOURCE_URI="http://ftp.gnu.org/pub/gnu/patch/patch-$portVersion.tar.gz" -CHECKSUM_SHA256="7436f5a19f93c3ca83153ce9c5cbe4847e97c5d956e57a220121e741f6e7968f" +REVISION="1" +SOURCE_URI="https://ftpmirror.gnu.org/patch/patch-$portVersion.tar.xz + https://ftp.gnu.org/gnu/patch/patch-$portVersion.tar.xz" +CHECKSUM_SHA256="ac610bda97abe0d9f6b7c963255a11dcb196c25e337c61f94e4778d632f1d8fd" PATCHES="patch-$portVersion.patchset" +if [ "$effectiveTargetArchitecture" = x86_gcc2 ]; then +PATCHES+=" + patch-$portVersion-gcc2.patchset + " +fi ARCHITECTURES="x86_gcc2 x86 x86_64 arm" if [ "$targetArchitecture" = x86_gcc2 ]; then diff --git a/sys-devel/patch/patches/patch-2.7.6-gcc2.patchset b/sys-devel/patch/patches/patch-2.7.6-gcc2.patchset new file mode 100644 index 000000000..4cc9fc573 --- /dev/null +++ b/sys-devel/patch/patches/patch-2.7.6-gcc2.patchset @@ -0,0 +1,1460 @@ +From da0fbab0e3b0db97467bb9f34f2f43ba4d5e6310 Mon Sep 17 00:00:00 2001 +From: fbrosson +Date: Sun, 7 Oct 2018 15:28:58 +0000 +Subject: C89 fixes for gcc2 compatibility + + +diff --git a/lib/diffseq.h b/lib/diffseq.h +index 9244729..67b22bf 100644 +--- a/lib/diffseq.h ++++ b/lib/diffseq.h +@@ -208,6 +208,7 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, bool find_minimal, + { + OFFSET d; /* Active diagonal. */ + bool big_snake = false; ++ bool heuristic; + + /* Extend the top-down search by an edit step in each diagonal. */ + if (fmin > dmin) +@@ -279,9 +280,9 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, bool find_minimal, + continue; + + #ifdef USE_HEURISTIC +- bool heuristic = ctxt->heuristic; ++ heuristic = ctxt->heuristic; + #else +- bool heuristic = false; ++ heuristic = false; + #endif + + /* Heuristic: check occasionally for a diagonal that has made lots +diff --git a/lib/filenamecat-lgpl.c b/lib/filenamecat-lgpl.c +index f50ecc1..fc2741c 100644 +--- a/lib/filenamecat-lgpl.c ++++ b/lib/filenamecat-lgpl.c +@@ -46,6 +46,8 @@ + char * + mfile_name_concat (char const *dir, char const *base, char **base_in_result) + { ++ char *p_concat; ++ char *p; + char const *dirbase = last_component (dir); + size_t dirbaselen = base_len (dirbase); + size_t dirlen = dirbase - dir + dirbaselen; +@@ -67,8 +69,7 @@ mfile_name_concat (char const *dir, char const *base, char **base_in_result) + sep = '.'; + } + +- char *p_concat = malloc (dirlen + (sep != '\0') + baselen + 1); +- char *p; ++ p_concat = malloc (dirlen + (sep != '\0') + baselen + 1); + + if (p_concat == NULL) + return NULL; +-- +2.19.1 + + +From 67150aab60b3e8219fbd63a2234b229241083ec5 Mon Sep 17 00:00:00 2001 +From: fbrosson +Date: Fri, 22 Jun 2018 20:30:40 +0000 +Subject: C89 fixes for gcc2, almost identical to tar-1.30-gcc2.patchset + + +diff --git a/lib/backupfile.c b/lib/backupfile.c +index d438455..12f0d06 100644 +--- a/lib/backupfile.c ++++ b/lib/backupfile.c +@@ -219,6 +219,7 @@ numbered_backup (char **buffer, size_t buffer_size, size_t filelen, + char *q; + bool all_9s; + size_t versionlen; ++ size_t new_buffer_size; + + if (_D_EXACT_NAMLEN (dp) < baselen + 4) + continue; +@@ -250,12 +251,13 @@ numbered_backup (char **buffer, size_t buffer_size, size_t filelen, + + versionlenmax = all_9s + versionlen; + result = (all_9s ? BACKUP_IS_LONGER : BACKUP_IS_SAME_LENGTH); +- size_t new_buffer_size = filelen + 2 + versionlenmax + 2; ++ new_buffer_size = filelen + 2 + versionlenmax + 2; + if (buffer_size < new_buffer_size) + { ++ char *new_buf; + if (! xalloc_oversized (new_buffer_size, 2)) + new_buffer_size *= 2; +- char *new_buf = realloc (buf, new_buffer_size); ++ new_buf = realloc (buf, new_buffer_size); + if (!new_buf) + { + *buffer = buf; +@@ -293,26 +295,34 @@ backupfile_internal (char const *file, enum backup_type backup_type, bool rename + { + ptrdiff_t base_offset = last_component (file) - file; + size_t filelen = base_offset + strlen (file + base_offset); ++ size_t simple_backup_suffix_size; ++ size_t backup_suffix_size_guess; ++ enum { GUESS = sizeof ".~12345~" }; ++ ssize_t ssize; ++ char *s; ++ DIR *dirp; + + if (! simple_backup_suffix) + set_simple_backup_suffix (NULL); + + /* Allow room for simple or ".~N~" backups. The guess must be at + least sizeof ".~1~", but otherwise will be adjusted as needed. */ +- size_t simple_backup_suffix_size = strlen (simple_backup_suffix) + 1; +- size_t backup_suffix_size_guess = simple_backup_suffix_size; +- enum { GUESS = sizeof ".~12345~" }; ++ simple_backup_suffix_size = strlen (simple_backup_suffix) + 1; ++ backup_suffix_size_guess = simple_backup_suffix_size; + if (backup_suffix_size_guess < GUESS) + backup_suffix_size_guess = GUESS; + +- ssize_t ssize = filelen + backup_suffix_size_guess + 1; +- char *s = malloc (ssize); ++ ssize = filelen + backup_suffix_size_guess + 1; ++ s = malloc (ssize); + if (!s) + return s; + +- DIR *dirp = NULL; ++ dirp = NULL; + while (true) + { ++ int sdir; ++ unsigned flags; ++ int e; + memcpy (s, file, filelen + 1); + + if (backup_type == simple_backups) +@@ -346,16 +356,16 @@ backupfile_internal (char const *file, enum backup_type backup_type, bool rename + if (! rename) + break; + +- int sdir = dirp ? dirfd (dirp) : -1; ++ sdir = dirp ? dirfd (dirp) : -1; + if (sdir < 0) + { + sdir = AT_FDCWD; + base_offset = 0; + } +- unsigned flags = backup_type == simple_backups ? 0 : RENAME_NOREPLACE; ++ flags = backup_type == simple_backups ? 0 : RENAME_NOREPLACE; + if (renameat2 (AT_FDCWD, file, sdir, s + base_offset, flags) == 0) + break; +- int e = errno; ++ e = errno; + if (e != EEXIST) + { + if (dirp) +diff --git a/lib/parse-datetime.y b/lib/parse-datetime.y +index f14bb31..4d8128f 100644 +--- a/lib/parse-datetime.y ++++ b/lib/parse-datetime.y +@@ -405,8 +405,9 @@ time_zone_str (int time_zone, char time_zone_buf[TIME_ZONE_BUFSIZE]) + char *p = time_zone_buf; + char sign = time_zone < 0 ? '-' : '+'; + int hour = abs (time_zone / (60 * 60)); ++ int offset_from_hour; + p += sprintf (time_zone_buf, "%c%02d", sign, hour); +- int offset_from_hour = abs (time_zone % (60 * 60)); ++ offset_from_hour = abs (time_zone % (60 * 60)); + if (offset_from_hour != 0) + { + int mm = offset_from_hour / 60; +@@ -477,9 +478,9 @@ debug_print_current_time (char const *item, parser_control *pc) + + if (pc->days_seen && !pc->debug_days_seen) + { ++ char tmp[DBGBUFSIZE]; + if (space) + fputc (' ', stderr); +- char tmp[DBGBUFSIZE]; + fprintf (stderr, _("%s (day ordinal=%"PRIdMAX" number=%d)"), + str_days (pc, tmp, sizeof tmp), + pc->day_ordinal, pc->day_number); +@@ -1414,6 +1415,7 @@ yylex (union YYSTYPE *lvalp, parser_control *pc) + + for (;;) + { ++ ptrdiff_t count; + while (c = *pc->input, c_isspace (c)) + pc->input++; + +@@ -1531,7 +1533,7 @@ yylex (union YYSTYPE *lvalp, parser_control *pc) + if (c != '(') + return to_uchar (*pc->input++); + +- ptrdiff_t count = 0; ++ count = 0; + do + { + c = *pc->input++; +@@ -1617,12 +1619,12 @@ debug_strfdatetime (struct tm const *tm, parser_control const *pc, + if (pc && m < n && pc->zones_seen) + { + int tz = pc->time_zone; ++ char time_zone_buf[TIME_ZONE_BUFSIZE]; + + /* Account for DST if tLOCAL_ZONE was seen. */ + if (pc->local_zones_seen && !pc->zones_seen && 0 < pc->local_isdst) + tz += 60 * 60; + +- char time_zone_buf[TIME_ZONE_BUFSIZE]; + snprintf (&buf[m], n - m, " TZ=%s", time_zone_str (tz, time_zone_buf)); + } + return buf; +@@ -1720,9 +1722,10 @@ parse_datetime (struct timespec *result, char const *p, + { + char const *tzstring = getenv ("TZ"); + timezone_t tz = tzalloc (tzstring); ++ bool ok; + if (!tz) + return false; +- bool ok = parse_datetime2 (result, p, now, 0, tz, tzstring); ++ ok = parse_datetime2 (result, p, now, 0, tz, tzstring); + tzfree (tz); + return ok; + } +@@ -1749,6 +1752,12 @@ parse_datetime2 (struct timespec *result, char const *p, + Use heap allocation if TZ's length exceeds this. */ + enum { TZBUFSIZE = 100 }; + char tz1buf[TZBUFSIZE]; ++ time_t Start; ++ int Start_ns; ++ unsigned char c; ++ timezone_t tz; ++ struct tm tmp; ++ parser_control pc; + + struct timespec gettime_buffer; + if (! now) +@@ -1757,14 +1766,13 @@ parse_datetime2 (struct timespec *result, char const *p, + now = &gettime_buffer; + } + +- time_t Start = now->tv_sec; +- int Start_ns = now->tv_nsec; ++ Start = now->tv_sec; ++ Start_ns = now->tv_nsec; + +- unsigned char c; + while (c = *p, c_isspace (c)) + p++; + +- timezone_t tz = tzdefault; ++ tz = tzdefault; + + if (strncmp (p, "TZ=\"", 4) == 0) + { +@@ -1809,7 +1817,6 @@ parse_datetime2 (struct timespec *result, char const *p, + } + } + +- struct tm tmp; + if (! localtime_rz (tz, &now->tv_sec, &tmp)) + goto fail; + +@@ -1819,7 +1826,6 @@ parse_datetime2 (struct timespec *result, char const *p, + if (*p == '\0') + p = "0"; + +- parser_control pc; + pc.input = p; + pc.parse_datetime_debug = (flags & PARSE_DATETIME_DEBUG) != 0; + if (INT_ADD_WRAPV (tmp.tm_year, TM_YEAR_BASE, &pc.year.value)) +@@ -1869,11 +1875,12 @@ parse_datetime2 (struct timespec *result, char const *p, + for (quarter = 1; quarter <= 3; quarter++) + { + intmax_t iprobe; ++ time_t probe; ++ struct tm probe_tm; + if (INT_ADD_WRAPV (Start, quarter * (90 * 24 * 60 * 60), &iprobe) + || time_overflow (iprobe)) + break; +- time_t probe = iprobe; +- struct tm probe_tm; ++ probe = iprobe; + if (localtime_rz (tz, &probe, &probe_tm) && probe_tm.tm_zone + && probe_tm.tm_isdst != pc.local_time_zone_table[0].value) + { +@@ -1970,6 +1977,8 @@ parse_datetime2 (struct timespec *result, char const *p, + *result = pc.seconds; + else + { ++ char dbg_ord[DBGBUFSIZE]; ++ + if (1 < (pc.times_seen | pc.dates_seen | pc.days_seen | pc.dsts_seen + | (pc.local_zones_seen + pc.zones_seen))) + { +@@ -2061,9 +2070,10 @@ parse_datetime2 (struct timespec *result, char const *p, + by setting TZ="XXX1:00" and try mktime again. */ + + char tz2buf[sizeof "XXX" - 1 + TIME_ZONE_BUFSIZE]; ++ timezone_t tz2; + tz2buf[0] = tz2buf[1] = tz2buf[2] = 'X'; + time_zone_str (pc.time_zone, &tz2buf[3]); +- timezone_t tz2 = tzalloc (tz2buf); ++ tz2 = tzalloc (tz2buf); + if (!tz2) + { + if (pc.parse_datetime_debug) +@@ -2089,8 +2099,6 @@ parse_datetime2 (struct timespec *result, char const *p, + } + } + +- char dbg_ord[DBGBUFSIZE]; +- + if (pc.days_seen && ! pc.dates_seen) + { + intmax_t dayincr; +@@ -2146,6 +2154,7 @@ parse_datetime2 (struct timespec *result, char const *p, + /* Add relative date. */ + if (pc.rel.year | pc.rel.month | pc.rel.day) + { ++ int year, month, day; + if (pc.parse_datetime_debug) + { + if ((pc.rel.year != 0 || pc.rel.month != 0) && tm.tm_mday != 15) +@@ -2158,7 +2167,6 @@ parse_datetime2 (struct timespec *result, char const *p, + "it is recommended to specify noon\n")); + } + +- int year, month, day; + if (INT_ADD_WRAPV (tm.tm_year, pc.rel.year, &year) + || INT_ADD_WRAPV (tm.tm_mon, pc.rel.month, &month) + || INT_ADD_WRAPV (tm.tm_mday, pc.rel.day, &day)) +@@ -2229,9 +2237,9 @@ parse_datetime2 (struct timespec *result, char const *p, + && (tm.tm_mday != day + || (pc.rel.month == 0 && tm.tm_mon != month))) + { ++ char tm_year_buf[TM_YEAR_BUFSIZE]; + dbg_printf (_("warning: month/year adjustment resulted in " + "shifted dates:\n")); +- char tm_year_buf[TM_YEAR_BUFSIZE]; + dbg_printf (_(" adjusted Y M D: %s %02d %02d\n"), + tm_year_str (year, tm_year_buf), month + 1, day); + dbg_printf (_(" normalized Y M D: %s %02d %02d\n"), +@@ -2311,6 +2319,7 @@ parse_datetime2 (struct timespec *result, char const *p, + if (pc.parse_datetime_debug + && (pc.rel.hour | pc.rel.minutes | pc.rel.seconds | pc.rel.ns)) + { ++ struct tm lmt; + dbg_printf (_("after time adjustment (%+"PRIdMAX" hours, " + "%+"PRIdMAX" minutes, " + "%+"PRIdMAX" seconds, %+d ns),\n"), +@@ -2329,7 +2338,6 @@ parse_datetime2 (struct timespec *result, char const *p, + places. + + 'tm.tm_isdst' contains the date after date adjustment. */ +- struct tm lmt; + if (tm.tm_isdst != -1 && localtime_rz (tz, &result->tv_sec, &lmt) + && tm.tm_isdst != lmt.tm_isdst) + dbg_printf (_("warning: daylight saving time changed after " +@@ -2340,6 +2348,10 @@ parse_datetime2 (struct timespec *result, char const *p, + + if (pc.parse_datetime_debug) + { ++ intmax_t sec; ++ int nsec; ++ struct tm gmt, lmt; ++ bool got_utc; + /* Special case: using 'date -u' simply set TZ=UTC0 */ + if (! tzstring) + dbg_printf (_("timezone: system default\n")); +@@ -2348,13 +2360,12 @@ parse_datetime2 (struct timespec *result, char const *p, + else + dbg_printf (_("timezone: TZ=\"%s\" environment value\n"), tzstring); + +- intmax_t sec = result->tv_sec; +- int nsec = result->tv_nsec; ++ sec = result->tv_sec; ++ nsec = result->tv_nsec; + dbg_printf (_("final: %"PRIdMAX".%09d (epoch-seconds)\n"), + sec, nsec); + +- struct tm gmt, lmt; +- bool got_utc = !!gmtime_r (&result->tv_sec, &gmt); ++ got_utc = !!gmtime_r (&result->tv_sec, &gmt); + if (got_utc) + dbg_printf (_("final: %s (UTC)\n"), + debug_strfdatetime (&gmt, NULL, +-- +2.19.1 + + +From b7aebf87e65f97062362e8377e20311bc0f15e8e Mon Sep 17 00:00:00 2001 +From: fbrosson +Date: Tue, 18 Sep 2018 11:40:27 +0000 +Subject: regenerated parse-datetime.c with bison 3.0.5 + + +diff --git a/lib/parse-datetime.c b/lib/parse-datetime.c +index da075e9..f12cea1 100644 +--- a/lib/parse-datetime.c ++++ b/lib/parse-datetime.c +@@ -1,8 +1,8 @@ +-/* A Bison parser, made by GNU Bison 3.0.4. */ ++/* A Bison parser, made by GNU Bison 3.0.5. */ + + /* Bison implementation for Yacc-like parsers in C + +- Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. ++ Copyright (C) 1984, 1989-1990, 2000-2015, 2018 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 +@@ -44,7 +44,7 @@ + #define YYBISON 1 + + /* Bison version. */ +-#define YYBISON_VERSION "3.0.4" ++#define YYBISON_VERSION "3.0.5" + + /* Skeleton name. */ + #define YYSKELETON_NAME "yacc.c" +@@ -470,8 +470,9 @@ time_zone_str (int time_zone, char time_zone_buf[TIME_ZONE_BUFSIZE]) + char *p = time_zone_buf; + char sign = time_zone < 0 ? '-' : '+'; + int hour = abs (time_zone / (60 * 60)); ++ int offset_from_hour; + p += sprintf (time_zone_buf, "%c%02d", sign, hour); +- int offset_from_hour = abs (time_zone % (60 * 60)); ++ offset_from_hour = abs (time_zone % (60 * 60)); + if (offset_from_hour != 0) + { + int mm = offset_from_hour / 60; +@@ -542,9 +543,9 @@ debug_print_current_time (char const *item, parser_control *pc) + + if (pc->days_seen && !pc->debug_days_seen) + { ++ char tmp[DBGBUFSIZE]; + if (space) + fputc (' ', stderr); +- char tmp[DBGBUFSIZE]; + fprintf (stderr, _("%s (day ordinal=%"PRIdMAX" number=%d)"), + str_days (pc, tmp, sizeof tmp), + pc->day_ordinal, pc->day_number); +@@ -627,7 +628,7 @@ debug_print_relative_time (char const *item, parser_control const *pc) + + + +-#line 631 "parse-datetime.c" /* yacc.c:339 */ ++#line 632 "parse-datetime.c" /* yacc.c:339 */ + + # ifndef YY_NULLPTR + # if defined __cplusplus && 201103L <= __cplusplus +@@ -708,14 +709,14 @@ extern int yydebug; + + union YYSTYPE + { +-#line 576 "parse-datetime.y" /* yacc.c:355 */ ++#line 577 "parse-datetime.y" /* yacc.c:355 */ + + intmax_t intval; + textint textintval; + struct timespec timespec; + relative_time rel; + +-#line 719 "parse-datetime.c" /* yacc.c:355 */ ++#line 720 "parse-datetime.c" /* yacc.c:355 */ + }; + + typedef union YYSTYPE YYSTYPE; +@@ -731,7 +732,7 @@ int yyparse (parser_control *pc); + + /* Copy the second part of user declarations. */ + +-#line 735 "parse-datetime.c" /* yacc.c:358 */ ++#line 736 "parse-datetime.c" /* yacc.c:358 */ + + #ifdef short + # undef short +@@ -1030,16 +1031,16 @@ static const yytype_uint8 yytranslate[] = + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ + static const yytype_uint16 yyrline[] = + { +- 0, 603, 603, 604, 608, 616, 618, 622, 627, 632, +- 637, 642, 647, 652, 656, 660, 667, 671, 675, 680, +- 685, 690, 694, 699, 704, 711, 713, 717, 742, 744, +- 754, 756, 758, 763, 768, 771, 773, 778, 783, 788, +- 794, 803, 808, 841, 849, 857, 862, 868, 873, 879, +- 883, 893, 895, 897, 902, 904, 906, 908, 910, 912, +- 914, 917, 920, 922, 924, 926, 928, 930, 932, 934, +- 936, 938, 940, 942, 944, 948, 950, 952, 955, 957, +- 959, 964, 968, 968, 971, 972, 978, 979, 985, 990, +- 1001, 1002 ++ 0, 604, 604, 605, 609, 617, 619, 623, 628, 633, ++ 638, 643, 648, 653, 657, 661, 668, 672, 676, 681, ++ 686, 691, 695, 700, 705, 712, 714, 718, 743, 745, ++ 755, 757, 759, 764, 769, 772, 774, 779, 784, 789, ++ 795, 804, 809, 842, 850, 858, 863, 869, 874, 880, ++ 884, 894, 896, 898, 903, 905, 907, 909, 911, 913, ++ 915, 918, 921, 923, 925, 927, 929, 931, 933, 935, ++ 937, 939, 941, 943, 945, 949, 951, 953, 956, 958, ++ 960, 965, 969, 969, 972, 973, 979, 980, 986, 991, ++ 1002, 1003 + }; + #endif + +@@ -1577,6 +1578,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + case N: \ + yyformat = S; \ + break ++ default: /* Avoid compiler warnings. */ + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); +@@ -1898,269 +1900,269 @@ yyreduce: + switch (yyn) + { + case 4: +-#line 609 "parse-datetime.y" /* yacc.c:1646 */ ++#line 610 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->seconds = (yyvsp[0].timespec); + pc->timespec_seen = true; + debug_print_current_time (_("number of seconds"), pc); + } +-#line 1908 "parse-datetime.c" /* yacc.c:1646 */ ++#line 1910 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 7: +-#line 623 "parse-datetime.y" /* yacc.c:1646 */ ++#line 624 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->times_seen++; pc->dates_seen++; + debug_print_current_time (_("datetime"), pc); + } +-#line 1917 "parse-datetime.c" /* yacc.c:1646 */ ++#line 1919 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 8: +-#line 628 "parse-datetime.y" /* yacc.c:1646 */ ++#line 629 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->times_seen++; + debug_print_current_time (_("time"), pc); + } +-#line 1926 "parse-datetime.c" /* yacc.c:1646 */ ++#line 1928 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 9: +-#line 633 "parse-datetime.y" /* yacc.c:1646 */ ++#line 634 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->local_zones_seen++; + debug_print_current_time (_("local_zone"), pc); + } +-#line 1935 "parse-datetime.c" /* yacc.c:1646 */ ++#line 1937 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 10: +-#line 638 "parse-datetime.y" /* yacc.c:1646 */ ++#line 639 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->zones_seen++; + debug_print_current_time (_("zone"), pc); + } +-#line 1944 "parse-datetime.c" /* yacc.c:1646 */ ++#line 1946 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 11: +-#line 643 "parse-datetime.y" /* yacc.c:1646 */ ++#line 644 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->dates_seen++; + debug_print_current_time (_("date"), pc); + } +-#line 1953 "parse-datetime.c" /* yacc.c:1646 */ ++#line 1955 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 12: +-#line 648 "parse-datetime.y" /* yacc.c:1646 */ ++#line 649 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->days_seen++; + debug_print_current_time (_("day"), pc); + } +-#line 1962 "parse-datetime.c" /* yacc.c:1646 */ ++#line 1964 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 13: +-#line 653 "parse-datetime.y" /* yacc.c:1646 */ ++#line 654 "parse-datetime.y" /* yacc.c:1648 */ + { + debug_print_relative_time (_("relative"), pc); + } +-#line 1970 "parse-datetime.c" /* yacc.c:1646 */ ++#line 1972 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 14: +-#line 657 "parse-datetime.y" /* yacc.c:1646 */ ++#line 658 "parse-datetime.y" /* yacc.c:1648 */ + { + debug_print_current_time (_("number"), pc); + } +-#line 1978 "parse-datetime.c" /* yacc.c:1646 */ ++#line 1980 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 15: +-#line 661 "parse-datetime.y" /* yacc.c:1646 */ ++#line 662 "parse-datetime.y" /* yacc.c:1648 */ + { + debug_print_relative_time (_("hybrid"), pc); + } +-#line 1986 "parse-datetime.c" /* yacc.c:1646 */ ++#line 1988 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 18: +-#line 676 "parse-datetime.y" /* yacc.c:1646 */ ++#line 677 "parse-datetime.y" /* yacc.c:1648 */ + { + set_hhmmss (pc, (yyvsp[-1].textintval).value, 0, 0, 0); + pc->meridian = (yyvsp[0].intval); + } +-#line 1995 "parse-datetime.c" /* yacc.c:1646 */ ++#line 1997 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 19: +-#line 681 "parse-datetime.y" /* yacc.c:1646 */ ++#line 682 "parse-datetime.y" /* yacc.c:1648 */ + { + set_hhmmss (pc, (yyvsp[-3].textintval).value, (yyvsp[-1].textintval).value, 0, 0); + pc->meridian = (yyvsp[0].intval); + } +-#line 2004 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2006 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 20: +-#line 686 "parse-datetime.y" /* yacc.c:1646 */ ++#line 687 "parse-datetime.y" /* yacc.c:1648 */ + { + set_hhmmss (pc, (yyvsp[-5].textintval).value, (yyvsp[-3].textintval).value, (yyvsp[-1].timespec).tv_sec, (yyvsp[-1].timespec).tv_nsec); + pc->meridian = (yyvsp[0].intval); + } +-#line 2013 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2015 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 22: +-#line 695 "parse-datetime.y" /* yacc.c:1646 */ ++#line 696 "parse-datetime.y" /* yacc.c:1648 */ + { + set_hhmmss (pc, (yyvsp[-1].textintval).value, 0, 0, 0); + pc->meridian = MER24; + } +-#line 2022 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2024 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 23: +-#line 700 "parse-datetime.y" /* yacc.c:1646 */ ++#line 701 "parse-datetime.y" /* yacc.c:1648 */ + { + set_hhmmss (pc, (yyvsp[-3].textintval).value, (yyvsp[-1].textintval).value, 0, 0); + pc->meridian = MER24; + } +-#line 2031 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2033 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 24: +-#line 705 "parse-datetime.y" /* yacc.c:1646 */ ++#line 706 "parse-datetime.y" /* yacc.c:1648 */ + { + set_hhmmss (pc, (yyvsp[-5].textintval).value, (yyvsp[-3].textintval).value, (yyvsp[-1].timespec).tv_sec, (yyvsp[-1].timespec).tv_nsec); + pc->meridian = MER24; + } +-#line 2040 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2042 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 27: +-#line 718 "parse-datetime.y" /* yacc.c:1646 */ ++#line 719 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->zones_seen++; + if (! time_zone_hhmm (pc, (yyvsp[-1].textintval), (yyvsp[0].intval))) YYABORT; + } +-#line 2049 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2051 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 28: +-#line 743 "parse-datetime.y" /* yacc.c:1646 */ ++#line 744 "parse-datetime.y" /* yacc.c:1648 */ + { pc->local_isdst = (yyvsp[0].intval); } +-#line 2055 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2057 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 29: +-#line 745 "parse-datetime.y" /* yacc.c:1646 */ ++#line 746 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->local_isdst = 1; + pc->dsts_seen++; + } +-#line 2064 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2066 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 30: +-#line 755 "parse-datetime.y" /* yacc.c:1646 */ ++#line 756 "parse-datetime.y" /* yacc.c:1648 */ + { pc->time_zone = (yyvsp[0].intval); } +-#line 2070 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2072 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 31: +-#line 757 "parse-datetime.y" /* yacc.c:1646 */ ++#line 758 "parse-datetime.y" /* yacc.c:1648 */ + { pc->time_zone = HOUR (7); } +-#line 2076 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2078 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 32: +-#line 759 "parse-datetime.y" /* yacc.c:1646 */ ++#line 760 "parse-datetime.y" /* yacc.c:1648 */ + { pc->time_zone = (yyvsp[-1].intval); + if (! apply_relative_time (pc, (yyvsp[0].rel), 1)) YYABORT; + debug_print_relative_time (_("relative"), pc); + } +-#line 2085 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2087 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 33: +-#line 764 "parse-datetime.y" /* yacc.c:1646 */ ++#line 765 "parse-datetime.y" /* yacc.c:1648 */ + { pc->time_zone = HOUR (7); + if (! apply_relative_time (pc, (yyvsp[0].rel), 1)) YYABORT; + debug_print_relative_time (_("relative"), pc); + } +-#line 2094 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2096 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 34: +-#line 769 "parse-datetime.y" /* yacc.c:1646 */ ++#line 770 "parse-datetime.y" /* yacc.c:1648 */ + { if (! time_zone_hhmm (pc, (yyvsp[-1].textintval), (yyvsp[0].intval))) YYABORT; + if (INT_ADD_WRAPV (pc->time_zone, (yyvsp[-2].intval), &pc->time_zone)) YYABORT; } +-#line 2101 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2103 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 35: +-#line 772 "parse-datetime.y" /* yacc.c:1646 */ ++#line 773 "parse-datetime.y" /* yacc.c:1648 */ + { pc->time_zone = (yyvsp[0].intval) + 60 * 60; } +-#line 2107 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2109 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 36: +-#line 774 "parse-datetime.y" /* yacc.c:1646 */ ++#line 775 "parse-datetime.y" /* yacc.c:1648 */ + { pc->time_zone = (yyvsp[-1].intval) + 60 * 60; } +-#line 2113 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2115 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 37: +-#line 779 "parse-datetime.y" /* yacc.c:1646 */ ++#line 780 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->day_ordinal = 0; + pc->day_number = (yyvsp[0].intval); + } +-#line 2122 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2124 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 38: +-#line 784 "parse-datetime.y" /* yacc.c:1646 */ ++#line 785 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->day_ordinal = 0; + pc->day_number = (yyvsp[-1].intval); + } +-#line 2131 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2133 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 39: +-#line 789 "parse-datetime.y" /* yacc.c:1646 */ ++#line 790 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->day_ordinal = (yyvsp[-1].intval); + pc->day_number = (yyvsp[0].intval); + pc->debug_ordinal_day_seen = true; + } +-#line 2141 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2143 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 40: +-#line 795 "parse-datetime.y" /* yacc.c:1646 */ ++#line 796 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->day_ordinal = (yyvsp[-1].textintval).value; + pc->day_number = (yyvsp[0].intval); + pc->debug_ordinal_day_seen = true; + } +-#line 2151 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2153 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 41: +-#line 804 "parse-datetime.y" /* yacc.c:1646 */ ++#line 805 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->month = (yyvsp[-2].textintval).value; + pc->day = (yyvsp[0].textintval).value; + } +-#line 2160 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2162 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 42: +-#line 809 "parse-datetime.y" /* yacc.c:1646 */ ++#line 810 "parse-datetime.y" /* yacc.c:1648 */ + { + /* Interpret as YYYY/MM/DD if the first value has 4 or more digits, + otherwise as MM/DD/YY. +@@ -2193,11 +2195,11 @@ yyreduce: + pc->year = (yyvsp[0].textintval); + } + } +-#line 2197 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2199 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 43: +-#line 842 "parse-datetime.y" /* yacc.c:1646 */ ++#line 843 "parse-datetime.y" /* yacc.c:1648 */ + { + /* E.g., 17-JUN-1992. */ + pc->day = (yyvsp[-2].textintval).value; +@@ -2205,11 +2207,11 @@ yyreduce: + if (INT_SUBTRACT_WRAPV (0, (yyvsp[0].textintval).value, &pc->year.value)) YYABORT; + pc->year.digits = (yyvsp[0].textintval).digits; + } +-#line 2209 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2211 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 44: +-#line 850 "parse-datetime.y" /* yacc.c:1646 */ ++#line 851 "parse-datetime.y" /* yacc.c:1648 */ + { + /* E.g., JUN-17-1992. */ + pc->month = (yyvsp[-2].intval); +@@ -2217,286 +2219,286 @@ yyreduce: + if (INT_SUBTRACT_WRAPV (0, (yyvsp[0].textintval).value, &pc->year.value)) YYABORT; + pc->year.digits = (yyvsp[0].textintval).digits; + } +-#line 2221 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2223 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 45: +-#line 858 "parse-datetime.y" /* yacc.c:1646 */ ++#line 859 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->month = (yyvsp[-1].intval); + pc->day = (yyvsp[0].textintval).value; + } +-#line 2230 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2232 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 46: +-#line 863 "parse-datetime.y" /* yacc.c:1646 */ ++#line 864 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->month = (yyvsp[-3].intval); + pc->day = (yyvsp[-2].textintval).value; + pc->year = (yyvsp[0].textintval); + } +-#line 2240 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2242 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 47: +-#line 869 "parse-datetime.y" /* yacc.c:1646 */ ++#line 870 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->day = (yyvsp[-1].textintval).value; + pc->month = (yyvsp[0].intval); + } +-#line 2249 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2251 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 48: +-#line 874 "parse-datetime.y" /* yacc.c:1646 */ ++#line 875 "parse-datetime.y" /* yacc.c:1648 */ + { + pc->day = (yyvsp[-2].textintval).value; + pc->month = (yyvsp[-1].intval); + pc->year = (yyvsp[0].textintval); + } +-#line 2259 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2261 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 50: +-#line 884 "parse-datetime.y" /* yacc.c:1646 */ ++#line 885 "parse-datetime.y" /* yacc.c:1648 */ + { + /* ISO 8601 format. YYYY-MM-DD. */ + pc->year = (yyvsp[-2].textintval); + if (INT_SUBTRACT_WRAPV (0, (yyvsp[-1].textintval).value, &pc->month)) YYABORT; + if (INT_SUBTRACT_WRAPV (0, (yyvsp[0].textintval).value, &pc->day)) YYABORT; + } +-#line 2270 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2272 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 51: +-#line 894 "parse-datetime.y" /* yacc.c:1646 */ ++#line 895 "parse-datetime.y" /* yacc.c:1648 */ + { if (! apply_relative_time (pc, (yyvsp[-1].rel), (yyvsp[0].intval))) YYABORT; } +-#line 2276 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2278 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 52: +-#line 896 "parse-datetime.y" /* yacc.c:1646 */ ++#line 897 "parse-datetime.y" /* yacc.c:1648 */ + { if (! apply_relative_time (pc, (yyvsp[0].rel), 1)) YYABORT; } +-#line 2282 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2284 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 53: +-#line 898 "parse-datetime.y" /* yacc.c:1646 */ ++#line 899 "parse-datetime.y" /* yacc.c:1648 */ + { if (! apply_relative_time (pc, (yyvsp[0].rel), 1)) YYABORT; } +-#line 2288 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2290 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 54: +-#line 903 "parse-datetime.y" /* yacc.c:1646 */ ++#line 904 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[-1].intval); } +-#line 2294 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2296 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 55: +-#line 905 "parse-datetime.y" /* yacc.c:1646 */ ++#line 906 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[-1].textintval).value; } +-#line 2300 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2302 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 56: +-#line 907 "parse-datetime.y" /* yacc.c:1646 */ ++#line 908 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = 1; } +-#line 2306 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2308 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 57: +-#line 909 "parse-datetime.y" /* yacc.c:1646 */ ++#line 910 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[-1].intval); } +-#line 2312 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2314 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 58: +-#line 911 "parse-datetime.y" /* yacc.c:1646 */ ++#line 912 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[-1].textintval).value; } +-#line 2318 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2320 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 59: +-#line 913 "parse-datetime.y" /* yacc.c:1646 */ ++#line 914 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = 1; } +-#line 2324 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2326 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 60: +-#line 915 "parse-datetime.y" /* yacc.c:1646 */ ++#line 916 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; + if (INT_MULTIPLY_WRAPV ((yyvsp[-1].intval), (yyvsp[0].intval), &(yyval.rel).day)) YYABORT; } +-#line 2331 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2333 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 61: +-#line 918 "parse-datetime.y" /* yacc.c:1646 */ ++#line 919 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; + if (INT_MULTIPLY_WRAPV ((yyvsp[-1].textintval).value, (yyvsp[0].intval), &(yyval.rel).day)) YYABORT; } +-#line 2338 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2340 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 62: +-#line 921 "parse-datetime.y" /* yacc.c:1646 */ ++#line 922 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[0].intval); } +-#line 2344 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2346 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 63: +-#line 923 "parse-datetime.y" /* yacc.c:1646 */ ++#line 924 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[-1].intval); } +-#line 2350 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2352 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 64: +-#line 925 "parse-datetime.y" /* yacc.c:1646 */ ++#line 926 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[-1].textintval).value; } +-#line 2356 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2358 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 65: +-#line 927 "parse-datetime.y" /* yacc.c:1646 */ ++#line 928 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = 1; } +-#line 2362 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2364 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 66: +-#line 929 "parse-datetime.y" /* yacc.c:1646 */ ++#line 930 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[-1].intval); } +-#line 2368 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2370 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 67: +-#line 931 "parse-datetime.y" /* yacc.c:1646 */ ++#line 932 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[-1].textintval).value; } +-#line 2374 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2376 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 68: +-#line 933 "parse-datetime.y" /* yacc.c:1646 */ ++#line 934 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = 1; } +-#line 2380 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2382 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 69: +-#line 935 "parse-datetime.y" /* yacc.c:1646 */ ++#line 936 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[-1].intval); } +-#line 2386 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2388 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 70: +-#line 937 "parse-datetime.y" /* yacc.c:1646 */ ++#line 938 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[-1].textintval).value; } +-#line 2392 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2394 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 71: +-#line 939 "parse-datetime.y" /* yacc.c:1646 */ ++#line 940 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[-1].timespec).tv_sec; (yyval.rel).ns = (yyvsp[-1].timespec).tv_nsec; } +-#line 2398 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2400 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 72: +-#line 941 "parse-datetime.y" /* yacc.c:1646 */ ++#line 942 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[-1].timespec).tv_sec; (yyval.rel).ns = (yyvsp[-1].timespec).tv_nsec; } +-#line 2404 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2406 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 73: +-#line 943 "parse-datetime.y" /* yacc.c:1646 */ ++#line 944 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = 1; } +-#line 2410 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2412 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 75: +-#line 949 "parse-datetime.y" /* yacc.c:1646 */ ++#line 950 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[-1].textintval).value; } +-#line 2416 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2418 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 76: +-#line 951 "parse-datetime.y" /* yacc.c:1646 */ ++#line 952 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[-1].textintval).value; } +-#line 2422 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2424 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 77: +-#line 953 "parse-datetime.y" /* yacc.c:1646 */ ++#line 954 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; + if (INT_MULTIPLY_WRAPV ((yyvsp[-1].textintval).value, (yyvsp[0].intval), &(yyval.rel).day)) YYABORT; } +-#line 2429 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2431 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 78: +-#line 956 "parse-datetime.y" /* yacc.c:1646 */ ++#line 957 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[-1].textintval).value; } +-#line 2435 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2437 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 79: +-#line 958 "parse-datetime.y" /* yacc.c:1646 */ ++#line 959 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[-1].textintval).value; } +-#line 2441 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2443 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 80: +-#line 960 "parse-datetime.y" /* yacc.c:1646 */ ++#line 961 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[-1].textintval).value; } +-#line 2447 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2449 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 81: +-#line 965 "parse-datetime.y" /* yacc.c:1646 */ ++#line 966 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[0].intval); } +-#line 2453 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2455 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 85: +-#line 973 "parse-datetime.y" /* yacc.c:1646 */ ++#line 974 "parse-datetime.y" /* yacc.c:1648 */ + { if (time_overflow ((yyvsp[0].textintval).value)) YYABORT; + (yyval.timespec).tv_sec = (yyvsp[0].textintval).value; (yyval.timespec).tv_nsec = 0; } +-#line 2460 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2462 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 87: +-#line 980 "parse-datetime.y" /* yacc.c:1646 */ ++#line 981 "parse-datetime.y" /* yacc.c:1648 */ + { if (time_overflow ((yyvsp[0].textintval).value)) YYABORT; + (yyval.timespec).tv_sec = (yyvsp[0].textintval).value; (yyval.timespec).tv_nsec = 0; } +-#line 2467 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2469 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 88: +-#line 986 "parse-datetime.y" /* yacc.c:1646 */ ++#line 987 "parse-datetime.y" /* yacc.c:1648 */ + { digits_to_date_time (pc, (yyvsp[0].textintval)); } +-#line 2473 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2475 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 89: +-#line 991 "parse-datetime.y" /* yacc.c:1646 */ ++#line 992 "parse-datetime.y" /* yacc.c:1648 */ + { + /* Hybrid all-digit and relative offset, so that we accept e.g., + "YYYYMMDD +N days" as well as "YYYYMMDD N days". */ + digits_to_date_time (pc, (yyvsp[-1].textintval)); + if (! apply_relative_time (pc, (yyvsp[0].rel), 1)) YYABORT; + } +-#line 2484 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2486 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 90: +-#line 1001 "parse-datetime.y" /* yacc.c:1646 */ ++#line 1002 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.intval) = -1; } +-#line 2490 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2492 "parse-datetime.c" /* yacc.c:1648 */ + break; + + case 91: +-#line 1003 "parse-datetime.y" /* yacc.c:1646 */ ++#line 1004 "parse-datetime.y" /* yacc.c:1648 */ + { (yyval.intval) = (yyvsp[0].textintval).value; } +-#line 2496 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2498 "parse-datetime.c" /* yacc.c:1648 */ + break; + + +-#line 2500 "parse-datetime.c" /* yacc.c:1646 */ ++#line 2502 "parse-datetime.c" /* yacc.c:1648 */ + default: break; + } + /* User semantic actions sometimes alter yychar, and that requires +@@ -2724,7 +2726,7 @@ yyreturn: + #endif + return yyresult; + } +-#line 1006 "parse-datetime.y" /* yacc.c:1906 */ ++#line 1007 "parse-datetime.y" /* yacc.c:1907 */ + + + static table const meridian_table[] = +@@ -3136,6 +3138,7 @@ yylex (union YYSTYPE *lvalp, parser_control *pc) + + for (;;) + { ++ ptrdiff_t count; + while (c = *pc->input, c_isspace (c)) + pc->input++; + +@@ -3253,7 +3256,7 @@ yylex (union YYSTYPE *lvalp, parser_control *pc) + if (c != '(') + return to_uchar (*pc->input++); + +- ptrdiff_t count = 0; ++ count = 0; + do + { + c = *pc->input++; +@@ -3339,12 +3342,12 @@ debug_strfdatetime (struct tm const *tm, parser_control const *pc, + if (pc && m < n && pc->zones_seen) + { + int tz = pc->time_zone; ++ char time_zone_buf[TIME_ZONE_BUFSIZE]; + + /* Account for DST if tLOCAL_ZONE was seen. */ + if (pc->local_zones_seen && !pc->zones_seen && 0 < pc->local_isdst) + tz += 60 * 60; + +- char time_zone_buf[TIME_ZONE_BUFSIZE]; + snprintf (&buf[m], n - m, " TZ=%s", time_zone_str (tz, time_zone_buf)); + } + return buf; +@@ -3442,9 +3445,10 @@ parse_datetime (struct timespec *result, char const *p, + { + char const *tzstring = getenv ("TZ"); + timezone_t tz = tzalloc (tzstring); ++ bool ok; + if (!tz) + return false; +- bool ok = parse_datetime2 (result, p, now, 0, tz, tzstring); ++ ok = parse_datetime2 (result, p, now, 0, tz, tzstring); + tzfree (tz); + return ok; + } +@@ -3471,6 +3475,12 @@ parse_datetime2 (struct timespec *result, char const *p, + Use heap allocation if TZ's length exceeds this. */ + enum { TZBUFSIZE = 100 }; + char tz1buf[TZBUFSIZE]; ++ time_t Start; ++ int Start_ns; ++ unsigned char c; ++ timezone_t tz; ++ struct tm tmp; ++ parser_control pc; + + struct timespec gettime_buffer; + if (! now) +@@ -3479,14 +3489,13 @@ parse_datetime2 (struct timespec *result, char const *p, + now = &gettime_buffer; + } + +- time_t Start = now->tv_sec; +- int Start_ns = now->tv_nsec; ++ Start = now->tv_sec; ++ Start_ns = now->tv_nsec; + +- unsigned char c; + while (c = *p, c_isspace (c)) + p++; + +- timezone_t tz = tzdefault; ++ tz = tzdefault; + + if (strncmp (p, "TZ=\"", 4) == 0) + { +@@ -3531,7 +3540,6 @@ parse_datetime2 (struct timespec *result, char const *p, + } + } + +- struct tm tmp; + if (! localtime_rz (tz, &now->tv_sec, &tmp)) + goto fail; + +@@ -3541,7 +3549,6 @@ parse_datetime2 (struct timespec *result, char const *p, + if (*p == '\0') + p = "0"; + +- parser_control pc; + pc.input = p; + pc.parse_datetime_debug = (flags & PARSE_DATETIME_DEBUG) != 0; + if (INT_ADD_WRAPV (tmp.tm_year, TM_YEAR_BASE, &pc.year.value)) +@@ -3591,11 +3598,12 @@ parse_datetime2 (struct timespec *result, char const *p, + for (quarter = 1; quarter <= 3; quarter++) + { + intmax_t iprobe; ++ time_t probe; ++ struct tm probe_tm; + if (INT_ADD_WRAPV (Start, quarter * (90 * 24 * 60 * 60), &iprobe) + || time_overflow (iprobe)) + break; +- time_t probe = iprobe; +- struct tm probe_tm; ++ probe = iprobe; + if (localtime_rz (tz, &probe, &probe_tm) && probe_tm.tm_zone + && probe_tm.tm_isdst != pc.local_time_zone_table[0].value) + { +@@ -3692,6 +3700,8 @@ parse_datetime2 (struct timespec *result, char const *p, + *result = pc.seconds; + else + { ++ char dbg_ord[DBGBUFSIZE]; ++ + if (1 < (pc.times_seen | pc.dates_seen | pc.days_seen | pc.dsts_seen + | (pc.local_zones_seen + pc.zones_seen))) + { +@@ -3783,9 +3793,10 @@ parse_datetime2 (struct timespec *result, char const *p, + by setting TZ="XXX1:00" and try mktime again. */ + + char tz2buf[sizeof "XXX" - 1 + TIME_ZONE_BUFSIZE]; ++ timezone_t tz2; + tz2buf[0] = tz2buf[1] = tz2buf[2] = 'X'; + time_zone_str (pc.time_zone, &tz2buf[3]); +- timezone_t tz2 = tzalloc (tz2buf); ++ tz2 = tzalloc (tz2buf); + if (!tz2) + { + if (pc.parse_datetime_debug) +@@ -3811,8 +3822,6 @@ parse_datetime2 (struct timespec *result, char const *p, + } + } + +- char dbg_ord[DBGBUFSIZE]; +- + if (pc.days_seen && ! pc.dates_seen) + { + intmax_t dayincr; +@@ -3868,6 +3877,7 @@ parse_datetime2 (struct timespec *result, char const *p, + /* Add relative date. */ + if (pc.rel.year | pc.rel.month | pc.rel.day) + { ++ int year, month, day; + if (pc.parse_datetime_debug) + { + if ((pc.rel.year != 0 || pc.rel.month != 0) && tm.tm_mday != 15) +@@ -3880,7 +3890,6 @@ parse_datetime2 (struct timespec *result, char const *p, + "it is recommended to specify noon\n")); + } + +- int year, month, day; + if (INT_ADD_WRAPV (tm.tm_year, pc.rel.year, &year) + || INT_ADD_WRAPV (tm.tm_mon, pc.rel.month, &month) + || INT_ADD_WRAPV (tm.tm_mday, pc.rel.day, &day)) +@@ -3951,9 +3960,9 @@ parse_datetime2 (struct timespec *result, char const *p, + && (tm.tm_mday != day + || (pc.rel.month == 0 && tm.tm_mon != month))) + { ++ char tm_year_buf[TM_YEAR_BUFSIZE]; + dbg_printf (_("warning: month/year adjustment resulted in " + "shifted dates:\n")); +- char tm_year_buf[TM_YEAR_BUFSIZE]; + dbg_printf (_(" adjusted Y M D: %s %02d %02d\n"), + tm_year_str (year, tm_year_buf), month + 1, day); + dbg_printf (_(" normalized Y M D: %s %02d %02d\n"), +@@ -4033,6 +4042,7 @@ parse_datetime2 (struct timespec *result, char const *p, + if (pc.parse_datetime_debug + && (pc.rel.hour | pc.rel.minutes | pc.rel.seconds | pc.rel.ns)) + { ++ struct tm lmt; + dbg_printf (_("after time adjustment (%+"PRIdMAX" hours, " + "%+"PRIdMAX" minutes, " + "%+"PRIdMAX" seconds, %+d ns),\n"), +@@ -4051,7 +4061,6 @@ parse_datetime2 (struct timespec *result, char const *p, + places. + + 'tm.tm_isdst' contains the date after date adjustment. */ +- struct tm lmt; + if (tm.tm_isdst != -1 && localtime_rz (tz, &result->tv_sec, &lmt) + && tm.tm_isdst != lmt.tm_isdst) + dbg_printf (_("warning: daylight saving time changed after " +@@ -4062,6 +4071,10 @@ parse_datetime2 (struct timespec *result, char const *p, + + if (pc.parse_datetime_debug) + { ++ intmax_t sec; ++ int nsec; ++ struct tm gmt, lmt; ++ bool got_utc; + /* Special case: using 'date -u' simply set TZ=UTC0 */ + if (! tzstring) + dbg_printf (_("timezone: system default\n")); +@@ -4070,13 +4083,12 @@ parse_datetime2 (struct timespec *result, char const *p, + else + dbg_printf (_("timezone: TZ=\"%s\" environment value\n"), tzstring); + +- intmax_t sec = result->tv_sec; +- int nsec = result->tv_nsec; ++ sec = result->tv_sec; ++ nsec = result->tv_nsec; + dbg_printf (_("final: %"PRIdMAX".%09d (epoch-seconds)\n"), + sec, nsec); + +- struct tm gmt, lmt; +- bool got_utc = !!gmtime_r (&result->tv_sec, &gmt); ++ got_utc = !!gmtime_r (&result->tv_sec, &gmt); + if (got_utc) + dbg_printf (_("final: %s (UTC)\n"), + debug_strfdatetime (&gmt, NULL, +-- +2.19.1 + diff --git a/sys-devel/patch/patches/patch-2.7.5.patchset b/sys-devel/patch/patches/patch-2.7.6.patchset similarity index 91% rename from sys-devel/patch/patches/patch-2.7.5.patchset rename to sys-devel/patch/patches/patch-2.7.6.patchset index 9b5774f2a..2c9c4f10d 100644 --- a/sys-devel/patch/patches/patch-2.7.5.patchset +++ b/sys-devel/patch/patches/patch-2.7.6.patchset @@ -5,7 +5,7 @@ Subject: fstatat is in sys/stat.h diff --git a/lib/symlinkat.c b/lib/symlinkat.c -index ce10d94..814b19a 100644 +index 7a663af..b6b09e2 100644 --- a/lib/symlinkat.c +++ b/lib/symlinkat.c @@ -18,6 +18,9 @@ @@ -19,5 +19,5 @@ index ce10d94..814b19a 100644 #include -- -1.8.3.4 +2.19.1