~ubuntu-branches/ubuntu/trusty/patch/trusty-security

« back to all changes in this revision

Viewing changes to ChangeLog

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Berg
  • Date: 2009-12-02 10:25:26 UTC
  • mfrom: (5.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20091202102526-5luk0zsqhghu58l2
Tags: 2.6-2
* Update watch file.
* Section: vcs.
* Suggests: diffutils-doc instead of diff-doc, thanks Christoph Anton
  Mitterer for spotting. Closes: #558974.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
2009-11-12  Andreas Gruenbacher  <agruen@suse.de>
 
2
 
 
3
        * NEWS: Version 2.6 released.
 
4
 
 
5
2009-10-27  Andreas Gruenbacher  <agruen@suse.de>
 
6
 
 
7
        * patch.man: Fix typo (reported by Vytautas Šaltenis).
 
8
 
 
9
        * src/merge.c: Clarify the message when (part of) a hunk cannot be
 
10
        merged.
 
11
        * tests/merge: Adapt the test case.
 
12
 
 
13
2009-09-04  Andreas Gruenbacher  <agruen@suse.de>
 
14
 
 
15
        * Makefile.in (LIBSRCS, LIBHDRS, LIBM4FILES): Add the gnulib which
 
16
        were imported on 2009-06-05 here as well.
 
17
 
 
18
        * src/partime.c (main): Try to preserve the owning group of patched
 
19
        files.
 
20
 
 
21
2009-07-19  Andreas Gruenbacher  <agruen@suse.de>
 
22
 
 
23
        * gl/lib/full-write.c, gl/lib/safe-write.c, gl/lib/full-write.h,
 
24
        gl/lib/safe-write.h, gl/m4/safe-write.m4, gl/m4/ssize_t.m4:
 
25
        Import full_write() and its prerequesites from gnulib.
 
26
        * Makefile.in (LIBSRCS, LIBHDRS, LIBM4FILES): Add new files.
 
27
        Add new dependencies.
 
28
        * configure.ac (gl_SAFE_WRITE): Needef for full_write().
 
29
        * src/util.c: Include full-write.h.
 
30
        (copy_to_fd): use full_write() instead of write().
 
31
 
 
32
        * src/partime.c: The -m option hasn't been officially allocated yet.
 
33
        Use only the long form for now (--merge).
 
34
 
 
35
2009-06-15  Andreas Gruenbacher  <agruen@suse.de>
 
36
 
 
37
        * src/util.c (move_file): Don't fail when removing nonexistent
 
38
        files: this condition is already checked in maybe_reverse().
 
39
 
 
40
2009-06-05  Andreas Gruenbacher  <agruen@suse.de>
 
41
 
 
42
        * gl/lib/getopt_int.h, gl/lib/strndup.c, gl/m4/strndup.m4: Add
 
43
        some missing gnulib files.
 
44
        * Makefile.in (GETOPT_H): Include subdirectory (gl/lib/) when
 
45
        using the gnulib version.
 
46
 
 
47
        * src/patch.c: When sending output to stdout, use dup2 to redirect
 
48
        messages to stderr; simply assigning stderr to stdout doesn't work on
 
49
        some platforms.
 
50
        * gl/lib/dup2.c, gl/m4/dup2.m4: Import from gnulib.
 
51
 
 
52
        * gl/lib/rename.c, gl/m4/rename.m4: Import from gnulib for platforms
 
53
        like Mingw.
 
54
 
 
55
2009-05-12  Andreas Gruenbacher  <agruen@suse.de>
 
56
 
 
57
        * src/merge.c (locate_merge): Make sure to return a line number
 
58
        bigger than last_frozen_line.
 
59
 
 
60
        * src/patch.c (explicit_inname): New variable.
 
61
        (get_some_switches): Set to true when the filename to patch has been
 
62
        specified on the command line.
 
63
        (reinitialize_almost_everything): Do not reset the input filename
 
64
        between patches when it has been specified on the command line.
 
65
        * tests/inname: New test case.
 
66
        * Makefile.in: Add test case.
 
67
 
 
68
2009-04-11  Vincent Legoll <vincent.legoll@gmail.com>
 
69
 
 
70
        * src/patch.c (main): Always set patch_get to 0 unless PATCH_GET is
 
71
        set.
 
72
        * patch.man: Update accordingly.
 
73
 
 
74
2009-04-11  Andreas Gruenbacher  <agruen@suse.de>
 
75
 
 
76
        * update-version.sh, configure.ac, Makefile.in: Portability
 
77
        improvements.
 
78
 
 
79
2009-04-08  Andreas Gruenbacher  <agruen@suse.de>
 
80
 
 
81
        * src/patch.c (create_output_file): Add support for sending output
 
82
        to standard output.
 
83
        (main): Allow -o -.  Remove redundant check.
 
84
        * patch.man: Document the new use of -o.
 
85
 
 
86
        * src/pch.c (there_is_another_patch): Allow special characters in
 
87
        filenames read interactively.
 
88
 
 
89
        * src/util.c (fetchname): Don't forget to NUL terminate ptimestr.
 
90
 
 
91
2009-04-07  Andreas Gruenbacher  <agruen@suse.de>
 
92
 
 
93
        * src/util.c (file_id_hasher): Adapt to Gnulib type change.
 
94
        * Makefile.in: Fix out-of-tree builds.
 
95
        (dist): Optionally also create bzip2 and xz tarballs.
 
96
        * NEWS: Update.
 
97
 
 
98
        * patch.man: Replace "systems like DOS" with "Windows". Spelling.
 
99
 
 
100
        Preserve timestamps in reject files.
 
101
        * src/pch.c (p_timestr): New variable.
 
102
        (intuit_diff_type): Set p_timestr here through fetchname().
 
103
        (pch_timestr): New function.
 
104
        * src/pch.h (pch_timestr): Declare.
 
105
        * src/util.c (fetchname): Return the timestamp as string when asked to.
 
106
        * src/util.h (fetchname): Update declaration.
 
107
        * tests/preserve-c-function-names, tests/reject-format: Update.
 
108
 
 
109
2009-04-06  Andreas Gruenbacher  <agruen@suse.de>
 
110
 
 
111
        Fix the "patch would create" fix from 2009-03-28.
 
112
        * src/pch.c (maybe_reverse): New function.
 
113
        (intuit_diff_type): Move the check back here from
 
114
        there_is_another_patch(), but compute it using maybe_reverse().  If
 
115
        an input file name has been specified, do this check here as well.
 
116
        * src/patch.c (main): Only set outname if we are not skipping the
 
117
        patch.
 
118
        * src/inp.c (get_input_file): We may get here without a file to read
 
119
        as well now; don't abort in this case.
 
120
        * tests/create-delete: Add test cases covering the previously-broken
 
121
        code paths.
 
122
 
 
123
        * Makefile.in (MISC): Add config.guess and config.sub.
 
124
 
 
125
        * src/partime.c (parse_pattern_letter): Fix for timestamps with
 
126
        seconds > 59.5 from Christian Franke.
 
127
 
 
128
2009-04-05  Andreas Gruenbacher  <agruen@suse.de>
 
129
 
 
130
        * util.c (create_backup): We also need to create base directories
 
131
        with a --prefix without slashes and a filename with slashes. A
 
132
        --suffix cannot contain slashes, though.
 
133
        * merge.c (merge_hunk): Add missing outstate->zero_output = false.
 
134
 
 
135
        Move all source and header files into src/.
 
136
        * Makefile.in, tests/test-lib.sh, configure.ac: Update accordingly.
 
137
        Move all Gnulib files below gl/, and all other source and header
 
138
        files into src/.
 
139
        * Makefile.in, tests/test-lib.sh, configure.ac, autogen.sh: Update
 
140
        accordingly.
 
141
        * m4/st_mtim.m4: Remove (obsolete since 2009-03-28).
 
142
 
 
143
        Update to the latest version of Gnulib.
 
144
        * config.guess, config.sub, gl/lib/getopt.hin, gl/lib/mbrtowc.c,
 
145
        gl/lib/stripslash.c, gl/lib/verify.h, gl/lib/xstrndup.c,
 
146
        gl/lib/xstrndup.h, gl/m4/argmatch.m4, gl/m4/double-slash-root.m4,
 
147
        gl/m4/gettext.m4, gl/m4/inline.m4, gl/m4/minmax.m4,
 
148
        gl/m4/xstrndup.m4: New files.
 
149
        * gl/lib/argmatch.c, gl/lib/argmatch.h, gl/lib/backupfile.c,
 
150
        gl/lib/backupfile.h, gl/lib/basename.c, gl/lib/dirname.c,
 
151
        gl/lib/dirname.h, gl/lib/error.c, gl/lib/error.h, gl/lib/exitfail.c,
 
152
        gl/lib/exitfail.h, gl/lib/getopt.c, gl/lib/getopt1.c, gl/lib/gettext.h,
 
153
        gl/lib/hash.c, gl/lib/hash.h, gl/lib/malloc.c, gl/lib/memchr.c,
 
154
        gl/lib/quote.c, gl/lib/quote.h, gl/lib/quotearg.c, gl/lib/quotearg.h,
 
155
        gl/lib/realloc.c, gl/lib/strcasecmp.c, gl/lib/strncasecmp.c,
 
156
        gl/lib/unlocked-io.h, gl/lib/xalloc.h, gl/lib/xmalloc.c: Modified.
 
157
        * gl/m4/backupfile.m4, gl/m4/d-ino.m4, gl/m4/dirname.m4, gl/m4/dos.m4,
 
158
        gl/m4/error.m4, gl/m4/exitfail.m4, gl/m4/extensions.m4,
 
159
        gl/m4/getopt.m4, gl/m4/hash.m4, gl/m4/malloc.m4, gl/m4/mbrtowc.m4,
 
160
        gl/m4/mbstate_t.m4, gl/m4/memchr.m4, gl/m4/onceonly.m4, gl/m4/quote.m4,
 
161
        gl/m4/quotearg.m4, gl/m4/realloc.m4, gl/m4/stdbool.m4,
 
162
        gl/m4/unlocked-io.m4, gl/m4/utimbuf.m4, gl/m4/xalloc.m4: Likewise.
 
163
        * install-sh, mkinstalldirs: Likewise.
 
164
        * gl/lib/stdbool.hin: Renamed from gl/lib/stdbool_.h.
 
165
        * gl/lib/getopt.h: Removed (should be generated).
 
166
        * gl/lib/addext.c: Removed from Gnulib.
 
167
 
 
168
        Replace memory_fatal() with xalloc_die().  The FILESYSTEM_PREFIX_LEN()
 
169
        macro has been renamed to FILE_SYSTEM_PREFIX_LEN().
 
170
        * src/patch.c (main): Remove xalloc_fail_func (replaced by
 
171
        xalloc_die()).  Work around the missing addext() with
 
172
        find_backup_file_name() plus hacks.
 
173
        * src/util.c (create_backup, version_controller): The new versions of
 
174
        base_name() and dir_name() return malloc'ed buffers.  Adapt.
 
175
        * src/util.h: Replace memory_fatal() with xalloc_die().
 
176
        * src/pch.c: Don't leak memory with strlen (base_name (...)).
 
177
 
 
178
        * src/util.c (create_file): Add to_dir_known_to_exist argument and
 
179
        try to create parent directories when set and the create failed with
 
180
        ENOENT.
 
181
        (copy_file, create_backup_copy): Pass the new to_dir_known_to_exist
 
182
        argument through.
 
183
        (create_backup): Don't assume the target directory exists when making
 
184
        a backup copy.
 
185
        * src/util.h (create_file, copy_file): Change the declarations.
 
186
        * src/patch.c, src/pch.c, src/inp.c: In the calls to create_file() and
 
187
        copy_file(), assume the parent directory exists.
 
188
        * tests/unmodified-files: Test the create_backup() fix.
 
189
 
 
190
        * src/util.c (create_backup): The new dir_name() and base_name()
 
191
        functions are really counter productive.  Remove them and the bugs
 
192
        that keepeing them here as introduced.
 
193
        * tests/backup-prefix-suffix: Add more regression tests.
 
194
 
 
195
        * src/patch.c (locate_hunk): Revert to the original asymmetric hunk
 
196
        behavior (but only anchor hunks starting at line 0 to the start of the
 
197
        file): there is not enough reason to change the historic behavior.
 
198
        * src/merge.c (locate_merge): Add similar asymmetric hunk check here.
 
199
        * tests/asymmetric-hunks: Update accordingly.
 
200
        * patch.man: Document the asymmetric hunk behavior.
 
201
        * NEWS: Update.
 
202
 
 
203
        Copyright notice updates.
 
204
        * README, AUTHORS: Updates.
 
205
 
 
206
        * patch.man: Document that merging can be slow.
 
207
        * tests/test-lib.sh: Also unset QUOTING_STYLE.
 
208
 
 
209
2009-04-04  Andreas Gruenbacher  <agruen@suse.de>
 
210
 
 
211
        * pch.c (another_hunk): Add (back) the line number ranges to the
 
212
        debug output.
 
213
        * merge.c (merge_hunk): Likewise.
 
214
        (locate_merge): Add a note about the algorithm's requirements.
 
215
        * util.c (create_backup): Split from move_file.  New LEAVE_ORIGINAL
 
216
        argument for copying instead of renaming.  Don't fail when rename
 
217
        fails with errno == EXDEV; copy and unlink in that case instead.
 
218
        (copy_file): Add debug message.
 
219
        * util.h: Move including <utime.h> etc. here from patch.c.
 
220
        (create_backup): Declare.
 
221
        * patch.c (main): Create backup files even for files which did not
 
222
        actually change; some users of patch rely on the presence of backup
 
223
        files when patch says "patching file".
 
224
        * tests/unmodified-files: Test the patch.c change.  (The EXDEV fix in
 
225
        create_mackup() was tested manually.)
 
226
        * util.c (copy_to_fd, ask): The read() return type is ssize_t.
 
227
 
 
228
2009-04-03  Andreas Gruenbacher  <agruen@suse.de>
 
229
 
 
230
        * patch.man: Document the -m or --merge option.  Some minor other
 
231
        changes.
 
232
        * NEWS: Document the asymmetric hunk behavior and the -m or --merge
 
233
        option.
 
234
        * merge.c (locate_merge): Include the number of changes in the debug
 
235
        message.
 
236
        (print_linerange): New function.
 
237
        (merge_result): No longer print line offsets: without exact matches,
 
238
        line numbers are less meaningful.  Output the entire messages here.
 
239
        (merge_hunk): Be silent when merging exact matches unless in
 
240
        --verbose mode.
 
241
        * tests/merge: Add another interesting test case.
 
242
 
 
243
        * tests/test-lib.sh: Add have_ed function for checking if ed is
 
244
        available.
 
245
        * tests/crlf-handling, tests/need-filename: Check for ed and skip the
 
246
        ed related tests if we don't have it.
 
247
        * tests/merge: Use sed instead of ed: sed is more readily available.
 
248
 
 
249
        * patch.c (locate_hunk): If a hunk starts at a line > 1, it obviously
 
250
        is not from the start of the file.
 
251
        * tests/asymmetric-hunks: Add tests for all possible cases.
 
252
 
 
253
2009-04-02  Andreas Gruenbacher  <agruen@suse.de>
 
254
 
 
255
        * patch.c (locate_hunk): Revert the assymmetric hunk fix from
 
256
        2009-03-29.  Instead, allow such hunks to apply only when no
 
257
        more context remains.
 
258
 
 
259
        * patch.c (main): Restructure to get rid of some code duplication.
 
260
        (copy_till, similar): Export these functions.
 
261
        * common.h (struct outstate, in_offset, out_offset,
 
262
        last_frozen_line): Move here from patch.c.
 
263
        (apply_hunk, copy_till, similar): Declare here.
 
264
 
 
265
        Simple merge support:
 
266
        * configure.ac (ENABLE_MERGE): New --disable-merge option.
 
267
        * patch.c (merge): New variable.
 
268
        (main): New -m and --merge options.  When in merge mode, don't try
 
269
        to reverse patches, and don't try to apply with fuzz.
 
270
        * common.h (merge_hunk): Declare function.
 
271
        * merge.c: New file containing all the merge code.
 
272
        * tests/merge: New test case.
 
273
        * Makefile.in (SRCS): Add merge.c.
 
274
        (OBJS): Add merge.$(OBJEXT) when merge support is enabled.
 
275
        (TESTS): Add test case.
 
276
        (COMPILE): Define ENABLE_MERGE when merge support is enabled.
 
277
 
 
278
        Locate hunks to merge more intelligently:
 
279
        * bestmatch.h: Shortest Edit Sequence algorithm.
 
280
        * merge.c (locate_merge, count_fuzz_lines): New functions.
 
281
        (merge_hunk): Replace simple guessing with locate_merge().
 
282
        * Makefile.in (HDRS): Add bestmatch.h.
 
283
        * tests/merge: Only minor improvements up to now.
 
284
 
 
285
        * diffseq.h: New file (Gnulib compareseq algorithm).
 
286
        * minmax.h: New file (Gnulib MIN and MAX macros).
 
287
        * Makefile.in (HDRS): Add diffseq.h and minmax.h.
 
288
 
 
289
        * COPYING: Update to GPL version 3 because of diffseq.h.
 
290
 
 
291
        * diffseq.h: When an EQUAL_IDX macro is defined, use that instead
 
292
        of EQUAL.  This macro takes vector indexes instead of elements as
 
293
        arguments.
 
294
 
 
295
        Better merge support:
 
296
        * patch.c, common.h (apply_hunk): Make static again.
 
297
        * merge.c (compute_changes): New function for computing the
 
298
        difference between lines in a hunk and lines in the input file.
 
299
        (merge_result): We may have more than one result per hunk now.
 
300
        (merge_hunk): Merge the hunk with the compute_changes() result.
 
301
        * tests/merge: Better results now.
 
302
 
 
303
        * merge.c: Add license header.
 
304
 
 
305
        * merge.c (locate_merge): The number of changes allowed permits a
 
306
        higher maximum merge position (max_where).
 
307
        * tests/merge: Add a test for this case.
 
308
 
 
309
        * merge.c (merge_hunk): Add two missing checks that were leading into
 
310
        failed assertions.
 
311
        * tests/merge: Add test cases for each of these checks.
 
312
 
 
313
        * Makefile.in (install, uninstall): DESTDIR specifies a prefix to
 
314
        the root directory to install into.
 
315
        (installdirs): Merge with install.
 
316
 
 
317
2009-04-01  Andreas Gruenbacher  <agruen@suse.de>
 
318
 
 
319
        * tests/test-lib.sh: When $GDB is set, run patch in gdbserver
 
320
        for debugging.
 
321
        * pch.c (another_hunk): Make the debug output easier to read.
 
322
 
 
323
2009-03-31  Andreas Gruenbacher  <agruen@suse.de>
 
324
 
 
325
        * patch.c: Split last_offset into in_offset and out_offset and
 
326
        count line numbers properly.
 
327
        * tests/line-numbers: Without the fixes, this test case goes
 
328
        horribly wrong.
 
329
        * Makefile.in (TESTS): Add test case.
 
330
 
 
331
2009-03-30  Jim Meyering  <meyering@redhat.com>
 
332
 
 
333
        tests: accommodate ls' "alternate access control method" indicator
 
334
        ls can output an additional byte after a file's permissions string,
 
335
        e.g., rather than "rwxr--r-- ..." it can output "rwxr--r--+ ..."
 
336
        or "rwxr--r--. ..." to indicate the presence of an ACL.
 
337
        * tests/create-delete: Adjust sed filter to accommodate that.
 
338
        * tests/preserve-mode-and-timestamp: Likewise.
 
339
 
 
340
2009-03-30  Andreas Gruenbacher  <agruen@suse.de>
 
341
 
 
342
        * tests/test-lib.sh: Unset environment variables that influence
 
343
        the behavior of patch.
 
344
        * util.c (move_file): Add debug message when files have been seen
 
345
        already.  Fix leftover "empty uneadable" debug message.
 
346
 
 
347
        * patch.c (main): Print newline earlier.
 
348
        * util.c (copy_file): Add debug message.
 
349
 
 
350
2009-03-29  Andreas Gruenbacher  <agruen@suse.de>
 
351
 
 
352
        * patch.c (locate_hunk): Hunks that have fewer or more lines of
 
353
        context at the beginning than at the end can match anywhere; the
 
354
        assumption that this can only occur at the beginning or end of the
 
355
        file is wrong. Remove those checks.
 
356
        * tests/asymmetric-hunks: New test case.
 
357
        * Makefile.in (TESTS): Add test case.
 
358
 
 
359
        * util.c (move_file): Create backup files of nonexisting files with
 
360
        the default mode instead of mode 0: files with mode 0 cause too many
 
361
        problems with applications which do not expect unreadable files.
 
362
        * tests/create-delete: Test for this.
 
363
 
 
364
        * Makefile.in (BROKEN_TESTS): Test cases which fail.
 
365
 
 
366
2009-03-28  Andreas Gruenbacher  <agruen@suse.de>
 
367
 
 
368
        * pch.c (intuit_diff_type): Rename need_filename argument to
 
369
        need_header.  Omit superfluous "missing header" warnings.
 
370
 
 
371
        When remembering files including timestamps, we need to update the
 
372
        timestamps after appending to a file.  This causes problems on some
 
373
        systems where the timestamps returned by fstat() after appending are
 
374
        not up to date, yes.  We only remember timestamps as a compatibility
 
375
        hack with non-POSIX systems that do not have unique inode numbers;
 
376
        drop this hack instead.
 
377
        * timespec.h, m4/timespec.m4: Remove.
 
378
        * util.c: Remove timespec.h and all uses of struct timespec.
 
379
        (append_to_file): Remove REMEMBER argument; no need to update known
 
380
        files anymore.
 
381
        * util.h (append_to_file): Update definition.
 
382
        * Makefile.in: Remove timespec.h and m4/timespec.m4.
 
383
 
 
384
        * common.h (origsuff): New variable.
 
385
        * patch.c (main): Remember when -z was used.
 
386
        * util.c (contains_slash): New function.
 
387
        (move_file): Enforce simple backup mode and compute the backup file
 
388
        name here if -B, -Y, or -z is used.  Fix the case where -B or -Y is
 
389
        combined with -z.
 
390
        * patch.man: Document this change.
 
391
        * tests/backup-prefix-suffix: New test case.
 
392
        * Makefile.in (TESTS): Add test case.
 
393
 
 
394
        * tests/munged-context-format: New test case.
 
395
        * Makefile.in (TESTS): Add test case.
 
396
 
 
397
        * util.c (vsay): New function for use in say(), etc.
 
398
        (ok_to_reverse): Use vsay() here instead of fprintf() to ensure
 
399
        flushing.
 
400
 
 
401
        * pch.c (there_is_another_patch): Move the "patch would create" test
 
402
        here from intuit_diff_type() after asking for the filename to patch.
 
403
        * inp.c (get_input_file): No need to report when the file is missing;
 
404
        this is done in there_is_another_patch() already.
 
405
        * patch.c (main): No need to report when a patch attempts to create
 
406
        an exiting file, either.
 
407
 
 
408
2009-03-25  Andreas Gruenbacher  <agruen@suse.de>
 
409
 
 
410
        * patch.c (main): Avoid replacing files when nothing has changed.
 
411
        * tests/unmodified-files: New test case.
 
412
        * Makefile.in (TESTS): Add test case.
 
413
 
 
414
        * patch.c (main): New apply_empty_patch variable. When applying an
 
415
        empty patch to a file and -o is given, copy the input file to the
 
416
        output file.
 
417
 
 
418
2009-03-24  Andreas Gruenbacher  <agruen@suse.de>
 
419
 
 
420
        * patch.c (abort_hunk_unified, abort_hunk_context): Preserve
 
421
        Index lines in reject files as well.
 
422
        * tests/reject-format: Test this change.
 
423
 
 
424
        * configure.ac (TEST_SHELL): New substitution.
 
425
        * Makefile.in (TEST_SHELL): New variable.
 
426
        (HAVE__BOOL): New variable.
 
427
        (hash.$(OBJEXT)): Add $(STDBOOL_H) dependency.
 
428
        * tests/test-lib.sh: Use expr for arithmetic operations. Check for
 
429
        working "echo -n" and BASH_LINENO.  Replace printf with echo.
 
430
        * tests/preserve-mode-and-timestamp: Ignore leading "+" in ls output.
 
431
        * tests: Remove !shebang line from tests and make them non-executable.
 
432
        Replace printf with echo.
 
433
 
 
434
2009-03-23  Andreas Gruenbacher  <agruen@suse.de>
 
435
 
 
436
        * patch.c (intuit_diff_type): When looking for an ed or normal
 
437
        patch, don't look for filename headers.  (Those formats don't
 
438
        have any.)
 
