Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 674538 - =sys-devel/patch-2.7.6-r2: patch re-applies already applied patch successfully
Summary: =sys-devel/patch-2.7.6-r2: patch re-applies already applied patch successfully
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL: http://savannah.gnu.org/bugs/index.ph...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-04 21:28 UTC by Sergei Trofimovich (RETIRED)
Modified: 2020-03-04 17:43 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
no-op-ccache-patch.patch (no-op-ccache-patch.patch,3.36 KB, patch)
2019-01-04 21:28 UTC, Sergei Trofimovich (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Trofimovich (RETIRED) gentoo-dev 2019-01-04 21:28:55 UTC
Created attachment 559880 [details, diff]
no-op-ccache-patch.patch

It's a bit confusing to see patch applied successfully.

I suggest two things:
- for existing EAPIs issue QA warning when patch did nothing
- for EAPI=8 issue an error if patch command had no effect.

Attaching example on top of ::gentoo's be5c4a9d9cda0adbb1734314bbeadb0ece0eabe6 tree.
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2019-01-04 21:35:54 UTC
Ah, it actually gets applied multiple times. I'll take it upstream.
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2019-01-04 21:38:36 UTC
Executing
    $ cat P/ccache-3.5.1-configure.patch | patch -p1 -s -g0 --no-backup-if-mismatch

applies patch multiple times.

$ ccache-3.5.1:git diff | cat
diff --git a/configure b/configure
index 69325b6..0f581e3 100755
--- a/configure
+++ b/configure
@@ -643,6 +643,8 @@ more_warnings
 include_dev_mk
 getopt_long_c
 getopt_long_c
+getopt_long_c
+getopt_long_c
 extra_libs
 disable_man
 host_os
@@ -4726,6 +4728,14 @@ fi
 done
 
 
+if test x"$ac_cv_func_getopt_long" != x"yes"; then
+    getopt_long_c="src/getopt_long.c"
+fi
+
+if test x"$ac_cv_func_getopt_long" != x"yes"; then
+    getopt_long_c="src/getopt_long.c"
+fi
+
 if test x"$ac_cv_func_getopt_long" != x"yes"; then
     getopt_long_c="src/getopt_long.c"
 fi
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2019-01-04 21:47:09 UTC
Filed upstream bug as:
    http://savannah.gnu.org/bugs/index.php?55393
Comment 4 Zac Medico gentoo-dev 2019-01-04 22:33:20 UTC
(In reply to Sergei Trofimovich from comment #3)
> Filed upstream bug as:
>     http://savannah.gnu.org/bugs/index.php?55393

First comment says:

> In automated environments, -F0 is generally a good idea.

Maybe we should make that the eapply default for next EAPI.

Meanwhile, eapply callers can specify -F0 in the eapply arguments.
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2019-01-04 23:01:35 UTC
Sounds good! Filed bug #674562 for PMS consideration. Bouncing back to dev-portage@ to portage-side changes.
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2020-03-04 17:43:36 UTC
Was rejected by PMS team in https://bugs.gentoo.org/674562#c17. I'll fall back to local hacks to catch such cases. Another one happened in https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e744aedf9ec1e2f374acebe42b6d7482e1324618.