On Sat, Aug 29, 2015 at 11:53:18PM -0500, Bruno Wolff III wrote:
I have a patch for a source file that has DOS line endings and
%patch strips the \r characters causing the patch to fail while
suggesting the use of the --binary option. However the %patch macro
will not accept the binary option.
Is there an easy way to use a patch with DOS line endings or am I
going to need to convert the fix to unix line endins in prep, before
applying the patch?
If the patched file is something like a C source file, then converting
the line endings of the source files in %prep seems like the right
thing to do here.
For example in nekovm.spec:
BuildRequires: dos2unix
# ...
%prep
%setup -q -n neko-%{version}
for f in CHANGES LICENSE `find -name '*.[ch]' -o -name 'install.neko'`;
do
dos2unix --keepdate $f
chmod -x $f
done
%patch0 -p1
%patch1 -p1
%patch2 -p1
# etc
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/