439
        * pch.c (there_is_another_patch): Don't suggest to use -p with
 
440
        normal format diffs for the same reason.
 
441
 
 
442
2009-03-22  Andreas Gruenbacher  <agruen@suse.de>
 
443
 
 
444
        * NEWS: Update for alpha release.
 
445
 
 
446
        * patch.c (main): Always initialize the known files table.
 
447
        Move new reject files into place; append to known ones.
 
448
        * util.c (file_already_seen): Export.
 
449
        (move_file): Remember all files, not only backup files.
 
450
        (append_to_file): When asked to remember a file, remember
 
451
        the state *after* appending. (The timestamps will change!)
 
452
        * tests/remember-reject-files: New test case.
 
453
        * Makefile.in (TESTS): Add test case.
 
454
 
 
455
        * common.h (no_strip_trailing_cr): New variable.
 
456
        * patch.c: Use no_strip_trailing_cr.  Option --binary no longer
 
457
        a no-op on POSIX systems.
 
458
        * patch.man: Document change of --binary.
 
459
        * pch.c (there_is_another_patch): Check no_strip_trailing_cr.
 
460
        * tests/crlf-handling: Add --binary tests here.
 
461
 
 
462
        * patch.c (apply_hunk): Use fputs() in simple fprintf()
 
463
        situations.
 
