For example, if I have two files:
file1:
This is file 1
and file2:
This is file 2
and create a patch using the following command:
diff -u file1 file2 > files.patch
result:
@@ -1,1 +1,1 @@
-This is file 1
+This is file 2
Then, if I try to apply this patch to Solaris using the patch command:
patch -u -i files.patch
it freezes:
Looks like a unified context diff.
File to patch:
1. Is there a way to use the native patch command for Solaris with uniform differences?
2. What diff format is considered the most portable if it is impossible to apply a unified format?
Update:
I found the answer in the first part of my question. patchOn Solaris , it seems to freeze if the second file (file2 in this case) exists in the same folder as the first (file1). For example, the following pretty common diff:
@@ -1,2 +1,1 @@
-1
-
+2
will not work with a fairly general fix command:
patch -p1 -u -d a < file.patch
diff ( ):
@@ -1,2 +1,1 @@
-1
-
+2
.
. .