View Full Version : applying patches
25-05-04, 08:53 PM
Ok, my question is not exactly dotproject related, but still applies I think. On sourceforge there are many patches, but there is no consistency between them. Some are unified patches, others patches on single files and yet third are complete modified files.
The problem gets worse as patches are created agains different versions as well.
My question is how should patches be created, especially having in mind that they should be appliable over modified files. As an example in my tasks module I've applied 2-3 published patches, plus a few modifications of my own, and it becomes very difficult to publish new patches and almost impossible to install others' patches. The file becomes too inconsistent for comparing.
It's even harder to work if complete files are installed, because that requires me to get a fresh install, create the patch file between that and the proposed file and try to apply the patch to my current file, which in the end may very well refuse to work.
Basically my question is how to work with more than one patches on the same file in an efficient way (comparing things manually is not considered efficient).
27-05-04, 09:38 AM
In general patches should be created against a known revision, and should be unified diffs (only because they are easier to read if you have to manually patch anything).
If a patch is overlaid over another patch, the patch notes should state the dependency.
Patches against CVS are always problematic and should be discouraged, or at least the DATE of the CVS version is clearly noted in the patch notes.
If a patch fixes a bug then the developers should (although sometimes time doesn't allow) install the patch into the CVS and annotate and announce that the patch is now in the CVS.
When time permits the developers normally clean up the patches and put them into the CVS, or release a "super patch" that contains all of the dependencies for a particular patch.
28-05-04, 11:07 AM
then my next question is how to work with patches that are not entered in the CVS. I had a look at the ChangeLog and most of the patches I use and I've made are not there. That makes if very difficult for me to submit new patches and that shouldn't be discouraged I think ...
I don't mean to be a pain. I'm just starting to work with patches and cvs so I am just asking how exactly is this done in general.
28-05-04, 11:45 AM
As long as you mention what you have referenced the patch against, and what other patches (if any) you have tested it against, this is enough for the developers to work out what is needed to get it into the code. Sure, the average user may have a problem with a combination of patches, but that is the nature of the beast, you will never get a patch system set up that is infallible when patches are donated from developers that don't have access to the CVS.
In general, every month or so (depending upon developer commitments) the patches and bug lists are reviewed and those that are deemed useful are incorporated into the code. It has been a little while since the last review, and I express the collective apologies of the developers, however it will happen and should become more regular as we get more active developers.
03-08-04, 03:23 AM
I have a non-development question regarding the application of patches. One of the patches I downloaded today (gantt chart fix) and went to apply required the use of a patch command. I'm on a windows system (W2K3), and see no patch command. Where does one acquire a patch command that will work in the Windows system?
I looked through SourceForge and here and was not able to get that info. If you can direct me, it would be greatly appreciated.
I love what I see of this product so far, and am just looking to bring it up to the latest fixes now.
Thank you for your patience with this non-developer. :)
03-08-04, 07:36 AM
Patches are normally applied using the GNU utility Patch. You might want to check on www.gnu.org to see if you can find information on Windows versions. Alternatively if you search the forums you will find instructions on how to read a patch file so that you can do the edits manually.
03-08-04, 08:49 AM
you can also try http://www.cygwin.com and install cygwin, which is a windows shell that execute some unix commands, I used it to ran patch successfully.
let me know if you need more help with that.
03-08-04, 11:40 AM
Thank you ajdonnison and Revelation7 for your time and help.
I went to both of those sites... On gnu I did not readily find that patch utility. On cygwin, I downloaded the shell and installed it with no issue. Went into the shell - and alas, the patch command was not part of it. I confirmed that out of the hundreds of files it downloaded, patch was not included. I looked through cygwin and saw packages for the patch. I don't see a means to download the package though - only a listing of all the files. I went through the cygwin help files, and they didn't go into how to load additional packages for the shell.
I realize this must all be old hat and overly simple for coding veterans like you. I'm sorry to bog down this forum with these basics. I really am trying to do research before bothering you, and truly appreciate your assistance.
Thank you again,
Paula (aka "Lisa") :)
03-08-04, 01:15 PM
no worries, we were all new at one time or another.
rerun cygwin setup via web, on the screen to choose packages, expand utils, patch should be half way down, make sure you check the box for binaries. that should do it. Play with it and see if you can figure it out from there. ;)
03-08-04, 09:22 PM
Thank you so very much!
I now have patch installed on my system, and I was able to use patch, and it patched the files perfectly. Prior to this, I made backups of the files, and did it manually, as Gandalf :) had suggested. That didn't seem to fix the issue with the Gantt chart not working - so I assumed I did it incorrectly. I restored the backed up files, and this time patched them.
Still no luck with my Gantt chart not showing up though. I realize I need to do some more research, and will pursue it in a different forum.
Thank you again for your help. You folks are wonderful!
vBulletin® v3.6.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.