464
 
 
465
        * patch.c (main): Require filename in patch if none specified on
 
466
        the command line and posixly_correct is false.
 
467
        * pch.c (intuit_diff_type): While we still don't have a filename,
 
468
        don't look for hunks.
 
469
        (there_is_another_patch): Pass need_filename through.
 
470
        * tests/need-filename: New test case.
 
471
        * Makefile.in (TESTS): Add test case.
 
472
 
 
473
        * pch.c (intuit_diff_type): Check for garbage after what looks
 
474
        like a normal format command.
 
475
        * tests/normal-garbage: New test case.
 
476
        * Makefile.in (TESTS): Add test case.
 
477
 
 
478
        * Makefile.in (bindir): Define as @bindir@.
 
479
        (DISTFILES_CLEAN): Move DISTFILES here which must not be remade by
 
480
        the dist target.
 
481
        (MISC): Add missing tests/test-lib.sh and update-version.sh.
 
482
        (check, $(TESTS)): Make each test depend on all so that they can be
 
483
        run individually.
 
484
        (maintainer-clean): Also remove patch-*.tar.gz and patch-*.tar.gz.sig.
 
485
        (dist): Add PV directory level.  Add reminder to self how to upload.
 
486
        * configure.ac: Silence "missing datarootdir" warning.
 
