views:

21

answers:

1

I'm trying to patch HtmlUnit with the patches at the bottom of this page. I can see how to apply patches from Eclipse, but I can't figure out how to apply these particular patches. I had the JARs initially, but then I realised I'd need to source, so I obtained those, but still no luck.

In the patch I see:

--- a/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java

and etc. but what is up with the 'a/htmlunit'? I have the packages and "src/main/java/com/gargoylesoftware/htmlunit/WebClient.java" (for example) is easily locatable, but not a/htmlunit. I can't really figure out how to apply this.

Can anyone help?

+2  A: 

Usually, patches come with prefixes, kind of like putting the previous version in directory a, and the new version in directory b and just diffing them to produce the patch, only with version control systems, you don't really need to do that anymore. Most still do I suppose (at least git does by default).

Anyway, patch-tools have an option to skip a number of directory levels as prefix, in your case you'd have to skip two (a and htmlunit). Unfortunately, I don't know how this is done in eclipse, with vanilla unix patch you would need to add a -p2 parameter. Poke around the UI, it ought to be there somewhere.

roe