OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Installing a patch?

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Installing a patch?

Postby Sherman » Mon Oct 30, 2006 1:09 pm

Call me a technofool, but I have no idea how to install a patch on OJS. I'm sure there must be some simple way to do it, but I couldn't figure it out. Help!

:shock:
Sherman
 
Posts: 60
Joined: Sat Dec 10, 2005 8:18 pm
Location: Tampa, FL

Postby asmecher » Tue Oct 31, 2006 3:20 am

Hi Sherman,

If you're using a Unix-like platform, use a command line like the following from inside the OJS directory:
Code: Select all
patch -p0 --dry-run < /path/to/patch_file
The --dry-run option will cause the patch tool to pretend to apply the patch without actually changing anything -- this is useful to check whether or not you'll encounter any conflicts when you actually apply the patch. Remove the option to actually apply the patch.

Regards,
Alec Smecher
Open Journal Systems Team
asmecher
 
Posts: 8316
Joined: Wed Aug 10, 2005 12:56 pm

Postby Sherman » Tue Oct 31, 2006 5:02 am

asmecher wrote:If you're using a Unix-like platform, use a command line like the following from inside the OJS directory:...


Ah... since I don't have shell access via my ISP, it's time to ask them for the equivalent, I suspect.
Sherman
 
Posts: 60
Joined: Sat Dec 10, 2005 8:18 pm
Location: Tampa, FL

Postby asmecher » Wed Nov 01, 2006 5:44 am

Hi Sherman,

In this case, unfortunately, you'll probably have to upload the modified files by hand via FTP or something similar.

Regards,
Alec Smecher
Open Journal Systems Team
asmecher
 
Posts: 8316
Joined: Wed Aug 10, 2005 12:56 pm

Postby jasonnolan » Thu Jan 04, 2007 6:35 am

Hi Alec;

I got the patch file from http://pkp.sfu.ca/cvs/cvsweb.cgi/ojs2/p ... 36;r2=1.37
got into my journal directory, and pico-ed a file and dumped the contents in there, and then ran the command "patch -p0 --dry-run ./filename" and waited forever and nothing happened. Should I get feedback? Does "inside the OJS directory:" refer to anywhere in the directory tree? at the top (/journal/)? Or in some sub directory?

thanks
jasonnolan
 
Posts: 34
Joined: Sun Dec 12, 2004 2:59 am

Postby asmecher » Thu Jan 04, 2007 10:39 am

Hi Jason,

You're missing the "<" symbol in the command line posted above. With the patch you're using, if you're in the OJS installation directory (i.e. the same directory that contains config.inc.php), you'll need to use a -p value of 1, i.e:
Code: Select all
patch -p1 --dry-run < /path/to/patch_file
When you've checked that everything looks OK -- no error messages -- remove the --dry-run option and run it again.

Regards,
Alec Smecher
Open Journal Systems Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8316
Joined: Wed Aug 10, 2005 12:56 pm

Postby jasonnolan » Thu Jan 04, 2007 3:13 pm

thanks. Don't know how I missed this.
I ran the patch, and got the following:

[sunset]$ patch -p1 --dry-run < ./RTHandler.inc.php.diff.txt
patching file pages/rt/RTHandler.inc.php
Hunk #1 FAILED at 10.
Hunk #6 succeeded at 232 (offset -10 lines).
Hunk #7 succeeded at 273 (offset -10 lines).
Hunk #8 succeeded at 307 (offset -10 lines).
Hunk #9 succeeded at 332 (offset -10 lines).
1 out of 9 hunks FAILED -- saving rejects to file pages/rt/RTHandler.inc.php.rej

what can I do now?
jasonnolan
 
Posts: 34
Joined: Sun Dec 12, 2004 2:59 am

Postby jasonnolan » Thu Jan 04, 2007 3:49 pm

being lazy, I went and edited the file by hand. I thought it would be harder. Everything's working fine now. THANKS for help past, present, and future. Everyone on our journal LOVES the new system, or says they will when I get all the bugs out.
jasonnolan
 
Posts: 34
Joined: Sun Dec 12, 2004 2:59 am

Postby asmecher » Thu Jan 04, 2007 11:44 pm

Hi Jason,

Glad to hear it's working -- typically the first hunk in a patch is a change in comments to reflect the file's new version number, so you can often ignore the error messages. When you get line offsets but the patch applies OK, you're usually OK.

Regards,
Alec Smecher
Open Journal Systems Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8316
Joined: Wed Aug 10, 2005 12:56 pm

Postby Sherman » Wed Jan 24, 2007 8:12 pm

asmecher wrote:Glad to hear it's working -- typically the first hunk in a patch is a change in comments to reflect the file's new version number, so you can often ignore the error messages. When you get line offsets but the patch applies OK, you're usually OK.


My concern with applying a patch automatically is that I've modified some of the code to customize OJS for my needs, and ... yikes! what if the line #s mess up because of that customization?

I suppose I should buckle down and do it manually... in my copious spare time!
Sherman
 
Posts: 60
Joined: Sat Dec 10, 2005 8:18 pm
Location: Tampa, FL

Postby asmecher » Thu Jan 25, 2007 10:47 am

Hi Sherman,

Unified diffs (the kind we use) are typically quite good at skirting around modifications. If you've modified the particular lines that are being patched, you'll get a rejection warning and you'll have to reconcile the changes yourself; if not, they'll generally be patched, even if the line numbers have changed somewhat.

I'd suggest trying the patch tool out on a copy of your installation; if you can use the patch tool to provide a base for some corrections, you'll save a lot of time.

Regards,
Alec Smecher
Open Journal Systems Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8316
Joined: Wed Aug 10, 2005 12:56 pm

Postby Sherman » Thu Jan 25, 2007 1:05 pm

Thanks!
Sherman
 
Posts: 60
Joined: Sat Dec 10, 2005 8:18 pm
Location: Tampa, FL


Return to OJS Technical Support

Who is online

Users browsing this forum: Google [Bot] and 3 guests