Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Jaka Kranjc (d2984804577d17438e7dcede6aaac7402b42e00d)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Jaka Kranjc (d2984804577d17438e7dcede6aaac7402b42e00d)
  • Date: Sat, 6 Dec 2008 13:39:51 -0600

GIT changes to master grimoire by Jaka Kranjc <lynxlynxlynx AT sourcemage.org>:

archive/cabextract/HISTORY | 3
archive/cabextract/PRE_BUILD | 5
archive/cabextract/cabextract_autoconf.patch | 197
+++++++++++++++++++++++++++
devel/cvs/HISTORY | 3
devel/cvs/PRE_BUILD | 3
devel/cvs/cvs_autoconf.patch | 197
+++++++++++++++++++++++++++
editors/gawk/HISTORY | 3
editors/gawk/PRE_BUILD | 5
editors/gawk/gawk_autoconf.patch | 48 ++++++
libs/gwenhywfar/HISTORY | 3
libs/gwenhywfar/PRE_BUILD | 5
libs/gwenhywfar/gwenhywfar_autoconf.patch | 48 ++++++
shell-term-fm/bash/HISTORY | 3
shell-term-fm/bash/PRE_BUILD | 3
shell-term-fm/bash/bash_autoconf.patch | 197
+++++++++++++++++++++++++++
15 files changed, 723 insertions(+)

New commits:
commit d2984804577d17438e7dcede6aaac7402b42e00d
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

gawk: fixed mktime/autoconf slowness #14635
all these by Fredrik Carlström
(cherry picked from commit 5755ca3383afe1d5e4ac4c76896cabcd287bf67c)

commit 4dc3f157ba769d0519aa49f053bce82cdc3d4389
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

cabextract: fixed mktime/autoconf slowness #14635

commit e76cecfea54f6435aee5ee9b8c08f67124314a3e
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

cvs: fixed mktime/autoconf slowness #14635

commit aee13efec290cc572d71fe00b3fd20e4a07bb648
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

gwenhyfar: fixed mktime/autoconf slowness #14635

commit 883392068f6d176fc6402e76ffbb715cf44ad080
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

bash: fixed mktime/autoconf slowness #14635

diff --git a/archive/cabextract/HISTORY b/archive/cabextract/HISTORY
index 222476d..61159e7 100644
--- a/archive/cabextract/HISTORY
+++ b/archive/cabextract/HISTORY
@@ -1,3 +1,6 @@
+2008-12-06 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * PRE_BUILD, autoconf.patch: fixed mktime/autoconf slowness #14635
+
2008-07-24 Julien "_kaze_" ROZO <julien AT rozo.org>
* DETAILS: updated version to 1.2, fixed WEB_SITE and SOURCE_URL

