Recent

Author Topic: how to apply patches?  (Read 10952 times)

erkka

  • New Member
  • *
  • Posts: 37
how to apply patches?
« on: August 30, 2011, 08:42:09 am »
I find there are some interesting patch-files to be found in the Lazarus bugtracker.
But how to apply them?

I run Windows XP with lazarus-0.9.30-fpc-2.4.2-win32.exe installed with the ordinary installer.

If I want to apply patches, should I've learn to donwload and install Lazarus with svn?

Or is it enough to download and install the daily snapshot?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8266
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: how to apply patches?
« Reply #1 on: August 30, 2011, 12:34:53 pm »
I don't know whether standard distribution contains patch executable. Just try this from lazarus top directory:
Quote
patch -p 0 < the patch file

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: how to apply patches?
« Reply #2 on: August 30, 2011, 12:46:22 pm »
I think that TortoiseSVN for Windows can apply patches.

Having said that, patches are made for 0.9.31, so although they might also work in 0.9.30 this is not guaranteed. The best would be really using Lazarus svn, although a recent snapshot should be almost the same.

Lacak2

  • Guest
Re: how to apply patches?
« Reply #3 on: August 30, 2011, 02:38:18 pm »
Or of you are finding way how to apply patch with transaction support to ODBCConnection, then you can simply use attached file
(replace original odbcconn.pas and add path to your search unit project options)

erkka

  • New Member
  • *
  • Posts: 37
Re: how to apply patches?
« Reply #4 on: August 30, 2011, 06:31:16 pm »
Hey, so many great answers! Thank you.

Lacak2, problem with odbcconnection is the issue which made me think of patching. But maybe I should still learn how to use svn and patches. Anyhow, your attached file made me very happy and of course I'd like to try it out. I found the original odbcconn.pas in lazarus sources, and replaced it with your file. Then, I figured out that I should hit Tools -> Build Lazarus with profile Build all. Was that the wrong way? I mean, if my project already uses odbcconn, why should I change anything in project options?

Felipedmc (and others) - just a plain stupid newbie question; I now have Lazarus 0.9.30 with FPC 2.4.2. installed and running. If I try svn, should I unistall the current version? If yes, does it mean that I should begin from the scratch, first getting fpc with svn, installing it and then proceeding?

Leledumbo - standard distribution seems to contain patch.exe; which means I could try to use the latest daily snapshot and patching it?


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6615
  • Debugger - SynEdit - and more
    • wiki
Re: how to apply patches?
« Reply #5 on: August 30, 2011, 07:49:23 pm »
About the patch.exe in the fpc/bin directory., It is (at least last time I checked) very sensitive to the correct line ending (windows vs unix style). I don't recall which one it wanted, but if you got the wrong one, it may just crash. In that case an editor like notepad++ which can convert the file will help.

You can (and probably should) install 2 Lazarus in parallel). Before going to use SVN, why not trying a snapshot.

However, if you use more than one lazarus, there is one thing you MUST learn.
Use the --primary-config-path=c:\some\folder\ option. Under windows in order to start lazarus with this option, you must create a shortcut, and edit the command line in its properties. Then always use the shortcut to start lazarus.

Otherwise you will share the same package between both lazarus versions, and latest when you install a package, you will be in trouble.

Both lazarus can use the same fpc installation => your 2nd lazarus can use the fpc that is within the 1st lazarus install dir.
But: you must never move or rename the fpc folder. Because fpc.cfg (which is in the fpc dir) contains absolute pathes)

If you install 3rd party packages, you can only share them between installations, if both lazarus are using the same fpc. To be save, install each 3rd party twice.

Once that is mastered it is a very small step to use svn.

Lacak2

  • Guest
Re: how to apply patches?
« Reply #6 on: August 31, 2011, 08:05:06 am »
I figured out that I should hit Tools -> Build Lazarus with profile Build all. Was that the wrong way? I mean, if my project already uses odbcconn, why should I change anything in project options?
May be, that you can do it also in this way, but I never use this way.
You must have compiled unit odbcconn in project search path (may be, that rebuilding Lazarus also recompiles all source units)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6615
  • Debugger - SynEdit - and more
    • wiki
Re: how to apply patches?
« Reply #7 on: August 31, 2011, 01:54:25 pm »
odbcconn is part of fpc (packages). Rebuilding Lazarus only rebuild LCL, and lazarus packages.

The correct way is to rebuild fpc.

erkka

  • New Member
  • *
  • Posts: 37
Re: how to apply patches?
« Reply #8 on: September 01, 2011, 10:12:04 pm »
now that is good medicine :)

Thank you very much - it is great that you people have time and patience to help us newbies with the basics. I'm sure your advice will boost my way of using Lazarus. And of course I also hope that there are a lot of other fresh Lazarus-users out there whom find this forum-post helpful for them too.

 

TinyPortal © 2005-2018