You are not logged in.

#1 2017-06-11 13:29:52

EFarmer
Member
Registered: 2017-01-01
Posts: 52

Precise path file to patch

I have this patch:

--- do.c	2015-03-10 07:43:04.000000000 -0500
+++ /home/userx/Downloads/do.c	2015-03-10 13:35:58.254807970 -0500
@@ -63,6 +63,7 @@
 #define FIRST_UP_HPVENDOR2        0xff010000
 #define FIRST_UP_MSVENDOR		0xff000000
 #define FIRST_UP_CUSTOM		0x00ff0000
+#define FIRST_UP_ASUSVENDOR	0xff310000
 #define FIRST_UP_LOGIVENDOR	0xffbc0000
 #define FIRST_UP_LOGIVENDOR2   0xff090000
 #define FIRST_UP_LOGIVENDOR3   0xff430000

how can I make so that when I run `patch -Np1 -i "this.patch"` it automatically patches at "./include/do.c" without asking me the actual path?

Last edited by EFarmer (2017-06-11 13:42:33)

Offline

#2 2017-06-11 13:38:29

loqs
Member
Registered: 2014-03-06
Posts: 19,114

Re: Precise path file to patch

Combination of the correct number of path elements to remove using the -p parameter and manually changing directory first or using

man 1 patch wrote:

       -d dir  or  --directory=dir
          Change to the directory dir immediately, before doing anything else.

Please post code in code tags.

Offline

#3 2017-06-11 13:44:12

EFarmer
Member
Registered: 2017-01-01
Posts: 52

Re: Precise path file to patch

loqs wrote:

Combination of the correct number of path elements to remove using the -p parameter and manually changing directory first or using

man 1 patch wrote:

       -d dir  or  --directory=dir
          Change to the directory dir immediately, before doing anything else.

Please post code in code tags.

fixed.. So the patch command should be `patch -d ./include/ -Np1 -i "../this.patch"`?

Last edited by EFarmer (2017-06-11 13:44:38)

Offline

#4 2017-06-11 13:49:52

loqs
Member
Registered: 2014-03-06
Posts: 19,114

Re: Precise path file to patch

EFarmer wrote:

fixed.. So the patch command should be `patch -d ./include/ -Np1 -i "../this.patch"`?

Yes if the command worked and the result was correct.

Offline

#5 2017-06-11 15:03:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,546
Website

Re: Precise path file to patch

Is there a file ./include/home/userx/Downloads/do.c and is that the file you want to patch?  I doubt it.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB