diff --git a/cmp-eof-dev-null.diff b/cmp-eof-dev-null.diff new file mode 100644 index 0000000..aa2e6ad --- /dev/null +++ b/cmp-eof-dev-null.diff @@ -0,0 +1,164 @@ +2006-05-09 Paul Eggert <eggert@cs.ucla.edu> + + * src/cmp.c (cmp): The previous fix wasn't quite right either, as + it mishandled 'cmp A B >/dev/null' when A is shorter than B and + differs before A's end-of-file, by outputting a bogus EOF message. + Also, it was inefficient if A and B were large. + +2006-05-07 Jim Meyering <jim@meyering.net> (tiny change) + + Fix bug introduced in 2006-03-09 change: + cmp always exits successfully, when stdout is redirected to /dev/null. + * src/cmp.c (cmp): When there's a difference, arrange to return nonzero + also when comparison_type is the new (from 2006-03-09) type_no_stdout. + +2006-03-09 Paul Eggert <eggert@cs.ucla.edu> + + * src/cmp.c (type_no_stdout): New constant. + (main): Use it to avoid bug when the "EOF on foo" message is + generated and stdout is /dev/null. + Problem reported by Vincent Lefevre (Debian bug 356083). + +Index: cmp.c +=================================================================== +RCS file: /sources/diffutils/diffutils/src/cmp.c,v +retrieving revision 1.39 +retrieving revision 1.40 +diff -u -a -p -u -p -a -r1.39 -r1.40 +--- cmp.c 5 Jan 2006 07:23:55 -0000 1.39 ++++ cmp.c 9 Mar 2006 20:38:11 -0000 1.40 +@@ -78,6 +78,7 @@ static enum comparison_type + { + type_first_diff, /* Print the first difference. */ + type_all_diffs, /* Print all differences. */ ++ type_no_stdout, /* Do not output to stdout; only stderr. */ + type_status /* Exit status only. */ + } comparison_type; + +@@ -317,7 +318,12 @@ main (int argc, char **argv) + if (fstat (STDOUT_FILENO, &outstat) == 0 + && stat (NULL_DEVICE, &nullstat) == 0 + && 0 < same_file (&outstat, &nullstat)) +- comparison_type = type_status; ++ comparison_type = ++ ((fstat (STDERR_FILENO, &outstat) == 0 ++ ? 0 < same_file (&outstat, &nullstat) ++ : errno == EBADF) ++ ? type_status ++ : type_no_stdout); + } + + /* If only a return code is needed, +@@ -356,7 +362,7 @@ main (int argc, char **argv) + for (f = 0; f < 2; f++) + if (close (file_desc[f]) != 0) + error (EXIT_TROUBLE, errno, "%s", file[f]); +- if (exit_status != 0 && comparison_type != type_status) ++ if (exit_status != EXIT_SUCCESS && comparison_type < type_no_stdout) + check_stdout (); + exit (exit_status); + return exit_status; +@@ -536,6 +542,9 @@ cmp (void) + while (first_diff < smaller); + ret = EXIT_FAILURE; + break; ++ ++ case type_no_stdout: ++ break; + } + } + +Index: cmp.c +=================================================================== +RCS file: /sources/diffutils/diffutils/src/cmp.c,v +retrieving revision 1.40 +retrieving revision 1.41 +diff -u -a -p -u -p -a -r1.40 -r1.41 +--- cmp.c 9 Mar 2006 20:38:11 -0000 1.40 ++++ cmp.c 9 Mar 2006 20:54:39 -0000 1.41 +@@ -318,12 +318,7 @@ main (int argc, char **argv) + if (fstat (STDOUT_FILENO, &outstat) == 0 + && stat (NULL_DEVICE, &nullstat) == 0 + && 0 < same_file (&outstat, &nullstat)) +- comparison_type = +- ((fstat (STDERR_FILENO, &outstat) == 0 +- ? 0 < same_file (&outstat, &nullstat) +- : errno == EBADF) +- ? type_status +- : type_no_stdout); ++ comparison_type = type_no_stdout; + } + + /* If only a return code is needed, +Index: cmp.c +=================================================================== +RCS file: /sources/diffutils/diffutils/src/cmp.c,v +retrieving revision 1.43 +retrieving revision 1.44 +diff -u -a -p -u -p -a -r1.43 -r1.44 +--- cmp.c 13 Mar 2006 19:11:17 -0000 1.43 ++++ cmp.c 8 May 2006 01:41:04 -0000 1.44 +@@ -536,10 +536,10 @@ cmp (void) + first_diff++; + } + while (first_diff < smaller); +- ret = EXIT_FAILURE; +- break; + ++ /* Fall through. */ + case type_no_stdout: ++ ret = EXIT_FAILURE; + break; + } + } +Index: cmp.c +=================================================================== +RCS file: /sources/diffutils/diffutils/src/cmp.c,v +retrieving revision 1.44 +retrieving revision 1.45 +diff -u -a -p -u -p -a -r1.44 -r1.45 +--- cmp.c 8 May 2006 01:41:04 -0000 1.44 ++++ cmp.c 9 May 2006 22:57:20 -0000 1.45 +@@ -382,7 +382,7 @@ cmp (void) + word *buffer1 = buffer[1]; + char *buf0 = (char *) buffer0; + char *buf1 = (char *) buffer1; +- int ret = EXIT_SUCCESS; ++ int differing = 0; + int f; + int offset_width IF_LINT (= 0); + +@@ -536,17 +536,18 @@ cmp (void) + first_diff++; + } + while (first_diff < smaller); ++ differing = -1; ++ break; + +- /* Fall through. */ + case type_no_stdout: +- ret = EXIT_FAILURE; ++ differing = 1; + break; + } + } + + if (read0 != read1) + { +- if (comparison_type != type_status) ++ if (differing <= 0 && comparison_type != type_status) + { + /* See POSIX 1003.1-2001 for this format. */ + fprintf (stderr, _("cmp: EOF on %s\n"), file[read1 < read0]); +@@ -555,9 +556,9 @@ cmp (void) + return EXIT_FAILURE; + } + } +- while (read0 == buf_size); ++ while (differing <= 0 && read0 == buf_size); + +- return ret; ++ return differing == 0 ? EXIT_SUCCESS : EXIT_FAILURE; + } + + /* Compare two blocks of memory P0 and P1 until they differ, diff --git a/diffutils-2.8.1-i18n-0.2.patch.gz b/diffutils-2.8.1-i18n-0.2.patch.gz new file mode 100644 index 0000000..744c38b --- /dev/null +++ b/diffutils-2.8.1-i18n-0.2.patch.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9289be62b118f41757d3ac267c6fbe4678717dfb26240edfdd85a5b5ddff4029 +size 4450 diff --git a/diffutils-2.8.7.tar.gz b/diffutils-2.8.7.tar.gz new file mode 100644 index 0000000..8242c96 --- /dev/null +++ b/diffutils-2.8.7.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53d9c10830ac322c00dfcccf60d961014e767da86d2c802ccc5cbad7e7aea07c +size 1057977 diff --git a/diffutils-3.5.tar.xz b/diffutils-3.5.tar.xz deleted file mode 100644 index 84acae2..0000000 --- a/diffutils-3.5.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dad398ccd5b9faca6b0ab219a036453f62a602a56203ac659b43e889bec35533 -size 1360996 diff --git a/diffutils-3.5.tar.xz.sig b/diffutils-3.5.tar.xz.sig deleted file mode 100644 index 19ff48d..0000000 --- a/diffutils-3.5.tar.xz.sig +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIcBAABCgAGBQJXuT2mAAoJEH/Z/MsAC+7uECsP/0wVZOh74XKI0Y4XPxqhgKou -L/uFMgqpq2P9Uwr8jnJCr3xsKWCHYSYXOjmzbQ21wkqDWynT+NbLRcH4HLvO6vU3 -EWtoBor7UG0weTDanNfRBFjVLWsHsDWJj7VGMja9OAkXjpqo0f+iYHHIbJ+oKlIY -gzNqUdjGg8RpsvNapz4XuTsoUNDrTtVOy/k9xHUZCw/h1cZBVpaAU8MEE3MReab6 -pOn660BlVqT50vMd09FKRuTLktJ2LBFZ6x+xdPBJm5LFdUFqClbiNaNv+idhlvfB -GC8qjBr4WhuCtGpJKLFADTOZ8UOxcmx2sNz0ypiQrLT1UkTUtY3B0ADnzWuMEcwx -eaPNzdJhPExY64i7MA2vc2MxlRb7omj8kI+n0rBpiFKLMI3x3ZWf6Papg/acYbJg -0NHQkqdc82gH3vsp5DX/wNn+3TNwks9ziVt7Jervk7uQqWaDLrah3waBN3q5UWsk -HLAlkhb94Ahi+cNMk1oiNKqT+en3AhZ/7O6imKzTM8bTk27Ek7q3ThLfBeUKcp2O -j1aaPbaDGEL9pZZDCeuZCSdRZDGMY+spGNYRC4pmYCL9C2LsH5jtX5ob9gQsPHt3 -XFsi5l83i5N3amwzb2OdSTEwM0xgPX8TmcN435409gvz/VVmeSmx5jhHb9m8SLSk -SrDXEuf5yKX8J8HXVMgt -=e0eV ------END PGP SIGNATURE----- diff --git a/diffutils.changes b/diffutils.changes index 474f356..335a465 100644 --- a/diffutils.changes +++ b/diffutils.changes @@ -1,192 +1,3 @@ -------------------------------------------------------------------- -Mon Aug 22 20:34:19 UTC 2016 - astieger@suse.com - -- Diffutils 3.5: - * diff3 no longer malfunctions due to use-after-free - [bug introduced in 3.4] - * diff --color no longer colorizes when TERM=dumb - -------------------------------------------------------------------- -Tue Aug 9 09:03:53 UTC 2016 - mpluskal@suse.com - -- Update to version 3.4 - * diff accepts two new options --color and --palette to generate - and configure colored output. --color takes an optional - argument specifying when to colorize a line: --color=always, - --color=auto, --color=never. --palette is used to configure - which colors are used. - * many bugfixes -- New -lang subpackage -- Drop no longer needed gnulib-perl522.patch - -------------------------------------------------------------------- -Thu Feb 4 09:29:27 UTC 2016 - mpluskal@suse.com - -- Make building more verbose -- Move info page removal to preun -- Cleanup spec file with spec-cleaner -- Update provides/obsoletes - -------------------------------------------------------------------- -Mon Jul 6 10:13:58 UTC 2015 - coolo@suse.com - -- add gnulib-perl522.patch from gnulib upstream - -------------------------------------------------------------------- -Sat Jan 3 15:25:32 UTC 2015 - meissner@suse.com - -- build with PIE - -------------------------------------------------------------------- -Fri Dec 6 13:28:07 CET 2013 - pth@suse.de - -- Diffutils has a testsuite so run it. - -------------------------------------------------------------------- -Fri Jun 21 07:22:47 UTC 2013 - meissner@suse.com - -- disable gpg key checking to avoid build cycles. will be - done by source service - -------------------------------------------------------------------- -Fri Apr 5 11:22:33 UTC 2013 - meissner@suse.com - -- add gpg key checking, keyring from savannah - -------------------------------------------------------------------- -Fri Apr 5 08:01:12 UTC 2013 - jslaby@suse.com - -- Update to 3.3: - * add --no-dereference - * -N works with - (stdin) as input - * many fixes - * many cleanups (in docco too) -- remove: config-guess-sub-update.patch -- remove: diffutils-stdio.in.patch - -------------------------------------------------------------------- -Mon Mar 25 14:33:40 UTC 2013 - mmeister@suse.com - -- Added url as source. - Please see http://en.opensuse.org/SourceUrls - -------------------------------------------------------------------- -Sat Feb 2 20:34:31 UTC 2013 - schwab@suse.de - -- Update config.guess/sub for aarch64 - -------------------------------------------------------------------- -Tue Jul 17 19:04:29 UTC 2012 - aj@suse.de - -- Fix build with missing gets declaration (glibc 2.16) - -------------------------------------------------------------------- -Mon Feb 27 16:22:01 CET 2012 - jslaby@suse.de - -- Update to 3.2: - * diff: --ignore-file-name-case now applies at top level too - * diff, sdiff: new option --ignore-trailing-space - * maint: avoid new "make sytnax-check" failure - -------------------------------------------------------------------- -Sun Sep 18 17:17:12 UTC 2011 - jengelh@medozas.de - -- Remove redundant tags/sections from specfile - (cf. packaging guidelines) - -------------------------------------------------------------------- -Sat Aug 13 03:10:31 CEST 2011 - pth@suse.de - -- Update to 3.1: - + Bug fixes - - diff no longer reports spurious differences merely because two - entries in the same directory have names that compare equal in - the current locale, or compare equal because --ignore-file-name-case - was given. - -------------------------------------------------------------------- -Sun Sep 19 10:02:52 CEST 2010 - vuntz@opensuse.org - -- Update to version 3.0: - + Bug fixes - - diff once again prints the required "\ No newline at end of - file" line when at least one input lacks a newline-at-EOF and - the final hunk plus context-length aligns exactly with the end - of the newline-lacking file. - [bug introduced between 2.8.7 and 2.9] - + Changes in behavior - - In context-style diffs, diff prints a portion of a preceding - "function" line for each hunk, with --show-function-line=RE - (-F) or --show-c-function (-p). Now, it trims leading blanks - from such lines before extracting a prefix. This is useful - especially when a function line is so far indented that the - name itself would be truncated or not included in the - limited-width substring that diff appends. - - diff once again reports a difference with the diagnostic - "Binary files A and B differ" when at least one of the files - appears to be binary. From 2.8.4 through diffutils-2.9, it - printed "Files A and B differ". -- Changes from version 2.9: - + New features - - New diff option --suppress-blank-empty. - - Bring back support for `diff -NUM', where NUM is a number, - even when conforming to POSIX 1003.1-2001. This change - reverts to the behavior of GNU diff 2.7 and earlier. This is - a change only when conforming to POSIX 1003.1-2001; there is - no effect when conforming to older POSIX versions. - - sdiff now understands '1' and '2' as synonyms for 'l' and - 'r'. - + Changes in behavior - - sdiff and diff3 now invoke diff, not $(bindir)/diff - + Administrivia - - updated gnulib support -- Drop diffutils-no_binary_mode.patch: fixed upstream. -- Drop diffutils-2.8.1-i18n-0.2.patch: this doesn't apply anymore, - the only reference I can guess about it goes back to 2004, and - commit 8983b8d9 upstream is about handling multibyte characters - in side-by-side format. So I'm assuming it's fixed. This also - means we can drop the call to autoreconf. -- Drop diffutils-2.8.7-autoconf.patch: this is not needed anymore. -- Remove AutoReqProv: it's default now. -- Stop touching the main pages in %build. -- Use %configure and %makeinstall macros. - -------------------------------------------------------------------- -Fri Aug 20 10:15:36 UTC 2010 - pth@novell.com - -- Only do freopen if O_BINARY is true. - -------------------------------------------------------------------- -Mon Jun 28 06:38:35 UTC 2010 - jengelh@medozas.de - -- use %_smp_mflags - -------------------------------------------------------------------- -Sat Feb 13 15:06:26 CET 2010 - rguenther@suse.de - -- fix stack limit autoconf check - -------------------------------------------------------------------- -Mon Dec 7 23:11:11 CET 2009 - jengelh@medozas.de - -- enable parallel building - -------------------------------------------------------------------- -Thu Jan 10 17:36:12 CET 2008 - schwab@suse.de - -- Update to head of trunk. - * New diff option --suppress-blank-empty. - * Bring back support for `diff -NUM', where NUM is a number, - even when conforming to POSIX 1003.1-2001. This change reverts to - the behavior of GNU diff 2.7 and earlier. This is a change only - when conforming to POSIX 1003.1-2001; there is no effect when - conforming to older POSIX versions. - This change is in response to decisions taken in the January 2005 - Austin Group standardization meeting. For more details, please see - "Utility Syntax Guidelines" in the Minutes of the January 2005 - Meeting <http://www.opengroup.org/austin/docs/austin_239.html>. - * sdiff now understands '1' and '2' as synonyms for 'l' and 'r'. - ------------------------------------------------------------------- Mon Nov 27 17:15:34 CET 2006 - rguenther@suse.de diff --git a/diffutils.keyring b/diffutils.keyring deleted file mode 100644 index fbe58db..0000000 Binary files a/diffutils.keyring and /dev/null differ diff --git a/diffutils.spec b/diffutils.spec index 09ca69f..fddf31d 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,82 +1,143 @@ # -# spec file for package diffutils +# spec file for package diffutils (Version 2.8.7) # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# This file and all modifications and additions to the pristine +# package are under the same license as the package itself. # -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - # Please submit bugfixes or comments via http://bugs.opensuse.org/ # +# norootforbuild Name: diffutils -Version: 3.5 -Release: 0 -Summary: GNU diff Utilities -License: GFDL-1.2 and GPL-3.0+ +URL: http://www.gnu.org/software/diffutils/ +License: GNU General Public License (GPL) Group: Productivity/Text/Utilities -Url: https://www.gnu.org/software/diffutils/ -Source0: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz -Source1: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig -# http://savannah.gnu.org/project/memberlist-gpgkeys.php?group=diffutils -Source2: %{name}.keyring -BuildRequires: xz -Requires(pre): %{install_info_prereq} -Requires(preun): %{install_info_prereq} -Recommends: %{name}-lang = %{version} -Provides: diff = %{version} -Obsoletes: diff < %{version} +Provides: diff +Obsoletes: diff +Autoreqprov: on +PreReq: %{install_info_prereq} +Version: 2.8.7 +Release: 38 +Summary: GNU diff Utilities +Source: diffutils-%{version}.tar.gz +Patch1: diffutils-2.8.1-i18n-0.2.patch.gz +Patch2: cmp-eof-dev-null.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description The GNU diff utilities find differences between files. diff is used to make source code patches, for instance. -%lang_package + + +Authors: +-------- + Paul Eggert <eggert@twinsun.com> + David J. MacKenzie <djm@gnu.org> + Richard Stallman <rms@gnu.org> + Roland McGrath <roland@gnu.org> %prep -%setup -q +%setup +%patch1 -p1 +cd src +%patch2 %build -export CFLAGS="%{optflags} -fPIE" -export LDFLAGS="-pie" -%configure -make %{?_smp_mflags} V=1 - -%check -make %{?_smp_mflags} check +autoreconf -fi +touch man/*.1 +./configure CFLAGS="$RPM_OPT_FLAGS" \ + --prefix=/usr --infodir=%{_infodir} --mandir=%{_mandir} +make %install -%make_install -%find_lang %{name} +make install DESTDIR="$RPM_BUILD_ROOT" +%find_lang %name %post -%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info%{ext_info} +%install_info --info-dir=%{_infodir} %{_infodir}/diff.info.gz -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info%{ext_info} +%postun +%install_info_delete --info-dir=%{_infodir} %{_infodir}/diff.info.gz -%files +%clean +rm -rf $RPM_BUILD_ROOT + +%files -f %name.lang %defattr(-,root,root) %doc AUTHORS COPYING NEWS README THANKS -%{_bindir}/cmp -%{_bindir}/diff -%{_bindir}/diff3 -%{_bindir}/sdiff -%{_infodir}/diffutils.info%{ext_info} -%{_mandir}/man1/cmp.1%{ext_man} -%{_mandir}/man1/diff.1%{ext_man} -%{_mandir}/man1/diff3.1%{ext_man} -%{_mandir}/man1/sdiff.1%{ext_man} +/usr/bin/cmp +/usr/bin/diff +/usr/bin/diff3 +/usr/bin/sdiff +%doc %{_infodir}/diff.info*.gz +%doc %{_mandir}/man1/*.gz -%files lang -f %{name}.lang -%defattr(-,root,root,-) - -%changelog +%changelog -n diffutils +* Mon Nov 27 2006 - rguenther@suse.de +- removed help2man BuildRequires again. Instead prevent patches + from invalidating the shipped manpages. +* Thu Oct 05 2006 - mjancar@suse.cz +- readd help2man to BuildRequires (needed to build manpages) +* Fri Aug 11 2006 - schwab@suse.de +- Update cmp patch [#198332]. +* Mon Jul 24 2006 - rguenther@suse.de +- diffutils does not need help2man. +* Fri Mar 10 2006 - schwab@suse.de +- Fix output of EOF message when stdout is redirected to /dev/null. +* Wed Jan 25 2006 - mls@suse.de +- converted neededforbuild to BuildRequires +* Wed Sep 15 2004 - schwab@suse.de +- Readd mbrtowc check [#45308]. +* Tue May 04 2004 - schwab@suse.de +- Update to diffutils 2.8.7. +* Tue Apr 13 2004 - schwab@suse.de +- Update to diffutils 2.8.6. +* Sat Jan 10 2004 - adrian@suse.de +- build as user +* Wed Oct 15 2003 - schwab@suse.de +- Update to diffutils 2.8.4. +* Mon May 12 2003 - schwab@suse.de +- Add %%defattr. +* Thu Apr 24 2003 - ro@suse.de +- fix install_info --delete call and move from preun to postun +* Mon Apr 07 2003 - schwab@suse.de +- Only delete info entries when removing last version. +* Thu Feb 06 2003 - schwab@suse.de +- Use %%install_info. +* Thu Sep 05 2002 - schwab@suse.de +- Avoid rebuilding manpage [#18930]. +* Tue Aug 20 2002 - schwab@suse.de +- Add i18n patches. +* Mon Apr 08 2002 - schwab@suse.de +- Update to diffutils 2.8.1. + * Documentation fixes. +* Thu Mar 28 2002 - schwab@suse.de +- Update to diffutils 2.8. +* Fri Oct 05 2001 - schwab@suse.de +- Update to diffutils 2.7.2. +* Sat Jan 13 2001 - schwab@suse.de +- Fix last change to close resource leaks. +* Sat Jan 13 2001 - draht@suse.de +- tmpfile security problem fixed using mkstemp(). +* Sun Dec 03 2000 - schwab@suse.de +- diff: Fix a corner case in handling of directories. +- sdiff: Fix reading of split lines. +* Tue Oct 24 2000 - schwab@suse.de +- Renamed from diff. +* Fri Sep 08 2000 - schwab@suse.de +- Switch to BuildRoot. +- Add group tag. +- Use %%{_infodir}. +* Tue Jan 18 2000 - schwab@suse.de +- /usr/info -> /usr/share/info +* Mon Sep 13 1999 - bs@suse.de +- ran old prepare_spec on spec file to switch to new prepare_spec. +* Wed Sep 08 1999 - schwab@suse.de +- specfile cleanup +* Fri Dec 18 1998 - ro@suse.de +- dont use m486 on alpha :-) +* Thu Jan 02 1997 - florian@suse.de + bug-fix for sdiff diff --git a/ready b/ready new file mode 100644 index 0000000..473a0f4