Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot]  [PATCH v3 0/2] fix build using old versions of patch
@ 2016-01-24 13:19 Ricardo Martincoski
  2016-01-24 13:19 ` [Buildroot] [PATCH v3 1/2] package/libsoil: " Ricardo Martincoski
  2016-01-24 13:19 ` [Buildroot] [PATCH v3 2/2] docs/manual: patches that change files with spaces in the name Ricardo Martincoski
  0 siblings, 2 replies; 9+ messages in thread
From: Ricardo Martincoski @ 2016-01-24 13:19 UTC (permalink / raw)
  To: buildroot

This patch series makes libsoil (currently the only package that
patches a file with spaces in the name) to build fine even in very old
distros. I tested using patch 2.5 (from 1997) compiled from its tarball
in a Ubuntu 14.04 host system.
The patch series also updates the manual to describe the workaround
needed in such cases (when a patch need to be applied to a file with
spaces in the name).

Anyone willing to help by testing on a RHEL4 or RHEL5 after the
code-review? See
http://autobuild.buildroot.net/results/ea7/ea77d6b23aca0cb1cf527e6c16ddf5eba957a69c/

Some background:

patch version 2.7 or later is required to apply patches (generated by
 diff v3.3) that change a file with space in the name

The output of "diff -purN" when there are spaces in the name of a
changed file depends on the tool version:
 diff <= v3.2 does not add double quotes to filenames with spaces
 diff >= v3.3 adds double quotes to filenames with spaces
Tests were performed using the versions 3.2 and 3.3 from
http://ftp.gnu.org/gnu/diffutils/

The tool 'patch' can handle patches with spaces in the name of a
changed file depending on the tool version:
 patch <= 2.5.4 cannot handle spaces in filenames
 patch >= 2.5.9 can handle unquoted filenames with spaces
 patch >= 2.7 can handle both quoted and unquoted filenames
Tests were performed using all versions with tarball available at
http://ftp.gnu.org/gnu/patch/

If the patch file is just edited to remove the quote (added by
 diff >= v3.3) around the filename, it would become applicable by
patch >= 2.5.9

RHEL5 and RHEL4 use patch 2.5.4. (Thomas P)
There are still users that build using these distros. (Thomas DS)

Symlink and hard link cannot be used because patch unlinks them.
But the file can be renamed by a hook before patched.
And the patched file can be renamed back by another hook, if needed.

Ricardo Martincoski (2):
  package/libsoil: fix build using old versions of patch
  docs/manual: patches that change files with spaces in the name

 docs/manual/patch-policy.txt            | 16 ++++++++++++++++
 package/libsoil/0001-fix-makefile.patch |  6 +++---
 package/libsoil/libsoil.mk              |  8 +++++++-
 3 files changed, 26 insertions(+), 4 deletions(-)

--- 
Changes v2 -> v3:
 - remove quotes (Arnout) (I missed the same suggestion from Thomas P)
 - say "post-extract" instead of "POST_EXTRACT"
 - prefer quotes rather than backslash in the rename hook (Arnout)
 - there is no strong argument to use post-extract instead of pre-patch
   (Arnout)
 - fix minor spelling mistakes
 - Arnout suggested to drop the patch to the manual:
   "I think that this situation is so exotic that it doesn't warrant a
   mention in the manual. The manual is already long and complicated
   enough."
   I updated the manual for now because it is a separate patch that can
   be Rejected if others agree with Arnout.

Changes v1 -> v2:
 - remove prerequisite patch >= 2.5.9 (added by v1)
 - use 1 or 2 hooks to rename the file that contains spaces
   (based on the suggestion to use a symlink from Thomas DS)
 - change the patch file to be applied on the renamed file
 - update the manual entry
 - do not use the 2nd rename hook for libsoil (Thomas P)
-- 
1.9.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-02-20 22:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-24 13:19 [Buildroot] [PATCH v3 0/2] fix build using old versions of patch Ricardo Martincoski
2016-01-24 13:19 ` [Buildroot] [PATCH v3 1/2] package/libsoil: " Ricardo Martincoski
2016-01-24 14:31   ` Arnout Vandecappelle
2016-01-25 22:35   ` Thomas Petazzoni
2016-02-20 22:26     ` Peter Korsgaard
2016-01-24 13:19 ` [Buildroot] [PATCH v3 2/2] docs/manual: patches that change files with spaces in the name Ricardo Martincoski
2016-01-24 16:20   ` Yann E. MORIN
2016-01-24 20:48     ` Ricardo Martincoski
2016-01-24 21:08       ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox