Projects
openEuler:Mainline
patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
_service:tar_scm:patch.spec
Changed
@@ -1,6 +1,6 @@ Name: patch Version: 2.7.6 -Release: 12 +Release: 20 Summary: Utiliity which applies a patch file to original files. License: GPLv3+ URL: http://www.gnu.org/software/patch/patch.html @@ -14,6 +14,19 @@ Patch6: CVE-2018-20969-and-CVE-2019-13638.patch Patch7: CVE-2019-13636.patch Patch8: patch-selinux.patch +Patch9: Avoid-set_file_attributes-sign-conversion-warnings.patch +Patch10: Test-suite-compatibility-fixes.patch +Patch11: Test-suite-fix-Korn-shell-incompatibility.patch +Patch12: backport-maint-avoid-warnings-from-GCC8.patch +Patch13: backport-Make-the-debug-2-output-more-useful.patch +Patch14: backport--Improve-support-for-memory-leak-detection.patch +Patch15: backport-Skip-ed-test-when-the-ed-utility-is-not-installed.patch +Patch16: backport-Abort-when-cleaning-up-fails.patch +Patch17: backport-Don-t-crash-when-RLIMIT_NOFILE-is-set-to-RLIM_INFINI.patch +Patch18: backport-Avoid-invalid-memory-access-in-context-format-diffs.patch +Patch19: backport-Fix-failed-assertion-outstate-after_newline.patch +Patch20: backport-Add-missing-section-tests-to-context-format-test-cas.patch +Patch21: backport-Fix-test-for-presence-of-BASH_LINENO-0.patch BuildRequires: gcc libselinux-devel libattr-devel ed Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-root @@ -39,7 +52,7 @@ %make_build %check -make check +%make_build check %install %makeinstall @@ -56,6 +69,36 @@ %{_mandir}/man1/* %changelog +* Fri Dec 30 2022 Xibo.Wang <wangxb12@chinatelecom.cn> - 2.7.6-20 +- Skip "ed" test when the ed utility is not installed +- Abort when cleaning up fails +- Don't crash when RLIMIT_NOFILE is set to RLIM_INFINITY +- Avoid invalid memory access in context format diffs +- Fix failed assertion 'outstate->after_newline' +- Add missing-section tests to context-format test case +- Fix test for presence of BASH_LINENO0 + +* Wed Dec 28 2022 Xibo.Wang <wangxb12@chinatelecom.cn> - 2.7.6-19 +- Improve support for memory leak detection + +* Wed Dec 28 2022 Xibo.Wang <wangxb12@chinatelecom.cn> - 2.7.6-18 +- Make the (debug & 2) output more useful + +* Wed Dec 28 2022 Xibo.Wang <wangxb12@chinatelecom.cn> - 2.7.6-17 +- maint: avoid warnings from GCC8 + +* Wed Dec 28 2022 Xibo.Wang <wangxb12@chinatelecom.cn> - 2.7.6-16 +- Test suite: fix Korn shell incompatibility + +* Wed Dec 28 2022 Xibo.Wang <wangxb12@chinatelecom.cn> - 2.7.6-15 +- Test suite compatibility fixes + +* Wed Dec 28 2022 Xibo.Wang <wangxb12@chinatelecom.cn> - 2.7.6-14 +- Avoid set_file_attributes sign conversion warnings + +* Wed Oct 19 2022 fuanan <fuanan3@h-partners.com> - 2.7.6-13 +- optimize check by running make in parallel + * Wed Mar 18 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.7.6-12 - Type:bugfix - ID:NA
View file
_service:tar_scm:Avoid-set_file_attributes-sign-conversion-warnings.patch
Added
@@ -0,0 +1,31 @@ +From 8b8b9f002ea665372d7afc505fa2fe2929d0a3fe Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher <agruen@gnu.org> +Date: Wed, 7 Feb 2018 12:01:22 +0100 +Subject: PATCH Avoid set_file_attributes sign conversion warnings + +* src/util.c (set_file_attributes): Avoid sign conversion warnings when +assigning -1 to uid_t / gid_t. + +Signed-off-by: Xibo.Wang <wangxb12@chinatelecom.cn> +--- + src/util.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/util.c b/src/util.c +index a626fdd..0900466 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -256,8 +256,8 @@ set_file_attributes (char const *to, enum file_attributes attr, + } + if (attr & FA_IDS) + { +- static uid_t euid = -1; +- static gid_t egid = -1; ++ static uid_t euid = (uid_t)-1; ++ static gid_t egid = (gid_t)-1; + uid_t uid; + uid_t gid; + +-- +1.8.3.1 +
View file
_service:tar_scm:Test-suite-compatibility-fixes.patch
Added
@@ -0,0 +1,134 @@ +From 3fc4998f31ffc7dfccfc4a3dde36184475c796ca Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher <agruen@gnu.org> +Date: Wed, 7 Feb 2018 12:10:41 +0100 +Subject: PATCH Test suite compatibility fixes + +* tests/crlf-handling, tests/git-cleanup, tests/test-lib.sh: Use printf +instead of echo -e / echo -n for compatibility with systems that don't +support these echo options. +* tests/merge: Minor other cleanups. + +Signed-off-by: Xibo.Wang <wangxb12@chinatelecom.cn> +--- + tests/crlf-handling | 2 +- + tests/git-cleanup | 4 ++-- + tests/merge | 18 ++++++++---------- + tests/test-lib.sh | 21 +++++++-------------- + 4 files changed, 18 insertions(+), 27 deletions(-) + +diff --git a/tests/crlf-handling b/tests/crlf-handling +index 239149c..c192cac 100644 +--- a/tests/crlf-handling ++++ b/tests/crlf-handling +@@ -14,7 +14,7 @@ use_local_patch + use_tmpdir + + lf2crlf() { +- while read l; do echo -e "$l\r"; done ++ while read l; do printf "%s\r\n" "$l"; done + } + + echo 1 > a +diff --git a/tests/git-cleanup b/tests/git-cleanup +index 2e3e4c6..ca527a1 100644 +--- a/tests/git-cleanup ++++ b/tests/git-cleanup +@@ -36,8 +36,8 @@ BAD PATCH + EOF + + echo 1 > f +-echo -n '' > g +-echo -n '' > h ++printf '' > g ++printf '' > h + + check 'patch -f -i 1.diff || echo status: $?' <<EOF + patching file f +diff --git a/tests/merge b/tests/merge +index 22d787b..b628891 100644 +--- a/tests/merge ++++ b/tests/merge +@@ -30,30 +30,28 @@ x2() { + while test $# -gt 0 && test "$1" != -- ; do + echo "$1" + shift +- done > a.sed +- echo "$body" | sed -f a.sed > b ++ done > b.sed ++ echo "$body" | sed -f b.sed > b + shift + while test $# -gt 0 ; do + echo "$1" + shift +- done > b.sed +- echo "$body" | sed -f b.sed > c +- rm -f a.sed b.sed ++ done > c.sed ++ echo "$body" | sed -f c.sed > c ++ rm -f b.sed c.sed + output=`diff -u a b | patch $ARGS -f c` + status=$? + echo "$output" | sed -e '/^$/d' -e '/^patching file c$/d' + cat c +- test $status == 0 || echo "Status: $status" ++ test $status = 0 || echo "Status: $status" + } + + x() { +- ARGS="$ARGS --merge" x2 "$@" ++ ARGS="--merge" x2 "$@" + echo +- ARGS="$ARGS --merge=diff3" x2 "$@" ++ ARGS="--merge=diff3" x2 "$@" + } + +-unset ARGS +- + # ============================================================== + + check 'x 3' <<EOF +diff --git a/tests/test-lib.sh b/tests/test-lib.sh +index be0d7e3..661da52 100644 +--- a/tests/test-lib.sh ++++ b/tests/test-lib.sh +@@ -41,7 +41,7 @@ use_local_patch() { + + eval 'patch() { + if test -n "$GDB" ; then +- echo -e "\n" >&3 ++ printf "\n\n" >&3 + gdbserver localhost:53153 $PATCH "$@" 2>&3 + else + $PATCH "$@" +@@ -113,22 +113,15 @@ cleanup() { + exit $status + } + +-if test -z "`echo -n`"; then +- if eval 'test -n "${BASH_LINENO0}" 2>/dev/null'; then +- eval ' +- _start_test() { +- echo -n "${BASH_LINENO2} $* -- " +- }' +- else +- eval ' +- _start_test() { +- echo -n "* $* -- " +- }' +- fi ++if eval 'test -n "${BASH_LINENO0}" 2>/dev/null'; then ++ eval ' ++ _start_test() { ++ printf "${BASH_LINENO2} %s -- " "$*" ++ }' + else + eval ' + _start_test() { +- echo "* $*" ++ printf "* %s -- " "$*" + }' + fi + +-- +1.8.3.1 +
View file
_service:tar_scm:Test-suite-fix-Korn-shell-incompatibility.patch
Added
@@ -0,0 +1,28 @@ +From 8f52e719d7b35e9f89b1e75d3aa8d3063de6d81a Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher <agruen@gnu.org> +Date: Wed, 7 Feb 2018 17:05:00 +0100 +Subject: PATCH Test suite: fix Korn shell incompatibility + +tests/merge: In a Korn shell, shift apparently fails when $# is 0. + +Signed-off-by: Xibo.Wang <wangxb12@chinatelecom.cn> +--- + tests/merge | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/merge b/tests/merge +index b628891..e950b92 100644 +--- a/tests/merge ++++ b/tests/merge +@@ -32,7 +32,7 @@ x2() { + shift + done > b.sed + echo "$body" | sed -f b.sed > b +- shift ++ test $# -eq 0 || shift + while test $# -gt 0 ; do + echo "$1" + shift +-- +1.8.3.1 +
View file
_service:tar_scm:backport--Improve-support-for-memory-leak-detection.patch
Added
@@ -0,0 +1,55 @@ +From 312b793db6f549a3d4036b5d0ed2265c451ede15 Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher <agruen@gnu.org> +Date: Thu, 27 Jun 2019 11:02:02 +0200 +Subject: PATCH Improve support for memory leak detection + +When building with the address sanitizer on, free some more resources before +exiting. (This is unnecessary when not looking for memory leaks.) +* src/patch.c (init_files_to_delete): Add dispose function for freeing +filenames. + +Signed-off-by: Xibo.Wang <wangxb12@chinatelecom.cn> +--- + src/patch.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/src/patch.c b/src/patch.c +index 99a5904..e57cf19 100644 +--- a/src/patch.c ++++ b/src/patch.c +@@ -36,6 +36,10 @@ + #include <minmax.h> + #include <safe.h> + ++#ifdef __SANITIZE_ADDRESS__ ++# define FREE_BEFORE_EXIT ++#endif ++ + /* procedures */ + + static FILE *create_output_file (char const *, int); +@@ -1777,10 +1781,20 @@ struct file_to_delete { + + static gl_list_t files_to_delete; + ++#ifdef FREE_BEFORE_EXIT ++void dispose_file_to_delete (const void *elt) ++{ ++ free ((void *) elt); ++} ++#else ++#define dispose_file_to_delete NULL ++#endif ++ + static void + init_files_to_delete (void) + { +- files_to_delete = gl_list_create_empty (GL_LINKED_LIST, NULL, NULL, NULL, true); ++ files_to_delete = gl_list_create_empty (GL_LINKED_LIST, NULL, NULL, ++ dispose_file_to_delete, true); + } + + static void +-- +1.8.3.1 +
View file
_service:tar_scm:backport-Abort-when-cleaning-up-fails.patch
Added
@@ -0,0 +1,53 @@ +From b5c17c6c6591e62173197f97d3113862bf23bd4d Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher <agruen@gnu.org> +Date: Fri, 28 Jun 2019 00:30:25 +0200 +Subject: PATCH 2/8 Abort when cleaning up fails + +When a fatal error triggers during cleanup, another attempt will be made to +clean up, which will likely lead to the same fatal error. So instead, bail out +when that happens. +src/patch.c (cleanup): Bail out when called recursively. +(main): There is no need to call output_files() before cleanup() as cleanup() +already does that. + +Signed-off-by: Xibo.Wang <wangxb12@chinatelecom.cn> +--- + src/patch.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/patch.c b/src/patch.c +index e57cf19..1e1915d 100644 +--- a/src/patch.c ++++ b/src/patch.c +@@ -685,7 +685,6 @@ main (int argc, char **argv) + } + if (outstate.ofp && (ferror (outstate.ofp) || fclose (outstate.ofp) != 0)) + write_fatal (); +- output_files (NULL); + cleanup (); + delete_files (); + if (somefailed) +@@ -1991,7 +1990,6 @@ void + fatal_exit (int sig) + { + cleanup (); +- + if (sig) + exit_with_signal (sig); + +@@ -2011,6 +2009,12 @@ remove_if_needed (char const *name, bool *needs_removal) + static void + cleanup (void) + { ++ static bool already_cleaning_up; ++ ++ if (already_cleaning_up) ++ return; ++ already_cleaning_up = true; ++ + remove_if_needed (TMPINNAME, &TMPINNAME_needs_removal); + remove_if_needed (TMPOUTNAME, &TMPOUTNAME_needs_removal); + remove_if_needed (TMPPATNAME, &TMPPATNAME_needs_removal); +-- +1.8.3.1 +
View file
_service:tar_scm:backport-Add-missing-section-tests-to-context-format-test-cas.patch
Added
@@ -0,0 +1,132 @@ +From 3a4a357daa920361d709bbc4cf43865dff769112 Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher <agruen@gnu.org> +Date: Tue, 30 Jul 2019 12:10:19 +0200 +Subject: PATCH 6/8 Add missing-section tests to context-format test case + +* tests/context-format: Add tests with a missing pattern and a missing +replacement section in a hunk. Patch should fill in the missing +sections from the existing sections. + +Signed-off-by: Xibo.Wang <wangxb12@chinatelecom.cn> +--- + tests/context-format | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 84 insertions(+), 2 deletions(-) + +diff --git a/tests/context-format b/tests/context-format +index 8143448..b3276ff 100644 +--- a/tests/context-format ++++ b/tests/context-format +@@ -11,6 +11,46 @@ use_tmpdir + + # ============================================================== + ++printf "%s\n" 1 2 4 5 > a ++cat > ab.diff <<EOF ++*** a ++--- b ++*************** ++*** 1,4 **** ++--- 1,5 ---- ++ 1 ++ 2 +++ 3 ++ 4 ++ 5 ++EOF ++ ++check 'patch < ab.diff' <<EOF ++patching file a ++EOF ++ ++printf "%s\n" 1 2 3 4 5 > a ++cat > ab.diff <<EOF ++*** a ++--- b ++*************** ++*** 1,5 **** ++ 1 ++ 2 ++- 3 ++ 4 ++ 5 ++--- 1,4 ---- ++EOF ++ ++check 'patch < ab.diff' <<EOF ++patching file a ++EOF ++ ++# -------------------------------------------------------------- ++ ++printf "%s\n" a a a a a b a a a a a > a ++ + cat > ab.diff <<EOF + *** a + --- b +@@ -20,11 +60,33 @@ cat > ab.diff <<EOF + --- 5 ---- + EOF + +-printf "%s\n" a a a a a b a a a a a > a + check 'patch < ab.diff' <<EOF + patching file a + EOF + ++check 'echo `cat a`' <<EOF ++a a a a a a a a a a ++EOF ++ ++cat > ba.diff <<EOF ++*** b ++--- a ++*************** ++*** 5 **** ++--- 6 ---- +++ b ++EOF ++ ++check 'patch < ba.diff' <<EOF ++patching file a ++EOF ++ ++check 'echo `cat a`' <<EOF ++a a a a a b a a a a a ++EOF ++ ++printf "%s\n" a a a a a a a a a a b > a ++ + cat > ab.diff <<EOF + *** a + --- b +@@ -34,7 +96,27 @@ cat > ab.diff <<EOF + --- 10 ---- + EOF + +-printf "%s\n" a a a a a a a a a a b > a + check 'patch < ab.diff' <<EOF + patching file a + EOF ++ ++check 'echo `cat a`' <<EOF ++a a a a a a a a a a ++EOF ++ ++cat > ba.diff <<EOF ++*** b ++--- a ++*************** ++*** 10 **** ++--- 11 ---- +++ b ++EOF ++ ++check 'patch < ba.diff' <<EOF ++patching file a ++EOF ++ ++check 'echo `cat a`' <<EOF ++a a a a a a a a a a b ++EOF +-- +1.8.3.1 +
View file
_service:tar_scm:backport-Avoid-invalid-memory-access-in-context-format-diffs.patch
Added
@@ -0,0 +1,28 @@ +From 46136e6440f78b4a21eaeaeabef2b4fcb482c158 Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher <agruen@gnu.org> +Date: Mon, 15 Jul 2019 19:10:02 +0200 +Subject: PATCH 4/8 Avoid invalid memory access in context format diffs + +* src/pch.c (another_hunk): Avoid invalid memory access in context format +diffs. + +Signed-off-by: Xibo.Wang <wangxb12@chinatelecom.cn> +--- + src/pch.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/pch.c b/src/pch.c +index aa0caf4..87e6f93 100644 +--- a/src/pch.c ++++ b/src/pch.c +@@ -1335,6 +1335,7 @@ another_hunk (enum diff difftype, bool rev) + ptrn_prefix_context = context; + ptrn_suffix_context = context; + if (repl_beginning ++ || p_end <= 0 + || (p_end + != p_ptrn_lines + 1 + (p_Charp_end - 1 == '\n'))) + { +-- +1.8.3.1 +
View file
_service:tar_scm:backport-Don-t-crash-when-RLIMIT_NOFILE-is-set-to-RLIM_INFINI.patch
Added
@@ -0,0 +1,91 @@ +From 2523dced822caae56f24eff4899c6307e1844df6 Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher <agruen@gnu.org> +Date: Thu, 27 Jun 2019 11:10:43 +0200 +Subject: PATCH 3/8 Don't crash when RLIMIT_NOFILE is set to RLIM_INFINITY + +* src/safe.c (min_cached_fds): Define minimum number of cached dir file +descriptors. +(max_cached_fds): Change type to rlim_t to allow storing RLIM_INFINITY. +(init_dirfd_cache): Set max_cached_fds to RLIM_INFINITY when RLIMIT_NOFILE is +RLIM_INFINITY. Set the initial hash table size to min_cached_fds, independent +of RLIMIT_NOFILE: patches commonly only affect one or a few files, so a small +hash table will usually suffice; if needed, the hash table will grow. +(insert_cached_dirfd): Don't shrink the cache when max_cached_fds is +RLIM_INFINITY. + +Signed-off-by: Xibo.Wang <wangxb12@chinatelecom.cn> +--- + src/safe.c | 36 +++++++++++++++++++++++------------- + 1 file changed, 23 insertions(+), 13 deletions(-) + +diff --git a/src/safe.c b/src/safe.c +index 5a7202f..f147b0e 100644 +--- a/src/safe.c ++++ b/src/safe.c +@@ -67,7 +67,8 @@ struct cached_dirfd { + }; + + static Hash_table *cached_dirfds = NULL; +-static size_t max_cached_fds; ++static rlim_t min_cached_fds = 8; ++static rlim_t max_cached_fds; + LIST_HEAD (lru_list); + + static size_t hash_cached_dirfd (const void *entry, size_t table_size) +@@ -98,11 +99,17 @@ static void init_dirfd_cache (void) + { + struct rlimit nofile; + +- max_cached_fds = 8; + if (getrlimit (RLIMIT_NOFILE, &nofile) == 0) +- max_cached_fds = MAX (nofile.rlim_cur / 4, max_cached_fds); ++ { ++ if (nofile.rlim_cur == RLIM_INFINITY) ++ max_cached_fds = RLIM_INFINITY; ++ else ++ max_cached_fds = MAX (nofile.rlim_cur / 4, min_cached_fds); ++ } ++ else ++ max_cached_fds = min_cached_fds; + +- cached_dirfds = hash_initialize (max_cached_fds, ++ cached_dirfds = hash_initialize (min_cached_fds, + NULL, + hash_cached_dirfd, + compare_cached_dirfds, +@@ -148,20 +155,23 @@ static void insert_cached_dirfd (struct cached_dirfd *entry, int keepfd) + if (cached_dirfds == NULL) + init_dirfd_cache (); + +- /* Trim off the least recently used entries */ +- while (hash_get_n_entries (cached_dirfds) >= max_cached_fds) ++ if (max_cached_fds != RLIM_INFINITY) + { +- struct cached_dirfd *last = +- list_entry (lru_list.prev, struct cached_dirfd, lru_link); +- if (&last->lru_link == &lru_list) +- break; +- if (last->fd == keepfd) ++ /* Trim off the least recently used entries */ ++ while (hash_get_n_entries (cached_dirfds) >= max_cached_fds) + { +- last = list_entry (last->lru_link.prev, struct cached_dirfd, lru_link); ++ struct cached_dirfd *last = ++ list_entry (lru_list.prev, struct cached_dirfd, lru_link); + if (&last->lru_link == &lru_list) + break; ++ if (last->fd == keepfd) ++ { ++ last = list_entry (last->lru_link.prev, struct cached_dirfd, lru_link); ++ if (&last->lru_link == &lru_list) ++ break; ++ } ++ remove_cached_dirfd (last); + } +- remove_cached_dirfd (last); + } + + /* Only insert if the parent still exists. */ +-- +1.8.3.1 +
View file
_service:tar_scm:backport-Fix-failed-assertion-outstate-after_newline.patch
Added
@@ -0,0 +1,36 @@ +From 2ab603a64f404d4724a867b8cf9f08ccacbff7c6 Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher <agruen@gnu.org> +Date: Tue, 16 Jul 2019 01:16:28 +0200 +Subject: PATCH 5/8 Fix failed assertion 'outstate->after_newline' + +The assertion triggers when the -o FILE option is used, more than one output +file is written into FILE, and one of those files (except the last one) ends in +the middle of a line. +* src/patch.c (main): Fix the case described above. + +Signed-off-by: Xibo.Wang <wangxb12@chinatelecom.cn> +--- + src/patch.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/patch.c b/src/patch.c +index 1e1915d..9684794 100644 +--- a/src/patch.c ++++ b/src/patch.c +@@ -369,6 +369,13 @@ main (int argc, char **argv) + /* outstate.ofp now owns the file descriptor */ + outfd = -1; + } ++ else ++ { ++ /* When writing to a single output file (-o FILE), always pretend ++ that the output file ends in a newline. Otherwise, when another ++ file is written to the same output file, apply_hunk will fail. */ ++ outstate.after_newline = true; ++ } + + /* find out where all the lines are */ + if (!skip_rest_of_patch) { +-- +1.8.3.1 +
View file
_service:tar_scm:backport-Fix-test-for-presence-of-BASH_LINENO-0.patch
Added
@@ -0,0 +1,34 @@ +From 1b33a17c9a79de1b6d5acb4da76d3fcedd8dc262 Mon Sep 17 00:00:00 2001 +From: Kerin Millar <kfm@plushkava.net> +Date: Sun, 3 Jan 2021 07:25:00 +0000 +Subject: PATCH 7/8 Fix test for presence of BASH_LINENO0 + +eval is not some sort of magical sandbox for executing code that might cause +the shell's parser to take exception. Render the test resilient by carrying +it out within a subshell. While at it, position the redirection so that +STDERR is, in fact, muted. + +Signed-off-by: Kerin Millar <kfm@plushkava.net> +Reported-by: Paolo Pedroni <paolo.pedroni@iol.it> +Closes: https://bugs.gentoo.org/738810 +Signed-off-by: Xibo.Wang <wangxb12@chinatelecom.cn> +--- + tests/test-lib.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test-lib.sh b/tests/test-lib.sh +index 661da52..b2e787d 100644 +--- a/tests/test-lib.sh ++++ b/tests/test-lib.sh +@@ -113,7 +113,7 @@ cleanup() { + exit $status + } + +-if eval 'test -n "${BASH_LINENO0}" 2>/dev/null'; then ++if ( eval 'test -n "${BASH_LINENO0}"' 2>/dev/null ); then + eval ' + _start_test() { + printf "${BASH_LINENO2} %s -- " "$*" +-- +1.8.3.1 +
View file
_service:tar_scm:backport-Make-the-debug-2-output-more-useful.patch
Added
@@ -0,0 +1,47 @@ +From 4be3ee4d25fc777a2508fdd03dc8f701cf4ca91d Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher <agruen@gnu.org> +Date: Fri, 17 Aug 2018 10:31:22 +0200 +Subject: PATCH Make the (debug & 2) output more useful + +* src/pch.c (another_hunk): In the (debug & 2) output, fix how empty +lines that are not part of the patch context are printed. Also, add +newlines to lines that are missing them to keep the output readable. + +Signed-off-by: Xibo.Wang <wangxb12@chinatelecom.cn> +--- + src/pch.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/src/pch.c b/src/pch.c +index 4368561..aa0caf4 100644 +--- a/src/pch.c ++++ b/src/pch.c +@@ -1923,8 +1923,13 @@ another_hunk (enum diff difftype, bool rev) + lin i; + + for (i = 0; i <= p_end + 1; i++) { +- fprintf (stderr, "%s %c", +- format_linenum (numbuf0, i), ++ fputs (format_linenum (numbuf0, i), stderr); ++ if (p_Chari == '\n') ++ { ++ fputc('\n', stderr); ++ continue; ++ } ++ fprintf (stderr, " %c", + p_Chari); + if (p_Chari == '*') + fprintf (stderr, " %s,%s\n", +@@ -1937,7 +1942,8 @@ another_hunk (enum diff difftype, bool rev) + else if (p_Chari != '^') + { + fputs(" |", stderr); +- pch_write_line (i, stderr); ++ if (! pch_write_line (i, stderr)) ++ fputc('\n', stderr); + } + else + fputc('\n', stderr); +-- +1.8.3.1 +
View file
_service:tar_scm:backport-Skip-ed-test-when-the-ed-utility-is-not-installed.patch
Added
@@ -0,0 +1,32 @@ +From 78ee5267f712c38f3343964533fb9fb7c4f70539 Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher <agruen@gnu.org> +Date: Thu, 27 Jun 2019 11:09:31 +0200 +Subject: PATCH 1/8 Skip "ed" test when the ed utility is not installed + +* tests/ed-style: Require ed. + +Signed-off-by: Xibo.Wang <wangxb12@chinatelecom.cn> + +Conflicts: + tests/ed-style +--- + tests/ed-style | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tests/ed-style b/tests/ed-style +index ca8e958..9907cb6 100644 +--- a/tests/ed-style ++++ b/tests/ed-style +@@ -6,7 +6,8 @@ + + . $srcdir/test-lib.sh + +-require_cat ++require cat ++require ed + use_local_patch + use_tmpdir + +-- +1.8.3.1 +
View file
_service:tar_scm:backport-maint-avoid-warnings-from-GCC8.patch
Added
@@ -0,0 +1,85 @@ +From 040f114197ca1797bf84caedb252119c1ec07be5 Mon Sep 17 00:00:00 2001 +From: Jim Meyering <jim@meyering.net> +Date: Fri, 6 Apr 2018 17:17:11 -0700 +Subject: PATCH maint: avoid warnings from GCC8 + +Hi Andreas, + +I configured with --enable-gcc-warnings and bleeding-edge gcc +(version 8.0.1 20180406) and hit some warning-escalated-to-errors. +This fixes them: + +>From a71ddb200dbe7ac0f9258796b5a51979b2740e88 Mon Sep 17 00:00:00 2001 +From: Jim Meyering <meyering@fb.com> +Date: Fri, 6 Apr 2018 16:47:00 -0700 +Subject: PATCH maint: avoid warnings from GCC8 + +* src/common.h (FALLTHROUGH): Define. +* src/patch.c (abort_hunk_context): Use FALLTHROUGH macro in place of +a comment. This avoids a warning from -Wimplicit-fallthrough=. +* src/pch.c (do_ed_script): Add otherwise unnecessary initialization +to avoid warning from -Wmaybe-uninitialized. +(another_hunk): Use FALLTHROUGH macro here, too, twice. + +Conflicts: + src/pch.c +--- + src/common.h | 8 ++++++++ + src/patch.c | 2 +- + src/pch.c | 4 ++-- + 3 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/src/common.h b/src/common.h +index 2524628..dfac17a 100644 +--- a/src/common.h ++++ b/src/common.h +@@ -223,3 +223,11 @@ bool merge_hunk (int hunk, struct outstate *, lin where, bool *); + #else + # define merge_hunk(hunk, outstate, where, somefailed) false + #endif ++ ++#ifndef FALLTHROUGH ++# if __GNUC__ < 7 ++# define FALLTHROUGH ((void) 0) ++# else ++# define FALLTHROUGH __attribute__ ((__fallthrough__)) ++# endif ++#endif +diff --git a/src/patch.c b/src/patch.c +index 065a05a..99a5904 100644 +--- a/src/patch.c ++++ b/src/patch.c +@@ -1382,7 +1382,7 @@ abort_hunk_context (bool header, bool reverse) + break; + case ' ': case '-': case '+': case '!': + fprintf (rejfp, "%c ", pch_char (i)); +- /* fall into */ ++ FALLTHROUGH; + case '\n': + pch_write_line (i, rejfp); + break; +diff --git a/src/pch.c b/src/pch.c +index 8dda771..4368561 100644 +--- a/src/pch.c ++++ b/src/pch.c +@@ -1742,7 +1742,7 @@ another_hunk (enum diff difftype, bool rev) + break; + case '=': + ch = ' '; +- /* FALL THROUGH */ ++ FALLTHROUGH; + case ' ': + if (fillsrc > p_ptrn_lines) { + free(s); +@@ -1763,7 +1763,7 @@ another_hunk (enum diff difftype, bool rev) + p_end = fillsrc-1; + return -1; + } +- /* FALL THROUGH */ ++ FALLTHROUGH; + case '+': + if (filldst > p_end) { + free(s); +-- +1.8.3.1 +
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="scm">git</param> <param name="url">git@gitee.com:src-openeuler/patch.git</param> - <param name="revision">3af8462de5aa6673d6e60512bf3ec6d88a2e184e</param> + <param name="revision">master</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2