487
 
 
488
        * tests/crlf-handling: Add test for "diff -p" context with a CRLF
 
489
        ine ending.
 
490
 
 
491
2009-03-21  Andreas Gruenbacher  <agruen@suse.de>
 
492
 
 
493
        * patch.c (main): With -r, instead of moving the global reject
 
494
        file into place, copy the first reject into the file, and
 
495
        append all the rest.  Discard rejects with -r -.
 
496
        * patch.man: Document the latter.
 
497
        * util.c (copy_to_fd): New function.
 
498
        (copy_file): Use that.
 
499
        (append_to_file): New function.
 
500
        * util.h (append_to_file): Add function declaration.
 
501
        * tests/global-reject-files: New test case.
 
502
        * Makefile.in (TESTS): Add test case.
 
503
 
 
504
        * patch.man: Minor fix.
 
505
 
 
506
        * pch.c (another_hunk, pch_swap): Always add the '^' hunk end
 
507
        marker: apply_hunk() and abort_hunk_unified() rely on it.
 
508
        (pch_char): Explain when this returns '\n'.
 
509
        * util.c: Remove unused include <version.h>.
 
510
 
 
511
2009-03-20  Andreas Gruenbacher  <agruen@suse.de>
 
512
 
 
513
        * patch.c: New option --reject-format=FORMAT.
 
