0

I've downloaded a tarballed version of 0.85 "MTR" -> http://www.bitwizard.nl/mtr/ and installed it.

I later saw that a 0.86 diff file exists. I downloaded this in order to patch it, but am confused how to use the patch command. The first thing that bothers me is that I need to know the originalfile name, right? But there is no file in the folder called mtr.0.85 or something along those lines.

How would I know what the originalfile is? Any pointers greatly appreciated.

Edit: The diff-file has the following content, but I've tried those commands all to no avail.

INSTALLING diff --git a/SECURITY b/SECURITY index 6cfc40b..4ff73a9 100644 --- a/SECURITY +++ b/SECURITY @@ -7,15 +7,16 @@ minimal. Or you can make mtr setuid-root, and the following applies to you...`

Running "patch mtr mtr-0.86.diff" renders the following output: HUNK #1 FAILED AT 16.. until all 9 hunks fails.

ftp://ftp.bitwizard.nl/mtr/mtr-0.86.diff

  • 1
    Please use the edit button underneath your post to add additional information. – s3lph Jan 24 '16 at 19:11
  • 1
    That's either a corrupted patch file or you've broken its formatting – roaima Jan 24 '16 at 19:27
  • @roaima it is only a extract from the file. the total contents can be found here: ftp.bitwizard.nl/mtr/mtr-0.86.diff – Krukan459 Jan 24 '16 at 19:36
2

What you have is an output from git diff (not the usual diff command). You would not use the usual patch program to apply it. Instead, you would use a git tool "apply".

Further reading:

| improve this answer | |
  • Tried it, renders only problems (git apply mtr-0.86.diff) – Krukan459 Jan 24 '16 at 19:56
  • Funny thing is when I ran the "git apply --check mtr-0.86.diff" command, it rendered no problems. then I ran the git apply again, and some output were shown in the terminal. When I run the check again, it says "does not apply" but version is still 0.85. This is doing my head in – Krukan459 Jan 24 '16 at 20:00
  • But git status might show that there are modifications, and that those can be committed. Once you've applied the patch, there's nothing to apply from it, anyway. – Thomas Dickey Jan 24 '16 at 20:03
1

If git(1) gave the diff, you have to use git apply (git uses most of the diff(1) unified format, but adds some git-specific handling).

If applying the patch fails, either (a) the patch got corrupted (i.e., lines deleted/mutilated, tabs expanded, different line ending conventions), or (b) you are trying to apply the patch to a different base (it should work if there are no overlapping modifications, and changes didn't move the places patched too much).

If the patch doesn't apply, you should get a file with the rejects as a byproduct, you can then try to apply the missing changes by hand. Just make sure you save intermediate stages frequently, having to redo the whole mess because of a misapplied change some 30 hunks into the rejects is no fun.

If this exists under git control somewhere, it is probably easier to ask permission to pull/clone.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.