diff --git a/archive/cabextract/PRE_BUILD b/archive/cabextract/PRE_BUILD
new file mode 100755
index 0000000..d0bd0f1
--- /dev/null
+++ b/archive/cabextract/PRE_BUILD
@@ -0,0 +1,5 @@
+default_pre_build &&
+cd $SOURCE_DIRECTORY &&
+if grep -q "# Generated by GNU Autoconf 2.59" configure; then
+ patch -Np1 < $SCRIPT_DIRECTORY/cabextract_autoconf.patch
+fi
diff --git a/archive/cabextract/cabextract_autoconf.patch
b/archive/cabextract/cabextract_autoconf.patch
new file mode 100644
index 0000000..77cc335
--- /dev/null
+++ b/archive/cabextract/cabextract_autoconf.patch
@@ -0,0 +1,197 @@
+diff -Naur cabextract-1.2.orig/configure cabextract-1.2/configure
+--- cabextract-1.2.orig/configure 2006-09-21 01:13:24.000000000 +0200
++++ cabextract-1.2/configure 2008-10-23 21:23:56.000000000 +0200
+@@ -5299,26 +5299,25 @@
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ /* Test program from Paul Eggert and Tony Leneis. */
+-#if TIME_WITH_SYS_TIME
++#ifdef TIME_WITH_SYS_TIME
+ # include <sys/time.h>
+ # include <time.h>
+ #else
+-# if HAVE_SYS_TIME_H
++# ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ # else
+ # include <time.h>
+ # endif
+ #endif
+
+-#if HAVE_STDLIB_H
+-# include <stdlib.h>
+-#endif
++#include <limits.h>
++#include <stdlib.h>
+
+-#if HAVE_UNISTD_H
++#ifdef HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+
+-#if !HAVE_ALARM
++#ifndef HAVE_ALARM
+ # define alarm(X) /* empty */
+ #endif
+
+@@ -5335,9 +5334,9 @@
+ };
+ #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
+
+-/* Fail if mktime fails to convert a date in the spring-forward gap.
++/* Return 0 if mktime fails to convert a date in the spring-forward gap.
+ Based on a problem report from Andreas Jaeger. */
+-static void
++static int
+ spring_forward_gap ()
+ {
+ /* glibc (up to about 1998-10-07) failed this test. */
+@@ -5356,29 +5355,27 @@
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+- if (mktime (&tm) == (time_t)-1)
+- exit (1);
++ return mktime (&tm) != (time_t) -1;
+ }
+
+-static void
++static int
+ mktime_test1 (now)
+ time_t now;
+ {
+ struct tm *lt;
+- if ((lt = localtime (&now)) && mktime (lt) != now)
+- exit (1);
++ return ! (lt = localtime (&now)) || mktime (lt) == now;
+ }
+
+-static void
++static int
+ mktime_test (now)
+ time_t now;
+ {
+- mktime_test1 (now);
+- mktime_test1 ((time_t) (time_t_max - now));
+- mktime_test1 ((time_t) (time_t_min + now));
++ return (mktime_test1 (now)
++ && mktime_test1 ((time_t) (time_t_max - now))
++ && mktime_test1 ((time_t) (time_t_min + now)));
+ }
+
+-static void
++static int
+ irix_6_4_bug ()
+ {
+ /* Based on code from Ariel Faigon. */
+@@ -5391,11 +5388,10 @@
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ mktime (&tm);
+- if (tm.tm_mon != 2 || tm.tm_mday != 31)
+- exit (1);
++ return tm.tm_mon == 2 && tm.tm_mday == 31;
+ }
+
+-static void
++static int
+ bigtime_test (j)
+ int j;
+ {
+@@ -5417,8 +5413,39 @@
+ && lt->tm_wday == tm.tm_wday
+ && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
+ == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
+- exit (1);
++ return 0;
+ }
++ return 1;
++}
++
++static int
++year_2050_test ()
++{
++ /* The correct answer for 2050-02-01 00:00:00 in Pacific time,
++ ignoring leap seconds. */
++ unsigned long int answer = 2527315200UL;
++
++ struct tm tm;
++ time_t t;
++ tm.tm_year = 2050 - 1900;
++ tm.tm_mon = 2 - 1;
++ tm.tm_mday = 1;
++ tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
++ tm.tm_isdst = -1;
++
++ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
++ instead of "TZ=America/Vancouver" in order to detect the bug even
++ on systems that don't support the Olson extension, or don't have the
++ full zoneinfo tables installed. */
++ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
++
++ t = mktime (&tm);
++
++ /* Check that the result is either a failure, or close enough
++ to the correct answer that we can assume the discrepancy is
++ due to leap seconds. */
++ return (t == (time_t) -1
++ || (0 < t && answer - 120 <= t && t <= answer + 120));
+ }
+
+ int
+@@ -5432,12 +5459,15 @@
+ isn't worth using anyway. */
+ alarm (60);
+
+- for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
+- continue;
+- time_t_max--;
+- if ((time_t) -1 < 0)
+- for (time_t_min = -1; (time_t) (time_t_min * 2) < 0; time_t_min *= 2)
+- continue;
++ for (;;)
++ {
++ t = (time_t_max << 1) + 1;
++ if (t <= time_t_max)
++ break;
++ time_t_max = t;
++ }
++ time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max;
++
+ delta = time_t_max / 997; /* a suitable prime number */
+ for (i = 0; i < N_STRINGS; i++)
+ {
+@@ -5445,18 +5475,22 @@
+ putenv (tz_strings[i]);
+
+ for (t = 0; t <= time_t_max - delta; t += delta)
+- mktime_test (t);
+- mktime_test ((time_t) 1);
+- mktime_test ((time_t) (60 * 60));
+- mktime_test ((time_t) (60 * 60 * 24));
+-
+- for (j = 1; 0 < j; j *= 2)
+- bigtime_test (j);
+- bigtime_test (j - 1);
++ if (! mktime_test (t))
++ return 1;
++ if (! (mktime_test ((time_t) 1)
++ && mktime_test ((time_t) (60 * 60))
++ && mktime_test ((time_t) (60 * 60 * 24))))
++ return 1;
++
++ for (j = 1; ; j <<= 1)
++ if (! bigtime_test (j))
++ return 1;
++ else if (INT_MAX / 2 < j)
++ break;
++ if (! bigtime_test (INT_MAX))
++ return 1;
+ }
+- irix_6_4_bug ();
+- spring_forward_gap ();
+- exit (0);
++ return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ());
+ }
+ _ACEOF
+ rm -f conftest$ac_exeext
diff --git a/devel/cvs/HISTORY b/devel/cvs/HISTORY
index 1278a25..2bdcbbf 100644
--- a/devel/cvs/HISTORY
+++ b/devel/cvs/HISTORY
@@ -1,3 +1,6 @@
+2008-12-06 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * PRE_BUILD, cvs_autoconf.patch: fixed mktime/autoconf slowness #14635
+
2008-08-14 Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>
* DETAILS: updated feature version to 1.12.13