514
        (abort_hunk_context): Rename from abort_hunk().
 
515
        (abort_hunk_unified, abort_hunk, mangled_patch,
 
516
        print_unidiff_range): New functions.
 
517
        * patch.man: Document this.
 
518
        * pch.c, pch.h (pch_normalize): New function.
 
519
        * tests/reject-format: New test case.
 
520
        * Makefile.in (TESTS): Add test case.
 
521
        * tests/preserve-c-function-names: Update.
 
522
 
 
523
        * pch.c (p_name): New variable.
 
524
        (intuit_diff_type): Save the old, new, and index filenames.
 
525
        (pch_char): Return either of the saved filenames.
 
526
        * pch.h: Move enum nametype here from pch.c.  Declare pch_name().
 
527
        * patch.c (abort_hunk, abort_hunk_unified, abort_hunk_context):
 
528
        New HEADER and REVERSE arguments.
 
529
        (print_header_line): New function.
 
530
        (abort_hunk_unified, abort_hunk_context): Use it.
 
531
        * tests/corrupt-reject-files, tests/preserve-c-function-names,
 
532
        tests/reject-format: Update.
 
533
 
 
534
        * patch.c (main): No longer set reject file modes to the modes of the
 
535
        files they are assiciated with: the previous behavior is inconsistent
 
