From 27970d04ce6b4abab51c9430969bbd311f03336d Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Tue, 29 Sep 2009 05:51:14 +0000 Subject: [PATCH 01/14] Initialize branch F-12 for patch --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..06de2d2 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +F-12 From 4c70b2adffd0c479af010909c2b5433f4fd15e10 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 16 Nov 2009 17:08:44 +0000 Subject: [PATCH 02/14] - 2.6. No longer need stderr, suffix, stripcr, parse, allow-spaces, ifdef, program_name, or posix-backup patches. --- .cvsignore | 1 + patch-2.5-stderr.patch | 11 --- patch-2.5.4-ifdef.patch | 70 -------------- patch-2.5.4-program_name.patch | 11 --- patch-2.5.4-sigsegv.patch | 36 ++++--- patch-2.5.4-suffix.patch | 12 --- patch-2.6.tar.xz.sig | 7 ++ patch-allow-spaces.patch | 16 ---- patch-parse.patch | 12 --- patch-posix-backup.patch | 166 --------------------------------- patch-selinux.patch | 151 +++++++++++++++--------------- patch-stripcr.patch | 35 ------- patch.spec | 37 +++----- sources | 2 +- upstream-key.gpg | 57 +++++++++++ 15 files changed, 175 insertions(+), 449 deletions(-) delete mode 100644 patch-2.5-stderr.patch delete mode 100644 patch-2.5.4-ifdef.patch delete mode 100644 patch-2.5.4-program_name.patch delete mode 100644 patch-2.5.4-suffix.patch create mode 100644 patch-2.6.tar.xz.sig delete mode 100644 patch-allow-spaces.patch delete mode 100644 patch-parse.patch delete mode 100644 patch-posix-backup.patch delete mode 100644 patch-stripcr.patch create mode 100644 upstream-key.gpg diff --git a/.cvsignore b/.cvsignore index 9697754..ab22b20 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1,2 @@ patch-2.5.4.tar.gz +patch-2.6.tar.xz diff --git a/patch-2.5-stderr.patch b/patch-2.5-stderr.patch deleted file mode 100644 index d7a461c..0000000 --- a/patch-2.5-stderr.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- patch-2.5/util.c~ Thu Jul 10 09:16:12 1997 -+++ patch-2.5/util.c Sun Jun 6 18:16:30 1999 -@@ -568,6 +568,8 @@ - int r; - va_list args; - -+ fflush(stderr); /* Ensure pending errors are written before the question */ -+ - vararg_start (args, format); - vfprintf (stdout, format, args); - va_end (args); diff --git a/patch-2.5.4-ifdef.patch b/patch-2.5.4-ifdef.patch deleted file mode 100644 index d52b420..0000000 --- a/patch-2.5.4-ifdef.patch +++ /dev/null @@ -1,70 +0,0 @@ ---- patch-2.5.4/patch.c.ifdef Tue Mar 5 09:42:45 2002 -+++ patch-2.5.4/patch.c Tue Mar 5 09:42:47 2002 -@@ -88,8 +88,9 @@ - - static char const *do_defines; /* symbol to patch using ifdef, ifndef, etc. */ - static char const if_defined[] = "\n#ifdef %s\n"; --static char const not_defined[] = "#ifndef %s\n"; --static char const else_defined[] = "\n#else\n"; -+static char const not_defined[] = "\n#ifndef %s\n"; -+static char const elseis_defined[] = "\n#else /* %s */\n"; -+static char const elsenot_defined[] = "\n#else /* not %s */\n"; - static char const end_defined[] = "\n#endif /* %s */\n"; - - static int Argc; -@@ -1014,12 +1015,13 @@ - return FALSE; - if (R_do_defines) { - if (def_state == OUTSIDE) { -- fprintf (fp, outstate->after_newline + if_defined, -+ fprintf (fp, outstate->after_newline + not_defined, - R_do_defines); - def_state = IN_IFNDEF; - } - else if (def_state == IN_IFDEF) { -- fprintf (fp, outstate->after_newline + else_defined); -+ fprintf (fp, outstate->after_newline + elsenot_defined, -+ R_do_defines); - def_state = IN_ELSE; - } - if (ferror (fp)) -@@ -1038,7 +1040,8 @@ - return FALSE; - if (R_do_defines) { - if (def_state == IN_IFNDEF) { -- fprintf (fp, outstate->after_newline + else_defined); -+ fprintf (fp, outstate->after_newline + elseis_defined, -+ R_do_defines); - def_state = IN_ELSE; - } - else if (def_state == OUTSIDE) { -@@ -1069,7 +1072,8 @@ - return FALSE; - assert (outstate->after_newline); - if (R_do_defines) { -- fprintf (fp, not_defined, R_do_defines); -+ fprintf (fp, outstate->after_newline + not_defined, -+ R_do_defines); - if (ferror (fp)) - write_fatal (); - def_state = IN_IFNDEF; -@@ -1086,7 +1090,8 @@ - while (pch_char (old) == '!'); - - if (R_do_defines) { -- fprintf (fp, outstate->after_newline + else_defined); -+ fprintf (fp, outstate->after_newline + elseis_defined, -+ R_do_defines); - if (ferror (fp)) - write_fatal (); - def_state = IN_ELSE; -@@ -1124,7 +1129,8 @@ - def_state = IN_IFDEF; - } - else if (def_state == IN_IFNDEF) { -- fprintf (fp, outstate->after_newline + else_defined); -+ fprintf (fp, outstate->after_newline + elseis_defined, -+ R_do_defines); - def_state = IN_ELSE; - } - if (ferror (fp)) diff --git a/patch-2.5.4-program_name.patch b/patch-2.5.4-program_name.patch deleted file mode 100644 index 5447839..0000000 --- a/patch-2.5.4-program_name.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- patch-2.5.4/error.c.program_name Tue Apr 9 14:38:27 2002 -+++ patch-2.5.4/error.c Tue Apr 9 14:38:43 2002 -@@ -80,7 +80,7 @@ - - /* The calling program should define program_name and set it to the - name of the executing program. */ --extern char *program_name; -+extern char const program_name[]; - - # ifdef HAVE_STRERROR_R - # define __strerror_r strerror_r diff --git a/patch-2.5.4-sigsegv.patch b/patch-2.5.4-sigsegv.patch index df0676e..c018153 100644 --- a/patch-2.5.4-sigsegv.patch +++ b/patch-2.5.4-sigsegv.patch @@ -1,11 +1,7 @@ -Bug report: #14693 -Reported by: Vincent Renardias -Patch: jdassen@wi.leidenuniv.nl (J.H.M.Dassen) -Since Version: 2.5-2 - ---- patch-2.5.orig/inp.c -+++ patch-2.5/inp.c -@@ -71,6 +71,14 @@ +diff -up patch-2.6/src/inp.c.sigsegv patch-2.6/src/inp.c +--- patch-2.6/src/inp.c.sigsegv 2009-11-02 19:09:57.000000000 +0000 ++++ patch-2.6/src/inp.c 2009-11-16 09:31:52.305022200 +0000 +@@ -77,6 +77,14 @@ re_input (void) } } @@ -20,9 +16,19 @@ Since Version: 2.5-2 /* Construct the line index, somehow or other. */ void ---- patch-2.5.orig/patch.c -+++ patch-2.5/patch.c -@@ -210,7 +210,10 @@ +diff -up patch-2.6/src/inp.h.sigsegv patch-2.6/src/inp.h +--- patch-2.6/src/inp.h.sigsegv 2009-11-02 19:09:57.000000000 +0000 ++++ patch-2.6/src/inp.h 2009-11-16 09:32:24.440021838 +0000 +@@ -24,4 +24,5 @@ XTERN LINENUM input_lines; /* how long + char const *ifetch (LINENUM, bool, size_t *); + void get_input_file (char const *, char const *); + void re_input (void); ++void reset_scan_input_vars (void); + void scan_input (char *); +diff -up patch-2.6/src/patch.c.sigsegv patch-2.6/src/patch.c +--- patch-2.6/src/patch.c.sigsegv 2009-11-02 19:09:57.000000000 +0000 ++++ patch-2.6/src/patch.c 2009-11-16 09:31:52.306021801 +0000 +@@ -210,7 +210,10 @@ main (int argc, char **argv) /* find out where all the lines are */ if (!skip_rest_of_patch) @@ -34,11 +40,3 @@ Since Version: 2.5-2 /* from here on, open no standard i/o files, because malloc */ /* might misfire and we can't catch it easily */ ---- patch-2.5.orig/inp.h -+++ patch-2.5/inp.h -@@ -7,4 +7,5 @@ - char const *ifetch PARAMS ((LINENUM, int, size_t *)); - void get_input_file PARAMS ((char const *, char const *)); - void re_input PARAMS ((void)); -+void reset_scan_input_vars PARAMS (()); - void scan_input PARAMS ((char *)); diff --git a/patch-2.5.4-suffix.patch b/patch-2.5.4-suffix.patch deleted file mode 100644 index a8255e6..0000000 --- a/patch-2.5.4-suffix.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- patch-2.5.4/patch.c.suffix Thu Nov 2 17:57:46 2000 -+++ patch-2.5.4/patch.c Thu Nov 2 17:58:25 2000 -@@ -145,8 +145,7 @@ - : posixly_correct - 1); - - val = getenv ("SIMPLE_BACKUP_SUFFIX"); -- if (val && *val) -- simple_backup_suffix = val; -+ simple_backup_suffix = val && *val ? val : ".orig"; - - if ((version_control = getenv ("PATCH_VERSION_CONTROL"))) - version_control_context = "$PATCH_VERSION_CONTROL"; diff --git a/patch-2.6.tar.xz.sig b/patch-2.6.tar.xz.sig new file mode 100644 index 0000000..23b7e79 --- /dev/null +++ b/patch-2.6.tar.xz.sig @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.12 (GNU/Linux) + +iEYEABECAAYFAkr9aWMACgkQ9+hy/rlxVNMK0wCgg0Jg3HqcXm2Eh8jR66YADk8L +Si8AmwZ1EDTTvYmeQmae0zrYK6+4HRTR +=KgtY +-----END PGP SIGNATURE----- diff --git a/patch-allow-spaces.patch b/patch-allow-spaces.patch deleted file mode 100644 index 531c97a..0000000 --- a/patch-allow-spaces.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- patch-2.5.4/util.c 1999-08-30 07:20:08.000000000 +0100 -+++ patch-2.5.9/util.c 2003-05-20 15:04:53.000000000 +0100 -@@ -939,7 +939,13 @@ fetchname (char *at, int strip_leading, - } - else if (ISSPACE ((unsigned char) *t)) - { -+ /* Allow file names with internal spaces, -+ but only if a tab separates the file name from the date. */ - char const *u = t; -+ while (*u != '\t' && ISSPACE ((unsigned char) u[1])) -+ u++; -+ if (*u != '\t' && strchr (u + 1, '\t')) -+ continue; - - if (set_time | set_utc) - stamp = str2time (&u, initial_time, diff --git a/patch-parse.patch b/patch-parse.patch deleted file mode 100644 index cbd97fa..0000000 --- a/patch-parse.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- patch-2.5.4/partime.c.parse 1998-03-15 15:48:53.000000000 +0000 -+++ patch-2.5.4/partime.c 2005-09-07 08:04:41.000000000 +0000 -@@ -792,7 +792,8 @@ - if (negative) - n = -n; - while (!ISALNUM ((unsigned char) *s)) -- s++; -+ if (*s++ == '\0') -+ return 0; - i = lookup (s, relative_units); - if (!TM_DEFINED (i)) - return 0; diff --git a/patch-posix-backup.patch b/patch-posix-backup.patch deleted file mode 100644 index 013bbc2..0000000 --- a/patch-posix-backup.patch +++ /dev/null @@ -1,166 +0,0 @@ -diff -up patch-2.5.4/util.c.posix-backup patch-2.5.4/util.c ---- patch-2.5.4/util.c.posix-backup 2008-06-16 10:22:52.000000000 +0100 -+++ patch-2.5.4/util.c 2008-06-16 11:30:27.000000000 +0100 -@@ -109,37 +109,40 @@ move_file (char const *from, int volatil - memory_fatal (); - } - -- if (to_errno) -+ if (strcmp (bakname, "/dev/null") != 0) - { -- int fd; -+ if (to_errno) -+ { -+ int fd; - -- if (debug & 4) -- say ("Creating empty unreadable file %s\n", quotearg (bakname)); -+ if (debug & 4) -+ say ("Creating empty unreadable file %s\n", quotearg (bakname)); - -- try_makedirs_errno = ENOENT; -- unlink (bakname); -- while ((fd = creat (bakname, 0)) < 0) -- { -- if (errno != try_makedirs_errno) -- pfatal ("Can't create file %s", quotearg (bakname)); -- makedirs (bakname); -- try_makedirs_errno = 0; -+ try_makedirs_errno = ENOENT; -+ unlink (bakname); -+ while ((fd = creat (bakname, 0)) < 0) -+ { -+ if (errno != try_makedirs_errno) -+ pfatal ("Can't create file %s", quotearg (bakname)); -+ makedirs (bakname); -+ try_makedirs_errno = 0; -+ } -+ if (close (fd) != 0) -+ pfatal ("Can't close file %s", quotearg (bakname)); - } -- if (close (fd) != 0) -- pfatal ("Can't close file %s", quotearg (bakname)); -- } -- else -- { -- if (debug & 4) -- say ("Renaming file %s to %s\n", -- quotearg_n (0, to), quotearg_n (1, bakname)); -- while (rename (to, bakname) != 0) -+ else - { -- if (errno != try_makedirs_errno) -- pfatal ("Can't rename file %s to %s", -- quotearg_n (0, to), quotearg_n (1, bakname)); -- makedirs (bakname); -- try_makedirs_errno = 0; -+ if (debug & 4) -+ say ("Renaming file %s to %s\n", -+ quotearg_n (0, to), quotearg_n (1, bakname)); -+ while (rename (to, bakname) != 0) -+ { -+ if (errno != try_makedirs_errno) -+ pfatal ("Can't rename file %s to %s", -+ quotearg_n (0, to), quotearg_n (1, bakname)); -+ makedirs (bakname); -+ try_makedirs_errno = 0; -+ } - } - } - -diff -up patch-2.5.4/backupfile.c.posix-backup patch-2.5.4/backupfile.c ---- patch-2.5.4/backupfile.c.posix-backup 2008-06-16 11:27:55.000000000 +0100 -+++ patch-2.5.4/backupfile.c 2008-06-16 11:44:05.000000000 +0100 -@@ -23,6 +23,8 @@ - # include - #endif - -+#define XTERN extern -+#include - #include - #include - -@@ -118,11 +120,15 @@ static int version_number PARAMS ((const - char * - find_backup_file_name (const char *file, enum backup_type backup_type) - { -+ static char **previous_files = NULL; -+ static int previous_files_allocated = 0; -+ - size_t backup_suffix_size_max; - size_t file_len = strlen (file); - size_t numbered_suffix_size_max = INT_STRLEN_BOUND (int) + 4; - char *s; - const char *suffix = simple_backup_suffix; -+ int used_version = 0; - - /* Allow room for simple or `.~N~' backups. */ - backup_suffix_size_max = strlen (simple_backup_suffix) + 1; -@@ -147,12 +153,66 @@ find_backup_file_name (const char *file, - char *numbered_suffix = s + (file_len + backup_suffix_size_max); - sprintf (numbered_suffix, ".~%d~", highest_backup + 1); - suffix = numbered_suffix; -+ used_version = 1; - } - strcpy (s, file); - } - #endif /* HAVE_DIR */ - -- addext (s, suffix, '~'); -+ if (used_version == 0) -+ { -+ /* If we have already written a ".orig" backup file during -+ this run, don't overwrite it. */ -+ if (previous_files_allocated != 0) -+ { -+ int i; -+ for (i = 0; previous_files[i] != NULL; i++) -+ { -+ if (!strcmp (previous_files[i], s)) -+ { -+ strcpy (s, "/dev/null"); -+ break; -+ } -+ } -+ -+ if (previous_files[i] == NULL) -+ { -+ if (i == previous_files_allocated - 1) -+ { -+ char **old_previous_files = previous_files; -+ previous_files = realloc (previous_files, -+ 2 * previous_files_allocated * -+ sizeof (const char *)); -+ if (previous_files) -+ previous_files_allocated *= 2; -+ else -+ { -+ for (i = 0; old_previous_files[i] != NULL; i++) -+ free (old_previous_files[i]); -+ free (old_previous_files); -+ previous_files_allocated = 0; -+ } -+ } -+ -+ if (i < previous_files_allocated - 1) -+ { -+ previous_files[i] = strdup (s); -+ previous_files[i + 1] = NULL; -+ } -+ } -+ } -+ else -+ { -+ previous_files_allocated = 2; -+ previous_files = malloc (previous_files_allocated * -+ sizeof (const char *)); -+ previous_files[0] = strdup (s); -+ previous_files[1] = NULL; -+ } -+ } -+ -+ if (strcmp (s, "/dev/null") != 0) -+ addext (s, suffix, '~'); - } - return s; - } diff --git a/patch-selinux.patch b/patch-selinux.patch index 2f354f9..3c2774f 100644 --- a/patch-selinux.patch +++ b/patch-selinux.patch @@ -1,7 +1,19 @@ -diff -up patch-2.5.4/common.h.selinux patch-2.5.4/common.h ---- patch-2.5.4/common.h.selinux 1999-08-30 07:20:08.000000000 +0100 -+++ patch-2.5.4/common.h 2009-02-17 15:33:13.000000000 +0000 -@@ -39,6 +39,8 @@ +diff -up patch-2.6/Makefile.in.selinux patch-2.6/Makefile.in +--- patch-2.6/Makefile.in.selinux 2009-11-02 19:09:57.000000000 +0000 ++++ patch-2.6/Makefile.in 2009-11-16 09:38:44.171021894 +0000 +@@ -40,7 +40,7 @@ EXEEXT = @EXEEXT@ + LDFLAGS = @LDFLAGS@ + LIBOBJDIR = gl/lib/ + LIBOBJS = @LIBOBJS@ ${LIBOBJDIR}full-write$U.o +-LIBS = @LIBS@ ++LIBS = @LIBS@ -lselinux + OBJEXT = @OBJEXT@ + PACKAGE_NAME = @PACKAGE_NAME@ + PACKAGE_VERSION = @PACKAGE_VERSION@ +diff -up patch-2.6/src/common.h.selinux patch-2.6/src/common.h +--- patch-2.6/src/common.h.selinux 2009-11-02 19:09:57.000000000 +0000 ++++ patch-2.6/src/common.h 2009-11-16 09:38:12.579147244 +0000 +@@ -32,6 +32,8 @@ #include #include @@ -10,7 +22,7 @@ diff -up patch-2.5.4/common.h.selinux patch-2.5.4/common.h #include #if ! defined S_ISDIR && defined S_IFDIR # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -@@ -168,6 +170,7 @@ XTERN char *outfile; +@@ -118,6 +120,7 @@ XTERN char *outfile; XTERN int inerrno; XTERN int invc; XTERN struct stat instat; @@ -18,16 +30,16 @@ diff -up patch-2.5.4/common.h.selinux patch-2.5.4/common.h XTERN bool dry_run; XTERN bool posixly_correct; -diff -up patch-2.5.4/inp.c.selinux patch-2.5.4/inp.c ---- patch-2.5.4/inp.c.selinux 2009-02-17 15:33:13.000000000 +0000 -+++ patch-2.5.4/inp.c 2009-02-17 15:33:13.000000000 +0000 -@@ -154,7 +154,20 @@ get_input_file (char const *filename, ch +diff -up patch-2.6/src/inp.c.selinux patch-2.6/src/inp.c +--- patch-2.6/src/inp.c.selinux 2009-11-16 09:37:57.515147431 +0000 ++++ patch-2.6/src/inp.c 2009-11-16 09:40:04.782022221 +0000 +@@ -153,7 +153,20 @@ get_input_file (char const *filename, ch char *getbuf; if (inerrno == -1) -- inerrno = stat (inname, &instat) == 0 ? 0 : errno; +- inerrno = stat (filename, &instat) == 0 ? 0 : errno; + { -+ inerrno = stat (inname, &instat) == 0 ? 0 : errno; ++ inerrno = stat (filename, &instat) == 0 ? 0 : errno; + if (inerrno == 0) + { + inerrno = getfilecon (inname, &incontext) == -1 ? errno : 0; @@ -43,7 +55,7 @@ diff -up patch-2.5.4/inp.c.selinux patch-2.5.4/inp.c /* Perhaps look for RCS or SCCS versions. */ if (patch_get -@@ -196,7 +209,7 @@ get_input_file (char const *filename, ch +@@ -197,7 +210,7 @@ get_input_file (char const *filename, ch } if (cs && version_get (filename, cs, ! inerrno, elsewhere, getbuf, @@ -52,7 +64,7 @@ diff -up patch-2.5.4/inp.c.selinux patch-2.5.4/inp.c inerrno = 0; free (getbuf); -@@ -213,6 +226,7 @@ get_input_file (char const *filename, ch +@@ -209,6 +222,7 @@ get_input_file (char const *filename, ch { instat.st_mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH; instat.st_size = 0; @@ -60,43 +72,36 @@ diff -up patch-2.5.4/inp.c.selinux patch-2.5.4/inp.c } else if (! S_ISREG (instat.st_mode)) fatal ("File %s is not a regular file -- can't patch", -diff -up patch-2.5.4/Makefile.in.selinux patch-2.5.4/Makefile.in ---- patch-2.5.4/Makefile.in.selinux 1999-08-30 07:37:54.000000000 +0100 -+++ patch-2.5.4/Makefile.in 2009-02-17 15:33:13.000000000 +0000 -@@ -36,7 +36,7 @@ DEFS = @DEFS@ - EXEEXT = @EXEEXT@ - LDFLAGS = @LDFLAGS@ - LIBOBJS = @LIBOBJS@ --LIBS = @LIBS@ -+LIBS = @LIBS@ -lselinux - PACKAGE = @PACKAGE@ - U = @U@ - VERSION = @VERSION@ -diff -up patch-2.5.4/patch.c.selinux patch-2.5.4/patch.c ---- patch-2.5.4/patch.c.selinux 2009-02-17 15:33:13.000000000 +0000 -+++ patch-2.5.4/patch.c 2009-02-17 15:34:42.000000000 +0000 -@@ -414,6 +414,16 @@ main (int argc, char **argv) - if (! inerrno && chmod (outname, instat.st_mode) != 0) - pfatal ("Can't set permissions on file %s", - quotearg (outname)); -+ if (! inerrno && incontext) { -+ security_context_t outcontext; -+ if (! getfilecon (outname, &outcontext) && outcontext && -+ strcmp(outcontext, incontext) && -+ setfilecon (outname, incontext) != 0) { +diff -up patch-2.6/src/patch.c.selinux patch-2.6/src/patch.c +--- patch-2.6/src/patch.c.selinux 2009-11-16 09:37:57.516146641 +0000 ++++ patch-2.6/src/patch.c 2009-11-16 09:41:47.676147549 +0000 +@@ -421,6 +421,21 @@ main (int argc, char **argv) + /* Fails if we are not in group instat.st_gid. */ + chown (outname, -1, instat.st_gid); + } ++ ++ if (! inerrno && incontext) ++ { ++ security_context_t outcontext; ++ if (! getfilecon (outname, &outcontext) && ++ outcontext && ++ strcmp(outcontext, incontext) && ++ setfilecon (outname, incontext) != 0) ++ { + if (errno != ENOTSUP && errno != EPERM) -+ pfatal ("Can't set security context on file %s", -+ quotearg (outname)); -+ } -+ } - } - } - } -diff -up patch-2.5.4/pch.c.selinux patch-2.5.4/pch.c ---- patch-2.5.4/pch.c.selinux 2009-02-17 15:33:13.000000000 +0000 -+++ patch-2.5.4/pch.c 2009-02-17 15:33:13.000000000 +0000 -@@ -258,7 +258,12 @@ there_is_another_patch (void) - { ++ pfatal ("Can't set security context " ++ "on file %s", quotearg (outname)); ++ } ++ } ++ + /* FIXME: There may be other attributes to preserve. */ + } + } +diff -up patch-2.6/src/pch.c.selinux patch-2.6/src/pch.c +--- patch-2.6/src/pch.c.selinux 2009-11-02 19:09:57.000000000 +0000 ++++ patch-2.6/src/pch.c 2009-11-16 09:42:17.453147283 +0000 +@@ -288,7 +288,12 @@ there_is_another_patch (bool need_header + inname[t - buf - 1] = 0; if (stat (inname, &instat) == 0) { - inerrno = 0; @@ -109,37 +114,37 @@ diff -up patch-2.5.4/pch.c.selinux patch-2.5.4/pch.c invc = -1; } else -@@ -573,7 +578,7 @@ intuit_diff_type (void) +@@ -662,7 +667,7 @@ intuit_diff_type (bool need_header) if (cs) { - if (version_get (name[i], cs, 0, readonly, + if (version_get (p_name[i], cs, false, readonly, - getbuf, &st[i])) + getbuf, &st[i], NULL)) stat_errno[i] = 0; else version_controlled[i] = 0; -@@ -641,6 +646,7 @@ intuit_diff_type (void) +@@ -727,6 +732,7 @@ intuit_diff_type (bool need_header) inerrno = stat_errno[i]; invc = version_controlled[i]; instat = st[i]; + getfilecon (inname, &incontext); } - for (i = OLD; i <= INDEX; i++) -diff -up patch-2.5.4/util.c.selinux patch-2.5.4/util.c ---- patch-2.5.4/util.c.selinux 2009-02-17 15:33:13.000000000 +0000 -+++ patch-2.5.4/util.c 2009-02-17 15:33:13.000000000 +0000 -@@ -375,7 +375,8 @@ version_controller (char const *filename - Return nonzero if successful. */ - int - version_get (char const *filename, char const *cs, int exists, int readonly, + return retval; +diff -up patch-2.6/src/util.c.selinux patch-2.6/src/util.c +--- patch-2.6/src/util.c.selinux 2009-11-02 19:09:57.000000000 +0000 ++++ patch-2.6/src/util.c 2009-11-16 09:40:27.472147644 +0000 +@@ -574,7 +574,8 @@ version_controller (char const *filename + Return true if successful. */ + bool + version_get (char const *filename, char const *cs, bool exists, bool readonly, - char const *getbuf, struct stat *filestat) + char const *getbuf, struct stat *filestat, + security_context_t *filecontext) { if (patch_get < 0) { -@@ -400,6 +401,13 @@ version_get (char const *filename, char +@@ -599,6 +600,13 @@ version_get (char const *filename, char fatal ("Can't get file %s from %s", quotearg (filename), cs); if (stat (filename, filestat) != 0) pfatal ("%s", quotearg (filename)); @@ -153,15 +158,15 @@ diff -up patch-2.5.4/util.c.selinux patch-2.5.4/util.c } return 1; -diff -up patch-2.5.4/util.h.selinux patch-2.5.4/util.h ---- patch-2.5.4/util.h.selinux 1999-08-30 07:20:08.000000000 +0100 -+++ patch-2.5.4/util.h 2009-02-17 15:33:13.000000000 +0000 -@@ -21,7 +21,7 @@ char *fetchname PARAMS ((char *, int, ti - char *savebuf PARAMS ((char const *, size_t)); - char *savestr PARAMS ((char const *)); - char const *version_controller PARAMS ((char const *, int, struct stat const *, char **, char **)); --int version_get PARAMS ((char const *, char const *, int, int, char const *, struct stat *)); -+int version_get PARAMS ((char const *, char const *, int, int, char const *, struct stat *, security_context_t *)); - int create_file PARAMS ((char const *, int, mode_t)); - int systemic PARAMS ((char const *)); - char *format_linenum PARAMS ((char[LINENUM_LENGTH_BOUND + 1], LINENUM)); +diff -up patch-2.6/src/util.h.selinux patch-2.6/src/util.h +--- patch-2.6/src/util.h.selinux 2009-11-02 19:09:57.000000000 +0000 ++++ patch-2.6/src/util.h 2009-11-16 09:42:48.750148164 +0000 +@@ -51,7 +51,7 @@ char *fetchname (char *, int, char **, t + char *savebuf (char const *, size_t); + char *savestr (char const *); + char const *version_controller (char const *, bool, struct stat const *, char **, char **); +-bool version_get (char const *, char const *, bool, bool, char const *, struct stat *); ++bool version_get (char const *, char const *, bool, bool, char const *, struct stat *, security_context_t *); + int create_file (char const *, int, mode_t, bool); + int systemic (char const *); + char *format_linenum (char[LINENUM_LENGTH_BOUND + 1], LINENUM); diff --git a/patch-stripcr.patch b/patch-stripcr.patch deleted file mode 100644 index 956573b..0000000 --- a/patch-stripcr.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- patch-2.5.4/pch.c.stripcr 1999-08-30 07:20:08.000000000 +0100 -+++ patch-2.5.4/pch.c 2005-08-11 12:59:35.000000000 +0100 -@@ -355,10 +355,16 @@ - if (!stars_last_line && strnEQ(s, "*** ", 4)) - name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]); - else if (strnEQ(s, "+++ ", 4)) -+ { - /* Swap with NEW below. */ - name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]); -+ p_strip_trailing_cr = strip_trailing_cr; -+ } - else if (strnEQ(s, "Index:", 6)) -+ { - name[INDEX] = fetchname (s+6, strippath, (time_t *) 0); -+ p_strip_trailing_cr = strip_trailing_cr; -+ } - else if (strnEQ(s, "Prereq:", 7)) { - for (t = s + 7; ISSPACE ((unsigned char) *t); t++) - continue; -@@ -386,6 +392,7 @@ - p_timestamp[NEW] = timestamp; - p_rfc934_nesting = (t - s) >> 1; - } -+ p_strip_trailing_cr = strip_trailing_cr; - } - } - if ((diff_type == NO_DIFF || diff_type == ED_DIFF) && -@@ -419,7 +426,6 @@ - if (s[0] == '+' && s[1] == '0' && !ISDIGIT (s[2])) - p_says_nonexistent[NEW] = 1 + ! p_timestamp[NEW]; - p_indent = indent; -- p_strip_trailing_cr = strip_trailing_cr; - p_start = this_line; - p_sline = p_input_line; - retval = UNI_DIFF; diff --git a/patch.spec b/patch.spec index 9040294..455140c 100644 --- a/patch.spec +++ b/patch.spec @@ -1,21 +1,13 @@ Summary: Utility for modifying/upgrading files Name: patch -Version: 2.5.4 -Release: 40%{?dist} +Version: 2.6 +Release: 1%{?dist} License: GPLv2+ URL: http://www.gnu.org/software/patch/patch.html Group: Development/Tools -Source: ftp://ftp.gnu.org/gnu/patch/patch-%{version}.tar.gz -Patch1: patch-2.5-stderr.patch -Patch2: patch-2.5.4-suffix.patch -Patch3: patch-2.5.4-sigsegv.patch -Patch4: patch-2.5.4-ifdef.patch -Patch5: patch-2.5.4-program_name.patch -Patch6: patch-stripcr.patch -Patch7: patch-parse.patch -Patch8: patch-allow-spaces.patch -Patch9: patch-selinux.patch -Patch10: patch-posix-backup.patch +Source: ftp://ftp.gnu.org/gnu/patch/patch-%{version}.tar.xz +Patch1: patch-2.5.4-sigsegv.patch +Patch100: patch-selinux.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libselinux-devel @@ -32,16 +24,8 @@ applications. %prep %setup -q -%patch1 -p1 -b .stderr -%patch2 -p1 -b .suffix -%patch3 -p1 -b .sigsegv -%patch4 -p1 -b .ifdef -%patch5 -p1 -b .program_name -%patch6 -p1 -b .stripcr -%patch7 -p1 -b .parse -%patch8 -p1 -b .allow-spaces -%patch9 -p1 -b .selinux -%patch10 -p1 -b .posix-backup +%patch1 -p1 -b .sigsegv +%patch100 -p1 -b .selinux %build CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" @@ -54,6 +38,9 @@ make CPPFLAGS="" make %{?smp_mflags} %endif +%check +make check + %install rm -rf $RPM_BUILD_ROOT %makeinstall @@ -68,6 +55,10 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/*/* %changelog +* Mon Nov 16 2009 Tim Waugh 2.6-1 +- 2.6. No longer need stderr, suffix, stripcr, parse, allow-spaces, + ifdef, program_name, or posix-backup patches. + * Sat Jul 25 2009 Fedora Release Engineering - 2.5.4-40 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild diff --git a/sources b/sources index 2520be1..b386173 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ee5ae84d115f051d87fcaaef3b4ae782 patch-2.5.4.tar.gz +d9d62cb7b98a8a17e42dab910fd2adc9 patch-2.6.tar.xz diff --git a/upstream-key.gpg b/upstream-key.gpg new file mode 100644 index 0000000..8aa5fdc --- /dev/null +++ b/upstream-key.gpg @@ -0,0 +1,57 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.10 (GNU/Linux) + +mQGiBErn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SirK9bN0/erQ5L9jw +7rZ74h0Qg+wriE8EGBECAA8FAkrnFxkCGwwFCQPCZwAACgkQ9+hy/rlxVNPUPgCg +1metaBd0maHAzv3VDykFniswViEAn0xXM7wVlt/XHULD/Yn+ZfF67fGz +=2DCt +-----END PGP PUBLIC KEY BLOCK----- From f12cc50736eded1a390f685da9050b9119877a66 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:50:52 +0000 Subject: [PATCH 03/14] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9431f4c..27f5d45 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: patch -# $Id: Makefile,v 1.1 2004/09/09 09:54:06 cvsdist Exp $ +# $Id: Makefile,v 1.2 2007/10/15 19:13:12 notting Exp $ NAME := patch SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From 4d222909d3c364a585de9091c484a095971de067 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Thu, 24 Dec 2009 14:04:58 +0000 Subject: [PATCH 04/14] - Applied upstream patch to prevent incorrect filename being chosen when adding a new file (bug #549122). --- patch-best-name.patch | 72 +++++++++++++++++++++++++++++++++++++++++++ patch.spec | 8 ++++- 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 patch-best-name.patch diff --git a/patch-best-name.patch b/patch-best-name.patch new file mode 100644 index 0000000..810e403 --- /dev/null +++ b/patch-best-name.patch @@ -0,0 +1,72 @@ +--- patch-2.6/src/pch.c 2009-11-02 19:09:57.000000000 +0000 ++++ patch-2.6-4-ge2218ac/src/pch.c 2009-12-22 23:03:27.000000000 +0000 +@@ -195,23 +195,22 @@ + } + + static bool +-maybe_reverse (char const *name, bool nonexistent, bool empty) ++maybe_reverse (char const *name, bool nonexistent, bool is_empty) + { +- bool is_empty = nonexistent || empty; +- bool r; ++ bool looks_reversed = (! is_empty) < p_says_nonexistent[reverse ^ is_empty]; + +- r = (! is_empty) < p_says_nonexistent[reverse ^ is_empty] +- && ok_to_reverse ("The next patch%s would %s the file %s,\nwhich %s!", +- reverse ? ", when reversed," : "", +- (nonexistent ? "delete" +- : empty ? "empty out" +- : "create"), +- quotearg (name), +- (nonexistent ? "does not exist" +- : empty ? "is already empty" +- : "already exists")); +- reverse ^= r; +- return r; ++ if (looks_reversed) ++ reverse ^= ++ ok_to_reverse ("The next patch%s would %s the file %s,\nwhich %s!", ++ reverse ? ", when reversed," : "", ++ (nonexistent ? "delete" ++ : is_empty ? "empty out" ++ : "create"), ++ quotearg (name), ++ (nonexistent ? "does not exist" ++ : is_empty ? "is already empty" ++ : "already exists")); ++ return looks_reversed; + } + + /* True if the remainder of the patch file contains a diff of some sort. */ +@@ -638,6 +637,7 @@ + + if (! posixly_correct) + { ++ /* The best of all existing files. */ + i = best_name (p_name, stat_errno); + + if (i == NONE && patch_get) +@@ -680,12 +680,10 @@ + } + } + +- if (i != NONE && st[i].st_size > 0) +- i0 = i; + if (i0 != NONE +- && ! maybe_reverse (p_name[i0], i == NONE, +- i == NONE || st[i].st_size == 0)) +- i = i0; ++ && maybe_reverse (p_name[i0], i == NONE, ++ i == NONE || st[i].st_size == 0)) ++ i = i0; + + if (i == NONE && p_says_nonexistent[reverse]) + { +@@ -706,6 +704,7 @@ + if (p_name[i]) + distance_from_minimum[i] = newdirs[i] - newdirs_min; + ++ /* The best of the filenames which create the fewest directories. */ + i = best_name (p_name, distance_from_minimum); + } + } diff --git a/patch.spec b/patch.spec index 455140c..0e4245f 100644 --- a/patch.spec +++ b/patch.spec @@ -1,12 +1,13 @@ Summary: Utility for modifying/upgrading files Name: patch Version: 2.6 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: http://www.gnu.org/software/patch/patch.html Group: Development/Tools Source: ftp://ftp.gnu.org/gnu/patch/patch-%{version}.tar.xz Patch1: patch-2.5.4-sigsegv.patch +Patch2: patch-best-name.patch Patch100: patch-selinux.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -25,6 +26,7 @@ applications. %prep %setup -q %patch1 -p1 -b .sigsegv +%patch2 -p1 -b .best-name %patch100 -p1 -b .selinux %build @@ -55,6 +57,10 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/*/* %changelog +* Thu Dec 24 2009 Tim Waugh 2.6-2 +- Applied upstream patch to prevent incorrect filename being chosen + when adding a new file (bug #549122). + * Mon Nov 16 2009 Tim Waugh 2.6-1 - 2.6. No longer need stderr, suffix, stripcr, parse, allow-spaces, ifdef, program_name, or posix-backup patches. From 5b79fc3348a7cd75c6b06033f7438856d8852720 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 4 Jan 2010 13:59:04 +0000 Subject: [PATCH 05/14] - 2.6.1 (bug #551569). No longer need best-name patch. --- patch-2.6.1.tar.xz.sig | 7 ++++ patch-2.6.tar.xz.sig | 7 ---- patch-best-name.patch | 72 ------------------------------------------ patch.spec | 10 +++--- sources | 2 +- 5 files changed, 14 insertions(+), 84 deletions(-) create mode 100644 patch-2.6.1.tar.xz.sig delete mode 100644 patch-2.6.tar.xz.sig delete mode 100644 patch-best-name.patch diff --git a/patch-2.6.1.tar.xz.sig b/patch-2.6.1.tar.xz.sig new file mode 100644 index 0000000..fee87dc --- /dev/null +++ b/patch-2.6.1.tar.xz.sig @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.12 (GNU/Linux) + +iEYEABECAAYFAks7frsACgkQ9+hy/rlxVNONpwCgr0yqYFoW0Q1USWGBcA8dGNEn +XUMAn1RB5jT/EoiNi9ZrjawqxAT83JzB +=/8JO +-----END PGP SIGNATURE----- diff --git a/patch-2.6.tar.xz.sig b/patch-2.6.tar.xz.sig deleted file mode 100644 index 23b7e79..0000000 --- a/patch-2.6.tar.xz.sig +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.12 (GNU/Linux) - -iEYEABECAAYFAkr9aWMACgkQ9+hy/rlxVNMK0wCgg0Jg3HqcXm2Eh8jR66YADk8L -Si8AmwZ1EDTTvYmeQmae0zrYK6+4HRTR -=KgtY ------END PGP SIGNATURE----- diff --git a/patch-best-name.patch b/patch-best-name.patch deleted file mode 100644 index 810e403..0000000 --- a/patch-best-name.patch +++ /dev/null @@ -1,72 +0,0 @@ ---- patch-2.6/src/pch.c 2009-11-02 19:09:57.000000000 +0000 -+++ patch-2.6-4-ge2218ac/src/pch.c 2009-12-22 23:03:27.000000000 +0000 -@@ -195,23 +195,22 @@ - } - - static bool --maybe_reverse (char const *name, bool nonexistent, bool empty) -+maybe_reverse (char const *name, bool nonexistent, bool is_empty) - { -- bool is_empty = nonexistent || empty; -- bool r; -+ bool looks_reversed = (! is_empty) < p_says_nonexistent[reverse ^ is_empty]; - -- r = (! is_empty) < p_says_nonexistent[reverse ^ is_empty] -- && ok_to_reverse ("The next patch%s would %s the file %s,\nwhich %s!", -- reverse ? ", when reversed," : "", -- (nonexistent ? "delete" -- : empty ? "empty out" -- : "create"), -- quotearg (name), -- (nonexistent ? "does not exist" -- : empty ? "is already empty" -- : "already exists")); -- reverse ^= r; -- return r; -+ if (looks_reversed) -+ reverse ^= -+ ok_to_reverse ("The next patch%s would %s the file %s,\nwhich %s!", -+ reverse ? ", when reversed," : "", -+ (nonexistent ? "delete" -+ : is_empty ? "empty out" -+ : "create"), -+ quotearg (name), -+ (nonexistent ? "does not exist" -+ : is_empty ? "is already empty" -+ : "already exists")); -+ return looks_reversed; - } - - /* True if the remainder of the patch file contains a diff of some sort. */ -@@ -638,6 +637,7 @@ - - if (! posixly_correct) - { -+ /* The best of all existing files. */ - i = best_name (p_name, stat_errno); - - if (i == NONE && patch_get) -@@ -680,12 +680,10 @@ - } - } - -- if (i != NONE && st[i].st_size > 0) -- i0 = i; - if (i0 != NONE -- && ! maybe_reverse (p_name[i0], i == NONE, -- i == NONE || st[i].st_size == 0)) -- i = i0; -+ && maybe_reverse (p_name[i0], i == NONE, -+ i == NONE || st[i].st_size == 0)) -+ i = i0; - - if (i == NONE && p_says_nonexistent[reverse]) - { -@@ -706,6 +704,7 @@ - if (p_name[i]) - distance_from_minimum[i] = newdirs[i] - newdirs_min; - -+ /* The best of the filenames which create the fewest directories. */ - i = best_name (p_name, distance_from_minimum); - } - } diff --git a/patch.spec b/patch.spec index 0e4245f..37752fa 100644 --- a/patch.spec +++ b/patch.spec @@ -1,17 +1,17 @@ Summary: Utility for modifying/upgrading files Name: patch -Version: 2.6 -Release: 2%{?dist} +Version: 2.6.1 +Release: 1%{?dist} License: GPLv2+ URL: http://www.gnu.org/software/patch/patch.html Group: Development/Tools Source: ftp://ftp.gnu.org/gnu/patch/patch-%{version}.tar.xz Patch1: patch-2.5.4-sigsegv.patch -Patch2: patch-best-name.patch Patch100: patch-selinux.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libselinux-devel +BuildRequires: ed %description The patch program applies diff files to originals. The diff command @@ -26,7 +26,6 @@ applications. %prep %setup -q %patch1 -p1 -b .sigsegv -%patch2 -p1 -b .best-name %patch100 -p1 -b .selinux %build @@ -57,6 +56,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/*/* %changelog +* Mon Jan 4 2010 Tim Waugh 2.6.1-1 +- 2.6.1 (bug #551569). No longer need best-name patch. + * Thu Dec 24 2009 Tim Waugh 2.6-2 - Applied upstream patch to prevent incorrect filename being chosen when adding a new file (bug #549122). diff --git a/sources b/sources index b386173..1dd45ef 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d9d62cb7b98a8a17e42dab910fd2adc9 patch-2.6.tar.xz +057d78436e858c3ed086a544f5e1fe7e patch-2.6.1.tar.xz From 7999de4d9ddd5ebdaafdfddf1a3fa972b6846d4e Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Wed, 17 Feb 2010 02:19:54 +0000 Subject: [PATCH 06/14] Initialize branch F-13 for patch --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..baa94ef --- /dev/null +++ b/branch @@ -0,0 +1 @@ +F-13 From ec53159932a47f108763c7b5274989d69e0c1c47 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Wed, 3 Mar 2010 16:53:46 +0000 Subject: [PATCH 07/14] - Added comments for all patches. - Ship COPYING file. - Removed sparc ifdefs in spec file. --- patch.spec | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/patch.spec b/patch.spec index 37752fa..d7a08e7 100644 --- a/patch.spec +++ b/patch.spec @@ -1,7 +1,7 @@ Summary: Utility for modifying/upgrading files Name: patch Version: 2.6.1 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: http://www.gnu.org/software/patch/patch.html Group: Development/Tools @@ -25,19 +25,17 @@ applications. %prep %setup -q + +# Avoid segfault. %patch1 -p1 -b .sigsegv + +# SELinux support. %patch100 -p1 -b .selinux %build CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" %configure - -# XXX unset CPPFLAGS on (ultra?)sparc to avoid large file system support -%ifarch sparc sparc64 -make CPPFLAGS="" -%else make %{?smp_mflags} -%endif %check make check @@ -51,11 +49,16 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -%doc NEWS README +%doc COPYING NEWS README %{_bindir}/* %{_mandir}/*/* %changelog +* Wed Mar 3 2010 Tim Waugh 2.6.1-2 +- Added comments for all patches. +- Ship COPYING file. +- Removed sparc ifdefs in spec file. + * Mon Jan 4 2010 Tim Waugh 2.6.1-1 - 2.6.1 (bug #551569). No longer need best-name patch. From 5e47e3921e186e2e0fdaa3096b25fa98d4971ec8 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 10 Mar 2010 18:00:04 +0000 Subject: [PATCH 08/14] add patch to fix sigbus in merge code yes the %{sparc} macro, not sure we really need to handle sparc different here --- patch-2.6.1-merge-sigbus.patch | 11 +++++++++++ patch.spec | 9 +++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 patch-2.6.1-merge-sigbus.patch diff --git a/patch-2.6.1-merge-sigbus.patch b/patch-2.6.1-merge-sigbus.patch new file mode 100644 index 0000000..6ab41f6 --- /dev/null +++ b/patch-2.6.1-merge-sigbus.patch @@ -0,0 +1,11 @@ +--- patch-2.6.1/src/bestmatch.h.BAD 2010-03-10 17:55:53.000000000 +0000 ++++ patch-2.6.1/src/bestmatch.h 2010-03-10 17:57:04.000000000 +0000 +@@ -150,7 +150,7 @@ + + done: + if (py) +- *py = ymax; ++ *py = (signed int)ymax; + return c; + } + diff --git a/patch.spec b/patch.spec index 37752fa..063c2ee 100644 --- a/patch.spec +++ b/patch.spec @@ -1,12 +1,13 @@ Summary: Utility for modifying/upgrading files Name: patch Version: 2.6.1 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: http://www.gnu.org/software/patch/patch.html Group: Development/Tools Source: ftp://ftp.gnu.org/gnu/patch/patch-%{version}.tar.xz Patch1: patch-2.5.4-sigsegv.patch +Patch2: patch-2.6.1-merge-sigbus.patch Patch100: patch-selinux.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -27,13 +28,14 @@ applications. %setup -q %patch1 -p1 -b .sigsegv %patch100 -p1 -b .selinux +%patch2 -p1 -b .sigbus %build CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" %configure # XXX unset CPPFLAGS on (ultra?)sparc to avoid large file system support -%ifarch sparc sparc64 +%ifarch %{sparc} make CPPFLAGS="" %else make %{?smp_mflags} @@ -56,6 +58,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/*/* %changelog +* Wed Mar 10 2010 Dennis Gilmore 2.6.1-2 +- add patch to fix sigbus in merge code + * Mon Jan 4 2010 Tim Waugh 2.6.1-1 - 2.6.1 (bug #551569). No longer need best-name patch. From 45dc7c01831a5e60c7869d1c493aa304dd942452 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 12 Mar 2010 22:08:39 +0000 Subject: [PATCH 09/14] disable -fstack-protector on 32 bit sparc for now --- patch-2.6.1-merge-sigbus.patch | 11 ----------- patch.spec | 12 ++++-------- 2 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 patch-2.6.1-merge-sigbus.patch diff --git a/patch-2.6.1-merge-sigbus.patch b/patch-2.6.1-merge-sigbus.patch deleted file mode 100644 index 6ab41f6..0000000 --- a/patch-2.6.1-merge-sigbus.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- patch-2.6.1/src/bestmatch.h.BAD 2010-03-10 17:55:53.000000000 +0000 -+++ patch-2.6.1/src/bestmatch.h 2010-03-10 17:57:04.000000000 +0000 -@@ -150,7 +150,7 @@ - - done: - if (py) -- *py = ymax; -+ *py = (signed int)ymax; - return c; - } - diff --git a/patch.spec b/patch.spec index 063c2ee..14135f4 100644 --- a/patch.spec +++ b/patch.spec @@ -7,7 +7,6 @@ URL: http://www.gnu.org/software/patch/patch.html Group: Development/Tools Source: ftp://ftp.gnu.org/gnu/patch/patch-%{version}.tar.xz Patch1: patch-2.5.4-sigsegv.patch -Patch2: patch-2.6.1-merge-sigbus.patch Patch100: patch-selinux.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -28,18 +27,15 @@ applications. %setup -q %patch1 -p1 -b .sigsegv %patch100 -p1 -b .selinux -%patch2 -p1 -b .sigbus %build CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" +%ifarch sparcv9 +CFLAGS=`echo $CFLAGS|sed -e 's|-fstack-protector||g'` +%endif %configure -# XXX unset CPPFLAGS on (ultra?)sparc to avoid large file system support -%ifarch %{sparc} -make CPPFLAGS="" -%else make %{?smp_mflags} -%endif %check make check @@ -59,7 +55,7 @@ rm -rf $RPM_BUILD_ROOT %changelog * Wed Mar 10 2010 Dennis Gilmore 2.6.1-2 -- add patch to fix sigbus in merge code +- using -fstack-projector causes weirdness on 32 bit sparc so disabling for now * Mon Jan 4 2010 Tim Waugh 2.6.1-1 - 2.6.1 (bug #551569). No longer need best-name patch. From 05e2d2bc6f3f17423239271e78b4647fbf77e1e3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 05:35:23 +0000 Subject: [PATCH 10/14] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 27f5d45..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: patch -# $Id: Makefile,v 1.2 2007/10/15 19:13:12 notting Exp $ -NAME := patch -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attempt a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/branch b/branch deleted file mode 100644 index baa94ef..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -F-13 From 005e61cbd6bc0bf65989b293d7603e9bdf0f3474 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 05:35:26 +0000 Subject: [PATCH 11/14] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 27f5d45..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: patch -# $Id: Makefile,v 1.2 2007/10/15 19:13:12 notting Exp $ -NAME := patch -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attempt a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/branch b/branch deleted file mode 100644 index 06de2d2..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -F-12 From ca881725b1a9ec0bd719512310f5bb542195ed15 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Fri, 6 Aug 2010 17:06:36 +0100 Subject: [PATCH 12/14] Cherry-picked spec file fix-ups from f14 branch. - Added comments for all patches. - Ship COPYING file. - Removed sparc ifdefs in spec file. (cherry picked from commit f474c83f8ab22d59ac204ce13d0525c487bacd78) --- patch.spec | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/patch.spec b/patch.spec index 14135f4..f175c74 100644 --- a/patch.spec +++ b/patch.spec @@ -25,7 +25,11 @@ applications. %prep %setup -q + +# Avoid segfault. %patch1 -p1 -b .sigsegv + +# SELinux support. %patch100 -p1 -b .selinux %build @@ -34,7 +38,6 @@ CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" CFLAGS=`echo $CFLAGS|sed -e 's|-fstack-protector||g'` %endif %configure - make %{?smp_mflags} %check @@ -49,11 +52,16 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -%doc NEWS README +%doc COPYING NEWS README %{_bindir}/* %{_mandir}/*/* %changelog +* Fri Aug 6 2010 Tim Waugh +- Added comments for all patches. +- Ship COPYING file. +- Removed sparc ifdefs in spec file. + * Wed Mar 10 2010 Dennis Gilmore 2.6.1-2 - using -fstack-projector causes weirdness on 32 bit sparc so disabling for now From d15ffc545d548bdb1fe024ecb7db97506b48d6e1 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Fri, 6 Aug 2010 17:08:49 +0100 Subject: [PATCH 13/14] Fixed argument type for --get (bug #553624). (cherry picked from commit 322e73af7aa60ce6d737ce1e4736d4a41e4d5b10) --- patch-get-arg.patch | 12 ++++++++++++ patch.spec | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 patch-get-arg.patch diff --git a/patch-get-arg.patch b/patch-get-arg.patch new file mode 100644 index 0000000..45f3bc8 --- /dev/null +++ b/patch-get-arg.patch @@ -0,0 +1,12 @@ +diff -up patch-2.6.1/src/patch.c.get-arg patch-2.6.1/src/patch.c +--- patch-2.6.1/src/patch.c.get-arg 2010-07-27 18:05:26.217150510 +0100 ++++ patch-2.6.1/src/patch.c 2010-07-27 18:05:47.464150892 +0100 +@@ -558,7 +558,7 @@ static struct option const longopts[] = + {"remove-empty-files", no_argument, NULL, 'E'}, + {"force", no_argument, NULL, 'f'}, + {"fuzz", required_argument, NULL, 'F'}, +- {"get", no_argument, NULL, 'g'}, ++ {"get", required_argument, NULL, 'g'}, + {"input", required_argument, NULL, 'i'}, + {"ignore-whitespace", no_argument, NULL, 'l'}, + #ifdef ENABLE_MERGE diff --git a/patch.spec b/patch.spec index f175c74..d1afe6a 100644 --- a/patch.spec +++ b/patch.spec @@ -1,12 +1,13 @@ Summary: Utility for modifying/upgrading files Name: patch Version: 2.6.1 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ URL: http://www.gnu.org/software/patch/patch.html Group: Development/Tools Source: ftp://ftp.gnu.org/gnu/patch/patch-%{version}.tar.xz Patch1: patch-2.5.4-sigsegv.patch +Patch2: patch-get-arg.patch Patch100: patch-selinux.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -29,6 +30,9 @@ applications. # Avoid segfault. %patch1 -p1 -b .sigsegv +# Fixed argument type for --get (bug #553624). +%patch2 -p1 -b .get-arg + # SELinux support. %patch100 -p1 -b .selinux @@ -57,6 +61,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/*/* %changelog +* Fri Aug 6 2010 Tim Waugh 2.6.1-3 +- Fixed argument type for --get (bug #553624). + * Fri Aug 6 2010 Tim Waugh - Added comments for all patches. - Ship COPYING file. From 35f37f091cb45f231668881f894d83aa9bd9eaff Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Fri, 6 Aug 2010 16:59:40 +0100 Subject: [PATCH 14/14] Fixed interpretation of return value from getfilecon(). --- patch-selinux.patch | 2 +- patch.spec | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/patch-selinux.patch b/patch-selinux.patch index 3c2774f..d88e222 100644 --- a/patch-selinux.patch +++ b/patch-selinux.patch @@ -83,7 +83,7 @@ diff -up patch-2.6/src/patch.c.selinux patch-2.6/src/patch.c + if (! inerrno && incontext) + { + security_context_t outcontext; -+ if (! getfilecon (outname, &outcontext) && ++ if (getfilecon (outname, &outcontext) != -1 && + outcontext && + strcmp(outcontext, incontext) && + setfilecon (outname, incontext) != 0) diff --git a/patch.spec b/patch.spec index d1afe6a..ed6fb9a 100644 --- a/patch.spec +++ b/patch.spec @@ -62,6 +62,7 @@ rm -rf $RPM_BUILD_ROOT %changelog * Fri Aug 6 2010 Tim Waugh 2.6.1-3 +- Fixed interpretation of return value from getfilecon(). - Fixed argument type for --get (bug #553624). * Fri Aug 6 2010 Tim Waugh