diff --git a/devel/cvs/PRE_BUILD b/devel/cvs/PRE_BUILD
index d5baa50..290939d 100755
--- a/devel/cvs/PRE_BUILD
+++ b/devel/cvs/PRE_BUILD
@@ -1,3 +1,6 @@
default_pre_build &&
cd ${SOURCE_DIRECTORY} &&
+if [[ $CVS_FEATURES == y ]] && grep -q "# Generated by GNU Autoconf 2.59"
configure; then
+ patch -Np1 < $SCRIPT_DIRECTORY/cvs_autoconf.patch
+fi &&
patch -p1 < ${SCRIPT_DIRECTORY}/cvs-insecuretemp_file.patch
diff --git a/devel/cvs/cvs_autoconf.patch b/devel/cvs/cvs_autoconf.patch
new file mode 100644
index 0000000..2936244
--- /dev/null
+++ b/devel/cvs/cvs_autoconf.patch
@@ -0,0 +1,197 @@
+diff -Naur cvs-1.12.13.orig/configure cvs-1.12.13/configure
+--- cvs-1.12.13.orig/configure 2005-10-03 15:36:42.000000000 +0200
++++ cvs-1.12.13/configure 2008-10-23 20:44:48.000000000 +0200
+@@ -13496,26 +13496,25 @@
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ /* Test program from Paul Eggert and Tony Leneis. */
+-#if TIME_WITH_SYS_TIME
++#ifdef TIME_WITH_SYS_TIME
+ # include <sys/time.h>
+ # include <time.h>
+ #else
+-# if HAVE_SYS_TIME_H
++# ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ # else
+ # include <time.h>
+ # endif
+ #endif
+
+-#if HAVE_STDLIB_H
+-# include <stdlib.h>
+-#endif
++#include <limits.h>
++#include <stdlib.h>
+
+-#if HAVE_UNISTD_H
++#ifdef HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+
+-#if !HAVE_ALARM
++#ifndef HAVE_ALARM
+ # define alarm(X) /* empty */
+ #endif
+
+@@ -13532,9 +13531,9 @@
+ };
+ #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
+
+-/* Fail if mktime fails to convert a date in the spring-forward gap.
++/* Return 0 if mktime fails to convert a date in the spring-forward gap.
+ Based on a problem report from Andreas Jaeger. */
+-static void
++static int
+ spring_forward_gap ()
+ {
+ /* glibc (up to about 1998-10-07) failed this test. */
+@@ -13553,29 +13552,27 @@
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+- if (mktime (&tm) == (time_t)-1)
+- exit (1);
++ return mktime (&tm) != (time_t) -1;
+ }
+
+-static void
++static int
+ mktime_test1 (now)
+ time_t now;
+ {
+ struct tm *lt;
+- if ((lt = localtime (&now)) && mktime (lt) != now)
+- exit (1);
++ return ! (lt = localtime (&now)) || mktime (lt) == now;
+ }
+
+-static void
++static int
+ mktime_test (now)
+ time_t now;
+ {
+- mktime_test1 (now);
+- mktime_test1 ((time_t) (time_t_max - now));
+- mktime_test1 ((time_t) (time_t_min + now));
++ return (mktime_test1 (now)
++ && mktime_test1 ((time_t) (time_t_max - now))
++ && mktime_test1 ((time_t) (time_t_min + now)));
+ }
+
+-static void
++static int
+ irix_6_4_bug ()
+ {
+ /* Based on code from Ariel Faigon. */
+@@ -13588,11 +13585,10 @@
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ mktime (&tm);
+- if (tm.tm_mon != 2 || tm.tm_mday != 31)
+- exit (1);
++ return tm.tm_mon == 2 && tm.tm_mday == 31;
+ }
+
+-static void
++static int
+ bigtime_test (j)
+ int j;
+ {
+@@ -13614,8 +13610,39 @@
+ && lt->tm_wday == tm.tm_wday
+ && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
+ == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
+- exit (1);
++ return 0;
+ }
++ return 1;
++}
++
++static int
++year_2050_test ()
++{
++ /* The correct answer for 2050-02-01 00:00:00 in Pacific time,
++ ignoring leap seconds. */
++ unsigned long int answer = 2527315200UL;
++
++ struct tm tm;
++ time_t t;
++ tm.tm_year = 2050 - 1900;
++ tm.tm_mon = 2 - 1;
++ tm.tm_mday = 1;
++ tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
++ tm.tm_isdst = -1;
++
++ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
++ instead of "TZ=America/Vancouver" in order to detect the bug even
++ on systems that don't support the Olson extension, or don't have the
++ full zoneinfo tables installed. */
++ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
++
++ t = mktime (&tm);
++
++ /* Check that the result is either a failure, or close enough
++ to the correct answer that we can assume the discrepancy is
++ due to leap seconds. */
++ return (t == (time_t) -1
++ || (0 < t && answer - 120 <= t && t <= answer + 120));
+ }
+
+ int
+@@ -13629,12 +13656,15 @@
+ isn't worth using anyway. */
+ alarm (60);
+
+- for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
+- continue;
+- time_t_max--;
+- if ((time_t) -1 < 0)
+- for (time_t_min = -1; (time_t) (time_t_min * 2) < 0; time_t_min *= 2)
+- continue;
++ for (;;)
++ {
++ t = (time_t_max << 1) + 1;
++ if (t <= time_t_max)
++ break;
++ time_t_max = t;
++ }
++ time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max;
++
+ delta = time_t_max / 997; /* a suitable prime number */
+ for (i = 0; i < N_STRINGS; i++)
+ {
+@@ -13642,18 +13672,22 @@
+ putenv (tz_strings[i]);
+
+ for (t = 0; t <= time_t_max - delta; t += delta)
+- mktime_test (t);
+- mktime_test ((time_t) 1);
+- mktime_test ((time_t) (60 * 60));
+- mktime_test ((time_t) (60 * 60 * 24));
+-
+- for (j = 1; 0 < j; j *= 2)
+- bigtime_test (j);
+- bigtime_test (j - 1);
++ if (! mktime_test (t))
++ return 1;
++ if (! (mktime_test ((time_t) 1)
++ && mktime_test ((time_t) (60 * 60))
++ && mktime_test ((time_t) (60 * 60 * 24))))
++ return 1;
++
++ for (j = 1; ; j <<= 1)
++ if (! bigtime_test (j))
++ return 1;
++ else if (INT_MAX / 2 < j)
++ break;
++ if (! bigtime_test (INT_MAX))
++ return 1;
+ }
+- irix_6_4_bug ();
+- spring_forward_gap ();
+- exit (0);
++ return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ());
+ }
+ _ACEOF
+ rm -f conftest$ac_exeext
diff --git a/editors/gawk/HISTORY b/editors/gawk/HISTORY
index 50c1a5c..b6368cb 100644
--- a/editors/gawk/HISTORY
+++ b/editors/gawk/HISTORY
@@ -1,3 +1,6 @@
+2008-12-06 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * PRE_BUILD, autoconf.patch: fixed mktime/autoconf slowness #14635
+
2007-10-26 Ladislav Hagara <hgr AT vabo.cz>
* DETAILS: 3.1.6
* PRE_BUILD, invalid-free.patch: removed
diff --git a/editors/gawk/PRE_BUILD b/editors/gawk/PRE_BUILD
new file mode 100755
index 0000000..505fb17
--- /dev/null
+++ b/editors/gawk/PRE_BUILD
@@ -0,0 +1,5 @@
+default_pre_build &&
+cd $SOURCE_DIRECTORY &&
+if grep -q "# Generated by GNU Autoconf 2.61" configure; then
+ patch -Np1 < $SCRIPT_DIRECTORY/gawk_autoconf.patch
+fi
diff --git a/editors/gawk/gawk_autoconf.patch
b/editors/gawk/gawk_autoconf.patch
new file mode 100644
index 0000000..3123a83
--- /dev/null
+++ b/editors/gawk/gawk_autoconf.patch
@@ -0,0 +1,48 @@
+diff -Naur gawk-3.1.6.orig/configure gawk-3.1.6/configure
+--- gawk-3.1.6.orig/configure 2007-10-22 08:52:03.000000000 +0200
++++ gawk-3.1.6/configure 2008-10-23 20:40:58.000000000 +0200
+@@ -10518,6 +10518,7 @@
+ # endif
+ #endif
+
++#include <limits.h>
+ #include <stdlib.h>
+
+ #ifdef HAVE_UNISTD_H
+@@ -10666,12 +10667,15 @@
+ isn't worth using anyway. */
+ alarm (60);
+
+- for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
+- continue;
+- time_t_max--;
+- if ((time_t) -1 < 0)
+- for (time_t_min = -1; (time_t) (time_t_min * 2) < 0; time_t_min *= 2)
+- continue;
++ for (;;)
++ {
++ t = (time_t_max << 1) + 1;
++ if (t <= time_t_max)
++ break;
++ time_t_max = t;
++ }
++ time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max;
++
+ delta = time_t_max / 997; /* a suitable prime number */
+ for (i = 0; i < N_STRINGS; i++)
+ {
+@@ -10686,10 +10690,12 @@
+ && mktime_test ((time_t) (60 * 60 * 24))))
+ return 1;
+
+- for (j = 1; 0 < j; j *= 2)
++ for (j = 1; ; j <<= 1)
+ if (! bigtime_test (j))
+ return 1;
+- if (! bigtime_test (j - 1))
++ else if (INT_MAX / 2 < j)
++ break;
++ if (! bigtime_test (INT_MAX))
+ return 1;
+ }
+ return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ());
diff --git a/libs/gwenhywfar/HISTORY b/libs/gwenhywfar/HISTORY
index 58c38db..4be1955 100644
--- a/libs/gwenhywfar/HISTORY
+++ b/libs/gwenhywfar/HISTORY
@@ -1,3 +1,6 @@
+2008-12-06 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * PRE_BUILD, autoconf.patch: fixed mktime/autoconf slowness #14635
+
2008-12-04 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* DETAILS: Fixed SOURCE_URL[0] and added another from the main site
updated spell to 3.5.2
diff --git a/libs/gwenhywfar/PRE_BUILD b/libs/gwenhywfar/PRE_BUILD
new file mode 100755
index 0000000..99fdfb1
--- /dev/null
+++ b/libs/gwenhywfar/PRE_BUILD
@@ -0,0 +1,5 @@
+default_pre_build &&
+cd $SOURCE_DIRECTORY &&
+if grep "# Generated by GNU Autoconf 2.61" configure > /dev/null; then
+ patch -Np1 < $SCRIPT_DIRECTORY/gwenhywfar_autoconf.patch
+fi
diff --git a/libs/gwenhywfar/gwenhywfar_autoconf.patch
b/libs/gwenhywfar/gwenhywfar_autoconf.patch
new file mode 100644
index 0000000..14512ef
--- /dev/null
+++ b/libs/gwenhywfar/gwenhywfar_autoconf.patch
@@ -0,0 +1,48 @@
+diff -Naur gwenhywfar-3.4.1.orig/configure gwenhywfar-3.4.1/configure
+--- gwenhywfar-3.4.1.orig/configure 2008-08-16 14:10:22.000000000 +0200
++++ gwenhywfar-3.4.1/configure 2008-10-23 20:54:29.000000000 +0200
+@@ -24699,6 +24699,7 @@
+ # endif
+ #endif
+
++#include <limits.h>
+ #include <stdlib.h>
+
+ #ifdef HAVE_UNISTD_H
+@@ -24847,12 +24848,15 @@
+ isn't worth using anyway. */
+ alarm (60);
+
+- for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
+- continue;
+- time_t_max--;
+- if ((time_t) -1 < 0)
+- for (time_t_min = -1; (time_t) (time_t_min * 2) < 0; time_t_min *= 2)
+- continue;
++ for (;;)
++ {
++ t = (time_t_max << 1) + 1;
++ if (t <= time_t_max)
++ break;
++ time_t_max = t;
++ }
++ time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max;
++
+ delta = time_t_max / 997; /* a suitable prime number */
+ for (i = 0; i < N_STRINGS; i++)
+ {
+@@ -24867,10 +24871,12 @@
+ && mktime_test ((time_t) (60 * 60 * 24))))
+ return 1;
+
+- for (j = 1; 0 < j; j *= 2)
++ for (j = 1; ; j <<= 1)
+ if (! bigtime_test (j))
+ return 1;
+- if (! bigtime_test (j - 1))
++ else if (INT_MAX / 2 < j)
++ break;
++ if (! bigtime_test (INT_MAX))
+ return 1;
+ }
+ return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ());
diff --git a/shell-term-fm/bash/HISTORY b/shell-term-fm/bash/HISTORY
index d11bdc0..17edf7d 100644
--- a/shell-term-fm/bash/HISTORY
+++ b/shell-term-fm/bash/HISTORY
@@ -1,3 +1,6 @@
+2008-12-06 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * PRE_BUILD, bash_autoconf.patch: fixed mktime/autoconf slowness
#14635
+
2008-10-09 Remko van der Vossen <wich AT sourcemage.org>
* POST_RESURRECT: Added, fix bug 14335
* FINAL, POST_REMOVE: install and remove shell from /etc/shells
diff --git a/shell-term-fm/bash/PRE_BUILD b/shell-term-fm/bash/PRE_BUILD
index 5a1a58d..63a20b9 100755
--- a/shell-term-fm/bash/PRE_BUILD
+++ b/shell-term-fm/bash/PRE_BUILD
@@ -43,4 +43,7 @@ patch -p0 < $SCRIPT_DIRECTORY/patches/bash32-039 &&
if [[ "$BASH_NI_LOGIN" == y ]]; then
message "${MESSAGE_COLOR}Defining
NON_INTERACTIVE_LOGIN_SHELLS.$DEFAULT_COLOR" &&
sed -i 's/\/\* \(#define NON_INTERACTIVE_LOGIN_SHELLS\) \*\//\1/'
config-top.h
+fi &&
+if grep "# Generated by GNU Autoconf 2.59" configure > /dev/null; then
+ patch -Np1 < $SCRIPT_DIRECTORY/bash_autoconf.patch
fi
diff --git a/shell-term-fm/bash/bash_autoconf.patch
b/shell-term-fm/bash/bash_autoconf.patch
new file mode 100644
index 0000000..74602b9
--- /dev/null
+++ b/shell-term-fm/bash/bash_autoconf.patch
@@ -0,0 +1,197 @@
+diff -Naur bash-3.2.orig/configure bash-3.2/configure
+--- bash-3.2.orig/configure 2006-09-26 17:06:01.000000000 +0200
++++ bash-3.2/configure 2008-10-23 20:54:55.000000000 +0200
+@@ -14344,26 +14344,25 @@
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ /* Test program from Paul Eggert and Tony Leneis. */
+-#if TIME_WITH_SYS_TIME
++#ifdef TIME_WITH_SYS_TIME
+ # include <sys/time.h>
+ # include <time.h>
+ #else
+-# if HAVE_SYS_TIME_H
++# ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ # else
+ # include <time.h>
+ # endif
+ #endif
+
+-#if HAVE_STDLIB_H
+-# include <stdlib.h>
+-#endif
++#include <limits.h>
++#include <stdlib.h>
+
+-#if HAVE_UNISTD_H
++#ifdef HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+
+-#if !HAVE_ALARM
++#ifndef HAVE_ALARM
+ # define alarm(X) /* empty */
+ #endif
+
+@@ -14380,9 +14379,9 @@
+ };
+ #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
+
+-/* Fail if mktime fails to convert a date in the spring-forward gap.
++/* Return 0 if mktime fails to convert a date in the spring-forward gap.
+ Based on a problem report from Andreas Jaeger. */
+-static void
++static int
+ spring_forward_gap ()
+ {
+ /* glibc (up to about 1998-10-07) failed this test. */
+@@ -14401,29 +14400,27 @@
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+- if (mktime (&tm) == (time_t)-1)
+- exit (1);
++ return mktime (&tm) != (time_t) -1;
+ }
+
+-static void
++static int
+ mktime_test1 (now)
+ time_t now;
+ {
+ struct tm *lt;
+- if ((lt = localtime (&now)) && mktime (lt) != now)
+- exit (1);
++ return ! (lt = localtime (&now)) || mktime (lt) == now;
+ }
+
+-static void
++static int
+ mktime_test (now)
+ time_t now;
+ {
+- mktime_test1 (now);
+- mktime_test1 ((time_t) (time_t_max - now));
+- mktime_test1 ((time_t) (time_t_min + now));
++ return (mktime_test1 (now)
++ && mktime_test1 ((time_t) (time_t_max - now))
++ && mktime_test1 ((time_t) (time_t_min + now)));
+ }
+
+-static void
++static int
+ irix_6_4_bug ()
+ {
+ /* Based on code from Ariel Faigon. */
+@@ -14436,11 +14433,10 @@
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ mktime (&tm);
+- if (tm.tm_mon != 2 || tm.tm_mday != 31)
+- exit (1);
++ return tm.tm_mon == 2 && tm.tm_mday == 31;
+ }
+
+-static void
++static int
+ bigtime_test (j)
+ int j;
+ {
+@@ -14462,8 +14458,39 @@
+ && lt->tm_wday == tm.tm_wday
+ && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
+ == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
+- exit (1);
++ return 0;
+ }
++ return 1;
++}
++
++static int
++year_2050_test ()
++{
++ /* The correct answer for 2050-02-01 00:00:00 in Pacific time,
++ ignoring leap seconds. */
++ unsigned long int answer = 2527315200UL;
++
++ struct tm tm;
++ time_t t;
++ tm.tm_year = 2050 - 1900;
++ tm.tm_mon = 2 - 1;
++ tm.tm_mday = 1;
++ tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
++ tm.tm_isdst = -1;
++
++ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
++ instead of "TZ=America/Vancouver" in order to detect the bug even
++ on systems that don't support the Olson extension, or don't have the
++ full zoneinfo tables installed. */
++ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
++
++ t = mktime (&tm);
++
++ /* Check that the result is either a failure, or close enough
++ to the correct answer that we can assume the discrepancy is
++ due to leap seconds. */
++ return (t == (time_t) -1
++ || (0 < t && answer - 120 <= t && t <= answer + 120));
+ }
+
+ int
+@@ -14477,12 +14504,15 @@
+ isn't worth using anyway. */
+ alarm (60);
+
+- for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
+- continue;
+- time_t_max--;
+- if ((time_t) -1 < 0)
+- for (time_t_min = -1; (time_t) (time_t_min * 2) < 0; time_t_min *= 2)
+- continue;
++ for (;;)
++ {
++ t = (time_t_max << 1) + 1;
++ if (t <= time_t_max)
++ break;
++ time_t_max = t;
++ }
++ time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max;
++
+ delta = time_t_max / 997; /* a suitable prime number */
+ for (i = 0; i < N_STRINGS; i++)
+ {
+@@ -14490,18 +14520,22 @@
+ putenv (tz_strings[i]);
+
+ for (t = 0; t <= time_t_max - delta; t += delta)
+- mktime_test (t);
+- mktime_test ((time_t) 1);
+- mktime_test ((time_t) (60 * 60));
+- mktime_test ((time_t) (60 * 60 * 24));
+-
+- for (j = 1; 0 < j; j *= 2)
+- bigtime_test (j);
+- bigtime_test (j - 1);
++ if (! mktime_test (t))
++ return 1;
++ if (! (mktime_test ((time_t) 1)
++ && mktime_test ((time_t) (60 * 60))
++ && mktime_test ((time_t) (60 * 60 * 24))))
++ return 1;
++
++ for (j = 1; ; j <<= 1)
++ if (! bigtime_test (j))
++ return 1;
++ else if (INT_MAX / 2 < j)
++ break;
++ if (! bigtime_test (INT_MAX))
++ return 1;
+ }
+- irix_6_4_bug ();
+- spring_forward_gap ();
+- exit (0);
++ return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ());
+ }
+ _ACEOF
+ rm -f conftest$ac_exeext



  • [SM-Commit] GIT changes to master grimoire by Jaka Kranjc (d2984804577d17438e7dcede6aaac7402b42e00d), Jaka Kranjc, 12/06/2008

Archive powered by MHonArc 2.6.24.

Top of Page