536
        with global reject files (-r), which are not associated with any
 
537
        particular file.
 
538
        * tests/preserve-mode-and-timestamp: New test case.
 
539
        * Makefile.in (TESTS): Add test case.
 
540
 
 
541
        * Makefile.in (DISTFILES): Add the files from DISTFILES_M4,
 
542
        DISTFILES_PC, DISTFILES_PC_DJGPP.
 
543
        (DISTFILES_M4, DISTFILES_PC, DISTFILES_PC_DJGPP): Remove.
 
544
        (distclean): Also remove config.hin~ and autom4te.cache/.
 
545
        (maintainer-clean): Also remove aclocal.m4, config.hin, configure.
 
546
        (dist): Make work for DISTFILES in subdirectories.  Normalize and
 
547
        sort DISTFILES.
 
548
 
 
549
        * Makefile.in (MISC): Add VERSION.
 
550
        (FORCE): New target.
 
551
        (VERSION): Recompute automatically from repository.
 
552
        (configure): Depend on VERSION.  Regenerate with --force: autoconf
 
553
        does not recognize the dependency between VERSION and ocnfigure.
 
554
        (config.hin): Regenerate with --force.
 
555
        (maintainer-clean): Also remove VERSION.
 
556
        * configure.ac: Compute PACKAGE_VERSION from repository.
 
557
        * update-version.sh: New file.
 
558
 
 
559
        * README-alpha: New file.
 
560
        * Makefile.in (dist): Add README-alpha when appropriate.
 
561
 
 
562
        * Makefile.in (M4FILES): Rename from ACINCLUDE_INPUTS.
 
563
        (aclocal.m4): Recompute with aclocal.
 
564
 
 
565
        * tests/test-lib.sh: Add library for simple test scripts.
 
566
        * tests/crlf-handling, tests/remember-backup-files: New test cases.
 
567
        * Makefile.in (TESTS): New variable.  Add test cases.
 
568
        (check): Replace the dummy test target with running all TESTS.
 
569
 
 
570
        * pch.c, pch.h (pch_c_function): New function.
 
571
        * pch.c (p_c_function): New variable.
 
572
        (another_hunk): Preserve the "diff -p" output.
 
573
        * patch.c (abort_hunk): Use pch_c_function().
 
574
        * tests/preserve-c-function-names: New test case.
 
575
        * Makefile.in (TESTS): Add test case.
 
576
 
 
577
        * util.c (savebuf): Return NULL if size == 0.
 
578
        * pch.c (another_hunk): Check size for size != 0 before checking
 
579
        savebuf()'s return value.
 
580
        * tests/no-newline-triggers-assert: New test case.
 
581
        * Makefile.in (TESTS): Add test case.
 
582
 
 
583
        * tests/corrupt-reject-files: new test case for Jim Meyering's
 
584
        2007-08-26 fix.
 
585
        * Makefile.in (TESTS): Add test case.
 
586
 
 
587
2009-03-19  Andreas Gruenbacher  <agruen@suse.de>
 
588
 
 
589
        Imported from Paul Eggert's working directory:
 
590
        * exitfail.c, exitfail, m4/exitfail.m4: Import from gnulib.
 
591
        * hash.c, hash.h, m4/hash.m4: Likewise.
 
592
        * m4/extensions.m4: Likewise.
 
593
        * timespec.h, m4/timespec.m4: Likewise.
 
594
        * m4/st_mtim.m4: New file.
 
595
        * configure.ac: Update.
 
596
        * common.h: Include <limits.h> unconditionally.  Include <stdint.h>
 
597
        if we have it.
 
598
        * inp.c (plan_b, ifetch): Remove unnecessary casts.
 
599
        * maketime.c, partime.c: Include <limits.h>, <stdlib.h>, <time.h>
 
600
        unconditionally.  Convert from K&R to ANSI C.
 
601
        * maketime.h, partime.h: Convert from K&R to ANSI C.
 
602
        * pch.c (p_indent, pget_line, intuit_diff_type): Use size_t for
 
603
        indents.
 
604
        * util.c: Assume we have vfprintf().
 
605
        (NUM_SIGS): Cast to int in.
 
606
        (fatal_exit_handler): Replace obsolescent AC_RETSIGTYPE.
 
607
        * Various files: Update copyright notices.
 
608
 
 
609
2007-08-26  Jim Meyering  <jim@meyering.net>
 
