View previous topic :: View next topic |
Author |
Message |
rabcor Apprentice
Joined: 05 Apr 2012 Posts: 200
|
Posted: Fri May 30, 2014 3:13 pm Post subject: Change Portage's Patch Command |
|
|
I'm getting an error while patching the kernel, someone suggested to try patching it with -p1, but portage's default patch command is -p0.
Quote: | PATCH COMMAND: patch -p0 -g0 -E --no-backup-if-mismatch < '/etc/portage/patches/sys-kernel/gentoo-sources/ACS_Override.patch'
==============================
can't find file to patch at input line 9
Perhaps you used the wrong -p or --strip option? |
How can I change that command? And if that solves my problem, is there a way I can inform portage to use -p1 instead of -p0 for that patch in future updates?
If this cannot be done, then at least how can I manually apply these patches with a different method (not through /etc/portage/patches)?
Edit: I looked up the manual of patch, seems that changing this command does indeed not solve my problem in that particular case, but it would still be nice to know how to change this line. _________________ This picture was my biggest reason for ever trying Gentoo <3 |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54239 Location: 56N 3W
|
Posted: Fri May 30, 2014 5:15 pm Post subject: |
|
|
rabcor,
epatch tries -p0 ... -p6 before it gives up _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
rabcor Apprentice
Joined: 05 Apr 2012 Posts: 200
|
Posted: Sat May 31, 2014 6:17 am Post subject: |
|
|
My bad! Thanks for clarifying _________________ This picture was my biggest reason for ever trying Gentoo <3 |
|
Back to top |
|
|
piotr5 Tux's lil' helper
Joined: 14 Dec 2012 Posts: 117
|
Posted: Sun Jun 01, 2014 10:23 am Post subject: |
|
|
sorry for abducting this thread, but I still have to ask: how do you actually change the patch commands for user-patches? what file is that command contained in?
my problem is sometimes patches I provide in /etc/portage/patches/... fail because the directory in which the patch is being applied isn't the directory with the sourcecode. i.e. manually applying the patch works, also if I include the patch into the ebuild file it works, but emerge doesn't manage to do it automatically as a user-patch. obviously a bug. how do I hunt this bug? where to start?
not saying this bug actually exists, maybe new versions of portage have fixed it. just curious... |
|
Back to top |
|
|
EmaRsk Apprentice
Joined: 07 Sep 2004 Posts: 158 Location: Italy
|
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21635
|
Posted: Sun Jun 01, 2014 3:07 pm Post subject: |
|
|
You should not change the patch command. You should change the patch file so that it works with the default patch command. The failed patch commands should be shown in one of the logs generated when epatch_user fails. Best practice is that the patch file should specify a relative path rooted at $S. Many patches have a single leading directory, often in the git convention of a/ for old and b/ for new. |
|
Back to top |
|
|
piotr5 Tux's lil' helper
Joined: 14 Dec 2012 Posts: 117
|
Posted: Mon Jun 02, 2014 1:36 pm Post subject: |
|
|
thanks for this link, I'll investigate from here. seems there is no change directory happening there though...
@Hu: guess you didn't read my posting carefully enough, I said it's a bug in portage and not in the patch, which I'm trying to fix! for example whenever I'm upgrading gentoo I recently had to do so with cmake excluded. angry at that inconvenience I searched for a solution and discovered a patch at https://bugs.gentoo.org/show_bug.cgi?id=468622. but this patch doesn't get applied. contents of /var/tmp/portage/dev-util/cmake-2.8.12.2/temp/cmake-2.8.12.1-FindCurses.patch.out: Code: | ***** cmake-2.8.12.1-FindCurses.patch *****
PWD: /usr/lib64/portage/pym
===========================================
PATCH COMMAND: patch -p0 -g0 -E --no-backup-if-mismatch < '/etc/portage/patches//dev-util/cmake-2.8.12.2/cmake-2.8.12.1-FindCurses.patch'
===========================================
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- cmake-2.8.12.1-orig/Modules/FindCurses.cmake 2013-11-06 06:07:22.000000000 +1100
|+++ cmake-2.8.12.1/Modules/FindCurses.cmake 2014-01-17 21:55:40.630142386 +1100
--------------------------
No file to patch. Skipping patch.
3 out of 3 hunks ignored
patch program exited with status 1
===========================================
PATCH COMMAND: patch -p1 -g0 -E --no-backup-if-mismatch < '/etc/portage/patches//dev-util/cmake-2.8.12.2/cmake-2.8.12.1-FindCurses.patch'
===========================================
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- cmake-2.8.12.1-orig/Modules/FindCurses.cmake 2013-11-06 06:07:22.000000000 +1100
|+++ cmake-2.8.12.1/Modules/FindCurses.cmake 2014-01-17 21:55:40.630142386 +1100
--------------------------
No file to patch. Skipping patch.
3 out of 3 hunks ignored
patch program exited with status 1
===========================================
PATCH COMMAND: patch -p2 -g0 -E --no-backup-if-mismatch < '/etc/portage/patches//dev-util/cmake-2.8.12.2/cmake-2.8.12.1-FindCurses.patch'
===========================================
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- cmake-2.8.12.1-orig/Modules/FindCurses.cmake 2013-11-06 06:07:22.000000000 +1100
|+++ cmake-2.8.12.1/Modules/FindCurses.cmake 2014-01-17 21:55:40.630142386 +1100
--------------------------
No file to patch. Skipping patch.
3 out of 3 hunks ignored
patch program exited with status 1
===========================================
PATCH COMMAND: patch -p3 -g0 -E --no-backup-if-mismatch < '/etc/portage/patches//dev-util/cmake-2.8.12.2/cmake-2.8.12.1-FindCurses.patch'
===========================================
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- cmake-2.8.12.1-orig/Modules/FindCurses.cmake 2013-11-06 06:07:22.000000000 +1100
|+++ cmake-2.8.12.1/Modules/FindCurses.cmake 2014-01-17 21:55:40.630142386 +1100
--------------------------
No file to patch. Skipping patch.
3 out of 3 hunks ignored
patch program exited with status 1
===========================================
PATCH COMMAND: patch -p4 -g0 -E --no-backup-if-mismatch < '/etc/portage/patches//dev-util/cmake-2.8.12.2/cmake-2.8.12.1-FindCurses.patch'
===========================================
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- cmake-2.8.12.1-orig/Modules/FindCurses.cmake 2013-11-06 06:07:22.000000000 +1100
|+++ cmake-2.8.12.1/Modules/FindCurses.cmake 2014-01-17 21:55:40.630142386 +1100
--------------------------
No file to patch. Skipping patch.
3 out of 3 hunks ignored
patch program exited with status 1 | then I switch to root, cd to /var/tmp/portage/dev-util/cmake-2.8.12.2/work/cmake-2.8.12.2/ and execute Code: | patch -p1 -g0 -E --no-backup-if-mismatch < '/etc/portage/patches//dev-util/cmake-2.8.12.2/cmake-2.8.12.1-FindCurses.patch' | and it works. any idea how to change the patch for the same result? unfortunately the patch command doesn't accept absolute directories, neither ".." directories seem to manage getting out of /usr/lib64/portage/pym into the working source directory. so obviously I must alter the sourcecode of portage itself... |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21635
|
Posted: Tue Jun 03, 2014 1:19 am Post subject: |
|
|
I read it, but it is depressingly common for people to claim that there is a bug in core software when in fact they are simply misusing the software in question. From your initial vague description after the thread hijack, I read it to mean that the patch had been generated with incorrect path information, which is also a very common mistake. Now that you have provided the actual error text, I agree that it seems suspicious that the PWD line references a Portage directory. |
|
Back to top |
|
|
piotr5 Tux's lil' helper
Joined: 14 Dec 2012 Posts: 117
|
Posted: Tue Jun 03, 2014 3:52 pm Post subject: |
|
|
no problem.
btw, for people searching for a solution to the problem with compiling cmake in ncurses[tinfo] environment: the patch is already part of gentoo, just unmask it for your arch and upgrade to the 2.8.12.2-r1 version... |
|
Back to top |
|
|
|