This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 3.x development tree".
The branch, master has been updated
via 095d55fa78525fef77d2ba942b25c6c05f0cbe54 (commit)
via db0513113346485f971b4eb2c56967d4f45e4ccc (commit)
via b3e61541dca0f18c9a1df5920e07288feeedea73 (commit)
via bd21b6d932681c4a7bebc6a3383ae4e9278e4356 (commit)
from d2acf4f15b628d3208bc0b64bbcbf5c966045050 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 095d55fa78525fef77d2ba942b25c6c05f0cbe54
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Sat Aug 28 10:24:50 2010 +0200
cmake: Update to 2.8.2.
commit db0513113346485f971b4eb2c56967d4f45e4ccc
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Sat Aug 28 10:01:03 2010 +0200
Revert "make: Update to 3.82."
This reverts commit c8880961daf39257167a414463d430434ee19b1d.
This seems to break the build for at least cmake and the X server.
commit b3e61541dca0f18c9a1df5920e07288feeedea73
Merge: d2acf4f bd21b6d
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Fri Aug 27 20:45:17 2010 +0200
Merge commit 'stevee/naoki-fix' into next
commit bd21b6d932681c4a7bebc6a3383ae4e9278e4356
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Fri Aug 27 20:44:32 2010 +0200
naoki: Make won't sort anymore. So we do it on our own.
-----------------------------------------------------------------------
Summary of changes:
pkgs/core/cmake/cmake.nm | 2 +-
pkgs/core/make/make.nm | 2 +-
.../make/patches/make-3.79.1-noclock_gettime.patch | 13 +
pkgs/core/make/patches/make-3.80-getcwd.patch | 15 ++
.../{make-3.82-j8k.patch => make-3.80-j8k.patch} | 13 +-
...porting.patch => make-3.81-err-reporting.patch} | 93 ++++----
pkgs/core/make/patches/make-3.81-fdleak.patch | 60 +++++
pkgs/core/make/patches/make-3.81-jobserver.patch | 18 ++
pkgs/core/make/patches/make-3.81-memory.patch | 261 ++++++++++++++++++++
pkgs/core/make/patches/make-3.81-newlines.patch | 23 ++
pkgs/core/make/patches/make-3.81-rlimit.patch | 111 +++++++++
.../make/patches/make-3.81-strcpy-overlap.patch | 16 ++
pkgs/core/make/patches/make-3.82-getcwd.patch | 14 -
pkgs/core/make/patches/make-3.82-jobserver.patch | 19 --
pkgs/core/make/patches/make-3.82-newlines.patch | 30 ---
.../make/patches/make-3.82-noclock_gettime.patch | 14 -
pkgs/core/make/patches/make-3.82-weird-shell.patch | 16 --
tools/patch | 4 +-
18 files changed, 571 insertions(+), 153 deletions(-)
create mode 100644 pkgs/core/make/patches/make-3.79.1-noclock_gettime.patch
create mode 100644 pkgs/core/make/patches/make-3.80-getcwd.patch
rename pkgs/core/make/patches/{make-3.82-j8k.patch => make-3.80-j8k.patch} (63%)
rename pkgs/core/make/patches/{make-3.82-err-reporting.patch => make-3.81-err-reporting.patch} (58%)
create mode 100644 pkgs/core/make/patches/make-3.81-fdleak.patch
create mode 100644 pkgs/core/make/patches/make-3.81-jobserver.patch
create mode 100644 pkgs/core/make/patches/make-3.81-memory.patch
create mode 100644 pkgs/core/make/patches/make-3.81-newlines.patch
create mode 100644 pkgs/core/make/patches/make-3.81-rlimit.patch
create mode 100644 pkgs/core/make/patches/make-3.81-strcpy-overlap.patch
delete mode 100644 pkgs/core/make/patches/make-3.82-getcwd.patch
delete mode 100644 pkgs/core/make/patches/make-3.82-jobserver.patch
delete mode 100644 pkgs/core/make/patches/make-3.82-newlines.patch
delete mode 100644 pkgs/core/make/patches/make-3.82-noclock_gettime.patch
delete mode 100644 pkgs/core/make/patches/make-3.82-weird-shell.patch
Difference in files:
diff --git a/pkgs/core/cmake/cmake.nm b/pkgs/core/cmake/cmake.nm
index 95982f3..458b843 100644
--- a/pkgs/core/cmake/cmake.nm
+++ b/pkgs/core/cmake/cmake.nm
@@ -25,7 +25,7 @@
include $(PKGROOT)/Include
PKG_NAME = cmake
-PKG_VER = 2.8.1
+PKG_VER = 2.8.2
PKG_REL = 0
PKG_MAINTAINER =
diff --git a/pkgs/core/make/make.nm b/pkgs/core/make/make.nm
index 694a215..d4423dd 100644
--- a/pkgs/core/make/make.nm
+++ b/pkgs/core/make/make.nm
@@ -25,7 +25,7 @@
include $(PKGROOT)/Include
PKG_NAME = make
-PKG_VER = 3.82
+PKG_VER = 3.81
PKG_REL = 0
PKG_MAINTAINER = Michael Tremer <michael.tremer(a)ipfire.org>
diff --git a/pkgs/core/make/patches/make-3.79.1-noclock_gettime.patch b/pkgs/core/make/patches/make-3.79.1-noclock_gettime.patch
new file mode 100644
index 0000000..0638849
--- /dev/null
+++ b/pkgs/core/make/patches/make-3.79.1-noclock_gettime.patch
@@ -0,0 +1,13 @@
+diff -urp make-3.81/configure make-3.81-pm/configure
+--- make-3.81/configure 2006-04-01 08:40:00.000000000 +0200
++++ make-3.81-pm/configure 2008-09-22 10:50:40.000000000 +0200
+@@ -8018,7 +8018,7 @@ fi
+ rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test "$ac_cv_search_clock_gettime" = no; then
+- for ac_lib in rt posix4; do
++ for ac_lib in posix4; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+Only in make-3.81-pm/: configure.orig
diff --git a/pkgs/core/make/patches/make-3.80-getcwd.patch b/pkgs/core/make/patches/make-3.80-getcwd.patch
new file mode 100644
index 0000000..1e54709
--- /dev/null
+++ b/pkgs/core/make/patches/make-3.80-getcwd.patch
@@ -0,0 +1,15 @@
+Only in make-3.81-pm/: configure.orig
+diff -urp make-3.81/make.h make-3.81-pm/make.h
+--- make-3.81/make.h 2006-02-16 00:54:43.000000000 +0100
++++ make-3.81-pm/make.h 2008-09-22 10:53:35.000000000 +0200
+@@ -488,7 +488,7 @@ extern long int lseek ();
+ #endif /* Not GNU C library or POSIX. */
+
+ #ifdef HAVE_GETCWD
+-# if !defined(VMS) && !defined(__DECC)
++# if !defined(VMS) && !defined(__DECC) && !defined(getcwd)
+ extern char *getcwd ();
+ # endif
+ #else
+Only in make-3.81-pm/: make.h~
+Only in make-3.81-pm/: make.h.orig
diff --git a/pkgs/core/make/patches/make-3.80-j8k.patch b/pkgs/core/make/patches/make-3.80-j8k.patch
new file mode 100644
index 0000000..1acd4f9
--- /dev/null
+++ b/pkgs/core/make/patches/make-3.80-j8k.patch
@@ -0,0 +1,23 @@
+--- make-3.80/main.c.jj 2002-08-09 21:27:17.000000000 -0400
++++ make-3.80/main.c 2004-12-13 12:48:25.000000000 -0500
+@@ -1549,6 +1549,20 @@ int main (int argc, char ** argv)
+ }
+ }
+
++#ifdef PIPE_BUF
++ if (job_slots > PIPE_BUF)
++#elif defined _POSIX_PIPE_BUF
++ if (job_slots > _POSIX_PIPE_BUF)
++#else
++ if (job_slots > 512)
++#endif
++ {
++ error (NILF,
++ _("More parallel jobs (-jN) than this platform can handle requested."));
++ error (NILF, _("Resetting to single job (-j1) mode."));
++ job_slots = 1;
++ }
++
+ /* If we have >1 slot but no jobserver-fds, then we're a top-level make.
+ Set up the pipe and install the fds option for our children. */
+
diff --git a/pkgs/core/make/patches/make-3.81-err-reporting.patch b/pkgs/core/make/patches/make-3.81-err-reporting.patch
new file mode 100644
index 0000000..eaee702
--- /dev/null
+++ b/pkgs/core/make/patches/make-3.81-err-reporting.patch
@@ -0,0 +1,152 @@
+diff -urp make-3.81/misc.c make-3.81-pm/misc.c
+--- make-3.81/misc.c 2006-04-01 08:36:40.000000000 +0200
++++ make-3.81-pm/misc.c 2008-09-22 12:45:18.000000000 +0200
+@@ -311,17 +311,31 @@ strerror (int errnum)
+ /* Print an error message from errno. */
+
+ void
++perror_with_name_err (const char *str, const char *name, int errnum)
++{
++ error (NILF, _("%s%s: %s"), str, name, strerror (errnum));
++}
++
++void
+ perror_with_name (const char *str, const char *name)
+ {
+- error (NILF, _("%s%s: %s"), str, name, strerror (errno));
++ perror_with_name_err (str, name, errno);
+ }
+
+ /* Print an error message from errno and exit. */
+
+ void
++pfatal_with_name_err (const char *name, int errnum)
++{
++ fatal (NILF, _("%s: %s"), name, strerror (errnum));
++
++ /* NOTREACHED */
++}
++
++void
+ pfatal_with_name (const char *name)
+ {
+- fatal (NILF, _("%s: %s"), name, strerror (errno));
++ pfatal_with_name_err (name, errno);
+
+ /* NOTREACHED */
+ }
+diff -urp make-3.81/main.c make-3.81-pm/main.c
+--- make-3.81/main.c 2008-09-22 12:45:07.000000000 +0200
++++ make-3.81-pm/main.c 2008-09-22 12:45:18.000000000 +0200
+@@ -1502,13 +1502,13 @@ main (int argc, char **argv, char **envp
+ strcat (template, DEFAULT_TMPFILE);
+ outfile = open_tmpfile (&stdin_nm, template);
+ if (outfile == 0)
+- pfatal_with_name (_("fopen (temporary file)"));
++ pfatal_with_name_err (_("fopen (temporary file)"), errno);
+ while (!feof (stdin) && ! ferror (stdin))
+ {
+ char buf[2048];
+ unsigned int n = fread (buf, 1, sizeof (buf), stdin);
+ if (n > 0 && fwrite (buf, 1, n, outfile) != n)
+- pfatal_with_name (_("fwrite (temporary file)"));
++ pfatal_with_name_err (_("fwrite (temporary file)"), errno);
+ }
+ (void) fclose (outfile);
+
+@@ -1681,7 +1681,7 @@ main (int argc, char **argv, char **envp
+ else if ((job_rfd = dup (job_fds[0])) < 0)
+ {
+ if (errno != EBADF)
+- pfatal_with_name (_("dup jobserver"));
++ pfatal_with_name_err (_("dup jobserver"), errno);
+
+ error (NILF,
+ _("warning: jobserver unavailable: using -j1. Add `+' to parent make rule."));
+@@ -1721,7 +1721,7 @@ main (int argc, char **argv, char **envp
+ char c = '+';
+
+ if (pipe (job_fds) < 0 || (job_rfd = dup (job_fds[0])) < 0)
+- pfatal_with_name (_("creating jobs pipe"));
++ pfatal_with_name_err (_("creating jobs pipe"), errno);
+
+ /* Every make assumes that it always has one job it can run. For the
+ submakes it's the token they were given by their parent. For the
+@@ -1736,7 +1736,7 @@ main (int argc, char **argv, char **envp
+
+ EINTRLOOP (r, write (job_fds[1], &c, 1));
+ if (r != 1)
+- pfatal_with_name (_("init jobserver pipe"));
++ pfatal_with_name_err (_("init jobserver pipe"), errno);
+ }
+
+ /* Fill in the jobserver_fds struct for our children. */
+@@ -2151,7 +2151,7 @@ main (int argc, char **argv, char **envp
+ /* If there is a temp file from reading a makefile from stdin, get rid of
+ it now. */
+ if (stdin_nm && unlink (stdin_nm) < 0 && errno != ENOENT)
+- perror_with_name (_("unlink (temporary file): "), stdin_nm);
++ perror_with_name_err (_("unlink (temporary file): "), stdin_nm, errno);
+
+ {
+ int status;
+diff -urp make-3.81/make.h make-3.81-pm/make.h
+--- make-3.81/make.h 2008-09-22 12:45:07.000000000 +0200
++++ make-3.81-pm/make.h 2008-09-22 12:45:18.000000000 +0200
+@@ -414,6 +414,8 @@ extern void die PARAMS ((int)) __attribu
+ extern void log_working_directory PARAMS ((int));
+ extern void pfatal_with_name PARAMS ((const char *)) __attribute__ ((noreturn));
+ extern void perror_with_name PARAMS ((const char *, const char *));
++extern void pfatal_with_name_err PARAMS ((const char *, int errnum)) __attribute__ ((noreturn));
++extern void perror_with_name_err PARAMS ((const char *, const char *, int errnum));
+ extern char *savestring PARAMS ((const char *, unsigned int));
+ extern char *concat PARAMS ((const char *, const char *, const char *));
+ extern char *xmalloc PARAMS ((unsigned int));
+diff -urp make-3.81/job.c make-3.81-pm/job.c
+--- make-3.81/job.c 2006-03-20 04:03:04.000000000 +0100
++++ make-3.81-pm/job.c 2008-09-22 12:45:18.000000000 +0200
+@@ -859,7 +859,7 @@ free_child (struct child *child)
+
+ EINTRLOOP (r, write (job_fds[1], &token, 1));
+ if (r != 1)
+- pfatal_with_name (_("write jobserver"));
++ pfatal_with_name_err (_("write jobserver"), errno);
+
+ DB (DB_JOBS, (_("Released token for child 0x%08lx (%s).\n"),
+ (unsigned long int) child, child->file->name));
+@@ -1699,6 +1699,7 @@ new_job (struct file *file)
+
+ /* Set interruptible system calls, and read() for a job token. */
+ set_child_handler_action_flags (1, waiting_jobs != NULL);
++ errno = 0;
+ got_token = read (job_rfd, &token, 1);
+ saved_errno = errno;
+ set_child_handler_action_flags (0, waiting_jobs != NULL);
+@@ -1713,10 +1714,14 @@ new_job (struct file *file)
+
+ /* If the error _wasn't_ expected (EINTR or EBADF), punt. Otherwise,
+ go back and reap_children(), and try again. */
+- errno = saved_errno;
+- if (errno != EINTR && errno != EBADF)
+- pfatal_with_name (_("read jobs pipe"));
+- if (errno == EBADF)
++ if (saved_errno != EINTR && saved_errno != EBADF)
++ {
++ if (got_token == 0)
++ fatal (NILF, _("read jobs pipe EOF"));
++ else
++ pfatal_with_name_err (_("read jobs pipe"), saved_errno);
++ }
++ if (saved_errno == EBADF)
+ DB (DB_JOBS, ("Read returned EBADF.\n"));
+ }
+ #endif
+@@ -1831,7 +1836,7 @@ load_too_high (void)
+ error (NILF,
+ _("cannot enforce load limits on this operating system"));
+ else
+- perror_with_name (_("cannot enforce load limit: "), "getloadavg");
++ perror_with_name_err (_("cannot enforce load limit: "), "getloadavg", errno);
+ }
+ lossage = errno;
+ load = 0;
diff --git a/pkgs/core/make/patches/make-3.81-fdleak.patch b/pkgs/core/make/patches/make-3.81-fdleak.patch
new file mode 100644
index 0000000..442ee54
--- /dev/null
+++ b/pkgs/core/make/patches/make-3.81-fdleak.patch
@@ -0,0 +1,60 @@
+diff -urp make-3.81/read.c make-3.81-leak/read.c
+--- make-3.81/read.c 2006-03-17 15:24:20.000000000 +0100
++++ make-3.81-leak/read.c 2008-09-16 16:43:12.000000000 +0200
+@@ -296,6 +300,37 @@ restore_conditionals (struct conditional
+ conditionals = saved;
+ }
+
++/* If possible, open the file and mark it close-on-exec, so that make
++ doesn't leak the descriptor to binaries called via $(shell ...).*/
++static FILE *
++open_makefile (char *filename)
++{
++ FILE *fp;
++
++#if HAVE_FDOPEN
++ int fd = open (filename, O_RDONLY);
++ int save;
++ if (fd < 0)
++ return NULL;
++
++ fp = fdopen (fd, "r");
++ if (fp == NULL)
++ {
++ save = errno;
++ close (fd);
++ errno = save;
++ return NULL;
++ }
++
++ CLOSE_ON_EXEC (fd);
++
++#else
++ fp = fopen (filename, "r");
++#endif
++
++ return fp;
++}
++
+ static int
+ eval_makefile (char *filename, int flags)
+ {
+@@ -335,7 +376,8 @@ eval_makefile (char *filename, int flags
+ filename = expanded;
+ }
+
+- ebuf.fp = fopen (filename, "r");
++ ebuf.fp = open_makefile (filename);
++
+ /* Save the error code so we print the right message later. */
+ makefile_errno = errno;
+
+@@ -348,7 +390,7 @@ eval_makefile (char *filename, int flags
+ for (i = 0; include_directories[i] != 0; ++i)
+ {
+ included = concat (include_directories[i], "/", filename);
+- ebuf.fp = fopen (included, "r");
++ ebuf.fp = open_makefile (included);
+ if (ebuf.fp)
+ {
+ filename = included;
diff --git a/pkgs/core/make/patches/make-3.81-jobserver.patch b/pkgs/core/make/patches/make-3.81-jobserver.patch
new file mode 100644
index 0000000..df65107
--- /dev/null
+++ b/pkgs/core/make/patches/make-3.81-jobserver.patch
@@ -0,0 +1,18 @@
+diff -urp make-3.81/main.c make-3.81-pm/main.c
+--- make-3.81/main.c 2007-09-24 15:28:34.000000000 +0200
++++ make-3.81-pm/main.c 2007-09-24 15:32:50.000000000 +0200
+@@ -1669,8 +1669,12 @@ main (int argc, char **argv, char **envp
+
+ if (job_slots > 0)
+ {
+- close (job_fds[0]);
+- close (job_fds[1]);
++ if (restarts == 0)
++ {
++ close (job_fds[0]);
++ close (job_fds[1]);
++ }
++
+ job_fds[0] = job_fds[1] = -1;
+ free (jobserver_fds->list);
+ free (jobserver_fds);
diff --git a/pkgs/core/make/patches/make-3.81-memory.patch b/pkgs/core/make/patches/make-3.81-memory.patch
new file mode 100644
index 0000000..7a7bf9f
--- /dev/null
+++ b/pkgs/core/make/patches/make-3.81-memory.patch
@@ -0,0 +1,261 @@
+diff -Bburpd make-3.81_orig/file.c make-3.81/file.c
+--- make-3.81_orig/file.c 2006-05-23 13:59:11.000000000 +0200
++++ make-3.81/file.c 2006-05-23 14:39:34.000000000 +0200
+@@ -490,7 +490,7 @@ expand_deps (struct file *f)
+
+ o = subst_expand (buffer, d->name, "%", "$*", 1, 2, 0);
+
+- free (d->name);
++ hash_strfree (d->name);
+ d->name = savestring (buffer, o - buffer);
+ d->staticpattern = 0; /* Clear staticpattern so that we don't
+ re-expand %s below. */
+@@ -549,7 +549,7 @@ expand_deps (struct file *f)
+ dp->name[0] = '\0';
+ else
+ {
+- free (dp->name);
++ hash_strfree (dp->name);
+ dp->name = savestring (buffer, o - buffer);
+ }
+ }
+@@ -580,7 +580,7 @@ expand_deps (struct file *f)
+ if (d1->file == 0)
+ d1->file = enter_file (d1->name);
+ else
+- free (d1->name);
++ hash_strfree (d1->name);
+ d1->name = 0;
+ d1->staticpattern = 0;
+ d1->need_2nd_expansion = 0;
+Only in make-3.81: file.c~
+diff -Bburpd make-3.81_orig/implicit.c make-3.81/implicit.c
+--- make-3.81_orig/implicit.c 2006-05-23 13:59:11.000000000 +0200
++++ make-3.81/implicit.c 2006-05-23 14:40:01.000000000 +0200
+@@ -864,7 +864,7 @@ pattern_search (struct file *file, int a
+ dep->file = enter_file (dep->name);
+ /* enter_file uses dep->name _if_ we created a new file. */
+ if (dep->name != dep->file->name)
+- free (dep->name);
++ hash_strfree (dep->name);
+ dep->name = 0;
+ dep->file->tried_implicit |= dep->changed;
+ }
+Only in make-3.81: implicit.c~
+diff -Bburpd make-3.81_orig/main.c make-3.81/main.c
+--- make-3.81_orig/main.c 2006-05-23 13:59:11.000000000 +0200
++++ make-3.81/main.c 2006-05-23 14:40:49.000000000 +0200
+@@ -540,6 +540,7 @@ initialize_global_hash_tables (void)
+ init_hash_files ();
+ hash_init_directories ();
+ hash_init_function_table ();
++ init_hash_strings ();
+ }
+
+ static struct file *
+Only in make-3.81: main.c~
+diff -Bburpd make-3.81_orig/make.h make-3.81/make.h
+--- make-3.81_orig/make.h 2006-05-23 13:59:11.000000000 +0200
++++ make-3.81/make.h 2006-05-23 14:41:21.000000000 +0200
+@@ -431,6 +431,11 @@ extern void print_spaces PARAMS ((unsign
+ extern char *find_percent PARAMS ((char *));
+ extern FILE *open_tmpfile PARAMS ((char **, const char *));
+
++extern void init_hash_strings PARAMS ((void));
++extern char *hash_strdup PARAMS ((const char *));
++extern char *hash_savestring PARAMS ((const char *, unsigned int));
++extern void hash_strfree PARAMS ((char *));
++
+ #ifndef NO_ARCHIVES
+ extern int ar_name PARAMS ((char *));
+ extern void ar_parse_name PARAMS ((char *, char **, char **));
+Only in make-3.81: make.h~
+diff -Bburpd make-3.81_orig/misc.c make-3.81/misc.c
+--- make-3.81_orig/misc.c 2006-05-23 13:59:11.000000000 +0200
++++ make-3.81/misc.c 2006-05-23 14:42:59.000000000 +0200
+@@ -16,8 +16,10 @@ You should have received a copy of the G
+ GNU Make; see the file COPYING. If not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
+
++#include <assert.h>
+ #include "make.h"
+ #include "dep.h"
++#include "hash.h"
+ #include "debug.h"
+
+ /* Variadic functions. We go through contortions to allow proper function
+@@ -511,7 +513,7 @@ void
+ free_dep (struct dep *d)
+ {
+ if (d->name != 0)
+- free (d->name);
++ hash_strfree (d->name);
+
+ if (d->stem != 0)
+ free (d->stem);
+@@ -535,7 +537,7 @@ copy_dep_chain (const struct dep *d)
+ bcopy ((char *) d, (char *) c, sizeof (struct dep));
+
+ if (c->name != 0)
+- c->name = xstrdup (c->name);
++ c->name = hash_strdup (c->name);
+ if (c->stem != 0)
+ c->stem = xstrdup (c->stem);
+
+@@ -909,3 +911,154 @@ close_stdout (void)
+ exit (EXIT_FAILURE);
+ }
+ }
++
++/* Hash table of duplicated strings. */
++
++struct hash_string
++{
++ char *string;
++ unsigned int count;
++};
++
++static unsigned long
++string_hash_1 (key)
++ const void *key;
++{
++ return_ISTRING_HASH_1 (((const struct hash_string *) key)->string);
++}
++
++static unsigned long
++string_hash_2 (key)
++ const void *key;
++{
++ return_ISTRING_HASH_2 (((const struct hash_string *) key)->string);
++}
++
++static int
++string_hash_cmp (x, y)
++ const void *x;
++ const void *y;
++{
++ return_ISTRING_COMPARE (((const struct hash_string *) x)->string,
++ ((const struct hash_string *) y)->string);
++}
++
++static struct hash_table strings;
++
++void
++init_hash_strings ()
++{
++ hash_init (&strings, 1000, string_hash_1, string_hash_2,
++ string_hash_cmp);
++}
++
++/* Keep track duplicated string and return the old one if exists. */
++
++char *
++hash_strdup (ptr)
++ const char *ptr;
++{
++ struct hash_string *h, key;
++
++ if (*ptr == '\0')
++ return "";
++
++ key.string = (char *) ptr;
++ key.count = 0;
++ h = (struct hash_string *) hash_find_item (&strings, &key);
++ if (h == NULL)
++ {
++ char *result = (char *) malloc (strlen (ptr) + 1);
++
++ if (result == NULL)
++ fatal (NILF, _("virtual memory exhausted"));
++
++ strcpy (result, ptr);
++
++ h = (struct hash_string *) malloc (sizeof (struct hash_string));
++ if (h == NULL)
++ fatal (NILF, _("virtual memory exhausted"));
++
++ h->string = result;
++ h->count = 1;
++ hash_insert (&strings, h);
++ }
++ else
++ {
++ h->count++;
++ assert (h->count != 0);
++ }
++
++ return h->string;
++}
++
++char *
++hash_savestring (str, length)
++ const char *str;
++ unsigned int length;
++{
++ struct hash_string *h, key;
++
++ if (length == 0 || *str == '\0')
++ return "";
++
++ key.string = alloca (length + 1);
++ key.count = 0;
++ bcopy (str, key.string, length);
++ key.string [length] = '\0';
++
++ h = (struct hash_string *) hash_find_item (&strings, &key);
++ if (h == NULL)
++ {
++ char *out = (char *) xmalloc (length + 1);
++ bcopy (str, out, length);
++ out[length] = '\0';
++
++ h = (struct hash_string *) malloc (sizeof (struct hash_string));
++ if (h == NULL)
++ fatal (NILF, _("virtual memory exhausted"));
++
++ h->string = out;
++ h->count = 1;
++ hash_insert (&strings, h);
++ }
++ else
++ {
++ h->count++;
++ assert (h->count != 0);
++ }
++
++ return h->string;
++}
++
++void
++hash_strfree (ptr)
++ char *ptr;
++{
++ struct hash_string *h, key;
++
++ if (*ptr == '\0')
++ return;
++
++ key.string = ptr;
++ key.count = 0;
++ h = (struct hash_string *) hash_find_item (&strings, &key);
++
++ /* Check if string comes from hash_strdup or hash_savestring. */
++ if (h == NULL || h->string != ptr)
++ {
++ free (ptr);
++ return;
++ }
++
++ h->count--;
++ if (h->count == 0)
++ {
++ struct hash_string *d;
++
++ d = hash_delete (&strings, h);
++ assert (d == h);
++ free (h->string);
++ free (h);
++ }
++}
+Only in make-3.81: misc.c~
+Only in make-3.81: read.c~
diff --git a/pkgs/core/make/patches/make-3.81-newlines.patch b/pkgs/core/make/patches/make-3.81-newlines.patch
new file mode 100644
index 0000000..d9bb313
--- /dev/null
+++ b/pkgs/core/make/patches/make-3.81-newlines.patch
@@ -0,0 +1,23 @@
+--- make-3.81-orig/job.c 2007-02-21 19:10:54.000000000 +0100
++++ make-3.81-pm/job.c 2007-02-22 18:13:59.000000000 +0100
+@@ -2706,7 +2706,7 @@
+ unsigned int line_len = strlen (line);
+
+ char *new_line = (char *) alloca (shell_len + (sizeof (minus_c) - 1)
+- + (line_len * 2) + 1);
++ + (line_len * 4) + 1);
+ char *command_ptr = NULL; /* used for batch_mode_shell mode */
+
+ # ifdef __EMX__ /* is this necessary? */
+@@ -2740,9 +2740,10 @@
+ #endif
+ if (PRESERVE_BSNL)
+ {
+- *(ap++) = '\\';
++ *(ap++) = '\'';
+ *(ap++) = '\\';
+ *(ap++) = '\n';
++ *(ap++) = '\'';
+ }
+
+ ++p;
diff --git a/pkgs/core/make/patches/make-3.81-rlimit.patch b/pkgs/core/make/patches/make-3.81-rlimit.patch
new file mode 100644
index 0000000..f88f0fe
--- /dev/null
+++ b/pkgs/core/make/patches/make-3.81-rlimit.patch
@@ -0,0 +1,111 @@
+diff -urp make-3.81/job.c make-3.81-pm/job.c
+--- make-3.81/job.c 2008-03-25 18:15:38.000000000 +0100
++++ make-3.81-pm/job.c 2008-03-25 17:51:11.000000000 +0100
+@@ -2079,6 +2079,9 @@ exec_command (char **argv, char **envp)
+ # else
+
+ /* Run the program. */
++#ifdef SET_STACK_SIZE
++ restore_original_stack_rlimit ();
++#endif
+ environ = envp;
+ execvp (argv[0], argv);
+
+diff -urp make-3.81/main.c make-3.81-pm/main.c
+--- make-3.81/main.c 2008-03-25 18:15:38.000000000 +0100
++++ make-3.81-pm/main.c 2008-03-25 18:14:04.000000000 +0100
+@@ -44,12 +44,53 @@ Foundation, Inc., 51 Franklin St, Fifth
+ # include <fcntl.h>
+ #endif
+
+-#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
+-# define SET_STACK_SIZE
+-#endif
+-
+ #ifdef SET_STACK_SIZE
+ # include <sys/resource.h>
++/* Whether the rlimit was set successfuly */
++static int setrlimit_succeeded = 0;
++/* Original rlim_cur */
++static rlim_t setrlimit_orig_cur = 0;
++
++/* Get rid of any avoidable limit on stack size so that alloca does
++ not fail. */
++void
++set_max_stack_rlimit (void)
++{
++ struct rlimit rlim;
++
++ /* Back off if the limit is still set, probably due to failure in
++ restore_original_stack_rlimit. */
++ if (setrlimit_succeeded)
++ return;
++
++ if (getrlimit (RLIMIT_STACK, &rlim) == 0)
++ {
++ setrlimit_orig_cur = rlim.rlim_cur;
++ rlim.rlim_cur = rlim.rlim_max;
++ if (setrlimit (RLIMIT_STACK, &rlim) != -1)
++ setrlimit_succeeded = 1;
++ }
++}
++
++/* Set the rlimit back to its original value. To be called before
++ process spawn. */
++void
++restore_original_stack_rlimit (void)
++{
++ struct rlimit rlim;
++
++ if (!setrlimit_succeeded)
++ return;
++
++ if (getrlimit (RLIMIT_STACK, &rlim) == 0)
++ {
++ rlim.rlim_cur = setrlimit_orig_cur;
++ setrlimit (RLIMIT_STACK, &rlim);
++ /* Don't reset the setrlimit_succeeded flag. This can be called
++ after vfork, in which case the flag is in memory shared with
++ the parent. */
++ }
++}
+ #endif
+
+ #ifdef _AMIGA
+@@ -915,17 +956,7 @@ main (int argc, char **argv, char **envp
+ #endif
+
+ #ifdef SET_STACK_SIZE
+- /* Get rid of any avoidable limit on stack size. */
+- {
+- struct rlimit rlim;
+-
+- /* Set the stack limit huge so that alloca does not fail. */
+- if (getrlimit (RLIMIT_STACK, &rlim) == 0)
+- {
+- rlim.rlim_cur = rlim.rlim_max;
+- setrlimit (RLIMIT_STACK, &rlim);
+- }
+- }
++ set_max_stack_rlimit ();
+ #endif
+
+ #ifdef HAVE_ATEXIT
+diff -urp make-3.81/make.h make-3.81-pm/make.h
+--- make-3.81/make.h 2008-03-25 18:15:38.000000000 +0100
++++ make-3.81-pm/make.h 2008-03-25 17:51:10.000000000 +0100
+@@ -346,6 +346,13 @@ extern int strcmpi (const char *,const c
+ #define N_(msgid) gettext_noop (msgid)
+ #define S_(msg1,msg2,num) ngettext (msg1,msg2,num)
+
++/* Handle rlimit */
++#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
++# define SET_STACK_SIZE
++void set_max_stack_rlimit (void);
++void restore_original_stack_rlimit (void);
++#endif
++
+ /* Handle other OSs. */
+ #if defined(HAVE_DOS_PATHS)
+ # define PATH_SEPARATOR_CHAR ';'
+diff -urp make-3.81/w32/Makefile make-3.81-pm/w32/Makefile
diff --git a/pkgs/core/make/patches/make-3.81-strcpy-overlap.patch b/pkgs/core/make/patches/make-3.81-strcpy-overlap.patch
new file mode 100644
index 0000000..d045737
--- /dev/null
+++ b/pkgs/core/make/patches/make-3.81-strcpy-overlap.patch
@@ -0,0 +1,16 @@
+Index: job.c
+===================================================================
+RCS file: /sources/make/make/job.c,v
+retrieving revision 1.193
+diff -u -r1.193 job.c
+--- a/job.c 9 Jun 2009 15:35:38 -0000 1.193
++++ b/job.c 31 Jul 2009 11:42:16 -0000
+@@ -1600,7 +1600,7 @@
+ /* There are no more references in this line to worry about.
+ Copy the remaining uninteresting text to the output. */
+ if (out != in)
+- strcpy (out, in);
++ memmove (out, in, strlen (in) + 1);
+
+ /* Finally, expand the line. */
+ lines[i] = allocated_variable_expand_for_file (cmds->command_lines[i],
diff --git a/pkgs/core/make/patches/make-3.82-err-reporting.patch b/pkgs/core/make/patches/make-3.82-err-reporting.patch
deleted file mode 100644
index 2f5b3c6..0000000
--- a/pkgs/core/make/patches/make-3.82-err-reporting.patch
+++ /dev/null
@@ -1,157 +0,0 @@
-diff -urp make-3.82/misc.c make-3.82-pm/misc.c
---- make-3.82/misc.c 2010-07-19 09:10:54.000000000 +0200
-+++ make-3.82-pm/misc.c 2010-08-11 15:26:45.000000000 +0200
-@@ -342,17 +342,31 @@ strerror (int errnum)
- /* Print an error message from errno. */
-
- void
-+perror_with_name_err (const char *str, const char *name, int errnum)
-+{
-+ error (NILF, _("%s%s: %s"), str, name, strerror (errnum));
-+}
-+
-+void
- perror_with_name (const char *str, const char *name)
- {
-- error (NILF, _("%s%s: %s"), str, name, strerror (errno));
-+ perror_with_name_err (str, name, errno);
- }
-
- /* Print an error message from errno and exit. */
-
- void
-+pfatal_with_name_err (const char *name, int errnum)
-+{
-+ fatal (NILF, _("%s: %s"), name, strerror (errnum));
-+
-+ /* NOTREACHED */
-+}
-+
-+void
- pfatal_with_name (const char *name)
- {
-- fatal (NILF, _("%s: %s"), name, strerror (errno));
-+ pfatal_with_name_err (name, errno);
-
- /* NOTREACHED */
- }
-diff -urp make-3.82/main.c make-3.82-pm/main.c
---- make-3.82/main.c 2010-08-11 15:34:12.000000000 +0200
-+++ make-3.82-pm/main.c 2010-08-11 15:30:11.000000000 +0200
-@@ -1536,13 +1536,13 @@ main (int argc, char **argv, char **envp
- strcat (template, DEFAULT_TMPFILE);
- outfile = open_tmpfile (&stdin_nm, template);
- if (outfile == 0)
-- pfatal_with_name (_("fopen (temporary file)"));
-+ pfatal_with_name_err (_("fopen (temporary file)"), errno);
- while (!feof (stdin) && ! ferror (stdin))
- {
- char buf[2048];
- unsigned int n = fread (buf, 1, sizeof (buf), stdin);
- if (n > 0 && fwrite (buf, 1, n, outfile) != n)
-- pfatal_with_name (_("fwrite (temporary file)"));
-+ pfatal_with_name_err (_("fwrite (temporary file)"), errno);
- }
- fclose (outfile);
-
-@@ -1747,7 +1747,7 @@ main (int argc, char **argv, char **envp
- else if ((job_rfd = dup (job_fds[0])) < 0)
- {
- if (errno != EBADF)
-- pfatal_with_name (_("dup jobserver"));
-+ pfatal_with_name_err (_("dup jobserver"), errno);
-
- error (NILF,
- _("warning: jobserver unavailable: using -j1. Add `+' to parent make rule."));
-@@ -1788,7 +1788,7 @@ main (int argc, char **argv, char **envp
- char c = '+';
-
- if (pipe (job_fds) < 0 || (job_rfd = dup (job_fds[0])) < 0)
-- pfatal_with_name (_("creating jobs pipe"));
-+ pfatal_with_name_err (_("creating jobs pipe"), errno);
-
- /* Every make assumes that it always has one job it can run. For the
- submakes it's the token they were given by their parent. For the
-@@ -1803,7 +1803,7 @@ main (int argc, char **argv, char **envp
-
- EINTRLOOP (r, write (job_fds[1], &c, 1));
- if (r != 1)
-- pfatal_with_name (_("init jobserver pipe"));
-+ pfatal_with_name_err (_("init jobserver pipe"), errno);
- }
-
- /* Fill in the jobserver_fds struct for our children. */
-@@ -2226,7 +2226,7 @@ main (int argc, char **argv, char **envp
- /* If there is a temp file from reading a makefile from stdin, get rid of
- it now. */
- if (stdin_nm && unlink (stdin_nm) < 0 && errno != ENOENT)
-- perror_with_name (_("unlink (temporary file): "), stdin_nm);
-+ perror_with_name_err (_("unlink (temporary file): "), stdin_nm, errno);
-
- /* If there were no command-line goals, use the default. */
- if (goals == 0)
-Только в make-3.82-pm: job.c~
-Только в make-3.82-pm: main.c~
-diff -urp make-3.82/make.h make-3.82-pm/make.h
---- make-3.82/make.h 2010-08-11 15:34:12.000000000 +0200
-+++ make-3.82-pm/make.h 2010-08-11 15:31:26.000000000 +0200
-@@ -385,6 +385,8 @@ void die (int) __attribute__ ((noreturn)
- void log_working_directory (int);
- void pfatal_with_name (const char *) __attribute__ ((noreturn));
- void perror_with_name (const char *, const char *);
-+void pfatal_with_name_err (const char *, int errnum) __attribute__ ((noreturn));
-+void perror_with_name_err (const char *, const char *, int errnum);
- void *xmalloc (unsigned int);
- void *xcalloc (unsigned int);
- void *xrealloc (void *, unsigned int);
-diff -urp make-3.82/job.c make-3.82-pm/job.c
---- make-3.82/job.c 2010-07-24 10:27:50.000000000 +0200
-+++ make-3.82-pm/job.c 2010-08-11 15:33:54.000000000 +0200
-@@ -917,7 +917,7 @@ free_child (struct child *child)
-
- EINTRLOOP (r, write (job_fds[1], &token, 1));
- if (r != 1)
-- pfatal_with_name (_("write jobserver"));
-+ pfatal_with_name_err (_("write jobserver"), errno);
-
- DB (DB_JOBS, (_("Released token for child %p (%s).\n"),
- child, child->file->name));
-@@ -1768,6 +1768,7 @@ new_job (struct file *file)
-
- /* Set interruptible system calls, and read() for a job token. */
- set_child_handler_action_flags (1, waiting_jobs != NULL);
-+ errno = 0;
- got_token = read (job_rfd, &token, 1);
- saved_errno = errno;
- set_child_handler_action_flags (0, waiting_jobs != NULL);
-@@ -1782,10 +1783,14 @@ new_job (struct file *file)
-
- /* If the error _wasn't_ expected (EINTR or EBADF), punt. Otherwise,
- go back and reap_children(), and try again. */
-- errno = saved_errno;
-- if (errno != EINTR && errno != EBADF)
-- pfatal_with_name (_("read jobs pipe"));
-- if (errno == EBADF)
-+ if (saved_errno != EINTR && saved_errno != EBADF)
-+ {
-+ if (got_token == 0)
-+ fatal (NILF, _("read jobs pipe EOF"));
-+ else
-+ pfatal_with_name_err (_("read jobs pipe"), saved_errno);
-+ }
-+ if (saved_errno == EBADF)
- DB (DB_JOBS, ("Read returned EBADF.\n"));
- }
- #endif
-@@ -1909,7 +1914,8 @@ load_too_high (void)
- error (NILF,
- _("cannot enforce load limits on this operating system"));
- else
-- perror_with_name (_("cannot enforce load limit: "), "getloadavg");
-+ perror_with_name_err (_("cannot enforce load limit: "),
-+ "getloadavg", errno);
- }
- lossage = errno;
- load = 0;
-Только в make-3.82-pm: make.h~
-Только в make-3.82-pm: misc.c.orig
diff --git a/pkgs/core/make/patches/make-3.82-getcwd.patch b/pkgs/core/make/patches/make-3.82-getcwd.patch
deleted file mode 100644
index b688732..0000000
--- a/pkgs/core/make/patches/make-3.82-getcwd.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -up make-3.82/make.h\~ make-3.82/make.h
---- make-3.82/make.h~ 2010-07-20 15:12:06.000000000 +0200
-+++ make-3.82/make.h 2010-08-11 15:19:09.000000000 +0200
-@@ -472,7 +472,7 @@ long int lseek ();
- #endif /* Not GNU C library or POSIX. */
-
- #ifdef HAVE_GETCWD
--# if !defined(VMS) && !defined(__DECC)
-+# if !defined(VMS) && !defined(__DECC) && !defined(getcwd)
- char *getcwd ();
- # endif
- #else
-
-Diff finished. Wed Aug 11 15:19:12 2010
diff --git a/pkgs/core/make/patches/make-3.82-j8k.patch b/pkgs/core/make/patches/make-3.82-j8k.patch
deleted file mode 100644
index b5fa357..0000000
--- a/pkgs/core/make/patches/make-3.82-j8k.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff -up make-3.82/main.c\~ make-3.82/main.c
---- make-3.82/main.c~ 2010-07-19 09:10:53.000000000 +0200
-+++ make-3.82/main.c 2010-08-11 15:12:09.000000000 +0200
-@@ -1765,6 +1765,20 @@ main (int argc, char **argv, char **envp
- }
- }
-
-+#ifdef PIPE_BUF
-+ if (job_slots > PIPE_BUF)
-+#elif defined _POSIX_PIPE_BUF
-+ if (job_slots > _POSIX_PIPE_BUF)
-+#else
-+ if (job_slots > 512)
-+#endif
-+ {
-+ error (NILF,
-+ _("More parallel jobs (-jN) than this platform can handle requested."));
-+ error (NILF, _("Resetting to single job (-j1) mode."));
-+ job_slots = 1;
-+ }
-+
- /* If we have >1 slot but no jobserver-fds, then we're a top-level make.
- Set up the pipe and install the fds option for our children. */
-
-
-Diff finished. Wed Aug 11 15:12:32 2010
diff --git a/pkgs/core/make/patches/make-3.82-jobserver.patch b/pkgs/core/make/patches/make-3.82-jobserver.patch
deleted file mode 100644
index 2a85503..0000000
--- a/pkgs/core/make/patches/make-3.82-jobserver.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -up make-3.82/main.c\~ make-3.82/main.c
---- make-3.82/main.c~ 2010-08-12 14:59:20.000000000 +0200
-+++ make-3.82/main.c 2010-08-12 15:00:07.000000000 +0200
-@@ -1756,8 +1756,11 @@ main (int argc, char **argv, char **envp
-
- if (job_slots > 0)
- {
-- close (job_fds[0]);
-- close (job_fds[1]);
-+ if (restarts == 0)
-+ {
-+ close (job_fds[0]);
-+ close (job_fds[1]);
-+ }
- job_fds[0] = job_fds[1] = -1;
- free (jobserver_fds->list);
- free (jobserver_fds);
-
-Diff finished. Thu Aug 12 15:00:22 2010
diff --git a/pkgs/core/make/patches/make-3.82-newlines.patch b/pkgs/core/make/patches/make-3.82-newlines.patch
deleted file mode 100644
index d86018a..0000000
--- a/pkgs/core/make/patches/make-3.82-newlines.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff -up make-3.82/job.c\~ make-3.82/job.c
---- make-3.82/job.c~ 2010-08-12 14:57:15.000000000 +0200
-+++ make-3.82/job.c 2010-08-12 14:58:23.000000000 +0200
-@@ -2876,7 +2876,7 @@ construct_command_argv_internal (char *l
- }
-
- new_line = alloca (shell_len + 1 + sflags_len + 1
-- + (line_len*2) + 1);
-+ + (line_len*4) + 1);
- ap = new_line;
- memcpy (ap, shell, shell_len);
- ap += shell_len;
-@@ -2904,13 +2904,14 @@ construct_command_argv_internal (char *l
- #endif
- if (PRESERVE_BSNL)
- {
-- *(ap++) = '\\';
-+ *(ap++) = '\'';
- /* Only non-batch execution needs another backslash,
- because it will be passed through a recursive
- invocation of this function. */
- if (!batch_mode_shell)
- *(ap++) = '\\';
- *(ap++) = '\n';
-+ *(ap++) = '\'';
- }
- ++p;
- continue;
-
-Diff finished. Thu Aug 12 14:58:34 2010
diff --git a/pkgs/core/make/patches/make-3.82-noclock_gettime.patch b/pkgs/core/make/patches/make-3.82-noclock_gettime.patch
deleted file mode 100644
index f63e1fc..0000000
--- a/pkgs/core/make/patches/make-3.82-noclock_gettime.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -up make-3.82/configure\~ make-3.82/configure
---- make-3.82/configure~ 2010-07-28 07:41:51.000000000 +0200
-+++ make-3.82/configure 2010-08-11 15:07:50.000000000 +0200
-@@ -7215,7 +7215,7 @@ return clock_gettime ();
- return 0;
- }
- _ACEOF
--for ac_lib in '' rt posix4; do
-+for ac_lib in '' posix4; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
-
-Diff finished. Wed Aug 11 15:07:59 2010
diff --git a/pkgs/core/make/patches/make-3.82-weird-shell.patch b/pkgs/core/make/patches/make-3.82-weird-shell.patch
deleted file mode 100644
index dfdaf89..0000000
--- a/pkgs/core/make/patches/make-3.82-weird-shell.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -up make-3.82/job.c\~ make-3.82/job.c
---- make-3.82/job.c~ 2010-08-11 16:13:33.000000000 +0200
-+++ make-3.82/job.c 2010-08-12 14:20:08.000000000 +0200
-@@ -2442,7 +2442,11 @@ construct_command_argv_internal (char *l
-
- /* See if it is safe to parse commands internally. */
- if (shell == 0)
-- shell = default_shell;
-+ {
-+ shell = default_shell;
-+ if (shellflags == 0)
-+ shellflags = "-c";
-+ }
- #ifdef WINDOWS32
- else if (strcmp (shell, default_shell))
- {
diff --git a/tools/patch b/tools/patch
index 93be79a..ed3ba21 100755
--- a/tools/patch
+++ b/tools/patch
@@ -1,6 +1,8 @@
#!/bin/bash
-for patch in $@; do
+. $(dirname ${0})/common-functions
+
+for patch in $(listsort $@); do
echo "Applying file ${patch}..."
patch -Np1 -i ${patch}
hooks/post-receive
--
IPFire 3.x development tree