Accepting request 448821 from home:pluskalm:branches:Base:System

- Update to version 4.3:

OBS-URL: https://build.opensuse.org/request/show/448821
OBS-URL: https://build.opensuse.org/package/show/Base:System/sed?expand=0&rev=26
This commit is contained in:
Marcus Meissner 2017-01-07 12:38:45 +00:00 committed by Git OBS Bridge
parent 74e827760a
commit ef171ba933
13 changed files with 3493 additions and 478 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f048d1838da284c8bc9753e4506b85a1e0cc1ea8999d36f6995bcb9460cddbd7
size 1059414

Binary file not shown.

3
sed-4.3.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:47c20d8841ce9e7b6ef8037768aac44bc2937fff1c265b291c824004d56bd0aa
size 1167168

16
sed-4.3.tar.xz.sig Normal file
View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIcBAABCgAGBQJYbLXaAAoJEH/Z/MsAC+7uxC0P/i2NN+JoRMJNBZsR1Wll3v2B
7B4PvfV3aYJq22aHCce3I+is8d67NSVxH4/0Krb5ejlEFR+JXqsR/jfQF3PxUzd3
GUHNCNACYAfSBEAEpvSy1qZ8oljF8+f7rTqCDNKT9Hc5+Z3FX+7/kGe/26+IUVS7
vjcypuk/BMYYb5dIstN81gVPFjyV9LmFZ732t7NqVhcvqg39YLJ8LnVnd+JyoINv
8kclpYRT0KKG69NTQ2xzkU3O4V1VdWT4fa5FVQdudz3Ehh3BCc/x9Cdmr5pnNKib
vfjrMaUO3KHuKJg3Uk0YszfSVEgVapcObkQ1RGis2GRBLypDG4frMto+t+P1x9yd
k6idtcigyuKETcXAJSd8Kdyz4WUX/GJGXHhA0+U8cvr0qCPohtGflmdHmr2uBe7A
TA6WHukAtYjayC9NEUCrKP9IlKKqGnysVL8mkP0wV+zHi/7xyyvk+G70g5rgK2ig
Tku+gpBzpFWjGIGxZeekWmogHBF+7daf2rGnie/fxmSf/HfWlxvLNcctW4I3ubtd
f9QgGKNG4AQiTwJCl2YVDBc7ZXLCKmaZMrI/5J+RNrdZ+gNSiqeAZtqtlzC6X7y+
5sEcORdyG4GHHmqeJ2aFD+M2nzt57ldXB+bgB9KJ54dm63DtX3NTb6ag53mNVhdP
wtnAivC378MTphLEE0Eo
=z38D
-----END PGP SIGNATURE-----

View File

