summaryrefslogtreecommitdiff
path: root/patch.man
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2012-04-17 16:13:08 +0200
committerAndreas Gruenbacher <agruen@linbit.com>2012-04-17 16:48:19 +0200
commit9a26fde226660a628d58ed7d987a71b9a4123244 (patch)
treef19871a06ea2300e4e170a383733a91715f8dac2 /patch.man
parentb9a1ff0cfa3144f212b4f1c3923c3b3c281e2240 (diff)
downloadpatch-9a26fde226660a628d58ed7d987a71b9a4123244.tar.gz
Only warn when trying to modify read-only files
Failing when trying to patch read-only files causes various users of patch to break. Instead, warn by default and introduce a command line option for choosing a different behavior. * patch.man: Describe the new behavior and command-line option. * src/patch.c (read_only_behavior): New variable. (main): Implement the new behavior. (longopts): Add the new --read-only option. (option_help): Describe the new behavior. (get_some_switches): Recognize the new --read-only option.
Diffstat (limited to 'patch.man')
-rw-r--r--patch.man8
1 files changed, 6 insertions, 2 deletions
diff --git a/patch.man b/patch.man
index 02e6b90..b0ee8c1 100644
--- a/patch.man
+++ b/patch.man
@@ -314,6 +314,10 @@ and patches should be generated by
.B "diff\ \*=binary"
when line endings are significant.)
.TP
+\fB\*=read\-only=\fP\fIbehavior\fP
+Behave as requested when trying to modify a read-only file: \fBignore\fP the
+potential problem, \fBwarn\fP about it (the default), or \fBfail\fP.
+.TP
\fB\-c\fP or \fB\*=context\fP
Interpret the patch file as a ordinary context diff.
.TP
@@ -356,8 +360,8 @@ removes a file, it also attempts to remove any empty ancestor directories.
\fB\-f\fP or \fB\*=force\fP
Assume that the user knows exactly what he or she is doing, and do not
ask any questions. Skip patches whose headers
-do not say which file is to be patched; patch files even though they are
-read-only or have the wrong version for the
+do not say which file is to be patched; patch files even though they have the
+wrong version for the
.B Prereq:\&
line in the patch; and assume that
patches are not reversed even if they look like they are.