610
 
 
611
        * pch.c (another_hunk): Avoid an off-by-one error that would
 
612
        result in NUL bytes in .rej files.
 
613
 
 
614
2004-07-21  Paul Eggert  <eggert@twinsun.com>
 
615
 
 
616
        * Makefile.in (SRCS): Move hash.c here from LIBSRCS.
 
617
        (exitfail.$(OBJEXT), patch.$(OBJEXT), xmalloc.$(OBJEXT)):
 
618
        Depend on exitfail.h.
 
619
        (hash.$(OBJEXT), util.$(OBJEXT)): Depend on hash.h.
 
620
        * util.c: Whitespace cleanup in file_id.
 
621
 
 
622
2004-07-19  Stepan Kasal  <kasal@ucw.cz>
 
623
 
 
624
        * pch.c (get_ed_command_letter): Allow commands without address.
 
625
 
 
626
2003-11-10  Manu B  <manubee@users.sourceforge.net>
 
627
 
 
628
        Trivial change to port to mingw, which declares mkdir in unistd.h.
 
629
        * m4/mkdir.m4 (PATCH_FUNC_MKDIR_TAKES_ONE_ARG): Include unistd.h.
 
630
        * common.h (mkdir): Define after including unistd.h.
 
631
 
 
632
2003-09-11  Paul Eggert  <eggert@twinsun.com>
 
633
 
 
634
        * pch.c (do_ed_script): Adjust to copy_file signature change.
 
635
 
 
636
        * Makefile.in (STDBOOL_H): New macro.  All uses of @STDBOOL_H@ changed.
 
637
        (SRCS): Add exitfail.c.
 
638
        (OBJS): Add exitfail.$(OBJEXT).
 
639
        (HDRS): Add exitfail.h.
 
640
        (stdbool.h): Use $@, as gnulib now suggests.
 
641
        (ACINCLUDE_INPUTS): Add exitfail.m4, extensions.m4.
 
642
        * common.h: Include <string.h>, <stdlib.h> unconditionally.
 
643
        * configure.ac (gl_USE_SYSTEM_EXTENSIONS): Use this instead
 
644
        of AC_GNU_SOURCE.
 
645
        (gl_EXITFAIL): Add.
 
646
        * patch.c: Include exitfail.h.
 
647
        (main): Set exit_failure, not xalloc_exit_failure.
 
648
 
 
649
        * inp.c (get_input_file): Clear cs if dry run.
 
650
 
 
651
        * util.c (fetchname): Handle missing timestamps better.
 
652
 
 
653
        * Makefile.in (LIBSRCS): Add hash.c.
 
654
        (OBJS): Add hash.$(OBJEXT).
 
655
        (HDRS): Add hash.h.
 
656
        (MISC): Add timespec.h.
 
657
        (ACINCLUDE_INPUTS): Add hash.m4, st_mtim.m4, timespec.m4
 
658
        (util.$(OBJEXT): Depend on timespec.h.
 
659
        * configure.ac (gl_HASH, gl_TIMESPEC): Add.
 
660
        * patch.c (spew_output): New output arg, to contain status of output
 
661
        file.
 
662
        (main): Use it to get status of output file, and pass this to
 
663
        move_file as needed.  Initialize hash table.
 
664
        * util.c (file_id): New type.
 
665
        (file_id_hasher, file_id_comparator, init_backup_hash_table,
 
666
        insert_file, file_already_seen): New functions.
 
667
        (file_id_table): New var.
 
668
        (move_file): New arg FROMST; all uses changed.
 
669
        Do not backup a file that's already been patched.
 
670
        Keep track of files that have been patched.
 
671
        (copy_file): New arg TOST; all uses changed.
 
672
        * util.h (copy_file, move_file): Adjust decls as per above.
 
673
        (init_backup_hash_table): New decl.
 
674
 
 
675
 
 
676
2003-07-05  Paul Eggert  <eggert@twinsun.com>
 
677
 
 
678
        * Makefile.in (check): Add a trivial check that "patch --help" works.
 
679
        From a suggestion by Ed Avis.
 
680
 
 
681
2003-07-02  Paul Eggert  <eggert@twinsun.com>
 
682
 
 
683
        * pch.c (intuit_diff_type): If a unified-diff header line contains
 
684
        trailing CR, strip CR from each body line.  This corrects a bug
 
685
        introduced in the 2003-05-18 patch.  Bug reported by Andreas
 
686
        Gruenbacher.
 
687
 
 
688
        * mkdir.c, rmdir.c, m4/rmdir.m4: Remove; we no longer
 
689
        need to worry about ancient hosts that lack these functions.
 
690
 
 
691
        * addext.c, backupfile.c, backupfile.h, dirname.h, m4/backupfile.m4,
 
692
        m4/onceonly.m4, m4/quote.m4, malloc.c, quote,c, quote.h, realloc.c,
 
693
        strcasecmp.c, xalloc.h, xmalloc.c: Sync with gnulib.
 
694
        * stdbool_.h: Renamed from stdbool.h.in; all uses changed.
 
695
        This renaming is imported from gnulib.
 
696
        * m4/strcase.m4: New file, imported from gnulib.
 
697
 
 
698
        * Makefile.in (LIBSRCS): Remove mkdir.c and rmdir.c.
 
699
        (stdbool.h): Put output into temporary file and then rename it;
 
700
        this change is imported from gnulib.
 
701
        (mostlyclean): Clean stdbool.h-t too.
 
702
        (ACINCLUDE_INPUTS): Remove rmdir.m4.  Add strcase.m4.
 
703
        * configure.ac (gl_FUNC_RMDIR): Remove.
 
704
        (jm_PREREQ_ADDEXT): Remove; now down by gl_BACKUPFILE.
 
705
        (gl_STRCASE, gl_XALLOC): Add.
 
706
        (AC_REPLACE_FUNCS): Remove mkdir, strcasecmp.
 
707
 
1
708
2003-05-20  Paul Eggert  <eggert@twinsun.com>
2
709
 
3
710
        * NEWS, configure.ac (AC_INIT): Version 2.5.9 released.
159
866
        * configure.ac (AC_PROG_CC_STDC): Add.
160
867
        * util.c (vararg_start): Remove.  All uses changed to va_start.
161
868
        Always include <stdarg.h>.
162
 
        
 
869
 
163
870
        * configure.ac (AC_CANONICAL_HOST): Remove.
164
871
        (AC_REPLACE_FUNCS): Add strncasecmp.
165
872
        (AC_CHECK_DECLS): Add mktemp.
166
 
        
 
873
 
167
874
        * patch.c (main): Remove useless prototype decl.
168
875
        (mktemp): Don't declare if HAVE_DECL_MKTEMP || defined mktemp.
169
876
        (make_temp): Now accepts char, not int.
170
 
        
 
877
 
171
878
2002-05-26  Paul Eggert  <eggert@twinsun.com>
172
879
 
173
880
        * patch.c (not_defined): Prepend newline.  All uses changed.
636
1343
        this undoes the previous change to this file.
637
1344
 
638
1345
        * patch.c (locate_hunk): Fix bug when locating context diff hunks
639
 
        near end of file with nonzero fuzz.
 
1346
        near end of file with nonzero fuzz.
640
1347
 
641
1348
        * util.c (move_file): Don't assume that ENOENT is reported when both
642
1349
        ENOENT and EXDEV apply; this isn't true with DJGPP, and
748
1455
        file.
749
1456
        (DEV_NULL): New constant.
750
1457
        (SCCSPREFIX, GET. GET_LOCKED, SCCSDIFF1, SCCSDIFF2,
751
 
        RCSSUFFIX, CHECKOUT, CHECKOUT_LOCKED, RCSDIFF1): Moved here from inp.c.
 
1458
        RCSSUFFIX, CHECKOUT, CHECKOUT_LOCKED, RCSDIFF1): Moved here from inp.c.
