From c9e5162ae9163e021409224108ca63c6bf3a2d13 Mon Sep 17 00:00:00 2001 From: Merlin Mathesius Date: Mon, 25 Sep 2017 16:43:53 -0500 Subject: [PATCH 01/39] Initial commit for Atomic Host Tests --- tests/backup-file-not-cleared/Makefile | 63 +++++++++++ tests/backup-file-not-cleared/PURPOSE | 4 + tests/backup-file-not-cleared/runtest.sh | 106 ++++++++++++++++++ tests/handle-escapes-correctly/Makefile | 49 ++++++++ .../handle-escapes-correctly.sh | 21 ++++ tests/handle-escapes-correctly/runtest.sh | 33 ++++++ tests/handle-escapes-correctly/runtest.yml | 7 ++ tests/inventory | 3 + .../Makefile | 63 +++++++++++ .../PURPOSE | 34 ++++++ .../runtest.sh | 56 +++++++++ .../runtest.yml | 56 +++++++++ .../Makefile | 63 +++++++++++ .../PURPOSE | 33 ++++++ .../runtest.sh | 61 ++++++++++ .../runtest.yml | 93 +++++++++++++++ .../Makefile | 63 +++++++++++ .../PURPOSE | 45 ++++++++ .../runtest.sh | 59 ++++++++++ tests/selftest/Makefile | 64 +++++++++++ tests/selftest/PURPOSE | 3 + tests/selftest/runtest.sh | 87 ++++++++++++++ tests/tests.yml | 44 ++++++++ tests/uppercase-operand/Makefile | 61 ++++++++++ tests/uppercase-operand/PURPOSE | 9 ++ tests/uppercase-operand/runtest.sh | 83 ++++++++++++++ 26 files changed, 1263 insertions(+) create mode 100644 tests/backup-file-not-cleared/Makefile create mode 100644 tests/backup-file-not-cleared/PURPOSE create mode 100755 tests/backup-file-not-cleared/runtest.sh create mode 100644 tests/handle-escapes-correctly/Makefile create mode 100755 tests/handle-escapes-correctly/handle-escapes-correctly.sh create mode 100755 tests/handle-escapes-correctly/runtest.sh create mode 100755 tests/handle-escapes-correctly/runtest.yml create mode 100755 tests/inventory create mode 100644 tests/sed-does-not-handle-inline-edits-of-symlinks-with/Makefile create mode 100644 tests/sed-does-not-handle-inline-edits-of-symlinks-with/PURPOSE create mode 100755 tests/sed-does-not-handle-inline-edits-of-symlinks-with/runtest.sh create mode 100755 tests/sed-does-not-handle-inline-edits-of-symlinks-with/runtest.yml create mode 100644 tests/sed-needs-to-support-c-copy-option/Makefile create mode 100644 tests/sed-needs-to-support-c-copy-option/PURPOSE create mode 100755 tests/sed-needs-to-support-c-copy-option/runtest.sh create mode 100755 tests/sed-needs-to-support-c-copy-option/runtest.yml create mode 100644 tests/sed-reports-syntax-errors-with-some-multibyte/Makefile create mode 100644 tests/sed-reports-syntax-errors-with-some-multibyte/PURPOSE create mode 100755 tests/sed-reports-syntax-errors-with-some-multibyte/runtest.sh create mode 100644 tests/selftest/Makefile create mode 100644 tests/selftest/PURPOSE create mode 100755 tests/selftest/runtest.sh create mode 100644 tests/tests.yml create mode 100644 tests/uppercase-operand/Makefile create mode 100644 tests/uppercase-operand/PURPOSE create mode 100755 tests/uppercase-operand/runtest.sh diff --git a/tests/backup-file-not-cleared/Makefile b/tests/backup-file-not-cleared/Makefile new file mode 100644 index 0000000..8a37baf --- /dev/null +++ b/tests/backup-file-not-cleared/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/sed/Regression/backup-file-not-cleared +# Description: Test for tmp file not clear after registered to rhevm +# Author: Petr Muller +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2012 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/sed/Regression/backup-file-not-cleared +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Petr Muller " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for tmp file not clear after registered to rhevm" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: sed" >> $(METADATA) + @echo "Requires: sed" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/backup-file-not-cleared/PURPOSE b/tests/backup-file-not-cleared/PURPOSE new file mode 100644 index 0000000..fce5d82 --- /dev/null +++ b/tests/backup-file-not-cleared/PURPOSE @@ -0,0 +1,4 @@ +PURPOSE of /CoreOS/sed/Regression/backup-file-not-cleared +Description: Test for tmp file not clear after registered to rhevm +Author: Petr Muller +Bug summary: tmp file not clear after registered to rhevm diff --git a/tests/backup-file-not-cleared/runtest.sh b/tests/backup-file-not-cleared/runtest.sh new file mode 100755 index 0000000..19f7312 --- /dev/null +++ b/tests/backup-file-not-cleared/runtest.sh @@ -0,0 +1,106 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/sed/Regression/backup-file-not-cleared +# Description: Test for tmp file not clear after registered to rhevm +# Author: Petr Muller +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2012 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh + +PACKAGE="sed" + +rlJournalStart + rlPhaseStartSetup + rlRun "mkdir TMP" + rlRun "cd TMP" + rlRun "echo 'some content' > somefile" + rlRun "echo 'changed content' > somefile-expected" + rlRun "touch filelist" + cat > filelist-golden << EOF +./filelist +./filelist-golden +./somefile +./somefile-expected +EOF + rlPhaseEnd + + rlPhaseStartTest + rlRun "sed -i --copy 's/some/changed/' somefile" + rlRun "find . -type f | sort -f > filelist" + + rlAssertNotDiffer filelist filelist-golden + if [ $? -ne 0 ] + then + rlLog "Differences found: " + diff -u filelist-golden filelist | while read line + do + rlLog "\"$line\"" + done + fi + + rlAssertNotDiffer somefile somefile-expected + if [ $? -ne 0 ] + then + rlLog "Differences found: " + diff -u somefile-expected somefile | while read line + do + rlLog "\"$line\"" + done + fi + + rlRun "rm -f sed*" + rlRun "echo 'some content' > somefile" + rlRun "sed -i-fxpected --copy 's/some/changed/' somefile" + rlRun "find . -type f | sort > filelist" + echo "./somefile-fxpected" >> filelist-golden + rlAssertExists somefile-fxpected + sort filelist-golden -o filelist-golden + + rlAssertNotDiffer filelist filelist-golden + if [ $? -ne 0 ] + then + rlLog "Differences found: " + diff -u filelist-golden filelist | while read line + do + rlLog "\"$line\"" + done + fi + + rlAssertNotDiffer somefile somefile-expected + if [ $? -ne 0 ] + then + rlLog "Differences found: " + diff -u somefile-expected somefile | while read line + do + rlLog "\"$line\"" + done + fi + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "cd .." + rlRun "rm -rf TMP" + rlPhaseEnd +rlJournalEnd diff --git a/tests/handle-escapes-correctly/Makefile b/tests/handle-escapes-correctly/Makefile new file mode 100644 index 0000000..16469a1 --- /dev/null +++ b/tests/handle-escapes-correctly/Makefile @@ -0,0 +1,49 @@ +# The toplevel namespace within which the test lives. +TOPLEVEL_NAMESPACE=/CoreOS + +# The name of the package under test: +PACKAGE_NAME=sed + +# The path of the test below the package: +RELATIVE_PATH=handle-escapes-correctly + +# Version of the Test. Used with make tag. +export TESTVERSION=1.1 + +# The compiled namespace of the test. +export TEST=$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH) + +.PHONY: all install download clean + +BUILT_FILES= # executables to be built should be added here, they will be generated on the system under test. +FILES=$(METADATA) runtest.sh Makefile handle-escapes-correctly.sh + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x ./runtest.sh + chmod a+x ./handle-escapes-correctly.sh + +clean: + rm -f *~ $(BUILT_FILES) + +# Include Common Makefile +include /usr/share/rhts/lib/rhts-make.include + +# Generate the testinfo.desc here: +$(METADATA): Makefile + @touch $(METADATA) + @echo "Owner: Bastien Nocera " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "License: RH Internal Test" >> $(METADATA) + @echo "Description: Tests if sed handles escapes correctly">> $(METADATA) + @echo "TestTime: 1m" >> $(METADATA) + @echo "RunFor: $(PACKAGE_NAME) " >> $(METADATA) # add any other packages for which your test ought to run here + @echo "Requires: $(PACKAGE_NAME) " >> $(METADATA) # add any other requirements for the script to run here + @echo "Priority: Normal" >> $(METADATA) + @echo "Type: Regression " >> $(METADATA) + rhts-lint $(METADATA) + diff --git a/tests/handle-escapes-correctly/handle-escapes-correctly.sh b/tests/handle-escapes-correctly/handle-escapes-correctly.sh new file mode 100755 index 0000000..fa21c50 --- /dev/null +++ b/tests/handle-escapes-correctly/handle-escapes-correctly.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Tests if sed handles escapes correctly + +ACTUALFILE=`mktemp` +EXPECTEDFILE=`mktemp` +RETVAL=1 + +echo '' | sed -e ' i\\co' > $ACTUALFILE +printf '\x0f\n\n' > $EXPECTEDFILE + +if diff $EXPECTEDFILE $ACTUALFILE > /dev/null; then + RETVAL=0 + echo "Succeeded" +else + echo "Failed" +fi + +rm -f $ACTUALFILE $EXPECTEDFILE + +exit $RETVAL diff --git a/tests/handle-escapes-correctly/runtest.sh b/tests/handle-escapes-correctly/runtest.sh new file mode 100755 index 0000000..59492f5 --- /dev/null +++ b/tests/handle-escapes-correctly/runtest.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +# Package: Package under test (will be used to get version info on executed +# tests). If RPM query results on PACKAGE are null, then pass value of +# PACKAGE variable for Version +PACKAGE=sed + +# source the test script helpers +# BUG: This line is intentionally left commented out. +# When I have the helper packages installed the line below should be +# uncommented +. /usr/bin/rhts-environment.sh + +# Commands in this section are provided by test developer. +# --------------------------------------------- + + +# Assume the test will pass. +result=PASS + +# Run the acutal test and redirect the output to the log file +# So if need be we will have the debug info after the fact. +./handle-escapes-correctly.sh > $OUTPUTFILE +if [ $? -ne 0 ]; then + result=FAIL +fi + +echo $result + +# Then file the results in the database +#------------------------------------------------ +report_result $TEST $result + diff --git a/tests/handle-escapes-correctly/runtest.yml b/tests/handle-escapes-correctly/runtest.yml new file mode 100755 index 0000000..c2510e1 --- /dev/null +++ b/tests/handle-escapes-correctly/runtest.yml @@ -0,0 +1,7 @@ +- hosts: '{{ hosts | default("localhost") }}' + vars: + package: sed + OUTPUTFILE: ./outputfile + tasks: + - name: Runtest + script: "./handle-escapes-correctly.sh > {{ OUTPUTFILE }}" diff --git a/tests/inventory b/tests/inventory new file mode 100755 index 0000000..b118a5a --- /dev/null +++ b/tests/inventory @@ -0,0 +1,3 @@ +#!/bin/bash +export TEST_DOCKER_EXTRA_ARGS="--privileged" +exec merge-standard-inventory "$@" diff --git a/tests/sed-does-not-handle-inline-edits-of-symlinks-with/Makefile b/tests/sed-does-not-handle-inline-edits-of-symlinks-with/Makefile new file mode 100644 index 0000000..5c0a319 --- /dev/null +++ b/tests/sed-does-not-handle-inline-edits-of-symlinks-with/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/sed/Regression/sed-does-not-handle-inline-edits-of-symlinks-with +# Description: Test for sed does not handle inline edits of symlinks with +# Author: Marek Polacek +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2011 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/sed/Regression/sed-does-not-handle-inline-edits-of-symlinks-with +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Marek Polacek " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for sed does not handle inline edits of symlinks with" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: sed" >> $(METADATA) + @echo "Requires: sed" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/sed-does-not-handle-inline-edits-of-symlinks-with/PURPOSE b/tests/sed-does-not-handle-inline-edits-of-symlinks-with/PURPOSE new file mode 100644 index 0000000..0dabe03 --- /dev/null +++ b/tests/sed-does-not-handle-inline-edits-of-symlinks-with/PURPOSE @@ -0,0 +1,34 @@ +PURPOSE of /CoreOS/sed/Regression/sed-does-not-handle-inline-edits-of-symlinks-with +Description: Test for sed does not handle inline edits of symlinks with +Author: Marek Polacek +Bug summary: sed does not handle inline edits of symlinks with no dir portion + +Description: + +Description of problem: + +When executing on a symlink in present working directory, sed does not build the original path correctly, thus failing to follow the symlink. + +Version-Release number of selected component (if applicable): + +sed-4.1.5-5.fc6 + +How reproducible: + +Always. + +Steps to Reproduce: +1. echo "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" >1 +2. ln -s 1 2 +3. sed -i -e 's/z/a/g' 2 + +Actual results: + +sed: ck_follow_symlink: couldn't lstat 2/1: Not a directory + +Expected results: + +All z's in the file should be replaced with a's. + + +Additional info: diff --git a/tests/sed-does-not-handle-inline-edits-of-symlinks-with/runtest.sh b/tests/sed-does-not-handle-inline-edits-of-symlinks-with/runtest.sh new file mode 100755 index 0000000..0cda046 --- /dev/null +++ b/tests/sed-does-not-handle-inline-edits-of-symlinks-with/runtest.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/sed/Regression/sed-does-not-handle-inline-edits-of-symlinks-with +# Description: Test for sed does not handle inline edits of symlinks with +# Author: Marek Polacek +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2011 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include rhts environment +. /usr/bin/rhts-environment.sh +. /usr/lib/beakerlib/beakerlib.sh + +PACKAGE="sed" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + # Prepare the test file + rlRun "echo 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' > 1" 0 + # Create a symlink + rlRun "ln -s 1 2" 0 + rlPhaseEnd + + rlPhaseStartTest + # Try to replace characters + rlRun "sed -i -e 's/z/a/g' 2 " 0 "Replace all z's with a's" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/sed-does-not-handle-inline-edits-of-symlinks-with/runtest.yml b/tests/sed-does-not-handle-inline-edits-of-symlinks-with/runtest.yml new file mode 100755 index 0000000..6d342ee --- /dev/null +++ b/tests/sed-does-not-handle-inline-edits-of-symlinks-with/runtest.yml @@ -0,0 +1,56 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/sed/Regression/sed-does-not-handle-inline-edits-of-symlinks-with +# Description: Test for sed does not handle inline edits of symlinks with +# Author: Marek Polacek +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2011 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- hosts: '{{ hosts | default("localhost") }}' + vars: + package: sed + tasks: + - name: Make TmpDir + command: "mktemp -d" + register: TmpDir + - name: Prepare the test file + lineinfile: + create: yes + dest: "{{ TmpDir.stdout }}/1" + line: 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' + - name: Create a sym link + file: + src: "{{ TmpDir.stdout }}/1" + dest: "{{ TmpDir.stdout }}/2" + state: link + - block: + - name: Runtest - Try to replace characters + shell: "sed -i -e 's/z/a/g' 2 " + args: + warn: no + chdir: "{{ TmpDir.stdout }}" + always: + - name: Cleanup + file: + path: "{{ TmpDir.stdout }}" + state: absent diff --git a/tests/sed-needs-to-support-c-copy-option/Makefile b/tests/sed-needs-to-support-c-copy-option/Makefile new file mode 100644 index 0000000..3298910 --- /dev/null +++ b/tests/sed-needs-to-support-c-copy-option/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/sed/Regression/sed-needs-to-support-c-copy-option +# Description: Test for sed needs to support -c/--copy option +# Author: Karel Srot +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2010 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/sed/Regression/sed-needs-to-support-c-copy-option +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Karel Srot " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for sed needs to support -c/--copy option" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: sed" >> $(METADATA) + @echo "Requires: sed" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/sed-needs-to-support-c-copy-option/PURPOSE b/tests/sed-needs-to-support-c-copy-option/PURPOSE new file mode 100644 index 0000000..d9872ba --- /dev/null +++ b/tests/sed-needs-to-support-c-copy-option/PURPOSE @@ -0,0 +1,33 @@ +PURPOSE of /CoreOS/sed/Regression/sed-needs-to-support-c-copy-option +Description: Test for sed needs to support -c/--copy option +Author: Karel Srot +Bug summary: sed needs to support -c/--copy option + +Description: + +Description of problem: +sed on bind-mounted files fails in rename step. In previous versions this was fixed by using -c/--copy functionality which appears to have been removed in 4.2.1-4. + +Bind mounts are used in stateless systems for persistent data. + +Version-Release number of selected component (if applicable): +4.2.1-4 + +How reproducible: +Always + +Steps to Reproduce: +1. touch file1 file2 +2. mount --bind file1 file2 +3. echo "test" > file1 +4. sed -i "s/test/fail/g" file2 + +Actual results: +sed: cannot rename ./sedfnZpvY: Device or resource busy + + +Expected results: +sed script completes. + +Additional info: +As of 4.2.1-4, the -c/--copy options did not exist at all. Using them resulted in the printing of the help message. Using 4.2.1-5 from koji reintroduced the -c/--copy option support, but the above sed command still fails. diff --git a/tests/sed-needs-to-support-c-copy-option/runtest.sh b/tests/sed-needs-to-support-c-copy-option/runtest.sh new file mode 100755 index 0000000..1c8ec25 --- /dev/null +++ b/tests/sed-needs-to-support-c-copy-option/runtest.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/sed/Regression/sed-needs-to-support-c-copy-option +# Description: Test for sed needs to support -c/--copy option +# Author: Karel Srot +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2010 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include rhts environment +. /usr/bin/rhts-environment.sh +. /usr/lib/beakerlib/beakerlib.sh + +PACKAGE="sed" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlRun "echo 'test' > file1" 0 "Prepare test files" + rlRun "touch file2" + rlRun "mount -n --bind file1 file2" + rlRun "grep test file2" 0 "Verify tests files" + rlPhaseEnd + + rlPhaseStartTest + rlRun "sed -i 's/test/passed/' file2 &> out1" 4 "Executing sed -i" + rlAssertGrep "cannot rename" out1 + rlAssertGrep "test" file2 + rlRun "sed -i -c 's/test/passed/' file2 &> out2" 0 "Executing sed -i -c" + rlAssertNotGrep "cannot rename" out2 + rlAssertGrep "passed" file2 + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "umount file2" + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/sed-needs-to-support-c-copy-option/runtest.yml b/tests/sed-needs-to-support-c-copy-option/runtest.yml new file mode 100755 index 0000000..b104eb0 --- /dev/null +++ b/tests/sed-needs-to-support-c-copy-option/runtest.yml @@ -0,0 +1,93 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/sed/Regression/sed-needs-to-support-c-copy-option +# Description: Test for sed needs to support -c/--copy option +# Author: Karel Srot +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2010 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- hosts: '{{ hosts | default("localhost") }}' + vars: + package: sed + tasks: + - name: Make TmpDir + command: "mktemp -d" + register: TmpDir + - name: Prepare test files + lineinfile: + dest: "{{ TmpDir.stdout }}/file1" + create: yes + line: "test" + - name: Prepare second test file + file: + dest: "{{ TmpDir.stdout }}/file2" + state: touch + - name: Bind mount files. Dont write to /etc so dont use mount module + shell: "mount -n --bind file1 file2" + args: + warn: no + chdir: "{{ TmpDir.stdout }}" + - name: Verify tests files + command: "grep test file2" + args: + chdir: "{{ TmpDir.stdout }}" + - block: + - name: Runtest - executing sed -i + shell: "sed -i 's/test/passed/' file2 &> out1" + args: + warn: no + chdir: "{{ TmpDir.stdout }}" + register: sedi + failed_when: sedi.rc != 4 + - name: Runtest - grep out1 + command: grep "cannot rename" out1 + args: + chdir: "{{ TmpDir.stdout }}" + - name: Runtest - grep file2 + command: grep "test" file2 + args: + chdir: "{{ TmpDir.stdout }}" + - name: Runtest - executing sed -i -c + shell: "sed -i -c 's/test/passed/' file2 &> out2" + args: + warn: no + chdir: "{{ TmpDir.stdout }}" + - name: Runtest - grep out2 + command: grep "cannot rename" out2 + args: + chdir: "{{ TmpDir.stdout }}" + register: out2 + failed_when: out2.rc != 1 + - name: Runtest - grep file2 + command: grep "passed" file2 + args: + chdir: "{{ TmpDir.stdout }}" + always: + - name: Cleanup file + shell: "umount file2" + args: + chdir: "{{ TmpDir.stdout }}" + - name: Cleanup dir + file: + path: "{{ TmpDir.stdout }}" + state: absent diff --git a/tests/sed-reports-syntax-errors-with-some-multibyte/Makefile b/tests/sed-reports-syntax-errors-with-some-multibyte/Makefile new file mode 100644 index 0000000..cb8566d --- /dev/null +++ b/tests/sed-reports-syntax-errors-with-some-multibyte/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/sed/Regression/sed-reports-syntax-errors-with-some-multibyte +# Description: Test for sed reports syntax errors with some multibyte +# Author: Marek Polacek +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2011 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/sed/Regression/sed-reports-syntax-errors-with-some-multibyte +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Marek Polacek " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for sed reports syntax errors with some multibyte" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: sed" >> $(METADATA) + @echo "Requires: sed glibc-all-langpacks" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/sed-reports-syntax-errors-with-some-multibyte/PURPOSE b/tests/sed-reports-syntax-errors-with-some-multibyte/PURPOSE new file mode 100644 index 0000000..c11cde1 --- /dev/null +++ b/tests/sed-reports-syntax-errors-with-some-multibyte/PURPOSE @@ -0,0 +1,45 @@ +PURPOSE of /CoreOS/sed/Regression/sed-reports-syntax-errors-with-some-multibyte +Description: Test for sed reports syntax errors with some multibyte +Author: Marek Polacek +Bug summary: sed reports syntax errors with some multibyte characters + +Description: + +Description of problem: + +Using a multibyte character that ends with 0x5c (backslash) can cause sed to report syntax errors. + + +Version-Release number of selected component (if applicable): sed-4.1.5-5 + + +How reproducible: Always + + +Steps to Reproduce: +1. Start with your shell in a UTF-8 locale, eg en-US.UTF-8 (you can probably do this in a different locale, but it definitely works if you start in a UTF-8 locale). + +2. Run the follow commands to construct a sed script: + + U2010=$(echo -ne '\x20\x10' | iconv -f ucs-2be) + echo "echo '$U2010' | sed 's/$U2010/hyphen/g'" | iconv -t gbk > /tmp/script + +3. Run the shell script in a locale that uses the gbk character set: + + LC_ALL=zh_CN.gbk sh /tmp/script 2>&1 | iconv -f gbk + +Actual results: + The script reports an error: + + sed:-e 表达式 #1,字符 13:unterminated `s' command + +Expected results: + + The single word "hyphen" + + +Additional info: + +The error arises because the character U+2010 (HYPHEN) is encoded as \xa9\x5c in the gbk encoding. Sed sees the "\x5c" as a backslash escaping the following character which, in this case, is the "/" that we hope is going to terminate the pattern; it doesn't and so we get a syntax error. + +Of course, this is just one character in one encoding. There are likely to be many others and this is just one example. I have another example for SJIS, (U+8868) but SJIS isn't a good encoding to use for reporting bugs :-). diff --git a/tests/sed-reports-syntax-errors-with-some-multibyte/runtest.sh b/tests/sed-reports-syntax-errors-with-some-multibyte/runtest.sh new file mode 100755 index 0000000..a8c6106 --- /dev/null +++ b/tests/sed-reports-syntax-errors-with-some-multibyte/runtest.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/sed/Regression/sed-reports-syntax-errors-with-some-multibyte +# Description: Test for sed reports syntax errors with some multibyte +# Author: Marek Polacek +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2011 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include rhts environment +. /usr/bin/rhts-environment.sh +. /usr/lib/beakerlib/beakerlib.sh + +PACKAGE="sed" + +# as explained in the PURPOSE file, we need to start in a UTF-8 locale +export LC_ALL=en_US.UTF-8 + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + # Construct a sed script + rlRun "U2010=\$(echo -ne '\x20\x10' | iconv -f ucs-2be)" 0 + rlRun "echo \"echo '$U2010' | sed 's/$U2010/hyphen/g'\" | iconv -t gbk > script" 0 + rlRun "set -o pipefail" + rlPhaseEnd + + rlPhaseStartTest + # Run the shell script in a locale that uses the gbk character set + rlRun "LC_ALL=zh_CN.gbk sh ./script 2>&1 | iconv -f gbk" 0 + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/selftest/Makefile b/tests/selftest/Makefile new file mode 100644 index 0000000..cc25659 --- /dev/null +++ b/tests/selftest/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/sed/Sanity/selftest +# Description: Execute test suite comming with sed +# Author: Miroslav Vadkerti +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2010 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/sed/Sanity/selftest +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Miroslav Vadkerti " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Execute test suite comming with sed" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 30m" >> $(METADATA) + @echo "RunFor: sed" >> $(METADATA) + @echo "Requires: sed" >> $(METADATA) + @echo "Requires: gcc rpm-build automake libselinux-devel glibc-devel yum-utils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/selftest/PURPOSE b/tests/selftest/PURPOSE new file mode 100644 index 0000000..ae50f2c --- /dev/null +++ b/tests/selftest/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/sed/Sanity/selftest +Description: Execute test suite comming with sed +Author: Miroslav Vadkerti diff --git a/tests/selftest/runtest.sh b/tests/selftest/runtest.sh new file mode 100755 index 0000000..8b69564 --- /dev/null +++ b/tests/selftest/runtest.sh @@ -0,0 +1,87 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/sed/Sanity/selftest +# Description: Execute test suite comming with sed +# Author: Miroslav Vadkerti +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2010 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include rhts environment +. /usr/bin/rhts-environment.sh +. /usr/lib/beakerlib/beakerlib.sh + +PACKAGE="sed" +PACKAGES="sed gcc rpm-build automake libselinux-devel glibc-devel" +UPSTREAMPKG="sed-*" +BUILDLOG=`mktemp` +TESTLOG=`mktemp` +TARGET=$(echo `uname -m` | egrep ppc) +if [[ $TARGET != "" ]]; then + if rlIsRHEL 4; then + TARGET="--target ppc" + else + TARGET="--target `uname -m`" + fi +fi + +rlJournalStart + rlPhaseStartSetup + for PKG in $PACKAGES; do + rlAssertRpm $PKG + done + rlFetchSrcForInstalled $PACKAGE + # make sure all deps installed + if ! rlIsRHEL 3 4 5; then + rlRun "yum-builddep -y *.src.rpm" 0-255 + fi + rlPhaseEnd + + rlPhaseStartTest + rlRun "rpm -ivh $PACKAGE*.src.rpm" 0 "Installing $PACKAGE src rpm" +SRCDIR="/usr/src/redhat" +if ! rlIsRHEL 3 4 5; then + SRCDIR="$HOME/rpmbuild/" + echo "+ RHEL6+ detected: SRCDIR=$SRCDIR" +fi +SPEC="$SRCDIR/SPECS/$PACKAGE*.spec" +TESTDIR="$SRCDIR/BUILD/$UPSTREAMPKG/" + echo "+ Building $PACKAGE (Log: $BUILDLOG)" + echo "+ Build command: rpmbuild -bc $SPEC $TARGET" + rlRun "rpmbuild -bc $SPEC $TARGET &> $BUILDLOG" + echo "+ Buildlog:" + tail -n 100 $BUILDLOG + rlRun "pushd ." + rlRun "cd $TESTDIR" + # disable test known to fail when run as root + rlRun "sed -i 's/testsuite\/panic-tests.sh//' Makefile.in" + rlRun "make check &> $TESTLOG" + cat $TESTLOG + rlAssertNotGrep "^FAIL" $TESTLOG + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -rf $PACKAGE*.src.rpm" 0 "Removing source rpm" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..821e66c --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,44 @@ +--- +# Tests for classic and docker container environments +- hosts: localhost + tags: + - classic + - container + roles: + - role: standard-test-beakerlib + tests: + - selftest + - backup-file-not-cleared + - handle-escapes-correctly + - sed-does-not-handle-inline-edits-of-symlinks-with + - sed-needs-to-support-c-copy-option + - sed-reports-syntax-errors-with-some-multibyte + - uppercase-operand + required_packages: + - wget # beakerlib needs wget command + - findutils # backup-file-not-cleared needs find command + - glibc-langpack-en # sed-reports-syntax-errors-with-some-multibyte needs en_US.UTF-8 locale + - glibc-langpack-zh # sed-reports-syntax-errors-with-some-multibyte needs zh_CN.gbk locale + - glibc-langpack-ru # selftest needs ru_RU.UTF-8 locale + - gcc # selftest needs gcc package + - rpm-build # selftest needs rpm-build package + - automake # selftest needs automake package + - libselinux-devel # selftest needs libselinux-devel package + - glibc-devel # selftest needs glibc-devel package + - yum-utils # selftest needs yum-utils package + - libacl-devel # selftest needs libacl-devel package + +# Tests for Atomic Host +- hosts: localhost + tags: + - atomic + roles: + - role: standard-test-beakerlib + tests: + #- selftest # cannot run under Atomic + - backup-file-not-cleared + - handle-escapes-correctly + - sed-does-not-handle-inline-edits-of-symlinks-with + - sed-needs-to-support-c-copy-option + #- sed-reports-syntax-errors-with-some-multibyte # needs glibc-langpack-zh + - uppercase-operand diff --git a/tests/uppercase-operand/Makefile b/tests/uppercase-operand/Makefile new file mode 100644 index 0000000..da37af9 --- /dev/null +++ b/tests/uppercase-operand/Makefile @@ -0,0 +1,61 @@ +# Makefile - uppercase-operand +# Author: Petr Muller +# Location: /CoreOS/sed/Regression/uppercase-operand/Makefile + +# Description: Verifiies that sed correctly processes an 'u' operand, which returns uppercase of matched character + +# Copyright (c) 2008 Red Hat, Inc. All rights reserved. This copyrighted material +# is made available to anyone wishing to use, modify, copy, or +# redistribute it subject to the terms and conditions of the GNU General +# Public License v.2. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + + +TOPLEVEL_NAMESPACE=/CoreOS +PACKAGE_NAME=sed +RELATIVE_PATH=Regression/uppercase-operand + +export TEST=$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH) +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x ./runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + + +$(METADATA): Makefile + @touch $(METADATA) + @echo "Owner: Petr Muller " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Description: Verifiies that sed correctly processes an 'u' operand, which returns uppercase of matched character" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 1m" >> $(METADATA) + @echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA) + @echo "Requires: $(PACKAGE_NAME)" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/uppercase-operand/PURPOSE b/tests/uppercase-operand/PURPOSE new file mode 100644 index 0000000..ea59d9d --- /dev/null +++ b/tests/uppercase-operand/PURPOSE @@ -0,0 +1,9 @@ +Test Name: uppercase-operand +Author: Petr Muller +Location: /CoreOS/sed/Regression/uppercase-operand + +Short Description: Verifiies that sed correctly processes an 'u' operand, which returns uppercase of matched character + + +Long Description: +Verifiies that sed correctly processes an 'u' operand, which returns uppercase of matched character diff --git a/tests/uppercase-operand/runtest.sh b/tests/uppercase-operand/runtest.sh new file mode 100755 index 0000000..b5748a6 --- /dev/null +++ b/tests/uppercase-operand/runtest.sh @@ -0,0 +1,83 @@ +# runtest.sh - uppercase-operand +# Author: Petr Muller +# Location: /CoreOS/sed/Regression/uppercase-operand/runtest.sh + +# Description: Verifiies that sed correctly processes an 'u' operand, which returns uppercase of matched character + +# Copyright (c) 2008 Red Hat, Inc. All rights reserved. This copyrighted material +# is made available to anyone wishing to use, modify, copy, or +# redistribute it subject to the terms and conditions of the GNU General +# Public License v.2. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +PACKAGE=sed + +RESULT=FAIL +SCORE=0 + +if rpm -q $PACKAGE &>/dev/null; then + PKG_VERS=$( rpm -q ${PACKAGE} --queryformat %{version} ) + PKG_RELEASE=$( rpm -q ${PACKAGE} --queryformat %{release} ) +fi + +# Include rhts environment +. /usr/bin/rhts-environment.sh + +function Log { + echo -e ":: [`date +%H:%M:%S`] :: $1" >> $OUTPUTFILE +} + +function HeaderLog { + echo -e "\n::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" >> $OUTPUTFILE + echo -e ":: [`date +%H:%M:%S`] :: $1" >> $OUTPUTFILE + echo -e "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\n" >>$OUTPUTFILE +} + +HeaderLog "Starting $PACKAGE RHTS Test" + +if rpm -q $PACKAGE &>/dev/null; then + Log "Running $PACKAGE-$PKG_VERS-$PKG_RELEASE" +else + Log "WARNING: Unable to locate $PACKAGE" +fi + + #################### + # Begin Test-Case + # Find result should be PASS or FAIL + #################### + +HeaderLog "Starting Test-Case" + +testcase='i shouLD be In UpPeR CaSe, yeah, I should' +Log "Testcase: '$testcase'" +res=`echo $testcase | sed -e 's/[a-z]/\u&/g'` +Log "Result: $res" + + #################### + # Check Results + #################### + +HeaderLog "Checking Results" +if [ "$res" == "I SHOULD BE IN UPPER CASE, YEAH, I SHOULD" ] +then + RESULT=PASS + Log "Seems correct: PASS" +else + RESULT=FAIL + Log "Didn't get what we expected: FAIL" +fi + +HeaderLog "Reporting Results" + +Log "TEST: $TEST | RESULT: $RESULT\n" +report_result $TEST $RESULT + +HeaderLog "End of $PACKAGE RHTS Test" From c8c5dea6f741c4bf2653c5cd191900a68aa15949 Mon Sep 17 00:00:00 2001 From: Jakub Martisko Date: Thu, 11 Jan 2018 15:26:00 +0100 Subject: [PATCH 02/39] Change how sed handles SELinux context when working with symlinks inplace Resolves: #1401442 --- sed-selinux.patch | 29 +++++++++++++++++++++++++++++ sed.spec | 12 ++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 sed-selinux.patch diff --git a/sed-selinux.patch b/sed-selinux.patch new file mode 100644 index 0000000..2dca5ab --- /dev/null +++ b/sed-selinux.patch @@ -0,0 +1,29 @@ +diff --git a/NEWS b/NEWS +index e9335f0..e762b2d 100644 +--- a/NEWS ++++ b/NEWS +@@ -1,4 +1,9 @@ GNU sed NEWS -*- outline -*- + GNU sed NEWS -*- outline -*- ++ ++ sed -i now creates selinux context based on the context of the symlink ++ instead of the symlink target. [Bug present since at least sed-4.2] ++ sed -i --follow-symlinks remains unchanged. ++ + + * Noteworthy changes in release 4.4 (2017-02-03) [stable] + +diff --git a/sed/execute.c b/sed/execute.c +index 1843392..453886e 100644 +--- a/sed/execute.c ++++ b/sed/execute.c +@@ -607,7 +607,7 @@ open_next_file(const char *name, struct input *input) + if (is_selinux_enabled () > 0) + { + security_context_t con; +- if (getfilecon (input->in_file_name, &con) != -1) ++ if (lgetfilecon (input->in_file_name, &con) != -1) + { + /* Save and restore the old context for the sake of w and W + commands. */ +2.9.5 + diff --git a/sed.spec b/sed.spec index 8a1ae52..8eb2a57 100644 --- a/sed.spec +++ b/sed.spec @@ -3,15 +3,16 @@ Summary: A GNU stream text editor Name: sed Version: 4.4 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv3+ Group: Applications/Text URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz Source1: http://sed.sourceforge.net/sedfaq.txt Patch0: sed-4.2.2-binary_copy_args.patch +Patch1: sed-selinux.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: glibc-devel, libselinux-devel, libacl-devel +BuildRequires: glibc-devel, libselinux-devel, libacl-devel, automake, autoconf BuildRequires: perl-Getopt-Long Requires(post): /sbin/install-info Requires(preun): /sbin/install-info @@ -31,6 +32,7 @@ specified in a script file or from the command line. %prep %setup -q %patch0 -p1 -b .copy +%patch1 -p1 -b .selinux %build %configure --without-included-regex @@ -73,6 +75,12 @@ rm -rf ${RPM_BUILD_ROOT} %{_mandir}/man*/* %changelog +* Thu Jan 11 2018 Jakub Martisko - 4.4-4 +- When editing file inplace, the SELinux context should + be based on the link instead of the target file itself. + --follow-symlinks option remains unchanged +- Resolves: #1401442 + * Thu Aug 03 2017 Fedora Release Engineering - 4.4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild From bb408c435e41b7178734effe4d994ca8498027e2 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 9 Feb 2018 16:28:01 +0000 Subject: [PATCH 03/39] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- sed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index 8eb2a57..f69d3c5 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.4 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv3+ Group: Applications/Text URL: http://sed.sourceforge.net/ @@ -75,6 +75,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_mandir}/man*/* %changelog +* Fri Feb 09 2018 Fedora Release Engineering - 4.4-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Thu Jan 11 2018 Jakub Martisko - 4.4-4 - When editing file inplace, the SELinux context should be based on the link instead of the target file itself. From 216ad6cf24b1940a94ef03aabbc80b8033ff9360 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 14 Feb 2018 00:36:44 +0100 Subject: [PATCH 04/39] Remove BuildRoot definition None of currently supported distributions need that. It was needed last for EL5 which is EOL now Signed-off-by: Igor Gnatenko --- sed.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/sed.spec b/sed.spec index f69d3c5..747032d 100644 --- a/sed.spec +++ b/sed.spec @@ -11,7 +11,6 @@ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz Source1: http://sed.sourceforge.net/sedfaq.txt Patch0: sed-4.2.2-binary_copy_args.patch Patch1: sed-selinux.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: glibc-devel, libselinux-devel, libacl-devel, automake, autoconf BuildRequires: perl-Getopt-Long Requires(post): /sbin/install-info From 156b6bc55094643c3cf6ce1cffcc84a4f7c9f86a Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 14 Feb 2018 09:07:31 +0100 Subject: [PATCH 05/39] Remove %clean section None of currently supported distributions need that. Last one was EL5 which is EOL for a while. Signed-off-by: Igor Gnatenko --- sed.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/sed.spec b/sed.spec index 747032d..7056043 100644 --- a/sed.spec +++ b/sed.spec @@ -61,9 +61,6 @@ if [ $1 = 0 ]; then fi : -%clean -rm -rf ${RPM_BUILD_ROOT} - %files -f %{name}.lang %defattr(-,root,root) %{!?_licensedir:%global license %%doc} From 552e2dc03079888f757cf77929c4160e790615a0 Mon Sep 17 00:00:00 2001 From: Jakub Martisko Date: Thu, 8 Mar 2018 14:30:57 +0100 Subject: [PATCH 06/39] sed.spec: add gcc to buildrequires --- sed.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sed.spec b/sed.spec index 7056043..cf1773e 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.4 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv3+ Group: Applications/Text URL: http://sed.sourceforge.net/ @@ -11,7 +11,7 @@ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz Source1: http://sed.sourceforge.net/sedfaq.txt Patch0: sed-4.2.2-binary_copy_args.patch Patch1: sed-selinux.patch -BuildRequires: glibc-devel, libselinux-devel, libacl-devel, automake, autoconf +BuildRequires: glibc-devel, libselinux-devel, libacl-devel, automake, autoconf, gcc BuildRequires: perl-Getopt-Long Requires(post): /sbin/install-info Requires(preun): /sbin/install-info @@ -71,6 +71,9 @@ fi %{_mandir}/man*/* %changelog +* Thu Mar 08 2018 Jakub Martiso - 4.4-6 +- Add gcc to BuildRequires + * Fri Feb 09 2018 Fedora Release Engineering - 4.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From 49643044e4d48ad8ea0d71a88810e163273c05a8 Mon Sep 17 00:00:00 2001 From: Jakub Martisko Date: Thu, 8 Mar 2018 14:33:29 +0100 Subject: [PATCH 07/39] fix: build failure with glibc-2.28 --- sed-gnulib.patch | 218 +++++++++++++++++++++++++++++++++++++++++++++++ sed.spec | 9 +- 2 files changed, 226 insertions(+), 1 deletion(-) create mode 100644 sed-gnulib.patch diff --git a/sed-gnulib.patch b/sed-gnulib.patch new file mode 100644 index 0000000..902b847 --- /dev/null +++ b/sed-gnulib.patch @@ -0,0 +1,218 @@ +From 1831628c0630ae96a43586b2a25ca51cbdba3e53 Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Mon, 5 Mar 2018 10:56:29 -0800 +Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Problem reported by Daniel P. Berrangé in: +https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html +* lib/fbufmode.c (fbufmode): +* lib/fflush.c (clear_ungetc_buffer_preserving_position) +(disable_seek_optimization, rpl_fflush): +* lib/fpending.c (__fpending): +* lib/fpurge.c (fpurge): +* lib/freadable.c (freadable): +* lib/freadahead.c (freadahead): +* lib/freading.c (freading): +* lib/freadptr.c (freadptr): +* lib/freadseek.c (freadptrinc): +* lib/fseeko.c (fseeko): +* lib/fseterr.c (fseterr): +* lib/fwritable.c (fwritable): +* lib/fwriting.c (fwriting): +Check _IO_EOF_SEEN instead of _IO_ftrylockfile. +* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]: +Define if not already defined. +--- + ChangeLog | 23 +++++++++++++++++++++++ + lib/fbufmode.c | 2 +- + lib/fflush.c | 6 +++--- + lib/fpending.c | 2 +- + lib/fpurge.c | 2 +- + lib/freadable.c | 2 +- + lib/freadahead.c | 2 +- + lib/freading.c | 2 +- + lib/freadptr.c | 2 +- + lib/freadseek.c | 2 +- + lib/fseeko.c | 4 ++-- + lib/fseterr.c | 2 +- + lib/fwritable.c | 2 +- + lib/fwriting.c | 2 +- + lib/stdio-impl.h | 6 ++++++ + 15 files changed, 45 insertions(+), 16 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 667f91663..beb835670 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,26 @@ ++2018-03-05 Paul Eggert ++ ++ fflush: adjust to glibc 2.28 libio.h removal ++ Problem reported by Daniel P. Berrangé in: ++ https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html ++ * lib/fbufmode.c (fbufmode): ++ * lib/fflush.c (clear_ungetc_buffer_preserving_position) ++ (disable_seek_optimization, rpl_fflush): ++ * lib/fpending.c (__fpending): ++ * lib/fpurge.c (fpurge): ++ * lib/freadable.c (freadable): ++ * lib/freadahead.c (freadahead): ++ * lib/freading.c (freading): ++ * lib/freadptr.c (freadptr): ++ * lib/freadseek.c (freadptrinc): ++ * lib/fseeko.c (fseeko): ++ * lib/fseterr.c (fseterr): ++ * lib/fwritable.c (fwritable): ++ * lib/fwriting.c (fwriting): ++ Check _IO_EOF_SEEN instead of _IO_ftrylockfile. ++ * lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]: ++ Define if not already defined. ++ + 2017-02-03 Jim Meyering + + version 4.4 +diff --git a/gnulib-tests/fflush.c b/gnulib-tests/fflush.c +index 983ade0ff..a6edfa105 100644 +--- a/gnulib-tests/fflush.c ++++ b/gnulib-tests/fflush.c +@@ -33,7 +33,7 @@ + #undef fflush + + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + + /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ + static void +@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp) + + #endif + +-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) ++#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) + + # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ +@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream) + if (stream == NULL || ! freading (stream)) + return fflush (stream); + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + + clear_ungetc_buffer_preserving_position (stream); + +diff --git a/lib/fpending.c b/lib/fpending.c +index c84e3a5b4..789f50e4e 100644 +--- a/lib/fpending.c ++++ b/lib/fpending.c +@@ -32,7 +32,7 @@ __fpending (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + return fp->_IO_write_ptr - fp->_IO_write_base; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ +diff --git a/gnulib-tests/fpurge.c b/gnulib-tests/fpurge.c +index b1d417c7a..3aedcc373 100644 +--- a/gnulib-tests/fpurge.c ++++ b/gnulib-tests/fpurge.c +@@ -62,7 +62,7 @@ fpurge (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_IO_read_end = fp->_IO_read_ptr; + fp->_IO_write_ptr = fp->_IO_write_base; + /* Avoid memory leak when there is an active ungetc buffer. */ +diff --git a/gnulib-tests/freading.c b/gnulib-tests/freading.c +index 73c28acdd..c24d0c88a 100644 +--- a/gnulib-tests/freading.c ++++ b/gnulib-tests/freading.c +@@ -31,7 +31,7 @@ freading (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + return ((fp->_flags & _IO_NO_WRITES) != 0 + || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 + && fp->_IO_read_base != NULL)); +diff --git a/gnulib-tests/fseeko.c b/gnulib-tests/fseeko.c +index 0101ab55f..193f4e8ce 100644 +--- a/gnulib-tests/fseeko.c ++++ b/gnulib-tests/fseeko.c +@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence) + #endif + + /* These tests are based on fpurge.c. */ +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_read_end == fp->_IO_read_ptr + && fp->_IO_write_ptr == fp->_IO_write_base + && fp->_IO_save_base == NULL) +@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence) + return -1; + } + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_flags &= ~_IO_EOF_SEEN; + fp->_offset = pos; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ +diff --git a/lib/fwriting.c b/lib/fwriting.c +index 461ab0f1f..4a3d9c8d4 100644 +--- a/lib/fwriting.c ++++ b/lib/fwriting.c +@@ -27,7 +27,7 @@ fwriting (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + return (fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) != 0; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ +diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h +index 78d896e9f..05c5752a2 100644 +--- a/lib/stdio-impl.h ++++ b/lib/stdio-impl.h +@@ -18,6 +18,12 @@ + the same implementation of stdio extension API, except that some fields + have different naming conventions, or their access requires some casts. */ + ++/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this ++ problem by defining it ourselves. FIXME: Do not rely on glibc ++ internals. */ ++#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN ++# define _IO_IN_BACKUP 0x100 ++#endif + + /* BSD stdio derived implementations. */ + +diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h +index 78d896e9f..05c5752a2 100644 +--- a/gnulib-tests/stdio-impl.h ++++ b/gnulib-tests/stdio-impl.h +@@ -18,6 +18,12 @@ + the same implementation of stdio extension API, except that some fields + have different naming conventions, or their access requires some casts. */ + ++/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this ++ problem by defining it ourselves. FIXME: Do not rely on glibc ++ internals. */ ++#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN ++# define _IO_IN_BACKUP 0x100 ++#endif + + /* BSD stdio derived implementations. */ + +-- +2.14.3 + diff --git a/sed.spec b/sed.spec index cf1773e..71fa4cd 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.4 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv3+ Group: Applications/Text URL: http://sed.sourceforge.net/ @@ -11,6 +11,9 @@ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz Source1: http://sed.sourceforge.net/sedfaq.txt Patch0: sed-4.2.2-binary_copy_args.patch Patch1: sed-selinux.patch +#Build failure with glibc-2.28 +#https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html +Patch2: sed-gnulib.patch BuildRequires: glibc-devel, libselinux-devel, libacl-devel, automake, autoconf, gcc BuildRequires: perl-Getopt-Long Requires(post): /sbin/install-info @@ -32,6 +35,7 @@ specified in a script file or from the command line. %setup -q %patch0 -p1 -b .copy %patch1 -p1 -b .selinux +%patch2 -p1 -b .gnulib %build %configure --without-included-regex @@ -71,6 +75,9 @@ fi %{_mandir}/man*/* %changelog +* Thu Mar 08 2018 Jakub Martiso - 4.4-7 +- Fix build failure with glibc-2.28 + * Thu Mar 08 2018 Jakub Martiso - 4.4-6 - Add gcc to BuildRequires From 0b87a8acdf398a64a1ac795ef6c7ed3ba7fe3fc7 Mon Sep 17 00:00:00 2001 From: Jakub Martisko Date: Tue, 3 Apr 2018 13:29:18 +0200 Subject: [PATCH 08/39] Rebase to sed 4.5 -resolves #1562608 --- .gitignore | 1 + sed.spec | 18 +++++++++++------- sources | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index d46bc8b..596d3ec 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ sed-4.2.1.tar.bz2 /sed-4.2.2.tar.bz2 /sed-4.3.tar.xz /sed-4.4.tar.xz +/sed-4.5.tar.xz diff --git a/sed.spec b/sed.spec index 71fa4cd..df1fe99 100644 --- a/sed.spec +++ b/sed.spec @@ -2,15 +2,15 @@ Summary: A GNU stream text editor Name: sed -Version: 4.4 -Release: 7%{?dist} +Version: 4.5 +Release: 1%{?dist} License: GPLv3+ Group: Applications/Text URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz Source1: http://sed.sourceforge.net/sedfaq.txt Patch0: sed-4.2.2-binary_copy_args.patch -Patch1: sed-selinux.patch +#Patch1: sed-selinux.patch #Build failure with glibc-2.28 #https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html Patch2: sed-gnulib.patch @@ -34,8 +34,8 @@ specified in a script file or from the command line. %prep %setup -q %patch0 -p1 -b .copy -%patch1 -p1 -b .selinux -%patch2 -p1 -b .gnulib +#%patch1 -p1 -b .selinux +#%patch2 -p1 -b .gnulib %build %configure --without-included-regex @@ -75,10 +75,14 @@ fi %{_mandir}/man*/* %changelog -* Thu Mar 08 2018 Jakub Martiso - 4.4-7 +* Tue Apr 03 2018 Jakub Martisko - 4.5-1 +- Rebase to 4.5 +- Drop patches from 4.4-4 and 4.4-7 + +* Thu Mar 08 2018 Jakub Martisko - 4.4-7 - Fix build failure with glibc-2.28 -* Thu Mar 08 2018 Jakub Martiso - 4.4-6 +* Thu Mar 08 2018 Jakub Martisko - 4.4-6 - Add gcc to BuildRequires * Fri Feb 09 2018 Fedora Release Engineering - 4.4-5 diff --git a/sources b/sources index 2501833..6a0d35d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (sed-4.4.tar.xz) = 4e1b0a7403913f1e25047eb2292a0a9b3488b15b4463ce2803e05eaecbc2da19f477a18e6a70c992461c38ced90774415091aa2d8ce85cb74e391610d9eedb70 +SHA512 (sed-4.5.tar.xz) = f95fb27e03b2301dae63878413b4c48e40341cc676945a612e1d0bd911da3192858ae142791292a99fbdaacbc7dab2d6fccb50787c06846f99b0b3740b40c196 From 9236f86c8ee3c22e60e3c475e6bfcb91b0c138d1 Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: Tue, 10 Jul 2018 01:19:55 -0500 Subject: [PATCH 09/39] Remove needless use of %defattr --- sed.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/sed.spec b/sed.spec index df1fe99..5b5176a 100644 --- a/sed.spec +++ b/sed.spec @@ -66,7 +66,6 @@ fi : %files -f %{name}.lang -%defattr(-,root,root) %{!?_licensedir:%global license %%doc} %license COPYING %doc BUGS NEWS THANKS README AUTHORS sedfaq.txt.gz From d959769186f1643851d6ed4641845fe3528e6a23 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Thu, 12 Jul 2018 10:40:20 +0200 Subject: [PATCH 10/39] remove unneeded scriptlets install-info is handled by filetrigger nowadays. Signed-off-by: Igor Gnatenko --- sed.spec | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/sed.spec b/sed.spec index 5b5176a..acf0915 100644 --- a/sed.spec +++ b/sed.spec @@ -16,8 +16,6 @@ Patch0: sed-4.2.2-binary_copy_args.patch Patch2: sed-gnulib.patch BuildRequires: glibc-devel, libselinux-devel, libacl-devel, automake, autoconf, gcc BuildRequires: perl-Getopt-Long -Requires(post): /sbin/install-info -Requires(preun): /sbin/install-info Provides: /bin/sed @@ -55,23 +53,13 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %find_lang %{name} -%post -/sbin/install-info %{_infodir}/sed.info.gz %{_infodir}/dir || &> /dev/null -: - -%preun -if [ $1 = 0 ]; then - /sbin/install-info --delete %{_infodir}/sed.info.gz %{_infodir}/dir || &> /dev/null -fi -: - %files -f %{name}.lang %{!?_licensedir:%global license %%doc} %license COPYING %doc BUGS NEWS THANKS README AUTHORS sedfaq.txt.gz %{_bindir}/sed -%{_infodir}/*.info* -%{_mandir}/man*/* +%{_infodir}/sed.info* +%{_mandir}/man1/sed.1* %changelog * Tue Apr 03 2018 Jakub Martisko - 4.5-1 From b189ada44abd00aa86ef0736f8216e63d3c977f0 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 14 Jul 2018 05:55:58 +0000 Subject: [PATCH 11/39] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- sed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index acf0915..6c1fc1e 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.5 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Group: Applications/Text URL: http://sed.sourceforge.net/ @@ -62,6 +62,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Sat Jul 14 2018 Fedora Release Engineering - 4.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Tue Apr 03 2018 Jakub Martisko - 4.5-1 - Rebase to 4.5 - Drop patches from 4.4-4 and 4.4-7 From 9bd597f0839c34ae6002c454dd4ef194b7ef627e Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 28 Jan 2019 20:18:25 +0100 Subject: [PATCH 12/39] Remove obsolete Group tag References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag --- sed.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/sed.spec b/sed.spec index 6c1fc1e..0ea7f8c 100644 --- a/sed.spec +++ b/sed.spec @@ -5,7 +5,6 @@ Name: sed Version: 4.5 Release: 2%{?dist} License: GPLv3+ -Group: Applications/Text URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz Source1: http://sed.sourceforge.net/sedfaq.txt From 7ad151ab4b580b5b4593e9a5439aaf243a1e4bcc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 2 Feb 2019 15:09:45 +0000 Subject: [PATCH 13/39] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- sed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index 0ea7f8c..1c0c204 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.5 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -61,6 +61,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Sat Feb 02 2019 Fedora Release Engineering - 4.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Sat Jul 14 2018 Fedora Release Engineering - 4.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From 7f7ce335c358c2042c6f4398f724ac66b0243f60 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 26 Jul 2019 23:02:39 +0000 Subject: [PATCH 14/39] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- sed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index 1c0c204..15d9c72 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.5 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv3+ URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -61,6 +61,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Fri Jul 26 2019 Fedora Release Engineering - 4.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Sat Feb 02 2019 Fedora Release Engineering - 4.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From 18be292ba6076a90225c618ee77c70dc4ac48e08 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 30 Jan 2020 23:11:06 +0000 Subject: [PATCH 15/39] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- sed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index 15d9c72..1a30337 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.5 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv3+ URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -61,6 +61,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Thu Jan 30 2020 Fedora Release Engineering - 4.5-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Fri Jul 26 2019 Fedora Release Engineering - 4.5-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From 99e3879156ab24858f296069227d3daff5a0c4c4 Mon Sep 17 00:00:00 2001 From: Jakub Martisko Date: Wed, 12 Feb 2020 12:37:56 +0100 Subject: [PATCH 16/39] Rebase to sed 4.8 Refresht the downstream options patch --- .gitignore | 1 + sed-4.2.2-binary_copy_args.patch | 281 ------------------------------- sed-b-flag.patch | 29 ++++ sed-c-flag.patch | 247 +++++++++++++++++++++++++++ sed.spec | 17 +- sources | 2 +- 6 files changed, 289 insertions(+), 288 deletions(-) delete mode 100644 sed-4.2.2-binary_copy_args.patch create mode 100644 sed-b-flag.patch create mode 100644 sed-c-flag.patch diff --git a/.gitignore b/.gitignore index 596d3ec..bb24a27 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ sed-4.2.1.tar.bz2 /sed-4.3.tar.xz /sed-4.4.tar.xz /sed-4.5.tar.xz +/sed-4.8.tar.xz diff --git a/sed-4.2.2-binary_copy_args.patch b/sed-4.2.2-binary_copy_args.patch deleted file mode 100644 index 1c88342..0000000 --- a/sed-4.2.2-binary_copy_args.patch +++ /dev/null @@ -1,281 +0,0 @@ -diff -urN sed-4.3/sed/execute.c sed-4.3.new00/sed/execute.c ---- sed-4.3/sed/execute.c 2012-03-16 10:13:31.000000000 +0100 -+++ sed-4.3.new00/sed/execute.c 2014-02-10 14:40:25.603629422 +0100 -@@ -703,11 +703,13 @@ - if (strcmp(in_place_extension, "*") != 0) - { - char *backup_file_name = get_backup_file_name(target_name); -- ck_rename (target_name, backup_file_name, input->out_file_name); -+ (copy_instead_of_rename?ck_fccopy:ck_rename) -+ (target_name, backup_file_name, input->out_file_name); - free (backup_file_name); - } - -- ck_rename (input->out_file_name, target_name, input->out_file_name); -+ (copy_instead_of_rename?ck_fcmove:ck_rename) -+ (input->out_file_name, target_name, input->out_file_name); - cancel_cleanup (); - free (input->out_file_name); - } -diff -urN sed-4.3/sed/sed.c sed-4.3.new00/sed/sed.c ---- sed-4.3/sed/sed.c 2012-03-16 10:13:31.000000000 +0100 -+++ sed-4.3.new00/sed/sed.c 2014-02-10 17:37:19.381273509 +0100 -@@ -56,6 +56,10 @@ - /* How do we edit files in-place? (we don't if NULL) */ - char *in_place_extension = NULL; - -+ /* Do we use copy or rename when in in-place edit mode? (boolean -+ value, non-zero for copy, zero for rename).*/ -+ int copy_instead_of_rename = 0; -+ - /* The mode to use to read/write files, either "r"/"w" or "rb"/"wb". */ - char const *read_mode = "r"; - char const *write_mode = "w"; -@@ -117,11 +121,16 @@ - fprintf(out, _(" -i[SUFFIX], --in-place[=SUFFIX]\n\ - edit files in place (makes backup if SUFFIX supplied)\n")); --#if defined WIN32 || defined _WIN32 || defined __CYGWIN__ \ -- || defined MSDOS || defined __EMX__ -- fprintf(out, _(" -b, --binary\n\ -- open files in binary mode (CR+LFs are not" \ -- " processed specially)\n")); -+ fprintf(out, _(" -c, --copy\n\ -+ use copy instead of rename when shuffling files in -i mode\n")); -+ fprintf(out, _(" -b, --binary\n" -+#if ! ( defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(MSDOS) || defined(__EMX__) ) -+" does nothing; for compatibility with WIN32/CYGWIN/MSDOS/EMX (\n" -+#endif -+" open files in binary mode (CR+LFs are not treated specially)" -+#if ! ( defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(MSDOS) || defined(__EMX__) ) -+ ")" - #endif -+ "\n")); - fprintf(out, _(" -l N, --line-length=N\n\ - specify the desired line-wrap length for the `l' command\n")); - fprintf(out, _(" --posix\n\ -@@ -138,8 +149,10 @@ - the output buffers more often\n")); - fprintf(out, _(" -z, --null-data\n\ - separate lines by NUL characters\n")); -- fprintf(out, _(" --help display this help and exit\n")); -- fprintf(out, _(" --version output version information and exit\n")); -+ fprintf(out, _(" --help\n\ -+ display this help and exit\n")); -+ fprintf(out, _(" --version\n\ -+ output version information and exit\n")); - fprintf(out, _("\n\ - If no -e, --expression, -f, or --file option is given, then the first\n\ - non-option argument is taken as the sed script to interpret. All\n\ -@@ -158,9 +171,9 @@ - main (int argc, char **argv) - { - #ifdef REG_PERL --#define SHORTOPTS "bsnrzRuEe:f:l:i::V:" -+#define SHORTOPTS "bcsnrzRuEe:f:l:i::" - #else --#define SHORTOPTS "bsnrzuEe:f:l:i::V:" -+#define SHORTOPTS "bcsnrzuEe:f:l:i::" - #endif - - enum { SANDBOX_OPTION = CHAR_MAX+1 }; -@@ -172,6 +185,7 @@ - {"expression", 1, NULL, 'e'}, - {"file", 1, NULL, 'f'}, - {"in-place", 2, NULL, 'i'}, -+ {"copy", 0, NULL, 'c'}, - {"line-length", 1, NULL, 'l'}, - {"null-data", 0, NULL, 'z'}, - {"zero-terminated", 0, NULL, 'z'}, -@@ -246,6 +260,10 @@ - follow_symlinks = true; - break; - -+ case 'c': -+ copy_instead_of_rename = true; -+ break; -+ - case 'i': - separate_files = true; - if (optarg == NULL) -@@ -272,9 +290,11 @@ - posixicity = POSIXLY_BASIC; - break; - -- case 'b': -+ case 'b': -+#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(MSDOS) || defined(__EMX__) - read_mode = "rb"; - write_mode = "wb"; -+#endif - break; - - case 'E': -@@ -314,6 +334,12 @@ - } - } - -+ if (copy_instead_of_rename && in_place_extension == NULL) -+ { -+ fprintf (stderr, _("Error: -c used without -i.\n")); -+ usage(4); -+ } -+ - if (!the_program) - { - if (optind < argc) -diff -urN sed-4.3/sed/sed.h sed-4.3.new00/sed/sed.h ---- sed-4.3/sed/sed.h 2012-07-25 12:33:09.000000000 +0200 -+++ sed-4.3.new00/sed/sed.h 2014-02-10 14:40:25.602629419 +0100 -@@ -230,6 +230,10 @@ - /* How do we edit files in-place? (we don't if NULL) */ - extern char *in_place_extension; - -+/* Do we use copy or rename when in in-place edit mode? (boolean -+ value, non-zero for copy, zero for rename).*/ -+extern int copy_instead_of_rename; -+ - /* The mode to use to read and write files, either "rt"/"w" or "rb"/"wb". */ - extern char const *read_mode; - extern char const *write_mode; -diff -urN sed-4.3/sed/utils.c sed-4.3.new00/sed/utils.c ---- sed-4.3/sed/utils.c 2012-03-16 10:13:31.000000000 +0100 -+++ sed-4.3.new00/sed/utils.c 2014-02-10 14:40:25.603629422 +0100 -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - #include "unlocked-io.h" - #include "utils.h" -@@ -363,31 +364,106 @@ - #endif /* ENABLE_FOLLOW_SYMLINKS */ - } - --/* Panic on failing rename */ -+/* Panic on failing unlink */ - void --ck_rename (const char *from, const char *to, const char *unlink_if_fail) -+ck_unlink (const char *name) - { -- int rd = rename (from, to); -- if (rd != -1) -- return; -+ if (unlink (name) == -1) -+ panic (_("cannot remove %s: %s"), name, strerror (errno)); -+} - -- if (unlink_if_fail) -+/* Attempt to unlink denoted file if operation rd failed. */ -+static int -+_unlink_if_fail (rd, unlink_if_fail) -+ int rd; -+ const char *unlink_if_fail; -+{ -+ if (rd == -1 && unlink_if_fail) - { - int save_errno = errno; -+ ck_unlink (unlink_if_fail); -+ errno = save_errno; -+ } -+ -+ return rd != -1; -+} -+ -+/* Copy contents between files. */ -+static int -+_copy (from, to) -+ const char *from, *to; -+{ -+ static char buf[4096]; -+ -+ FILE *infile, *outfile; -+ int c, retval = 0; - errno = 0; -- unlink (unlink_if_fail); - -- /* Failure to remove the temporary file is more severe, -- so trigger it first. */ -- if (errno != 0) -- panic (_("cannot remove %s: %s"), unlink_if_fail, strerror (errno)); -+ infile = fopen (from, "r"); -+ if (infile == NULL) -+ return -1; - -- errno = save_errno; -+ outfile = fopen (to, "w"); -+ if (outfile == NULL) -+ { -+ fclose (infile); -+ return -1; -+ } -+ -+ while (1) -+ { -+ size_t bytes_in = fread (buf, 1, sizeof (buf), infile); -+ size_t bytes_out; -+ if (bytes_in == 0) -+ { -+ if (ferror (infile)) -+ retval = -1; -+ break; -+ } -+ -+ bytes_out = fwrite (buf, 1, bytes_in, outfile); -+ if (bytes_out != bytes_in) -+ { -+ retval = -1; -+ break; -+ } - } - -+ fclose (outfile); -+ fclose (infile); -+ -+ return retval; -+} -+ -+/* Panic on failing rename */ -+void -+ck_rename (from, to, unlink_if_fail) -+ const char *from, *to; -+ const char *unlink_if_fail; -+{ -+ if (!_unlink_if_fail (rename (from, to), unlink_if_fail)) - panic (_("cannot rename %s: %s"), from, strerror (errno)); - } - -+/* Attempt to copy file contents between the files. */ -+void -+ck_fccopy (from, to, unlink_if_fail) -+ const char *from, *to; -+ const char *unlink_if_fail; -+{ -+ if (!_unlink_if_fail (_copy (from, to), unlink_if_fail)) -+ panic (_("cannot copy %s to %s: %s"), from, to, strerror (errno)); -+} -+ -+/* Copy contents between files, and then unlink the source. */ -+void -+ck_fcmove (from, to, unlink_if_fail) -+ const char *from, *to; -+ const char *unlink_if_fail; -+{ -+ ck_fccopy (from, to, unlink_if_fail); -+ ck_unlink (from); -+} - - - -diff -urN sed-4.3/sed/utils.h sed-4.3.new00/sed/utils.h ---- sed-4.3/sed/utils.h 2012-03-16 10:13:31.000000000 +0100 -+++ sed-4.3.new00/sed/utils.h 2014-02-10 14:40:25.603629422 +0100 -@@ -33,6 +33,8 @@ - FILE * ck_mkstemp (char **p_filename, const char *tmpdir, const char *base, - const char *mode) _GL_ARG_NONNULL ((1, 2, 3, 4)); - void ck_rename (const char *from, const char *to, const char *unlink_if_fail); -+void ck_fccopy (const char *from, const char *to, const char *unlink_if_fail); -+void ck_fcmove (const char *from, const char *to, const char *unlink_if_fail); - - void *ck_malloc (size_t size); - void *xmalloc (size_t size); diff --git a/sed-b-flag.patch b/sed-b-flag.patch new file mode 100644 index 0000000..809ad9e --- /dev/null +++ b/sed-b-flag.patch @@ -0,0 +1,29 @@ +From 613057152c4f6caba22a15ed2ff0aeb9c4ce6a83 Mon Sep 17 00:00:00 2001 +From: Jakub Martisko +Date: Wed, 5 Feb 2020 15:50:15 +0100 +Subject: [PATCH] enable the -b option on all platforms + +--- + sed/sed.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/sed/sed.c b/sed/sed.c +index f75e4b6..1ca5839 100644 +--- a/sed/sed.c ++++ b/sed/sed.c +@@ -174,7 +174,12 @@ Usage: %s [OPTION]... {script-only-if-no-other-script} [input-file]...\n\ + fprintf (out, _(" -b, --binary\n\ + open files in binary mode (CR+LFs are not" \ + " processed specially)\n")); ++#else ++ fprintf (out, _(" -b, --binary\n\ ++ does nothing; for compatibility with WIN32/CYGWIN/MSDOS/EMX \n\ ++ (open files in binary mode; CR+LF are not processed specially)\n" )); + #endif ++ + fprintf (out, _(" -l N, --line-length=N\n\ + specify the desired line-wrap length for the `l' command\n")); + fprintf (out, _(" --posix\n\ +-- +2.24.1 + diff --git a/sed-c-flag.patch b/sed-c-flag.patch new file mode 100644 index 0000000..114d5c7 --- /dev/null +++ b/sed-c-flag.patch @@ -0,0 +1,247 @@ +From f336bde91e3fd9c3c2960aa548b8917eb1216678 Mon Sep 17 00:00:00 2001 +From: Jakub Martisko +Date: Thu, 6 Feb 2020 15:26:33 +0100 +Subject: [PATCH] -c flag + +--- + sed/execute.c | 18 +++++++++-- + sed/sed.c | 20 +++++++++++- + sed/sed.h | 4 +++ + sed/utils.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++ + sed/utils.h | 2 ++ + 5 files changed, 127 insertions(+), 3 deletions(-) + +diff --git a/sed/execute.c b/sed/execute.c +index c5f07cc..4e5f5b3 100644 +--- a/sed/execute.c ++++ b/sed/execute.c +@@ -670,11 +670,25 @@ closedown (struct input *input) + if (strcmp (in_place_extension, "*") != 0) + { + char *backup_file_name = get_backup_file_name (target_name); +- ck_rename (target_name, backup_file_name, input->out_file_name); ++ if (copy_instead_of_rename) ++ { ++ ck_fccopy (target_name, backup_file_name, input->out_file_name); ++ } ++ else ++ { ++ ck_rename (target_name, backup_file_name, input->out_file_name); ++ } + free (backup_file_name); + } + +- ck_rename (input->out_file_name, target_name, input->out_file_name); ++ if (copy_instead_of_rename) ++ { ++ ck_fcmove (input->out_file_name, target_name, input->out_file_name); ++ } ++ else ++ { ++ ck_rename (input->out_file_name, target_name, input->out_file_name); ++ } + cancel_cleanup (); + free (input->out_file_name); + } +diff --git a/sed/sed.c b/sed/sed.c +index 1ca5839..745159e 100644 +--- a/sed/sed.c ++++ b/sed/sed.c +@@ -67,6 +67,10 @@ bool debug = false; + /* How do we edit files in-place? (we don't if NULL) */ + char *in_place_extension = NULL; + ++/* Do we use copy or rename when in in-place edit mode? (boolean ++ + value, non-zero for copy, zero for rename).*/ ++int copy_instead_of_rename = 0; ++ + /* The mode to use to read/write files, either "r"/"w" or "rb"/"wb". */ + char const *read_mode = "r"; + char const *write_mode = "w"; +@@ -170,6 +174,10 @@ Usage: %s [OPTION]... {script-only-if-no-other-script} [input-file]...\n\ + #endif + fprintf (out, _(" -i[SUFFIX], --in-place[=SUFFIX]\n\ + edit files in place (makes backup if SUFFIX supplied)\n")); ++ ++ fprintf(out, _(" -c, --copy\n\ ++ use copy instead of rename when shuffling files in -i mode\n")); ++ + #if O_BINARY + fprintf (out, _(" -b, --binary\n\ + open files in binary mode (CR+LFs are not" \ +@@ -214,7 +222,7 @@ specified, then the standard input is read.\n\ + int + main (int argc, char **argv) + { +-#define SHORTOPTS "bsnrzuEe:f:l:i::V:" ++#define SHORTOPTS "bcsnrzuEe:f:l:i::V:" + + enum { SANDBOX_OPTION = CHAR_MAX+1, + DEBUG_OPTION +@@ -228,6 +236,7 @@ main (int argc, char **argv) + {"file", 1, NULL, 'f'}, + {"in-place", 2, NULL, 'i'}, + {"line-length", 1, NULL, 'l'}, ++ {"copy", 0, NULL, 'c'}, + {"null-data", 0, NULL, 'z'}, + {"zero-terminated", 0, NULL, 'z'}, + {"quiet", 0, NULL, 'n'}, +@@ -306,6 +315,10 @@ main (int argc, char **argv) + follow_symlinks = true; + break; + ++ case 'c': ++ copy_instead_of_rename = true; ++ break; ++ + case 'i': + separate_files = true; + IF_LINT (free (in_place_extension)); +@@ -376,6 +389,11 @@ main (int argc, char **argv) + } + } + ++ if (copy_instead_of_rename && in_place_extension == NULL) ++ { ++ fprintf (stderr, _("Error: -c used without -i.\n")); ++ usage(4); ++ } + if (!the_program) + { + if (optind < argc) +diff --git a/sed/sed.h b/sed/sed.h +index 1c8e83a..0859e72 100644 +--- a/sed/sed.h ++++ b/sed/sed.h +@@ -236,6 +236,10 @@ extern countT lcmd_out_line_len; + /* How do we edit files in-place? (we don't if NULL) */ + extern char *in_place_extension; + ++/* Do we use copy or rename when in in-place edit mode? (boolean ++ value, non-zero for copy, zero for rename).*/ ++extern int copy_instead_of_rename; ++ + /* The mode to use to read and write files, either "rt"/"w" or "rb"/"wb". */ + extern char const *read_mode; + extern char const *write_mode; +diff --git a/sed/utils.c b/sed/utils.c +index 9576dd1..371d5a9 100644 +--- a/sed/utils.c ++++ b/sed/utils.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #include "binary-io.h" + #include "unlocked-io.h" +@@ -400,7 +401,92 @@ ck_rename (const char *from, const char *to, const char *unlink_if_fail) + panic (_("cannot rename %s: %s"), from, strerror (errno)); + } + ++/* Downstream -c related functions */ + ++/* Panic on failing unlink */ ++void ++ck_unlink (const char *name) ++{ ++ if (unlink (name) == -1) ++ panic (_("cannot remove %s: %s"), name, strerror (errno)); ++} ++ ++/* Attempt to unlink denoted file if operation rd failed. */ ++static int ++_unlink_if_fail (int rd,const char * unlink_if_fail) ++{ ++ if (rd == -1 && unlink_if_fail) ++ { ++ int save_errno = errno; ++ ck_unlink (unlink_if_fail); ++ errno = save_errno; ++ } ++ ++ return rd != -1; ++} ++ ++/* Copy contents between files. */ ++static int ++_copy (from, to) ++ const char *from, *to; ++{ ++ static char buf[4096]; ++ ++ FILE *infile, *outfile; ++ int c, retval = 0; ++ errno = 0; ++ ++ infile = fopen (from, "r"); ++ if (infile == NULL) ++ return -1; ++ ++ outfile = fopen (to, "w"); ++ if (outfile == NULL) ++ { ++ fclose (infile); ++ return -1; ++ } ++ ++ while (1) ++ { ++ size_t bytes_in = fread (buf, 1, sizeof (buf), infile); ++ size_t bytes_out; ++ if (bytes_in == 0) ++ { ++ if (ferror (infile)) ++ retval = -1; ++ break; ++ } ++ ++ bytes_out = fwrite (buf, 1, bytes_in, outfile); ++ if (bytes_out != bytes_in) ++ { ++ retval = -1; ++ break; ++ } ++ } ++ ++ fclose (outfile); ++ fclose (infile); ++ ++ return retval; ++} ++ ++/* Attempt to copy file contents between the files. */ ++void ++ck_fccopy (const char *from,const char *to, const char *unlink_if_fail) ++{ ++ if (!_unlink_if_fail (_copy (from, to), unlink_if_fail)) ++ panic (_("cannot copy %s to %s: %s"), from, to, strerror (errno)); ++ } ++ ++/* Copy contents between files, and then unlink the source. */ ++void ++ck_fcmove (const char *from, const char *to,const char *unlink_if_fail) ++{ ++ ck_fccopy (from, to, unlink_if_fail); ++ ck_unlink (from); ++} + + + /* Implement a variable sized buffer of `stuff'. We don't know what it is, +diff --git a/sed/utils.h b/sed/utils.h +index 47a029e..0aba107 100644 +--- a/sed/utils.h ++++ b/sed/utils.h +@@ -40,6 +40,8 @@ size_t ck_getdelim (char **text, size_t *buflen, char buffer_delimiter, + FILE * ck_mkstemp (char **p_filename, const char *tmpdir, const char *base, + const char *mode) _GL_ARG_NONNULL ((1, 2, 3, 4)); + void ck_rename (const char *from, const char *to, const char *unlink_if_fail); ++void ck_fccopy (const char *from, const char *to, const char *unlink_if_fail); ++void ck_fcmove (const char *from, const char *to, const char *unlink_if_fail); + + void *ck_malloc (size_t size); + void *ck_realloc (void *ptr, size_t size); +-- +2.24.1 + diff --git a/sed.spec b/sed.spec index 1a30337..76cbde2 100644 --- a/sed.spec +++ b/sed.spec @@ -2,13 +2,14 @@ Summary: A GNU stream text editor Name: sed -Version: 4.5 -Release: 5%{?dist} +Version: 4.8 +Release: 1%{?dist} License: GPLv3+ URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz Source1: http://sed.sourceforge.net/sedfaq.txt -Patch0: sed-4.2.2-binary_copy_args.patch +Patch0: sed-b-flag.patch +Patch1: sed-c-flag.patch #Patch1: sed-selinux.patch #Build failure with glibc-2.28 #https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html @@ -30,9 +31,9 @@ specified in a script file or from the command line. %prep %setup -q -%patch0 -p1 -b .copy -#%patch1 -p1 -b .selinux -#%patch2 -p1 -b .gnulib +%patch0 -p1 +%patch1 -p1 +#%patch2 -p1 %build %configure --without-included-regex @@ -61,6 +62,10 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Tue Feb 11 2020 Jakub Martisko - 4.8-1 +- Rebase to 4.8 +- Refresh the downstream patch and split it into two + * Thu Jan 30 2020 Fedora Release Engineering - 4.5-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild diff --git a/sources b/sources index 6a0d35d..63247e0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (sed-4.5.tar.xz) = f95fb27e03b2301dae63878413b4c48e40341cc676945a612e1d0bd911da3192858ae142791292a99fbdaacbc7dab2d6fccb50787c06846f99b0b3740b40c196 +SHA512 (sed-4.8.tar.xz) = 7de25d9bc2981c63321c2223f3fbcab61d7b0df4fcf7d4394b72400b91993e1288d8bf53948ed5fffcf5a98c75265726a68ad4fb98e1d571bf768603a108c1c8 From 86e6f147eab801ca9a2fe7454973bb8ac60d2a07 Mon Sep 17 00:00:00 2001 From: Merlin Mathesius Date: Wed, 13 May 2020 14:59:35 -0500 Subject: [PATCH 17/39] sed.spec: added build dependency on perl-FileHandle Signed-off-by: Merlin Mathesius --- sed.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/sed.spec b/sed.spec index 76cbde2..da76d9d 100644 --- a/sed.spec +++ b/sed.spec @@ -16,6 +16,7 @@ Patch1: sed-c-flag.patch Patch2: sed-gnulib.patch BuildRequires: glibc-devel, libselinux-devel, libacl-devel, automake, autoconf, gcc BuildRequires: perl-Getopt-Long +BuildRequires: perl(FileHandle) Provides: /bin/sed From 5ac8d28452524db727a6d78a137e71656e461cc1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jul 2020 10:30:33 +0000 Subject: [PATCH 18/39] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- sed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index da76d9d..66979b6 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.8 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -63,6 +63,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Wed Jul 29 2020 Fedora Release Engineering - 4.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Tue Feb 11 2020 Jakub Martisko - 4.8-1 - Rebase to 4.8 - Refresh the downstream patch and split it into two From f30c51736789b4bce024266b9cae5ca1ee76812e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 1 Aug 2020 09:01:06 +0000 Subject: [PATCH 19/39] - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- sed.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index 66979b6..518cf35 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.8 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -63,6 +63,10 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Sat Aug 01 2020 Fedora Release Engineering - 4.8-3 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Wed Jul 29 2020 Fedora Release Engineering - 4.8-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From a9e8335e1bdda5d667b136468d05238023e0180c Mon Sep 17 00:00:00 2001 From: Jakub Martisko Date: Mon, 3 Aug 2020 13:19:32 +0200 Subject: [PATCH 20/39] Replace some hardcoded values in the gnulib-testsuite ..that caused build failures on arm 7 --- sed.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index 518cf35..22a3874 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.8 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv3+ URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -36,6 +36,10 @@ specified in a script file or from the command line. %patch1 -p1 #%patch2 -p1 + +sed -e 's/1729576/EPERM/' \ + -i gnulib-tests/test-{strerror_r,perror2}.c + %build %configure --without-included-regex make %{_smp_mflags} @@ -63,6 +67,10 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Mon Aug 03 2020 Jakub Martisko - 4.8-4 +- Replace some hardcoded constants in the gnulib-testsuite + ... that caused build failures on arm7 + * Sat Aug 01 2020 Fedora Release Engineering - 4.8-3 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From 82cd3490944863bf87eeda6e9e8a1b3b6255b5b1 Mon Sep 17 00:00:00 2001 From: Jakub Martisko Date: Mon, 3 Aug 2020 13:30:29 +0200 Subject: [PATCH 21/39] Use make macros --- sed.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sed.spec b/sed.spec index 22a3874..f3bad6e 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.8 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv3+ URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -42,7 +42,7 @@ sed -e 's/1729576/EPERM/' \ %build %configure --without-included-regex -make %{_smp_mflags} +%make_build install -m 644 -p %{SOURCE1} sedfaq.txt gzip -9 sedfaq.txt @@ -53,7 +53,7 @@ echo ====================TESTING END===================== %install rm -rf ${RPM_BUILD_ROOT} -make DESTDIR=$RPM_BUILD_ROOT install +%make_install rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %find_lang %{name} @@ -67,6 +67,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Mon Aug 03 2020 Jakub Martisko - 4.8-5 +- Use make macros + * Mon Aug 03 2020 Jakub Martisko - 4.8-4 - Replace some hardcoded constants in the gnulib-testsuite ... that caused build failures on arm7 From 1c4b830a2cbc4a6c918202b7373d58205b70494d Mon Sep 17 00:00:00 2001 From: Jakub Martisko Date: Mon, 17 Aug 2020 13:37:28 +0200 Subject: [PATCH 22/39] Minor cleanup (removal of unused patches) --- sed-gnulib.patch | 218 ---------------------------------------------- sed-selinux.patch | 29 ------ sed.spec | 10 +-- 3 files changed, 4 insertions(+), 253 deletions(-) delete mode 100644 sed-gnulib.patch delete mode 100644 sed-selinux.patch diff --git a/sed-gnulib.patch b/sed-gnulib.patch deleted file mode 100644 index 902b847..0000000 --- a/sed-gnulib.patch +++ /dev/null @@ -1,218 +0,0 @@ -From 1831628c0630ae96a43586b2a25ca51cbdba3e53 Mon Sep 17 00:00:00 2001 -From: Paul Eggert -Date: Mon, 5 Mar 2018 10:56:29 -0800 -Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Problem reported by Daniel P. Berrangé in: -https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html -* lib/fbufmode.c (fbufmode): -* lib/fflush.c (clear_ungetc_buffer_preserving_position) -(disable_seek_optimization, rpl_fflush): -* lib/fpending.c (__fpending): -* lib/fpurge.c (fpurge): -* lib/freadable.c (freadable): -* lib/freadahead.c (freadahead): -* lib/freading.c (freading): -* lib/freadptr.c (freadptr): -* lib/freadseek.c (freadptrinc): -* lib/fseeko.c (fseeko): -* lib/fseterr.c (fseterr): -* lib/fwritable.c (fwritable): -* lib/fwriting.c (fwriting): -Check _IO_EOF_SEEN instead of _IO_ftrylockfile. -* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]: -Define if not already defined. ---- - ChangeLog | 23 +++++++++++++++++++++++ - lib/fbufmode.c | 2 +- - lib/fflush.c | 6 +++--- - lib/fpending.c | 2 +- - lib/fpurge.c | 2 +- - lib/freadable.c | 2 +- - lib/freadahead.c | 2 +- - lib/freading.c | 2 +- - lib/freadptr.c | 2 +- - lib/freadseek.c | 2 +- - lib/fseeko.c | 4 ++-- - lib/fseterr.c | 2 +- - lib/fwritable.c | 2 +- - lib/fwriting.c | 2 +- - lib/stdio-impl.h | 6 ++++++ - 15 files changed, 45 insertions(+), 16 deletions(-) - -diff --git a/ChangeLog b/ChangeLog -index 667f91663..beb835670 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,26 @@ -+2018-03-05 Paul Eggert -+ -+ fflush: adjust to glibc 2.28 libio.h removal -+ Problem reported by Daniel P. Berrangé in: -+ https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html -+ * lib/fbufmode.c (fbufmode): -+ * lib/fflush.c (clear_ungetc_buffer_preserving_position) -+ (disable_seek_optimization, rpl_fflush): -+ * lib/fpending.c (__fpending): -+ * lib/fpurge.c (fpurge): -+ * lib/freadable.c (freadable): -+ * lib/freadahead.c (freadahead): -+ * lib/freading.c (freading): -+ * lib/freadptr.c (freadptr): -+ * lib/freadseek.c (freadptrinc): -+ * lib/fseeko.c (fseeko): -+ * lib/fseterr.c (fseterr): -+ * lib/fwritable.c (fwritable): -+ * lib/fwriting.c (fwriting): -+ Check _IO_EOF_SEEN instead of _IO_ftrylockfile. -+ * lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]: -+ Define if not already defined. -+ - 2017-02-03 Jim Meyering - - version 4.4 -diff --git a/gnulib-tests/fflush.c b/gnulib-tests/fflush.c -index 983ade0ff..a6edfa105 100644 ---- a/gnulib-tests/fflush.c -+++ b/gnulib-tests/fflush.c -@@ -33,7 +33,7 @@ - #undef fflush - - --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - - /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ - static void -@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp) - - #endif - --#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) -+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) - - # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ -@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream) - if (stream == NULL || ! freading (stream)) - return fflush (stream); - --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - - clear_ungetc_buffer_preserving_position (stream); - -diff --git a/lib/fpending.c b/lib/fpending.c -index c84e3a5b4..789f50e4e 100644 ---- a/lib/fpending.c -+++ b/lib/fpending.c -@@ -32,7 +32,7 @@ __fpending (FILE *fp) - /* Most systems provide FILE as a struct and the necessary bitmask in - , because they need it for implementing getc() and putc() as - fast macros. */ --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - return fp->_IO_write_ptr - fp->_IO_write_base; - #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ -diff --git a/gnulib-tests/fpurge.c b/gnulib-tests/fpurge.c -index b1d417c7a..3aedcc373 100644 ---- a/gnulib-tests/fpurge.c -+++ b/gnulib-tests/fpurge.c -@@ -62,7 +62,7 @@ fpurge (FILE *fp) - /* Most systems provide FILE as a struct and the necessary bitmask in - , because they need it for implementing getc() and putc() as - fast macros. */ --# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - fp->_IO_read_end = fp->_IO_read_ptr; - fp->_IO_write_ptr = fp->_IO_write_base; - /* Avoid memory leak when there is an active ungetc buffer. */ -diff --git a/gnulib-tests/freading.c b/gnulib-tests/freading.c -index 73c28acdd..c24d0c88a 100644 ---- a/gnulib-tests/freading.c -+++ b/gnulib-tests/freading.c -@@ -31,7 +31,7 @@ freading (FILE *fp) - /* Most systems provide FILE as a struct and the necessary bitmask in - , because they need it for implementing getc() and putc() as - fast macros. */ --# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - return ((fp->_flags & _IO_NO_WRITES) != 0 - || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 - && fp->_IO_read_base != NULL)); -diff --git a/gnulib-tests/fseeko.c b/gnulib-tests/fseeko.c -index 0101ab55f..193f4e8ce 100644 ---- a/gnulib-tests/fseeko.c -+++ b/gnulib-tests/fseeko.c -@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence) - #endif - - /* These tests are based on fpurge.c. */ --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - if (fp->_IO_read_end == fp->_IO_read_ptr - && fp->_IO_write_ptr == fp->_IO_write_base - && fp->_IO_save_base == NULL) -@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence) - return -1; - } - --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - fp->_flags &= ~_IO_EOF_SEEN; - fp->_offset = pos; - #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ -diff --git a/lib/fwriting.c b/lib/fwriting.c -index 461ab0f1f..4a3d9c8d4 100644 ---- a/lib/fwriting.c -+++ b/lib/fwriting.c -@@ -27,7 +27,7 @@ fwriting (FILE *fp) - /* Most systems provide FILE as a struct and the necessary bitmask in - , because they need it for implementing getc() and putc() as - fast macros. */ --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - return (fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) != 0; - #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ -diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h -index 78d896e9f..05c5752a2 100644 ---- a/lib/stdio-impl.h -+++ b/lib/stdio-impl.h -@@ -18,6 +18,12 @@ - the same implementation of stdio extension API, except that some fields - have different naming conventions, or their access requires some casts. */ - -+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this -+ problem by defining it ourselves. FIXME: Do not rely on glibc -+ internals. */ -+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN -+# define _IO_IN_BACKUP 0x100 -+#endif - - /* BSD stdio derived implementations. */ - -diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h -index 78d896e9f..05c5752a2 100644 ---- a/gnulib-tests/stdio-impl.h -+++ b/gnulib-tests/stdio-impl.h -@@ -18,6 +18,12 @@ - the same implementation of stdio extension API, except that some fields - have different naming conventions, or their access requires some casts. */ - -+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this -+ problem by defining it ourselves. FIXME: Do not rely on glibc -+ internals. */ -+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN -+# define _IO_IN_BACKUP 0x100 -+#endif - - /* BSD stdio derived implementations. */ - --- -2.14.3 - diff --git a/sed-selinux.patch b/sed-selinux.patch deleted file mode 100644 index 2dca5ab..0000000 --- a/sed-selinux.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff --git a/NEWS b/NEWS -index e9335f0..e762b2d 100644 ---- a/NEWS -+++ b/NEWS -@@ -1,4 +1,9 @@ GNU sed NEWS -*- outline -*- - GNU sed NEWS -*- outline -*- -+ -+ sed -i now creates selinux context based on the context of the symlink -+ instead of the symlink target. [Bug present since at least sed-4.2] -+ sed -i --follow-symlinks remains unchanged. -+ - - * Noteworthy changes in release 4.4 (2017-02-03) [stable] - -diff --git a/sed/execute.c b/sed/execute.c -index 1843392..453886e 100644 ---- a/sed/execute.c -+++ b/sed/execute.c -@@ -607,7 +607,7 @@ open_next_file(const char *name, struct input *input) - if (is_selinux_enabled () > 0) - { - security_context_t con; -- if (getfilecon (input->in_file_name, &con) != -1) -+ if (lgetfilecon (input->in_file_name, &con) != -1) - { - /* Save and restore the old context for the sake of w and W - commands. */ -2.9.5 - diff --git a/sed.spec b/sed.spec index f3bad6e..83f8675 100644 --- a/sed.spec +++ b/sed.spec @@ -3,17 +3,13 @@ Summary: A GNU stream text editor Name: sed Version: 4.8 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv3+ URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz Source1: http://sed.sourceforge.net/sedfaq.txt Patch0: sed-b-flag.patch Patch1: sed-c-flag.patch -#Patch1: sed-selinux.patch -#Build failure with glibc-2.28 -#https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html -Patch2: sed-gnulib.patch BuildRequires: glibc-devel, libselinux-devel, libacl-devel, automake, autoconf, gcc BuildRequires: perl-Getopt-Long BuildRequires: perl(FileHandle) @@ -34,7 +30,6 @@ specified in a script file or from the command line. %setup -q %patch0 -p1 %patch1 -p1 -#%patch2 -p1 sed -e 's/1729576/EPERM/' \ @@ -67,6 +62,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Mon Aug 17 2020 Jakub Martisko - 4.8-6 +- Minor spec cleanup + * Mon Aug 03 2020 Jakub Martisko - 4.8-5 - Use make macros From 488b553ebf16b540ca5797bc6227d64fe28d725d Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 8 Jan 2021 21:21:45 +0000 Subject: [PATCH 23/39] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- sed.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/sed.spec b/sed.spec index 83f8675..832a85e 100644 --- a/sed.spec +++ b/sed.spec @@ -10,6 +10,7 @@ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz Source1: http://sed.sourceforge.net/sedfaq.txt Patch0: sed-b-flag.patch Patch1: sed-c-flag.patch +BuildRequires: make BuildRequires: glibc-devel, libselinux-devel, libacl-devel, automake, autoconf, gcc BuildRequires: perl-Getopt-Long BuildRequires: perl(FileHandle) From adb20d34375418b3ca0b99978f5a36ef041b70b8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 27 Jan 2021 20:11:00 +0000 Subject: [PATCH 24/39] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- sed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index 832a85e..ef0a2bb 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.8 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv3+ URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -63,6 +63,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Wed Jan 27 2021 Fedora Release Engineering - 4.8-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Mon Aug 17 2020 Jakub Martisko - 4.8-6 - Minor spec cleanup From 2c1ef77df1c7148c1f847e8fe0049c48e3a299df Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 23 Jul 2021 17:20:02 +0000 Subject: [PATCH 25/39] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- sed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index ef0a2bb..0923c36 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.8 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv3+ URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -63,6 +63,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Fri Jul 23 2021 Fedora Release Engineering - 4.8-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Wed Jan 27 2021 Fedora Release Engineering - 4.8-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From b563fd9014c0738907ee8a4da259dfdd0385f60b Mon Sep 17 00:00:00 2001 From: Jakub Martisko Date: Tue, 16 Nov 2021 14:26:28 +0100 Subject: [PATCH 26/39] Add annotations to disable false positives reported by the covscan Related: rhbz#1938867 --- sed-covscan-annotations.patch | 60 +++++++++++++++++++++++++++++++++++ sed.spec | 8 ++++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 sed-covscan-annotations.patch diff --git a/sed-covscan-annotations.patch b/sed-covscan-annotations.patch new file mode 100644 index 0000000..0679ed4 --- /dev/null +++ b/sed-covscan-annotations.patch @@ -0,0 +1,60 @@ +From 87f411a001394948183aaf389c711f3837c361b5 Mon Sep 17 00:00:00 2001 +From: Jakub Martisko +Date: Mon, 15 Nov 2021 16:06:54 +0100 +Subject: [PATCH] covscan annotations + +--- + lib/malloca.c | 3 ++- + sed/compile.c | 2 ++ + sed/utils.c | 1 + + 3 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/lib/malloca.c b/lib/malloca.c +index 975b166..36e2342 100644 +--- a/lib/malloca.c ++++ b/lib/malloca.c +@@ -64,7 +64,8 @@ mmalloca (size_t n) + [mem, mem + nplus). */ + ((small_t *) p)[-1] = p - mem; + /* p ≡ sa_alignment_max mod 2*sa_alignment_max. */ +- return p; ++ /* cppcheck-suppress memleak */ ++ return p; + } + } + /* Out of memory. */ +diff --git a/sed/compile.c b/sed/compile.c +index 8321d68..df42794 100644 +--- a/sed/compile.c ++++ b/sed/compile.c +@@ -829,6 +829,7 @@ setup_replacement (struct subst *sub, const char *text, size_t length) + + tail->next = NULL; + sub->replacement = root.next; ++ /* coverity [leaked_storage] */ + } + + static void +@@ -1312,6 +1313,7 @@ compile_program (struct vector *vector) + bad_prog (_(Y_CMD_LEN)); + + IF_LINT (free (src_lens)); ++ /* coverity [leaked_storage] */ + } + else + { +diff --git a/sed/utils.c b/sed/utils.c +index 371d5a9..0d68f60 100644 +--- a/sed/utils.c ++++ b/sed/utils.c +@@ -294,6 +294,7 @@ do_ck_fclose (FILE *fp) + clearerr (fp); + + if (fclose (fp) == EOF) ++ /* coverity[pass_freed_arg] */ + panic ("couldn't close %s: %s", utils_fp_name (fp), strerror (errno)); + } + +-- +2.33.0 + diff --git a/sed.spec b/sed.spec index 0923c36..33f9990 100644 --- a/sed.spec +++ b/sed.spec @@ -3,13 +3,14 @@ Summary: A GNU stream text editor Name: sed Version: 4.8 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv3+ URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz Source1: http://sed.sourceforge.net/sedfaq.txt Patch0: sed-b-flag.patch Patch1: sed-c-flag.patch +Patch2: sed-covscan-annotations.patch BuildRequires: make BuildRequires: glibc-devel, libselinux-devel, libacl-devel, automake, autoconf, gcc BuildRequires: perl-Getopt-Long @@ -31,6 +32,7 @@ specified in a script file or from the command line. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 sed -e 's/1729576/EPERM/' \ @@ -63,6 +65,10 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Tue Nov 16 2021 Jakub Martisko - 4.8-9 +- Add annotations to disable false positives in the covscan +- Related: rhbz#1938867 + * Fri Jul 23 2021 Fedora Release Engineering - 4.8-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From d6798ced17600d47f9e2839ef9b37ea0005fa969 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jan 2022 00:38:53 +0000 Subject: [PATCH 27/39] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- sed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index 33f9990..6930dfd 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.8 -Release: 9%{?dist} +Release: 10%{?dist} License: GPLv3+ URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -65,6 +65,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Sat Jan 22 2022 Fedora Release Engineering - 4.8-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Tue Nov 16 2021 Jakub Martisko - 4.8-9 - Add annotations to disable false positives in the covscan - Related: rhbz#1938867 From 8d53d4c9144bbb51a4e6e384077b7f6f73df47d2 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 23 Jul 2022 08:20:23 +0000 Subject: [PATCH 28/39] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- sed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index 6930dfd..19f447e 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.8 -Release: 10%{?dist} +Release: 11%{?dist} License: GPLv3+ URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -65,6 +65,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Sat Jul 23 2022 Fedora Release Engineering - 4.8-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Sat Jan 22 2022 Fedora Release Engineering - 4.8-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 7ac32f6a543cbce7733f85da5ed5f64ef1c22607 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 21 Jan 2023 02:58:09 +0000 Subject: [PATCH 29/39] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- sed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index 19f447e..18b58a0 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.8 -Release: 11%{?dist} +Release: 12%{?dist} License: GPLv3+ URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -65,6 +65,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Sat Jan 21 2023 Fedora Release Engineering - 4.8-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Sat Jul 23 2022 Fedora Release Engineering - 4.8-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From ec6bf601339dfb2ee7e39708122132dc0d5ffa05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Tue, 11 Apr 2023 13:52:17 +0200 Subject: [PATCH 30/39] migrate to SPDX license format --- sed.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sed.spec b/sed.spec index 18b58a0..162d6ff 100644 --- a/sed.spec +++ b/sed.spec @@ -3,8 +3,8 @@ Summary: A GNU stream text editor Name: sed Version: 4.8 -Release: 12%{?dist} -License: GPLv3+ +Release: 13%{?dist} +License: GPL-3.0-or-later URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz Source1: http://sed.sourceforge.net/sedfaq.txt @@ -65,6 +65,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Tue Apr 11 2023 Lukáš Zaoral - 4.8-13 +- migrate to SPDX license format + * Sat Jan 21 2023 Fedora Release Engineering - 4.8-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From c3618785365bd535fadabc66601eeda7e5e50f9f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jul 2023 01:22:30 +0000 Subject: [PATCH 31/39] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- sed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index 162d6ff..1e5c7b5 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.8 -Release: 13%{?dist} +Release: 14%{?dist} License: GPL-3.0-or-later URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -65,6 +65,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Sat Jul 22 2023 Fedora Release Engineering - 4.8-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Tue Apr 11 2023 Lukáš Zaoral - 4.8-13 - migrate to SPDX license format From a211e53e688b173fc87f01ed0f813899a66dcf4e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jan 2024 02:31:46 +0000 Subject: [PATCH 32/39] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- sed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index 1e5c7b5..e619023 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.8 -Release: 14%{?dist} +Release: 15%{?dist} License: GPL-3.0-or-later URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -65,6 +65,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Sat Jan 27 2024 Fedora Release Engineering - 4.8-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sat Jul 22 2023 Fedora Release Engineering - 4.8-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From d25bb1b25271bb89acbae9eb6c3486071d0b17ca Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 30 Jan 2024 10:45:06 +0100 Subject: [PATCH 33/39] Rebase to 4.9 Update downstream patches --- .gitignore | 1 + sed-b-flag.patch | 15 ++--- sed-c-flag.patch | 101 ++++++++++++++-------------------- sed-covscan-annotations.patch | 48 ++++++---------- sed.spec | 15 ++--- sources | 2 +- 6 files changed, 75 insertions(+), 107 deletions(-) diff --git a/.gitignore b/.gitignore index bb24a27..c54486c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ sed-4.2.1.tar.bz2 /sed-4.4.tar.xz /sed-4.5.tar.xz /sed-4.8.tar.xz +/sed-4.9.tar.xz diff --git a/sed-b-flag.patch b/sed-b-flag.patch index 809ad9e..f4e6a03 100644 --- a/sed-b-flag.patch +++ b/sed-b-flag.patch @@ -1,17 +1,18 @@ -From 613057152c4f6caba22a15ed2ff0aeb9c4ce6a83 Mon Sep 17 00:00:00 2001 -From: Jakub Martisko -Date: Wed, 5 Feb 2020 15:50:15 +0100 -Subject: [PATCH] enable the -b option on all platforms +From f40556883a40ed7aaa4f44c9c9c95215c95eab9f Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Tue, 30 Jan 2024 10:31:57 +0100 +Subject: [PATCH 1/3] enable the -b option on all platforms +Content-Type: text/plain; charset=UTF-8 --- sed/sed.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sed/sed.c b/sed/sed.c -index f75e4b6..1ca5839 100644 +index af83065..bdf590b 100644 --- a/sed/sed.c +++ b/sed/sed.c -@@ -174,7 +174,12 @@ Usage: %s [OPTION]... {script-only-if-no-other-script} [input-file]...\n\ +@@ -153,7 +153,12 @@ Usage: %s [OPTION]... {script-only-if-no-other-script} [input-file]...\n\ fprintf (out, _(" -b, --binary\n\ open files in binary mode (CR+LFs are not" \ " processed specially)\n")); @@ -25,5 +26,5 @@ index f75e4b6..1ca5839 100644 specify the desired line-wrap length for the `l' command\n")); fprintf (out, _(" --posix\n\ -- -2.24.1 +2.43.0 diff --git a/sed-c-flag.patch b/sed-c-flag.patch index 114d5c7..590ccd0 100644 --- a/sed-c-flag.patch +++ b/sed-c-flag.patch @@ -1,50 +1,43 @@ -From f336bde91e3fd9c3c2960aa548b8917eb1216678 Mon Sep 17 00:00:00 2001 -From: Jakub Martisko -Date: Thu, 6 Feb 2020 15:26:33 +0100 -Subject: [PATCH] -c flag +From 100738652ca35e39f21742b8c54c1181efb38a0f Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Tue, 30 Jan 2024 10:38:50 +0100 +Subject: [PATCH 2/3] -c flag +Content-Type: text/plain; charset=UTF-8 --- - sed/execute.c | 18 +++++++++-- + sed/execute.c | 10 ++++-- sed/sed.c | 20 +++++++++++- sed/sed.h | 4 +++ sed/utils.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++ sed/utils.h | 2 ++ - 5 files changed, 127 insertions(+), 3 deletions(-) + 5 files changed, 119 insertions(+), 3 deletions(-) diff --git a/sed/execute.c b/sed/execute.c -index c5f07cc..4e5f5b3 100644 +index 485bca7..8d0cde7 100644 --- a/sed/execute.c +++ b/sed/execute.c -@@ -670,11 +670,25 @@ closedown (struct input *input) +@@ -673,11 +673,17 @@ closedown (struct input *input) if (strcmp (in_place_extension, "*") != 0) { char *backup_file_name = get_backup_file_name (target_name); -- ck_rename (target_name, backup_file_name, input->out_file_name); +- ck_rename (target_name, backup_file_name); + if (copy_instead_of_rename) -+ { -+ ck_fccopy (target_name, backup_file_name, input->out_file_name); -+ } ++ ck_fccopy (target_name, backup_file_name); + else -+ { -+ ck_rename (target_name, backup_file_name, input->out_file_name); -+ } ++ ck_rename (target_name, backup_file_name); free (backup_file_name); } -- ck_rename (input->out_file_name, target_name, input->out_file_name); +- ck_rename (input->out_file_name, target_name); + if (copy_instead_of_rename) -+ { -+ ck_fcmove (input->out_file_name, target_name, input->out_file_name); -+ } ++ ck_fcmove (input->out_file_name, target_name); + else -+ { -+ ck_rename (input->out_file_name, target_name, input->out_file_name); -+ } ++ ck_rename (input->out_file_name, target_name); cancel_cleanup (); free (input->out_file_name); } diff --git a/sed/sed.c b/sed/sed.c -index 1ca5839..745159e 100644 +index bdf590b..cebef70 100644 --- a/sed/sed.c +++ b/sed/sed.c @@ -67,6 +67,10 @@ bool debug = false; @@ -58,7 +51,7 @@ index 1ca5839..745159e 100644 /* The mode to use to read/write files, either "r"/"w" or "rb"/"wb". */ char const *read_mode = "r"; char const *write_mode = "w"; -@@ -170,6 +174,10 @@ Usage: %s [OPTION]... {script-only-if-no-other-script} [input-file]...\n\ +@@ -149,6 +153,10 @@ Usage: %s [OPTION]... {script-only-if-no-other-script} [input-file]...\n\ #endif fprintf (out, _(" -i[SUFFIX], --in-place[=SUFFIX]\n\ edit files in place (makes backup if SUFFIX supplied)\n")); @@ -69,7 +62,7 @@ index 1ca5839..745159e 100644 #if O_BINARY fprintf (out, _(" -b, --binary\n\ open files in binary mode (CR+LFs are not" \ -@@ -214,7 +222,7 @@ specified, then the standard input is read.\n\ +@@ -193,7 +201,7 @@ specified, then the standard input is read.\n\ int main (int argc, char **argv) { @@ -78,7 +71,7 @@ index 1ca5839..745159e 100644 enum { SANDBOX_OPTION = CHAR_MAX+1, DEBUG_OPTION -@@ -228,6 +236,7 @@ main (int argc, char **argv) +@@ -207,6 +215,7 @@ main (int argc, char **argv) {"file", 1, NULL, 'f'}, {"in-place", 2, NULL, 'i'}, {"line-length", 1, NULL, 'l'}, @@ -86,7 +79,7 @@ index 1ca5839..745159e 100644 {"null-data", 0, NULL, 'z'}, {"zero-terminated", 0, NULL, 'z'}, {"quiet", 0, NULL, 'n'}, -@@ -306,6 +315,10 @@ main (int argc, char **argv) +@@ -285,6 +294,10 @@ main (int argc, char **argv) follow_symlinks = true; break; @@ -97,7 +90,7 @@ index 1ca5839..745159e 100644 case 'i': separate_files = true; IF_LINT (free (in_place_extension)); -@@ -376,6 +389,11 @@ main (int argc, char **argv) +@@ -355,6 +368,11 @@ main (int argc, char **argv) } } @@ -110,10 +103,10 @@ index 1ca5839..745159e 100644 { if (optind < argc) diff --git a/sed/sed.h b/sed/sed.h -index 1c8e83a..0859e72 100644 +index 1c96bc5..2de60ae 100644 --- a/sed/sed.h +++ b/sed/sed.h -@@ -236,6 +236,10 @@ extern countT lcmd_out_line_len; +@@ -241,6 +241,10 @@ extern countT lcmd_out_line_len; /* How do we edit files in-place? (we don't if NULL) */ extern char *in_place_extension; @@ -125,7 +118,7 @@ index 1c8e83a..0859e72 100644 extern char const *read_mode; extern char const *write_mode; diff --git a/sed/utils.c b/sed/utils.c -index 9576dd1..371d5a9 100644 +index 4bd6587..05f7a44 100644 --- a/sed/utils.c +++ b/sed/utils.c @@ -25,6 +25,7 @@ @@ -135,8 +128,8 @@ index 9576dd1..371d5a9 100644 +#include #include "binary-io.h" - #include "unlocked-io.h" -@@ -400,7 +401,92 @@ ck_rename (const char *from, const char *to, const char *unlink_if_fail) + #include "eloop-threshold.h" +@@ -408,7 +409,78 @@ ck_rename (const char *from, const char *to) panic (_("cannot rename %s: %s"), from, strerror (errno)); } @@ -150,20 +143,6 @@ index 9576dd1..371d5a9 100644 + panic (_("cannot remove %s: %s"), name, strerror (errno)); +} + -+/* Attempt to unlink denoted file if operation rd failed. */ -+static int -+_unlink_if_fail (int rd,const char * unlink_if_fail) -+{ -+ if (rd == -1 && unlink_if_fail) -+ { -+ int save_errno = errno; -+ ck_unlink (unlink_if_fail); -+ errno = save_errno; -+ } -+ -+ return rd != -1; -+} -+ +/* Copy contents between files. */ +static int +_copy (from, to) @@ -172,7 +151,7 @@ index 9576dd1..371d5a9 100644 + static char buf[4096]; + + FILE *infile, *outfile; -+ int c, retval = 0; ++ int retval = 0; + errno = 0; + + infile = fopen (from, "r"); @@ -213,35 +192,35 @@ index 9576dd1..371d5a9 100644 + +/* Attempt to copy file contents between the files. */ +void -+ck_fccopy (const char *from,const char *to, const char *unlink_if_fail) ++ck_fccopy (const char *from, const char *to) +{ -+ if (!_unlink_if_fail (_copy (from, to), unlink_if_fail)) -+ panic (_("cannot copy %s to %s: %s"), from, to, strerror (errno)); -+ } ++ if (_copy (from, to) == -1) ++ panic (_("cannot copy %s to %s: %s"), from, to, strerror (errno)); ++} + +/* Copy contents between files, and then unlink the source. */ +void -+ck_fcmove (const char *from, const char *to,const char *unlink_if_fail) ++ck_fcmove (const char *from, const char *to) +{ -+ ck_fccopy (from, to, unlink_if_fail); -+ ck_unlink (from); ++ ck_fccopy (from, to); ++ ck_unlink (from); +} /* Implement a variable sized buffer of `stuff'. We don't know what it is, diff --git a/sed/utils.h b/sed/utils.h -index 47a029e..0aba107 100644 +index cac8a05..93bbcf2 100644 --- a/sed/utils.h +++ b/sed/utils.h -@@ -40,6 +40,8 @@ size_t ck_getdelim (char **text, size_t *buflen, char buffer_delimiter, +@@ -41,6 +41,8 @@ size_t ck_getdelim (char **text, size_t *buflen, char buffer_delimiter, FILE * ck_mkstemp (char **p_filename, const char *tmpdir, const char *base, const char *mode) _GL_ARG_NONNULL ((1, 2, 3, 4)); - void ck_rename (const char *from, const char *to, const char *unlink_if_fail); -+void ck_fccopy (const char *from, const char *to, const char *unlink_if_fail); -+void ck_fcmove (const char *from, const char *to, const char *unlink_if_fail); + void ck_rename (const char *from, const char *to); ++void ck_fccopy (const char *from, const char *to); ++void ck_fcmove (const char *from, const char *to); void *ck_malloc (size_t size); void *ck_realloc (void *ptr, size_t size); -- -2.24.1 +2.43.0 diff --git a/sed-covscan-annotations.patch b/sed-covscan-annotations.patch index 0679ed4..a36eada 100644 --- a/sed-covscan-annotations.patch +++ b/sed-covscan-annotations.patch @@ -1,33 +1,31 @@ -From 87f411a001394948183aaf389c711f3837c361b5 Mon Sep 17 00:00:00 2001 -From: Jakub Martisko -Date: Mon, 15 Nov 2021 16:06:54 +0100 -Subject: [PATCH] covscan annotations +From 7dbe9c0c2b3f2cac602ce352cad11dab4defe896 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Tue, 30 Jan 2024 10:41:40 +0100 +Subject: [PATCH 3/3] covscan annotations +Content-Type: text/plain; charset=UTF-8 --- - lib/malloca.c | 3 ++- + lib/malloca.c | 1 + sed/compile.c | 2 ++ - sed/utils.c | 1 + - 3 files changed, 5 insertions(+), 1 deletion(-) + 2 files changed, 3 insertions(+) diff --git a/lib/malloca.c b/lib/malloca.c -index 975b166..36e2342 100644 +index 1e19978..11783b4 100644 --- a/lib/malloca.c +++ b/lib/malloca.c -@@ -64,7 +64,8 @@ mmalloca (size_t n) +@@ -71,6 +71,7 @@ mmalloca (size_t n) [mem, mem + nplus). */ - ((small_t *) p)[-1] = p - mem; + p[-1] = offset; /* p ≡ sa_alignment_max mod 2*sa_alignment_max. */ -- return p; -+ /* cppcheck-suppress memleak */ -+ return p; ++ /* cppcheck-suppress memleak */ + return p; } } - /* Out of memory. */ diff --git a/sed/compile.c b/sed/compile.c -index 8321d68..df42794 100644 +index f96fbca..52759a5 100644 --- a/sed/compile.c +++ b/sed/compile.c -@@ -829,6 +829,7 @@ setup_replacement (struct subst *sub, const char *text, size_t length) +@@ -830,6 +830,7 @@ setup_replacement (struct subst *sub, const char *text, size_t length) tail->next = NULL; sub->replacement = root.next; @@ -35,26 +33,14 @@ index 8321d68..df42794 100644 } static void -@@ -1312,6 +1313,7 @@ compile_program (struct vector *vector) +@@ -1328,6 +1329,7 @@ compile_program (struct vector *vector) bad_prog (_(Y_CMD_LEN)); IF_LINT (free (src_lens)); -+ /* coverity [leaked_storage] */ ++ /* coverity [leaked_storage] */ } else { -diff --git a/sed/utils.c b/sed/utils.c -index 371d5a9..0d68f60 100644 ---- a/sed/utils.c -+++ b/sed/utils.c -@@ -294,6 +294,7 @@ do_ck_fclose (FILE *fp) - clearerr (fp); - - if (fclose (fp) == EOF) -+ /* coverity[pass_freed_arg] */ - panic ("couldn't close %s: %s", utils_fp_name (fp), strerror (errno)); - } - -- -2.33.0 +2.43.0 diff --git a/sed.spec b/sed.spec index e619023..26b7b26 100644 --- a/sed.spec +++ b/sed.spec @@ -2,8 +2,8 @@ Summary: A GNU stream text editor Name: sed -Version: 4.8 -Release: 15%{?dist} +Version: 4.9 +Release: 1%{?dist} License: GPL-3.0-or-later URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -29,11 +29,7 @@ that sed performs (substitutions, deletions, insertions, etc.) can be specified in a script file or from the command line. %prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 - +%autosetup -p1 sed -e 's/1729576/EPERM/' \ -i gnulib-tests/test-{strerror_r,perror2}.c @@ -65,6 +61,11 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Tue Jan 30 2024 Paolo Bonzini - 4.9-1 +- Rebase to 4.9 +- Update downstream patches +- Resolves: rhbz#2140486 + * Sat Jan 27 2024 Fedora Release Engineering - 4.8-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild diff --git a/sources b/sources index 63247e0..efafbe0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (sed-4.8.tar.xz) = 7de25d9bc2981c63321c2223f3fbcab61d7b0df4fcf7d4394b72400b91993e1288d8bf53948ed5fffcf5a98c75265726a68ad4fb98e1d571bf768603a108c1c8 +SHA512 (sed-4.9.tar.xz) = 36157a4b4a2430cf421b7bd07f1675d680d9f1616be96cf6ad6ee74a9ec0fe695f8d0b1e1f0b008bbb33cc7fcde5e1c456359bbbc63f8aebdd4fedc3982cf6dc From 1b82c7e44fce4d0bb12cd36bca035b1f87776841 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 30 Jan 2024 11:08:03 +0100 Subject: [PATCH 34/39] Install valgrind and langpacks to increase test coverage --- sed.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sed.spec b/sed.spec index 26b7b26..740aee6 100644 --- a/sed.spec +++ b/sed.spec @@ -16,6 +16,12 @@ BuildRequires: glibc-devel, libselinux-devel, libacl-devel, automake, autoconf, BuildRequires: perl-Getopt-Long BuildRequires: perl(FileHandle) +# for tests. More tests require a ja_JP locale, but glibc-langpack-ja gives: +# invalid-mb-seq-UMR.sh: skipped test: locale 'ja_JP' is buggy +# mb-charclass-non-utf8.sh: skipped test: ja_JP shift-jis locale not found +BuildRequires: glibc-langpack-el, glibc-langpack-en +BuildRequires: glibc-langpack-ru, valgrind + Provides: /bin/sed #copylib @@ -31,9 +37,6 @@ specified in a script file or from the command line. %prep %autosetup -p1 -sed -e 's/1729576/EPERM/' \ - -i gnulib-tests/test-{strerror_r,perror2}.c - %build %configure --without-included-regex %make_build @@ -65,6 +68,8 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir - Rebase to 4.9 - Update downstream patches - Resolves: rhbz#2140486 +- Remove change to gnulib tests, they pass anyway +- Install valgrind and langpacks to increase test coverage * Sat Jan 27 2024 Fedora Release Engineering - 4.8-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From f0eb9d96e82a6b03f50b589779eef96cbbe55306 Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Tue, 23 Apr 2024 15:21:27 +0800 Subject: [PATCH 35/39] Properly check valgrind arches --- sed.spec | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sed.spec b/sed.spec index 740aee6..3beccde 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.9 -Release: 1%{?dist} +Release: 2%{?dist} License: GPL-3.0-or-later URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -20,7 +20,11 @@ BuildRequires: perl(FileHandle) # invalid-mb-seq-UMR.sh: skipped test: locale 'ja_JP' is buggy # mb-charclass-non-utf8.sh: skipped test: ja_JP shift-jis locale not found BuildRequires: glibc-langpack-el, glibc-langpack-en -BuildRequires: glibc-langpack-ru, valgrind +BuildRequires: glibc-langpack-ru + +%ifarch %{valgrind_arches} +BuildRequires: valgrind +%endif Provides: /bin/sed @@ -64,6 +68,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Mon Apr 22 2024 David Abdurachmanov - 4.9-2 +- Properly check valgrind arches (riscv64 is not ported) + * Tue Jan 30 2024 Paolo Bonzini - 4.9-1 - Rebase to 4.9 - Update downstream patches From 8eb562c46858fd1ede606ffab4e97847e4d01a5b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 05:12:57 +0000 Subject: [PATCH 36/39] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- sed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index 3beccde..cb11451 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.9 -Release: 2%{?dist} +Release: 3%{?dist} License: GPL-3.0-or-later URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -68,6 +68,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Sat Jul 20 2024 Fedora Release Engineering - 4.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Mon Apr 22 2024 David Abdurachmanov - 4.9-2 - Properly check valgrind arches (riscv64 is not ported) From 7ab625db1149e3a966089684f9cd6ff6155e4b56 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 10:22:45 +0000 Subject: [PATCH 37/39] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- sed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index cb11451..a49faf2 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.9 -Release: 3%{?dist} +Release: 4%{?dist} License: GPL-3.0-or-later URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -68,6 +68,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Sun Jan 19 2025 Fedora Release Engineering - 4.9-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Sat Jul 20 2024 Fedora Release Engineering - 4.9-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 69e852671843dd3688b694fe903debda7878d4fc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 18:07:41 +0000 Subject: [PATCH 38/39] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- sed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index a49faf2..33c363e 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.9 -Release: 4%{?dist} +Release: 5%{?dist} License: GPL-3.0-or-later URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -68,6 +68,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 4.9-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Sun Jan 19 2025 Fedora Release Engineering - 4.9-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 4b1f76b01c2501d0fee4d6fe2c9dd6eea6918d18 Mon Sep 17 00:00:00 2001 From: Jakub Martisko Date: Fri, 24 Oct 2025 11:22:58 +0200 Subject: [PATCH 39/39] The man page should not mention whether SELinux is enabled/disabled Resolves: rhbz#2396649 --- sed.spec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sed.spec b/sed.spec index 33c363e..ad29b17 100644 --- a/sed.spec +++ b/sed.spec @@ -3,7 +3,7 @@ Summary: A GNU stream text editor Name: sed Version: 4.9 -Release: 5%{?dist} +Release: 6%{?dist} License: GPL-3.0-or-later URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz @@ -44,6 +44,11 @@ specified in a script file or from the command line. %build %configure --without-included-regex %make_build + +#rhbz#2396649 +sed -i s/"SELinux is enabled on this system."// ./doc/sed.1 +sed -i s/"SELinux is disabled on this system."// ./doc/sed.1 + install -m 644 -p %{SOURCE1} sedfaq.txt gzip -9 sedfaq.txt @@ -68,6 +73,11 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir %{_mandir}/man1/sed.1* %changelog +* Fri Oct 24 2025 Jakub Martisko - 4.9-6 +- The manpage should no longer mention whether the SELinux is enabled/disabled on the system +- It was based on the build system anyway +- Resolves: rhbz#2396649 + * Fri Jul 25 2025 Fedora Release Engineering - 4.9-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild