- 2.6.1 (bug #551569). No longer need best-name patch.

This commit is contained in:
Tim Waugh 2010-01-04 13:59:04 +00:00
parent 4d222909d3
commit 5b79fc3348
5 changed files with 14 additions and 84 deletions

7
patch-2.6.1.tar.xz.sig Normal file
View File

@ -0,0 +1,7 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
iEYEABECAAYFAks7frsACgkQ9+hy/rlxVNONpwCgr0yqYFoW0Q1USWGBcA8dGNEn
XUMAn1RB5jT/EoiNi9ZrjawqxAT83JzB
=/8JO
-----END PGP SIGNATURE-----

View File

@ -1,7 +0,0 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
iEYEABECAAYFAkr9aWMACgkQ9+hy/rlxVNMK0wCgg0Jg3HqcXm2Eh8jR66YADk8L
Si8AmwZ1EDTTvYmeQmae0zrYK6+4HRTR
=KgtY
-----END PGP SIGNATURE-----

View File

@ -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);
}
}

View File

@ -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 <twaugh@redhat.com> 2.6.1-1
- 2.6.1 (bug #551569). No longer need best-name patch.
* Thu Dec 24 2009 Tim Waugh <twaugh@redhat.com> 2.6-2
- Applied upstream patch to prevent incorrect filename being chosen
when adding a new file (bug #549122).

View File

@ -1 +1 @@
d9d62cb7b98a8a17e42dab910fd2adc9 patch-2.6.tar.xz
057d78436e858c3ed086a544f5e1fe7e patch-2.6.1.tar.xz