Patching files with spaces in the name

Sam Lawrance boris at brooknet.com.au
Fri Apr 8 05:11:15 PDT 2005


On Thu, 2005-04-07 at 21:31 -0700, Alex Varju wrote:
> Antonio Carlos Venancio Junior wrote:
>  >> Alex Varju wrote:
> >> While I'm sure this question must have come up in the past, I can't 
> >> find anything in the archives.  Is there any good method for patching 
> >> source files with spaces in the name?
> >>
> >> I'm looking at creating an eclipse-devel port for Eclipse 3.1m5a.  
> >> I've already got something working now that allows me to build on 
> >> AMD64 (see the freebsd-java archives if you are interested).  Now I'm 
> >> trying to clean up my work, and one of the problems I've encountered 
> >> is that Eclipse uses spaces in many of their paths.  If I take a diff 
> >> for changes I've made to files within one of these directories, the 
> >> patch won't apply again afterwards.
> >>
> >> Are there any ports that deal with similar problems in an elegant manner?
>  >
>  >     do you have some examples?
> 
> Hi Antonio,
> 
> Yes, I do have an example.  I've attached a diff from the port I have in 
> progress.  The theory is that it should update the file build.sh in the 
> directory "plugins/org.eclipse.swt/Eclipse SWT PI/gtk/library". 
> Unfortunately, because of the spaces in "Eclipse SWT PI", the patch does 
> not work.

One option could be to put the patches in files/ without the patch-
suffix, and apply them in a post-patch target explicitly listing the
files to be patched on the command line, eg.

post-patch:
	@${PATCH} ${PATCH_ARGS} "path/with spaces/somefile" ${FILESDIR}/thepatch





More information about the freebsd-ports mailing list