Topic: hunk FAILED - Help with running patch upgrade

Hi Friends,

I searched the forum for "hunk FAILED" and was surprised there was only one result (which didn't help).  Is this because everyone that runs the patch either doesn't have problems, or is so smart they don't need help?

Well, I don't fall into either of those camps!  big_smile

Here is what I got when I ran the upgrade patch:   punbb-1.2.14_to_1.2.15.patch.txt

patching file admin_categories.php
patching file admin_forums.php
patching file admin_loader.php
patching file admin_maintenance.php
patching file admin_options.php
patching file admin_prune.php
patching file admin_ranks.php
patching file admin_users.php
patching file extern.php
patching file footer.php
Hunk #1 succeeded at 155 (offset 16 lines).
patching file header.php
patching file include/common.php
patching file include/dblayer/mysql.php
patching file include/dblayer/mysqli.php
patching file include/dblayer/pgsql.php
patching file include/dblayer/sqlite.php
patching file include/email.php
patching file include/functions.php
patching file include/template/admin.tpl
patching file include/template/help.tpl
patching file include/template/main.tpl
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file include/template/main.tpl.rej
patching file include/template/maintenance.tpl
patching file include/template/redirect.tpl
patching file install.php
patching file misc.php
patching file moderate.php
patching file post.php
Hunk #1 succeeded at 129 (offset 1 line).
patching file profile.php
patching file register.php
patching file search.php
patching file style/imports/base.css
patching file userlist.php

First ?:  What are the offset lines?
Second ?: Can I assume all the patching went fine (other than the one failure)? 

I see one FAILED (I was expecting more... so this is good, right?)   So, I opened up main.tpl.rej and see this:

***************
*** 1,6 ****
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  
- <html dir="<pun_content_direction>">
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
  <pun_head>
--- 1,6 ----
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  
+ <html xmlns="http://www.w3.org/1999/xhtml" dir="<pun_content_direction>">
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
  <pun_head>

So, what am I looking at, and what do I still need to do?

Thanks in advance for any help you can provide!

Rob Ludlow 
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews

Re: hunk FAILED - Help with running patch upgrade

The same thing happened to me, it's no big deal.

First, you're right, only the changes in main.tpl have failed. The rest is fine.

He wanted to add xmlns="http://www.w3.org/1999/xhtml" to the html tag, and failed. You can do that by hand, delete the .rej, and you'll be fine.

Don't forget to run the .php update file to update the database scheme too.

Re: hunk FAILED - Help with running patch upgrade

Thanks Jérémie!  So, the "+" and "-" in the .rej file show what is there and what the patch is trying to replace it with?

Any ideas why that wouldn't have worked?  Of all the modded files on my forum where I was expecting problems... this was the least I thought I'd have any problems with (seems like a simple change compared to all the others).

Thanks again!

Rob Ludlow 
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews

4 (edited by Jérémie 2007-04-15 13:41)

Re: hunk FAILED - Help with running patch upgrade

Yep. You can open the .patch file in any text editor to see what he wants to do, it's pretty clear (search this, replace with that).

And nope, no idea. It failed on mine, but I already edited that part a long time ago, my main.tpl started with this :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html dir="<pun_content_direction>" xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>

So it's easy to see how that could confuse the diff util.