752
1459
        (version_controller, version_get): New functions.
753
1460
        (ask): Look only at /dev/tty for answers; and when standard output is
754
1461
        not a terminal and ! posixly_correct, don't even look there.
777
1484
        * configure.in (VERSION): Bump to 2.3.6.
778
1485
        (AC_CHECK_HEADERS): Add utime.h.
779
1486
        * acconfig.h, configure.in, pc/djgpp/config.h (HAVE_STRUCT_UTIMBUF):
780
 
        New macro.
 
1487
        New macro.
781
1488
        * pc/djgpp/config.h (HAVE_UTIME_H, TZ_is_unset): New macros.
782
1489
 
783
1490
        * NEWS, patch.man: Describe new -Z, -T options, new numeric
784
 
        option for -G, retired -G, and more verbose default behavior
785
 
        with fuzz.
 
1491
        option for -G, retired -G, and more verbose default behavior
 
1492
        with fuzz.
786
1493
 
787
1494
        * pch.c (intuit_diff_type): Record times reported for files in headers.
788
1495
        Remove head_says_nonexistent[x], since it's now equivalent to
789
1496
        !timestamp[x].
790
1497
        * util.h (fetchname): Change argument head_says_nonexistent to
791
 
        timestamp.
 
1498
        timestamp.
792
1499
        * util.c: #include <partime.h> for TM_LOCAL_ZONE.
793
1500
        Don't include <time.h> since common.h now includes it.
794
1501
        (ok_to_reverse): noreverse and batch cases now output regardless of
894
1601
        Do not use xxx.h -> xxxh~ hack.
895
1602
 
896
1603
        * util.c: (move_file): Avoid makedirs test when possible even
897
 
        if FILESYSTEM_PREFIX_LEN (p) is nonzero.  Don't play
898
 
        case-changing tricks to come up with backup file name; it's
899
 
        not portable to case-insensitive file systems.
 
1604
        if FILESYSTEM_PREFIX_LEN (p) is nonzero.  Don't play
 
1605
        case-changing tricks to come up with backup file name; it's
 
1606
        not portable to case-insensitive file systems.
900
1607
        * common.h (ISLOWER): Remove.
901
1608
 
902
1609
        * inp.c (scan_input): Don't use Plan A if (debug & 16).
1162
1869
 
1163
1870
        * pch.c (existing_prefix_components): New function.
1164
1871
        (intuit_diff_type): When creating a file, use a name whose existing
1165
 
        directory prefix contains the most nontrivial path name components.
 
1872
        directory prefix contains the most nontrivial path name components.
1166
1873
        (best_name): Don't check for null 2nd arg.
1167
1874
 
1168
1875
        * util.h (replace_slashes): New decl.
1181
1888
 
1182
1889
        * pch.c (existing_prefix_components): New function.
1183
1890
        (intuit_diff_type): When creating a file, use a name whose existing
1184
 
        directory prefix contains the most nontrivial path name components.
 
1891
        directory prefix contains the most nontrivial path name components.
1185
1892
        (best_name): Don't check for null 2nd arg.
1186
1893
 
1187
1894
        * util.h (replace_slashes): New decl.
2271
2978
Copyright (C) 1984, 1985, 1986, 1987, 1988 Larry Wall.
2272
2979
 
2273
2980
Copyright (C) 1989, 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001,
2274
 
2002 Free Software Foundation, Inc.
 
2981
2002, 2009 Free Software Foundation, Inc.
2275
2982
 
2276
2983
This file is part of GNU Patch.
2277
2984
 
2287
2994
 
2288
2995
You should have received a copy of the GNU General Public License
2289
2996
along with this program; see the file COPYING.  If not, write to
2290
 
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
2291
 
Boston, MA 02111-1307, USA.
 
2997
the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
 
2998
MA 02110-1301, USA.