Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No error returned if patching is aborted due to existing .orig file #60

Open
fmarier opened this issue Apr 18, 2019 · 0 comments
Open

Comments

@fmarier
Copy link

fmarier commented Apr 18, 2019

Given the following a.txt file:

1
2
3

and the following working.patch:

--- a.txt	2019-03-28 17:02:04.832004033 -0700
+++ b.txt	2019-03-28 17:02:34.999576803 -0700
@@ -1,4 +1,4 @@
-1
+0
 2
 3

Patching will fail if a.txt.orig already exists:

$ touch a.txt.orig
$ ./patch.py --debug working.patch && echo Success!
   DEBUG reading working.patch
   DEBUG crlf: 0  lf: 5  cr: 0	 - file: b.txt hunk: 1
   DEBUG -  1 hunks for a.txt
   DEBUG total files: 1  total hunks: 1
   DEBUG normalize filenames
   DEBUG     patch type = plain
   DEBUG     source = a.txt
   DEBUG     target = b.txt
   DEBUG processing 1/1:	 a.txt
   DEBUG  hunk no.1 for file a.txt  -- is ready to be patched
 WARNING can't backup original file to a.txt.orig - aborting
Success!

$ cat a.txt
1
2
3

but the program will exit successfully instead of returning an error.

fmarier added a commit to fmarier/python-patch that referenced this issue Apr 18, 2019
fmarier added a commit to brave/brave-core that referenced this issue Jul 5, 2019
This will prevent silent errors when `.orig` files already exist
and interfere with `npm run apply_patches`.

See techtonik/python-patch#60.
fmarier added a commit to brave/brave-core that referenced this issue Jul 8, 2019
This will prevent silent errors when `.orig` files already exist
and interfere with `npm run apply_patches`.

See techtonik/python-patch#60.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant