8 replies [Last post]
chum's picture
Offline
Joined: 02/27/2009
Juice: 151
Was this information Helpful?

I'd like to apply this patch (see attached) to the page_title module. The patch documentation at http://drupal.org/patch/apply is confusing me a bit, as it lists two different ways to apply patches, depending on how the patch was written (made relative to the Drupal root directory or not.)

Can someone offer some assistance as to how I would proceed?

I put the patch file within the /modules/page_title directory and when I run patch -p0 < page_title_w_tax.patch the following errors are displayed:

w_tax.patch
patching file page_title.install
Hunk #1 FAILED at 32.
1 out of 1 hunk FAILED -- saving rejects to file page_title.install.rej
patching file page_title.module
Hunk #1 FAILED at 220.
Hunk #2 FAILED at 266.
Hunk #3 FAILED at 294.
Hunk #4 FAILED at 381.
4 out of 4 hunks FAILED -- saving rejects to file page_title.module.rej

Help? What am I doing wrong?

Chum

PreviewAttachmentSize
page_title_w_tax.patch4.77 KB
cedarm's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 08/29/2008
Juice: 100
line endings?

Firstly, make sure you are patching the correct version that the patch was create for. Since all hunks failed, that's likely not the problem.

It's possible that the files you are trying to patch contain dos style line endings, and it looks like this patch contains unix style line endings. If you're on linux, try running dos2unix on the page_title.install and page_title.module files first, then reapply the patch. If your on windows, you can go the other way and convert the patch file to dos line endings just by opening and saving it in wordpad (not notepad).

chum's picture
Offline
Joined: 02/27/2009
Juice: 151
Re: line endings?

I ran the .install and .module files through dos2unix and then attempted the patch once again. This time 3 out of 5 hunks failed:

patching file page_title.install
Hunk #1 FAILED at 32.
1 out of 1 hunk FAILED -- saving rejects to file page_title.install.rej
patching file page_title.module
Hunk #1 FAILED at 220.
Hunk #2 FAILED at 266.
Hunk #3 succeeded at 257 (offset -37 lines).
Hunk #4 succeeded at 402 with fuzz 2 (offset 21 lines).
2 out of 4 hunks FAILED -- saving rejects to file page_title.module.rej

Any other ideas?

Thanks,
Chum

cedarm's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 08/29/2008
Juice: 100
wrong version?

What version of page_title are you trying to apply this to? I grabbed a few versions and it applies cleanly to page_title-6.x-1.x-dev. I suspect you're trying to apply it to 6.x-2.0?

chum's picture
Offline
Joined: 02/27/2009
Juice: 151
Re: wrong version?

Yes, my Ubercart site is in fact a 2.0 site so I was in fact trying to apply the patch to page_title-6.x-2.0.

So now I guess my questions are, can the patch be updated so it can be applied to the 2.0 version of the module? OR, can the patched 6.x-1.x-dev version of the module be updated to work with Ubercart 2.0?

cedarm's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 08/29/2008
Juice: 100
ask page_title

It doesn't appear that this patch actually has anything to do with Ubercart. I suggest you post a support request in the page_title issue queue on drupal.org. They should be able to help you out with porting the patch (if it's even needed for the 2.x version).

So, keep dos2unix in mind for future patching. It still bites me occasionally.

shushu.i's picture
Offline
Joined: 11/25/2009
Juice: 24
Thanks

As you said, Unix/DOS issues.
Had to take out old tricks:
find ./ -type f|grep -v CVS|xargs perl -pi -e 's-\r\n-\n-'

Shushu

uglyfad's picture
Offline
Joined: 09/26/2009
Juice: 4
using local install

how do i apply a patch on a localhost install, windows xp sp2 running xampp. thanks in advance.

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
I like to use the GnuWin

I like to use the GnuWin project. You'll have to download the patch.exe installer and put the resulting GnuWin folder in your path, probably. Then, you can use it just like you do on a UNIX machine:

  cd ubercart
  patch -p0 < filename.patch