8 Jan
2010
8 Jan
'10
16:31
Hello community, here is the log from the commit of package patch for openSUSE:Factory checked in at Fri Jan 8 17:31:54 CET 2010. -------- --- patch/patch.changes 2009-12-21 14:24:22.000000000 +0100 +++ /mounts/work_src_done/STABLE/patch/patch.changes 2009-12-30 17:19:02.000000000 +0100 @@ -1,0 +2,15 @@ +Wed Dec 30 17:14:24 CET 2009 - agruen@suse.de + +- Version 2.6.1: + + Support for diff3(1) style merges which show the old, original, + and new lines of a conflict has been added (--merge=diff3). + The default still is the merge(1) format (--merge or + --merge=merge). + + Bug and portability fixes. + +------------------------------------------------------------------- +Sun Dec 6 17:32:57 CET 2009 - jengelh + +- enable parallel building + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- patch-2.6.tar.bz2 New: ---- patch-2.6.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ patch.spec ++++++ --- /var/tmp/diff_new_pack.saKVjm/_old 2010-01-08 17:31:41.000000000 +0100 +++ /var/tmp/diff_new_pack.saKVjm/_new 2010-01-08 17:31:41.000000000 +0100 @@ -1,7 +1,7 @@ # -# spec file for package patch (Version 2.6) +# spec file for package patch (Version 2.6.1) # -# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ License: GPLv3+ Group: Productivity/Text/Utilities AutoReqProv: on -Version: 2.6 +Version: 2.6.1 Release: 1 Summary: GNU patch Source: ftp://alpha.gnu.org/gnu/patch/patch-%ver.tar.bz2 ++++++ patch-2.6.tar.bz2 -> patch-2.6.1.tar.bz2 ++++++ ++++ 1834 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/ChangeLog new/patch-2.6.1/ChangeLog --- old/patch-2.6/ChangeLog 2009-11-12 17:25:08.000000000 +0100 +++ new/patch-2.6.1/ChangeLog 2009-12-30 16:30:32.000000000 +0100 @@ -1,3 +1,77 @@ +2009-12-30 Andreas Gruenbacher+ + * patch.man: Clarify the description of the -F / --fuzz option. + + * NEWS: Version 2.6.1 released. + +2009-12-29 Andreas Gruenbacher + + * src/patch.c (longopts, get_some_switches): Add an optional argument + to the --merge option to choose the output formats for conflicts. + * patch.man: Document the new optional argument of --merge. + * src/merge.c (merge_hunk): Implement diff3-style conflicts. + * src/common.h (conflict_style): This global variable determines the + output format for conflicts. + * tests/merge: Add test cases for the diff3 output format. + + * patch.man: Try to improve the documentation of patch's CRLF handling + behavior. + +2009-12-28 Andreas Gruenbacher + + * tests/create-delete: Clean up a syntactic glitch. + + * src/pch.c: When the input files to diff have CRLF line endings, the + '<' and '>' lines of normal-style diffs will have CRLF endings even + when the patch itself has not been CRLF mangled. Do not assume a + mangled patch in this case. + * tests/crlf-handling: Update test case to cover this case. + + * configure.ac (gl_FUNC_STRNDUP, gl_FUNC_STRNLEN): Add here. + * gl/m4/strndup.m4 (gl_HEADER_STRING_H_DEFAULTS): Don't use gnulib's + strings.h replacement for now, it is too complicated to add right now. + * gl/lib/xstrndup.c: Instead of using gl_HEADER_STRING_H_DEFAULTS, + declare strndup here on systems which don't have it. + * gl/lib/strndup.c: Instead of using gl_HEADER_STRING_H_DEFAULTS, + declare strnlen here on systems which don't have it. + * gl/lib/strnlen.c: Import from gnulib. + + * Makefile.in (getopt.h, GETOPT_H): Generate getopt.h in the top-level + directory if needed. + (stdbool.h, STDBOOL_H): Likewise -- this should fix stdbool.h + generation on platforms which don't provide this header. + (argmatch.$(OBJEXT)): Add missing $(STDBOOL_H) dependency. + + * install-sh: Make executable. + +2009-12-22 Andreas Gruenbacher + + * src/version.c (copyright_string): Add year 2009. + + * src/pch.c (intuit_diff_type): Add some clarifying comments. + + * src/pch.c (intuit_diff_type): Fix regression introduced after patch + 2.5.9: when none of the filenames in the old, new, and index headers + exists, patch chose the wrong filename (bug 28367). + (maybe_reverse): Return if the patch looks reversed, not if this + function toggled the reverse flag. + * tests/filename-choice: New test case. + * Makefile.in (TESTS): Add test case. + +2009-11-24 Bert Wesarg + + * configure.ac: It looks like the . command does not pass the + arguments to the update-version.sh script [on some platforms]. Invoke + with sh instead. + +2009-11-21 Peter Breitenlohner + + * Makefile.in: Make the test suite work for a VPATH build. + +2009-11-14 Andreas Gruenbacher + + * update-version.sh: Platform compatibility fixes. + 2009-11-12 Andreas Gruenbacher * NEWS: Version 2.6 released. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/NEWS new/patch-2.6.1/NEWS --- old/patch-2.6/NEWS 2009-11-12 17:24:40.000000000 +0100 +++ new/patch-2.6.1/NEWS 2009-12-30 16:29:51.000000000 +0100 @@ -1,3 +1,10 @@ +Changes in version 2.6.1: + +* Support for diff3(1) style merges which show the old, original, and new lines + of a conflict has been added (--merge=diff3). The default still is the + merge(1) format (--merge or --merge=merge). +* Bug and portability fixes. + Changes in version 2.6: * A regression test suite has been added ("make check"). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/VERSION new/patch-2.6.1/VERSION --- old/patch-2.6/VERSION 2009-11-12 17:25:54.000000000 +0100 +++ new/patch-2.6.1/VERSION 2009-12-30 16:31:47.000000000 +0100 @@ -1 +1 @@ -2.6 +2.6.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/config.hin new/patch-2.6.1/config.hin --- old/patch-2.6/config.hin 2009-11-03 13:46:27.000000000 +0100 +++ new/patch-2.6.1/config.hin 2009-12-30 16:32:08.000000000 +0100 @@ -89,6 +89,14 @@ don't. */ #undef HAVE_DECL_STRERROR_R +/* Define to 1 if you have the declaration of `strndup', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNDUP + +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNLEN + /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H @@ -188,6 +196,9 @@ /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP +/* Define if you have the strndup() function and it works. */ +#undef HAVE_STRNDUP + /* Define if struct utimbuf is declared -- usually in . Some systems have utime.h but don't declare the struct anywhere. */ #undef HAVE_STRUCT_UTIMBUF @@ -318,3 +329,6 @@ /* Define as a signed type of the same size as size_t. */ #undef ssize_t + +/* Define to rpl_strnlen if the replacement function should be used. */ +#undef strnlen diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/configure.ac new/patch-2.6.1/configure.ac --- old/patch-2.6/configure.ac 2009-11-02 20:09:57.000000000 +0100 +++ new/patch-2.6.1/configure.ac 2009-12-30 13:56:30.000000000 +0100 @@ -21,7 +21,7 @@ AC_PREREQ(2.57) define(AC_PACKAGE_VERSION, m4_normalize(esyscmd( [ - . ./update-version.sh VERSION + sh ./update-version.sh VERSION cat VERSION ]))) AC_INIT(patch, AC_PACKAGE_VERSION, bug-patch@gnu.org) @@ -58,6 +58,8 @@ gl_ERROR gl_EXITFAIL gl_FUNC_MEMCHR +gl_FUNC_STRNDUP +gl_FUNC_STRNLEN gl_GETOPT gl_HASH gl_PREREQ_XMALLOC diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/gl/lib/strndup.c new/patch-2.6.1/gl/lib/strndup.c --- old/patch-2.6/gl/lib/strndup.c 2009-11-02 20:09:57.000000000 +0100 +++ new/patch-2.6.1/gl/lib/strndup.c 2009-12-30 13:56:30.000000000 +0100 @@ -23,6 +23,10 @@ #include +#ifndef HAVE_DECL_STRNLEN +extern size_t strnlen (const char *, size_t); +#endif + char * strndup (char const *s, size_t n) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/gl/lib/xstrndup.c new/patch-2.6.1/gl/lib/xstrndup.c --- old/patch-2.6/gl/lib/xstrndup.c 2009-11-02 20:09:57.000000000 +0100 +++ new/patch-2.6.1/gl/lib/xstrndup.c 2009-12-30 13:56:30.000000000 +0100 @@ -23,6 +23,10 @@ #include #include "xalloc.h" +#ifndef HAVE_DECL_STRNDUP +extern char *strndup (const char *, size_t); +#endif + /* Return a newly allocated copy of at most N bytes of STRING. In other words, return a copy of the initial segment of length N of STRING. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/gl/m4/strndup.m4 new/patch-2.6.1/gl/m4/strndup.m4 --- old/patch-2.6/gl/m4/strndup.m4 2009-11-02 20:09:57.000000000 +0100 +++ new/patch-2.6.1/gl/m4/strndup.m4 2009-12-30 13:56:30.000000000 +0100 @@ -9,7 +9,7 @@ dnl Persuade glibc to declare strndup(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + dnl AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) AC_CHECK_DECLS_ONCE([strndup]) if test $ac_cv_have_decl_strndup = no; then HAVE_DECL_STRNDUP=0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/patch.man new/patch-2.6.1/patch.man --- old/patch-2.6/patch.man 2009-11-02 20:09:57.000000000 +0100 +++ new/patch-2.6.1/patch.man 2009-12-30 14:52:11.000000000 +0100 @@ -64,9 +64,8 @@ diff listing to .BR patch , and it should work. -If the entire diff is indented by a consistent amount, -or if a context diff contains lines ending in \s-1CRLF\s0 -or is encapsulated one or more times by prepending +If the entire diff is indented by a consistent amount, if lines end in \s-1CRLF\s0, +or if a diff is encapsulated one or more times by prepending "\fB\- \fP" to lines starting with "\fB\-\fP" as specified by Internet RFC 934, this is taken into account. After removing indenting or encapsulation, @@ -307,8 +306,9 @@ Write all files in binary mode, except for standard output and .BR /dev/tty . When reading, disable the heuristic for transforming CRLF line endings into LF -line endings. -(On \s-1POSIX\s0-conforming systems, reads and writes never transform line +line endings. This option is needed on \s-1POSIX\s0 systems when applying patches +generated on non-\s-1POSIX\s0 systems to non-\s-1POSIX\s0 files. +(On \s-1POSIX\s0 systems, file reads and writes never transform line endings. On Windows, reads and writes do transform line endings by default, and patches should be generated by .B "diff\ \*=binary" @@ -369,10 +369,11 @@ Set the maximum fuzz factor. This option only applies to diffs that have context, and causes .B patch -to ignore up to that many lines in looking for places to install a hunk. +to ignore up to that many lines of context in looking for places to install a hunk. Note that a larger fuzz factor increases the odds of a faulty patch. -The default fuzz factor is 2, and it may not be set to more than -the number of lines of context in the context diff, ordinarily 3. +The default fuzz factor is 2. A fuzz factor greater than or equal to the +number of lines of context in the context diff, ordinarily 3, ignores all +context. .TP \fB\-g\fP \fInum\fP or \fB\*=get=\fP\fInum\fP This option controls @@ -414,25 +415,31 @@ Normal characters must still match exactly. Each line of the context must still match a line in the original file. .TP -\fB\*=merge\fP -Merge a patch file into the original files similar to \fBmerge\fP(1). If a -conflict is found, \fBpatch\fP outputs a warning and brackets the conflict -with \fB<<<<<<<\fP and \fB>>>>>>>\fP lines. A typical conflict will look like -this: +\fB\*=merge\fP or \fB\*=merge=merge\fP or \fB\*=merge=diff3\fP +Merge a patch file into the original files similar to \fBdiff3\fP(1) or +\fBmerge\fP(1). If a conflict is found, \fBpatch\fP outputs a warning and +brackets the conflict with \fB<<<<<<<\fP and \fB>>>>>>>\fP lines. +A typical conflict will look like this: .LP .RS .nf .B <<<<<<< .I lines from the original file +.B ||||||| +.I original lines from the patch .B ======= -.I lines from the patch +.I new lines from the patch .B >>>>>>> .RE .fi .IP "" 3 -If there are conflicts, the user should edit the result and delete one -of the alternatives. This option implies \fB\*=forward\fP and does not -take the \fB--fuzz\fR=\fInum\fP option into account. +The optional argument of \fB\*=merge\fP determines the output format for +conflicts: the diff3 format shows the \fB|||||||\fP section with the original +lines from the patch; in the merge format, this section is missing. The merge +format is the default. + +This option implies \fB\*=forward\fP and does not take the +\fB--fuzz\fR=\fInum\fP option into account. .TP \fB\-n\fP or \fB\*=normal\fP Interpret the patch file as a normal diff. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/src/common.h new/patch-2.6.1/src/common.h --- old/patch-2.6/src/common.h 2009-11-02 20:09:57.000000000 +0100 +++ new/patch-2.6.1/src/common.h 2009-12-30 13:56:30.000000000 +0100 @@ -283,6 +283,9 @@ bool similar (char const *, size_t, char const *, size_t); #ifdef ENABLE_MERGE +enum conflict_style { MERGE_MERGE, MERGE_DIFF3 }; +XTERN enum conflict_style conflict_style; + bool merge_hunk (int hunk, struct outstate *, LINENUM where, bool *); #else # define merge_hunk(hunk, outstate, where, somefailed) false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/src/merge.c new/patch-2.6.1/src/merge.c --- old/patch-2.6/src/merge.c 2009-11-02 20:09:57.000000000 +0100 +++ new/patch-2.6.1/src/merge.c 2009-12-30 13:56:30.000000000 +0100 @@ -201,6 +201,7 @@ { bool applies_cleanly; bool first_result = true; + bool already_applied; FILE *fp = outstate->ofp; LINENUM old = 1; LINENUM firstold = pch_ptrn_lines (); @@ -426,9 +427,19 @@ && context_matches_file (firstnew, lastwhere); firstin++, firstnew++, lastwhere++) continue; - if (firstin == in && firstnew == new) + already_applied = (firstin == in && firstnew == new); + if (already_applied) merge_result (&first_result, hunk, "already applied", where, lastwhere - 1); + if (conflict_style == MERGE_DIFF3) + { + LINENUM common_prefix = lastwhere - where; + + /* Forget about common prefix lines. */ + firstin -= common_prefix; + firstnew -= common_prefix; + lastwhere -= common_prefix; + } if (where != lastwhere) { where = lastwhere; @@ -436,23 +447,27 @@ return false; } - if (firstin < in || firstnew < new) + if (! already_applied) { - LINENUM common_suffix; + LINENUM common_suffix = 0; LINENUM lines; - /* Remember common suffix lines. */ - for (common_suffix = 0, - lastwhere = where + (in - firstin); - firstin < in && firstnew < new - && context_matches_file (new - 1, lastwhere - 1); - in--, new--, lastwhere--, common_suffix++) - continue; + if (conflict_style == MERGE_MERGE) + { + /* Remember common suffix lines. */ + for (lastwhere = where + (in - firstin); + firstin < in && firstnew < new + && context_matches_file (new - 1, lastwhere - 1); + in--, new--, lastwhere--, common_suffix++) + continue; + } lines = 3 + (in - firstin) + (new - firstnew); + if (conflict_style == MERGE_DIFF3) + lines += 1 + (old - firstold); merge_result (&first_result, hunk, "NOT MERGED", where, where + lines - 1); - out_offset += 3 + (new - firstnew); + out_offset += lines - (in - firstin); fputs (outstate->after_newline + "\n<<<<<<<\n", fp); outstate->after_newline = true; @@ -462,6 +477,18 @@ if (! copy_till (outstate, where - 1)) return false; } + + if (conflict_style == MERGE_DIFF3) + { + fputs (outstate->after_newline + "\n|||||||\n", fp); + outstate->after_newline = true; + while (firstold < old) + { + outstate->after_newline = pch_write_line (firstold, fp); + firstold++; + } + } + fputs (outstate->after_newline + "\n=======\n", fp); outstate->after_newline = true; while (firstnew < new) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/src/patch.c new/patch-2.6.1/src/patch.c --- old/patch-2.6/src/patch.c 2009-11-02 20:09:57.000000000 +0100 +++ new/patch-2.6.1/src/patch.c 2009-12-30 13:56:30.000000000 +0100 @@ -544,7 +544,7 @@ {"input", required_argument, NULL, 'i'}, {"ignore-whitespace", no_argument, NULL, 'l'}, #ifdef ENABLE_MERGE - {"merge", no_argument, NULL, 'm'}, + {"merge", optional_argument, NULL, 'm'}, #endif {"normal", no_argument, NULL, 'n'}, {"forward", no_argument, NULL, 'N'}, @@ -737,7 +737,18 @@ break; #ifdef ENABLE_MERGE case 'm': - merge = true; + merge = true; + if (optarg) + { + if (! strcmp (optarg, "merge")) + conflict_style = MERGE_MERGE; + else if (! strcmp (optarg, "diff3")) + conflict_style = MERGE_DIFF3; + else + usage (stderr, 2); + } + else + conflict_style = MERGE_MERGE; break; #endif case 'n': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/src/pch.c new/patch-2.6.1/src/pch.c --- old/patch-2.6/src/pch.c 2009-11-02 20:09:57.000000000 +0100 +++ new/patch-2.6.1/src/pch.c 2009-12-30 13:56:30.000000000 +0100 @@ -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. */ @@ -574,7 +573,6 @@ p_start = previous_line; p_sline = p_input_line - 1; p_indent = indent; - p_strip_trailing_cr = strip_trailing_cr; retval = NORMAL_DIFF; goto scan_exit; } @@ -638,6 +636,7 @@ if (! posixly_correct) { + /* The best of all existing files. */ i = best_name (p_name, stat_errno); if (i == NONE && patch_get) @@ -680,12 +679,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 +703,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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/src/version.c new/patch-2.6.1/src/version.c --- old/patch-2.6/src/version.c 2009-11-02 20:09:57.000000000 +0100 +++ new/patch-2.6.1/src/version.c 2009-12-30 13:56:30.000000000 +0100 @@ -8,7 +8,7 @@ static char const copyright_string[] = "\ Copyright (C) 1988 Larry Wall\n\ -Copyright (C) 2003 Free Software Foundation, Inc."; +Copyright (C) 2003, 2009 Free Software Foundation, Inc."; static char const free_software_msgid[] = "\ This program comes with NO WARRANTY, to the extent permitted by law.\n\ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/tests/crlf-handling new/patch-2.6.1/tests/crlf-handling --- old/patch-2.6/tests/crlf-handling 2009-11-02 20:09:57.000000000 +0100 +++ new/patch-2.6.1/tests/crlf-handling 2009-12-30 13:56:30.000000000 +0100 @@ -13,8 +13,9 @@ use_tmpdir lf2crlf() { - while read l; do echo -e "$l\r"; done \ + while read l; do echo -e "$l\r"; done } + echo 1 > a echo 1b > b @@ -51,6 +52,19 @@ echo 1 | lf2crlf > a echo 1b | lf2crlf > b + +diff a b > ab.diff +cp a c +check 'patch c < ab.diff' < ab.diff cp a c check 'patch c < ab.diff' < ab.diff +cp a c +check 'patch c < ab.diff' < ab.diff +cp a c +check 'patch c < ab.diff' < a echo 1b > b + +diff a b | lf2crlf > ab.diff +cp a c +check 'patch c < ab.diff' < c +check 'patch --binary c < ab.diff' < ab.diff cp a c check 'patch c < ab.diff' < c +lf2crlf < a > c +check 'patch --binary c < ab.diff' < ab.diff +cp a c +check 'patch c < ab.diff' < c check 'patch --binary c < ab.diff' < a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/tests/filename-choice new/patch-2.6.1/tests/filename-choice --- old/patch-2.6/tests/filename-choice 1970-01-01 01:00:00.000000000 +0100 +++ new/patch-2.6.1/tests/filename-choice 2009-12-30 13:56:30.000000000 +0100 @@ -0,0 +1,32 @@ +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, +# in any medium, are permitted without royalty provided the copyright +# notice and this notice are preserved. + +# Don't recognize hunks before a filename has been specified/seen + +. $srcdir/test-lib.sh + +require_cat +use_local_patch +use_tmpdir + +# ============================================================== + +#export GDB=1 + +cat > f.diff < a @@ -39,13 +39,19 @@ shift done echo "$body" | sed$sed -e b > c - output=`diff -u a b | patch $ARGS -f --merge c` + output=`diff -u a b | patch $ARGS -f c` status=$? echo "$output" | sed -e '/^\(\|patching file c\)$/d' cat c test $status == 0 || echo "Status: $status" } +x() { + ARGS="$ARGS --merge" x2 "$@" + echo + ARGS="$ARGS --merge=diff3" x2 "$@" +} + unset ARGS # ============================================================== @@ -54,17 +60,28 @@ 1 2 3 + +1 +2 +3 EOF check 'x 3 2d' < >>>>>> 3 Status: 1 + +Hunk #1 NOT MERGED at 2-8. +1 +<<<<<<< +2c +||||||| +2 +======= +2b +>>>>>>> +3 +Status: 1 EOF check 'x 3 2d -- 2d' < >>>>>> 4 Status: 1 + +Hunk #1 NOT MERGED at 2-9. +1 +<<<<<<< +2 +||||||| +2 +3 +======= +3 +>>>>>>> +4 +Status: 1 EOF check 'x 4 3d -- 2d' < >>>>>> 4 Status: 1 + +Hunk #1 NOT MERGED at 2-9. +1 +<<<<<<< +3 +||||||| +2 +3 +======= +2 +>>>>>>> +4 +Status: 1 EOF # ============================================================== @@ -151,6 +230,18 @@ >>>>>>> 3 Status: 1 + +Hunk #1 NOT MERGED at 2-8. +1 +<<<<<<< +||||||| +2 +======= +2 +b +>>>>>>> +3 +Status: 1 EOF check 'x 3 2d -- 3ib' < >>>>>> 3 Status: 1 + +Hunk #1 NOT MERGED at 2-8. +1 +<<<<<<< +2 +b +||||||| +2 +======= +>>>>>>> +3 +Status: 1 EOF # ============================================================== +# (Note that the output here differs from the diff3 output: +# patch does not have enough information to know that the "c" +# on the last line is part of the conflict. + check 'x 1 1cb -- 1cc' < >>>>>> c Status: 1 + +Hunk #1 NOT MERGED at 1-6. +<<<<<<< +||||||| +1 +======= +b +>>>>>>> +c +Status: 1 EOF check 'x 4 2ca 3cb -- 2ca 3cc' < >>>>>> 4 Status: 1 + +Hunk #1 NOT MERGED at 2-11. +1 +<<<<<<< +a +c +||||||| +2 +3 +======= +a +b +>>>>>>> +4 +Status: 1 EOF check 'x 6 3c3b 4c4b -- 3c3c 4c4c' < >>>>>> +5 +6 +Status: 1 EOF check 'x 4 2cb 3ca -- 2cc 3ca' < >>>>>> +4 +Status: 1 EOF check 'x 3 2ib 3ib -- 2ic' < >>>>>> +2 +b +3 +Status: 1 EOF check 'x 3 2ib 3ib 3ib -- 2ic' < >>>>>> +2 +b +b +3 +Status: 1 EOF check 'x 9 4ca 5cb 6ca -- 4ca 5cc 6ca' < >>>>>> +7 +8 +9 +Status: 1 EOF check 'x 3 2ib 3ib -- 1i0' < >>>>>> 5 Status: 1 + +Hunk #1 NOT MERGED at 2-11. +1 +<<<<<<< +2 +3c +4 +||||||| +2 +3 +4 +======= +>>>>>>> +5 +Status: 1 EOF check 'x 5 3c3c -- 2,4d' < >>>>>> 5 Status: 1 + +Hunk #1 NOT MERGED at 2-11. +1 +<<<<<<< +||||||| +2 +3 +4 +======= +2 +3c +4 +>>>>>>> +5 +Status: 1 EOF # ============================================================== @@ -327,6 +587,19 @@ >>>>>>> 3 Status: 1 + +Hunk #1 NOT MERGED at 1-9. +<<<<<<< +1 +c +2 +||||||| +1 +2 +======= +>>>>>>> +3 +Status: 1 EOF check 'x 3 2ic -- 1,2d' < >>>>>> +3 +Status: 1 + +Hunk #1 NOT MERGED at 1-9. +<<<<<<< +||||||| +1 +2 +======= +1 +c 2 >>>>>>> 3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/patch-2.6/update-version.sh new/patch-2.6.1/update-version.sh --- old/patch-2.6/update-version.sh 2009-11-02 20:09:57.000000000 +0100 +++ new/patch-2.6.1/update-version.sh 2009-12-30 13:56:30.000000000 +0100 @@ -20,8 +20,8 @@ if git diff-index --name-only HEAD | read dummy; then echo -dirty fi` - if test "`expr substr "$1" 1 1`" = v ; then - set -- "`expr substr "$1" 2 "(" length "$1" - 1 ")"`" "$2" + if test "`expr substr $1 1 1`" = v ; then + set -- "`expr substr $1 2 \( length $1 - 1 \)`" $2 fi echo $1$2 > .$version.tmp if test ! -e $version \ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org