I generated patch using diff
command with the number of context lines as 1 (-c option)
. My patch file contents:
*** /home/sk/abc/def/src/klm/a.py 2015-05-18 16:25:50.348398554 +0530
--- /opt/abc/def/ghi/klm/a.py 2015-05-18 14:27:13.860503469 +0530
***************
*** 72,73 ****
--- 72,74 ----
output, error, rCommand = "", "", ""
+ import subprocess
rCommand = self.copyCmd % (self.executor_hostname, self.testId, self.testId)
When i did cd
to the root directory, /
and tried to apply the patch using patch -p0 < sg.patch
command, I get this prompt,
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:
--------------------------
|*** /home/sk/abc/def/src/klm/a.py 2015-05-18 16:25:50.348398554 +0530
|--- /opt/abc/def/ghi/klm/a.py 2015-05-18 17:10:48.368670076 +0530
--------------------------
File to patch:
Why doesn't the patch command take the file name in second line as the file to patch?