Hunk #1 FAILED at 1. What's that mean?
It is an error generated by patch
. If you would open the .patch
file, you'd see that it's organized in a bunch of segments, so-called "hunks". Every hunk identifies corresponding pieces of code (by line numbers) in the old and new version, the differences between those pieces of code, and similarities between them (the "context").
A hunk might fail if the similarities of a hunk don't match what's in the original file. When you see this error, it is almost always because you're using a patch for the wrong version of the code you're patching. There are a few ways to work around this:
- Get an updated version of
libdvdnav
that already includes the patch (best option). - Get a
.patch
file for the version oflibdvdnav
you're patching. - Patch manually. For every hunk in the patch, try to locate the corresponding file and lines in
libdvdnav
, and correct them according to the instructions in the patch. - Take the version of
libdvdnav
that's closer to whatever version the.patch
file was intended for (probably a bad idea).
How can I ignore line endings when comparing files?
Use the --strip-trailing-cr
option:
diff --strip-trailing-cr file1 file2
The option causes diff
to strip the trailing carriage return character before comparing the files.
Related Topics
How to Configure Gitlab as a Subdomain in Nginix.Conf
Error Message When Setting Up Adt in Linux
Using Google as a Dictionary Lookup via Bash, How Can One Grab The First Definition
Openldap + Dynlist + Posixgroup
Unattended Install of Krb5-User on Ubuntu 16.04
How to Print $ in Shell Script
Replace Forward Slash with Double Backslash Enclosed in Double Quotes
How to Detect If The Script Is Running on a Virtual Machine
How to Get Use Count from Linux Kernel Module
When Will Send() Return Less Than The Length Argument
Setting Environment Variable with Leading Digit in Bash
Bind Outgoing Traffic to Eth0 Instead of Eth0:1
Conditional Awk Hashmap Match Lookup
Git Post-Receive Checkout to Remote Machine
Alternative to Valgrind (Memcheck) for Finding Leaks on Linux
Simulate Effect of Select() and Poll() in Kernel Socket Programming