@ -1,10 +1,10 @@
http://lists.gnu.org/archive/html/bug-gnu-utils/2014-06/msg00000.html
Index: sed-4.2.2/sed/utils.c
Index: sed/utils.c
===================================================================
--- sed-4.2.2.orig/sed/utils.c
+++ sed-4.2.2/sed/utils.c
@@ -298,8 +298,8 @@ ck_fclose(stream)
--- sed/utils.c.orig
+++ sed/utils.c
@@ -252,8 +252,8 @@ ck_fclose(FILE *stream)
{
if (!stream || stream == cur->fp)
{

View File

@ -1,85 +0,0 @@
This is a backport of the fix itself.
From 4c75f64068a7e1446c9aa6ae8f764e0ebddd67ef Mon Sep 17 00:00:00 2001
From: Norihiro Tanaka <noritnk@kcn.ne.jp>
Date: Fri, 20 Feb 2015 01:54:35 +0900
Subject: [PATCH 81/92] sed: fix mishandling of overlapping address ranges
When the line number ranges of two or more editing commands overlap,
sed applies all commands but the first to a line that is just beyond
the union of all ranges. E.g., with this command,
seq 9|sed '2,7d;3,6d', sed would mistakenly delete line 8.
* sed/execute.c (match_an_address_p) [ADDR_IS_NUM]: Make this
function work also in this case.
(match_address_p): Move the ADDR_IS_NUM +
...->line_number == ...->addr_number comparison "up" into
match_an_address_p, so we can hoist two similar if/return
blocks out of "if" and "else" branches.
Change so that this function returns false when the current
line number is outside the specified range.
* testsuite/range-overlap.sh: New file, to test for this.
* testsuite/Makefile.am (T): Add it to the list.
* NEWS (Bug fixes): Mention it.
Reported as http://bugs.gnu.org/19899
---
NEWS | 15 +++++++++++++++
sed/execute.c | 16 ++++++++--------
testsuite/Makefile.am | 3 ++-
testsuite/range-overlap.sh | 34 ++++++++++++++++++++++++++++++++++
4 files changed, 59 insertions(+), 9 deletions(-)
create mode 100755 testsuite/range-overlap.sh
Index: sed-4.2.2/sed/execute.c
===================================================================
--- sed-4.2.2.orig/sed/execute.c
+++ sed-4.2.2/sed/execute.c
@@ -860,8 +860,10 @@ match_an_address_p(addr, input)
case ADDR_IS_LAST:
return test_eof(input);
- /* ADDR_IS_NUM is handled in match_address_p. */
case ADDR_IS_NUM:
+ /* reminder: these are only meaningful for a1 addresses */
+ return (addr->addr_number == input->line_number);
+
default:
panic("INTERNAL ERROR: bad address type");
}
@@ -881,23 +883,20 @@ match_address_p(cmd, input)
if (cmd->range_state != RANGE_ACTIVE)
{
+ if (!cmd->a2)
+ return match_an_address_p(cmd->a1, input);
+
/* Find if we are going to activate a range. Handle ADDR_IS_NUM
specially: it represent an "absolute" state, it should not
be computed like regexes. */
if (cmd->a1->addr_type == ADDR_IS_NUM)
{
- if (!cmd->a2)
- return (input->line_number == cmd->a1->addr_number);
-
if (cmd->range_state == RANGE_CLOSED
|| input->line_number < cmd->a1->addr_number)
return false;
}
else
{
- if (!cmd->a2)
- return match_an_address_p(cmd->a1, input);
-
if (!match_an_address_p(cmd->a1, input))
return false;
}
@@ -913,7 +912,8 @@ match_address_p(cmd, input)
/* Same handling as below, but always include at least one line. */
if (input->line_number >= cmd->a2->addr_number)
cmd->range_state = RANGE_CLOSED;
- return true;
+ return (input->line_number <= cmd->a2->addr_number
+ || match_an_address_p(cmd->a1, input));
case ADDR_IS_STEP:
cmd->a2->addr_number = input->line_number + cmd->a2->addr_step;
return true;

View File

@ -1,51 +0,0 @@
This is a backport of the fix itself.
From c033bdee411128dfebfea1974d1ee3c1d9eac572 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Sat, 20 Jun 2015 07:38:49 -0700
Subject: [PATCH] sed -i: do not treat "-" as a file name
Most GNU utilities treat "-" as standard input, sed itself does that --
in most contexts. However, since the addition of support for
--in-place (-i) in sed-4.0, sed -i has treated a "-" argument as a
file name, i.e., like ./-. Now, that usage evokes a diagnostic:
$ sed -i s/a/b/ -
sed: couldn't edit -: is a terminal
If you require the old behavior, specify the file name as "./-".
Prompted by the report/patch from Stanislav Brabec in
http://bugs.gnu.org/20796 to document the strangely
inconsistent legacy behavior.
* sed/execute.c (open_next_file): Call panic before
even attempting to operate on the file descriptor.
* testsuite/in-place-hyphen.sh: New file. Test for this.
* testsuite/Makefile.am (T): Add it.
* NEWS (Feature removal): Mention it. Admittedly, the old behavior
feels more like a misfeature.
---
NEWS | 3 +++
sed/execute.c | 5 ++++-
testsuite/Makefile.am | 1 +
testsuite/in-place-hyphen.sh | 29 +++++++++++++++++++++++++++++
4 files changed, 37 insertions(+), 1 deletion(-)
create mode 100755 testsuite/in-place-hyphen.sh
Index: sed-4.2.2/sed/execute.c
===================================================================
--- sed-4.2.2.orig/sed/execute.c
+++ sed-4.2.2/sed/execute.c
@@ -580,8 +580,11 @@ open_next_file(name, input)
{
buffer.length = 0;
- if (name[0] == '-' && name[1] == '\0' && !in_place_extension)
+ if (name[0] == '-' && name[1] == '\0')
{
+ if (in_place_extension)
+ panic(_("couldn't edit %s: is a terminal"), name);
+
clearerr(stdin); /* clear any stale EOF indication */
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(MSDOS) || defined(__EMX__)
input->fp = ck_fdopen (fileno (stdin), "stdin", read_mode, false);

View File

@ -1,74 +0,0 @@
This is a backport of the fix itself.
From e387009c78fa08aaebf5192a3ceeb04dcfc7781d Mon Sep 17 00:00:00 2001
From: Stanislav Brabec <sbrabec@suse.com>
Date: Mon, 13 Jul 2015 22:59:17 +0200
Subject: [PATCH] sed: fix --follow-symlinks to work when reading stdin
When reading from stdin, use of --follow-symlinks would cause failure:
$ echo abc | sed --follow-symlinks s/a/d/
sed: cannot stat -: No such file or directory
* sed/execute.c (open_next_file): Set input->in_file_name earlier,
so we can rearrange logic to avoid calling follow_symlink("-").
* testsuite/follow-symlinks-stdin.sh: New file.
* testsuite/Makefile.am (T): Add it.
* NEWS (Bug fixes): Mention it.
Bug introduced by commit v4.2.1-13-g84066bf.
http://bugs.gnu.org/20795
---
NEWS | 3 +++
sed/execute.c | 24 +++++++++++++-----------
testsuite/Makefile.am | 1 +
testsuite/follow-symlinks-stdin.sh | 29 +++++++++++++++++++++++++++++
4 files changed, 46 insertions(+), 11 deletions(-)
create mode 100755 testsuite/follow-symlinks-stdin.sh
Index: sed-4.2.2/sed/execute.c
===================================================================
--- sed-4.2.2.orig/sed/execute.c
+++ sed-4.2.2/sed/execute.c
@@ -580,6 +580,7 @@ open_next_file(name, input)
{
buffer.length = 0;
+ input->in_file_name = name;
if (name[0] == '-' && name[1] == '\0')
{
if (in_place_extension)
@@ -592,22 +593,23 @@ open_next_file(name, input)
input->fp = stdin;
#endif
}
- else if ( ! (input->fp = ck_fopen(name, read_mode, false)) )
+ else
{
- const char *ptr = strerror(errno);
- fprintf(stderr, _("%s: can't read %s: %s\n"), myname, name, ptr);
- input->read_fn = read_always_fail; /* a redundancy */
- ++input->bad_count;
- return;
+ if (follow_symlinks)
+ input->in_file_name = follow_symlink (name);
+
+ if ( ! (input->fp = ck_fopen (name, read_mode, false)) )
+ {
+ const char *ptr = strerror (errno);
+ fprintf (stderr, _("%s: can't read %s: %s\n"), myname, name, ptr);
+ input->read_fn = read_always_fail; /* a redundancy */
+ ++input->bad_count;
+ return;
+ }
}
input->read_fn = read_file_line;
- if (follow_symlinks)
- input->in_file_name = follow_symlink (name);
- else
- input->in_file_name = name;
-
if (in_place_extension)
{
int input_fd;

View File

@ -1,112 +0,0 @@
This is a backport of the fix itself.
From 768901548e280726f160a1da4434f3fde8f9921a Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Sat, 9 May 2015 19:47:08 -0700
Subject: [PATCH 84/92] sed -i: don't leave behind a temporary sedXXXXXX file
For example, running a command like "sed -i s//b/ F" would fail
to remove a temporary file named sedXXXXXX (for random XXXXXX)
in the directory alongside F.
* sed/sed.c (G_file_to_unlink): New global.
(register_cleanup_file, cancel_cleanup, cleanup): New functions.
(main): Call atexit.
* sed/execute.c (open_next_file): Register for unlink.
(closedown): Call cancel_cleanup right after the rename.
* sed/sed.h: Declare two of the new functions.
* NEWS (Bug fixes): Mention it.
* testsuite/temp-file-cleanup.sh: New file. Test for this.
* testsuite/Makefile.am (T): Add it.
Reported by David Jones in http://bugs.gnu.org/20002.
---
NEWS | 4 ++++
sed/execute.c | 2 ++
sed/sed.c | 35 ++++++++++++++++++++++++++++++++++-
sed/sed.h | 2 ++
testsuite/Makefile.am | 3 ++-
testsuite/temp-file-cleanup.sh | 38 ++++++++++++++++++++++++++++++++++++++
6 files changed, 82 insertions(+), 2 deletions(-)
create mode 100755 testsuite/temp-file-cleanup.sh
Index: sed-4.2.2/sed/execute.c
===================================================================
--- sed-4.2.2.orig/sed/execute.c
+++ sed-4.2.2/sed/execute.c
@@ -656,6 +656,7 @@ open_next_file(name, input)
output_file.fp = ck_mkstemp (&input->out_file_name, tmpdir, "sed",
write_mode);
+ register_cleanup_file (input->out_file_name);
output_file.missing_newline = false;
free (tmpdir);
@@ -713,6 +714,7 @@ closedown(input)
}
ck_rename (input->out_file_name, target_name, input->out_file_name);
+ cancel_cleanup ();
free (input->out_file_name);
}
else
Index: sed-4.2.2/sed/sed.c
===================================================================
--- sed-4.2.2.orig/sed/sed.c
+++ sed-4.2.2/sed/sed.c
@@ -69,6 +69,35 @@ countT lcmd_out_line_len = 70;
/* The complete compiled SED program that we are going to run: */
static struct vector *the_program = NULL;
+/* When we've created a temporary for an in-place update,
+ we may have to exit before the rename. This is the name
+ of the temporary that we'll have to unlink via an atexit-
+ registered cleanup function. */
+static char const *G_file_to_unlink;
+
+/* When exiting between temporary file creation and the rename
+ associated with a sed -i invocation, remove that file. */
+static void
+cleanup (void)
+{
+ if (G_file_to_unlink)
+ unlink (G_file_to_unlink);
+}
+
+/* Note that FILE must be removed upon exit. */
+void
+register_cleanup_file (char const *file)
+{
+ G_file_to_unlink = file;
+}
+
+/* Clear the global file-to-unlink global. */
+void
+cancel_cleanup (void)
+{
+ G_file_to_unlink = NULL;
+}
+
static void usage (int);
static void
contact(errmsg)
@@ -200,6 +229,10 @@ main(argc, argv)
#endif
initialize_mbcs ();
+ /* Arrange to remove any un-renamed temporary file,
+ upon premature exit. */
+ atexit (cleanup);
+
#if ENABLE_NLS
/* Tell program which translations to use and where to find. */
Index: sed-4.2.2/sed/sed.h
===================================================================
--- sed-4.2.2.orig/sed/sed.h
+++ sed-4.2.2/sed/sed.h
@@ -262,4 +262,6 @@ extern bool is_utf8;
extern int brlen (int ch, mbstate_t *ps);
extern void initialize_mbcs (void);
+extern void register_cleanup_file (char const *file);
+extern void cancel_cleanup (void);

View File

@ -1,45 +0,0 @@
This is a backport of the fix itself.
From 643f692bc7b02086e91c2afd12bf9ac8b40b6fe4 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Thu, 4 Sep 2014 20:52:12 -0700
Subject: [PATCH 12/92] fix "y" to work with NUL in the RHS
* sed/execute.c (do_list) [case 'y']: Handle NUL bytes
in the RHS of a y/LHS/RHS/ transliteration.
* testsuite/y-zero.good: New test-related files.
* testsuite/y-zero.inp:
* testsuite/y-zero.sed:
* testsuite/Makefile.am (SEDTESTS): Add y-zero here.
* testsuite/Makefile.tests: And here.
* NEWS (Bug fixes): Describe it.
The bug was reported by table@inventati.org,
with the execute.c change mostly by Paolo Bonzini.
---
ChangeLog | 14 ++++++++++++++
NEWS | 18 +++++++++++++++++-
sed/execute.c | 3 ++-
testsuite/Makefile.am | 3 ++-
testsuite/Makefile.tests | 2 +-
testsuite/y-zero.good | Bin 0 -> 4 bytes
testsuite/y-zero.inp | 1 +
testsuite/y-zero.sed | 1 +
8 files changed, 38 insertions(+), 4 deletions(-)
create mode 100644 testsuite/y-zero.good
create mode 100644 testsuite/y-zero.inp
create mode 100644 testsuite/y-zero.sed
Index: sed-4.2.2/sed/execute.c
===================================================================
--- sed-4.2.2.orig/sed/execute.c
+++ sed-4.2.2/sed/execute.c
@@ -1572,7 +1572,8 @@ execute_program(vec, input)
if (strncmp(line.active + idx, trans[2*i], mbclen) == 0)
{
bool move_remain_buffer = false;
- int trans_len = strlen(trans[2*i+1]);
+ const char *tr = trans[2*i+1];
+ size_t trans_len = *tr == '\0' ? 1 : strlen (tr);
if (mbclen < trans_len)
{

View File

@ -1,3 +1,26 @@
-------------------------------------------------------------------
Wed Jan 4 21:36:07 UTC 2017 - mpluskal@suse.com
- Update to version 4.3:
* sed's regular expression matching is now typically 10x faster
* sed now uses unlocked-io where available, resulting in faster
I/O operations.
* lots of bugfixes (for detailed list see NEWS)
- Drop patches (all upstreamed):
* sed-fix-overlapping-address-ranges.patch
* sed-follow-symlinks-hyphen.patch
* sed-follow-symlinks-stdin.patch
* sed-temp-delete.patch
* sed-y-NUL-RHS.patch
- Spec file cleanups
* run spec-cleaner
* use macro for configure
* execute tests with produced binary as well
* use url for signature as well
* use https for download links
* use xs compressed tarballl
* make building verbose
-------------------------------------------------------------------
Fri Sep 11 15:32:37 UTC 2015 - schwab@linux-m68k.org

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
#
# spec file for package sed
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,37 +17,23 @@
Name: sed
Version: 4.2.2
Version: 4.3
Release: 0
Summary: A Stream-Oriented Non-Interactive Text Editor
License: GPL-3.0+
Group: System/Base
Url: http://www.gnu.org/software/sed/
Source: ftp://ftp.gnu.org/gnu/sed/%{name}-%{version}.tar.bz2
Source1: %{name}-%{version}.tar.bz2.sig
Url: https://www.gnu.org/software/sed/
Source0: https://ftp.gnu.org/gnu/sed/%{name}-%{version}.tar.xz
Source1: https://ftp.gnu.org/gnu/sed/%{name}-%{version}.tar.xz.sig
Source2: %{name}.keyring
# PATCH-FIX-SLE sed-dont_close_twice.patch bnc@880817 tcech@suse.cz -- Fix double close.
Patch: sed-dont_close_twice.patch
# PATCH-FIX-UPSTREAM sed-follow-symlinks-hyphen.patch bnc933029 gnu20796 sbrabec@suse.com -- Make behavior of "sed --follow-symlinks -" consistent again.
Patch1: sed-follow-symlinks-hyphen.patch
# PATCH-FIX-UPSTREAM sed-follow-symlinks-stdin.patch bnc933029 gnu20795 sbrabec@suse.com -- Fix --follow-symlinks on stdin.
Patch2: sed-follow-symlinks-stdin.patch
# PATCH-FIX-UPSTREAM sed-y-NUL-RHS.patch sbrabec@suse.com -- Fix y command in the RHS of a y/LHS/RHS/ transliteration.
Patch3: sed-y-NUL-RHS.patch
# PATCH-FIX-UPSTREAM sed-fix-overlapping-address-ranges.patch sbrabec@suse.com -- Fix mishandling of overlapping address ranges.
Patch4: sed-fix-overlapping-address-ranges.patch
# PATCH-FIX-UPSTREAM sed-temp-delete.patch sbrabec@suse.com -- Fix fail to remove a temporary file.
Patch5: sed-temp-delete.patch
# Use rpmbuild -D 'VERIFY_SIG 1' to verify signature during build or run one-shot check by "gpg-offline --verify --package=sed sed-*.sig".
%if 0%{?VERIFY_SIG}
BuildRequires: gpg-offline
%endif
Patch0: sed-dont_close_twice.patch
BuildRequires: libacl-devel
BuildRequires: libselinux-devel
PreReq: %install_info_prereq
Provides: base:/bin/sed
Requires(post): %{install_info_prereq}
Requires(preun): %{install_info_prereq}
Recommends: %{name}-lang
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: base:/bin/sed
%description
Sed takes text input, performs one or more operations on it, and
@ -56,59 +42,54 @@ of a file using pattern matching or for substituting multiple
occurrences of a string within a file.
%lang_package
%prep
%if 0%{?VERIFY_SIG}
%gpg_verify %{S:1}
%endif
%setup -q
%patch -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch0
%build
%define warn_flags -Wall -Wstrict-prototypes -Wpointer-arith -Wformat-security
export CFLAGS="%{optflags} %warn_flags -fPIE"
export CFLAGS="%{optflags} %{warn_flags} -fPIE"
export LDFLAGS="-pie"
./configure --prefix=/usr \
--mandir=%{_mandir} \
--infodir=%{_infodir} \
--without-included-regex \
%{_target_cpu}-suse-linux
%if %do_profiling
make %{?_smp_mflags} CFLAGS="$CFLAGS "%cflags_profile_generate
make %{?_smp_mflags} check
%configure \
--without-included-regex
%if %{do_profiling}
make %{?_smp_mflags} CFLAGS="$CFLAGS %{cflags_profile_generate}" V=1
make %{?_smp_mflags} CFLAGS="$CFLAGS %{cflags_profile_generate}" check
make clean
make %{?_smp_mflags} CFLAGS="$CFLAGS "%cflags_profile_feedback
make %{?_smp_mflags} CFLAGS="$CFLAGS %{cflags_profile_feedback}" V=1
%else
make %{?_smp_mflags}
make %{?_smp_mflags} V=1
%endif
make %{?_smp_mflags} check
%install
%makeinstall
%make_install
#UsrMerge
mkdir -p %{buildroot}/bin
ln -s %{_bindir}/sed %{buildroot}/bin/sed
#EndUserMerge
%find_lang %{name}
%files
%defattr(-, root, root)
/bin/sed
%{_bindir}/sed
%doc AUTHORS BUGS COPYING* NEWS README* THANKS
%doc %{_infodir}/sed.info*.gz
%doc %{_mandir}/man*/*.gz
%files lang -f %{name}.lang
%check
# run check once more with final binaries
make %{?_smp_mflags} check
%post
%install_info --info-dir=%{_infodir} %{_infodir}/%name.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info%{ext_info}
%postun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%name.info.gz
%preun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info%{ext_info}
%files
%defattr(-, root, root)
%doc AUTHORS BUGS COPYING* NEWS README* THANKS
/bin/sed
%{_bindir}/sed
%{_mandir}/man*/*%{ext_man}
%{_infodir}/sed.info*%{ext_info}
%files lang -f %{name}.lang
%defattr(-,root,root)
%changelog