#773591 new patch(1) in jessie refuses to work on symlinks

Package:
patch
Source:
patch
Description:
Apply a diff file to an original
Submitter:
Michael Tokarev
Date:
2015-02-02 14:33:13 UTC
Severity:
important
#773591#5
Date:
2014-12-20 12:45:51 UTC
From:
To:
patch(1) utility in jessie refuses to work on symlinks.  When the file
to be patched is a symlink, it produces the following error message:

  File FOO is not a regular file -- refusing to patch
  1 out of 1 hunk ignored -- saving rejects to file FOO.rej

This makes patch(1) basically useless for many our users.

The problem is that our workflow is hugely based around "local patching"
of symlinked trees.  For example, given an original linux kernel source
tree, symlink it to a temp directory (maybe on a separate tmpfs) apply some
local patch and build it (with ccache).

wheezy version of patch(1) just replaced a symlink with a patched
file and all was well.  jessie version just refuses to work.

For now I downgraded patch(1) package to the one from wheezy and added
an apt-preferencs pin for it.

Thanks,

/mjt

#773591#10
Date:
2015-02-02 14:00:18 UTC
From:
To:
 Yes, this is fixed in Debian now. I should check Debian #773591 [1].
On the other hand, upstream #44149 [2] will be fixed later, right? I
think the best would be to disable that test on non-Linux platforms
for now.

Thanks,
Laszlo/GCS
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=773591
[2] http://savannah.gnu.org/bugs/?44149

#773591#15
Date:
2015-02-02 14:29:10 UTC
From:
To:
Note that by default, patch-2.7.4 will still refuse to treat symlinks
as files and
replace them with patched versions of the files the symlinks point to
by default.
This behavior can be achieved with the --follow-symlinks option, though.