Difference between revisions of "Creating A Patch/pt"

From Free Pascal wiki
Jump to navigationJump to search
 
Line 1: Line 1:
Esse texto assuma que você pegou o Lazarus via SVN [[Getting Lazarus#Via SVN| Getting Lazarus Via SVN]]
+
Esse texto assume que você pegou o Lazarus via SVN [[Getting Lazarus#Via SVN| Getting Lazarus Via SVN]]
  
  

Revision as of 03:40, 20 November 2005

Esse texto assume que você pegou o Lazarus via SVN Getting Lazarus Via SVN


Instruções

Abra um prompt de comando ou cmd e mude para o diretório onde estão os fontes do Lazarus.

Instruções Para Windows:

Vamos assumir que o diretório dos fontes do Lazarus seja C:\Lazarus

  1. Abra um prompt do MS-DOS
  2. c: {pressione enter}
  3. cd \lazarus {pressione enter}
  4. svn diff > meu_path.diff {pressione enter}

Instruções Para Linux/BSD etc:

Vamos assumir que o diretório dos fontes do Lazarus seja $HOME/lazarus

  1. Abra seu programa de Terminal favirito
  2. cd $HOME {pressione enter}
  3. cd lazarus {pressione enter}
  4. svn diff > meu_path.diff {pressione enter}


Note: I also like to look the file over to see if there is anything in there that shouldn't be.

Agora comprima o arquivo que você criou (com zip ou gzip) e mande por email para o mailing list do Lazarus (40 kB é o limite) ou para a caixa postal para patches patch@lazarus.dommelstein.net.

Isso é tudo!

Problemas

This mostly applies to Windows but could apply for other platforms as well.

You get the error "svn command not found" or similar. Most probably you do not have svn.exe in your PATH environment variable. The following steps should fix this problem:

  1. Locate svn.exe using the Find Files feature of your Start menu.
  2. Once you have located svn.exe you need to add the directory it is in to your PATH.

As an example: From the command prompt type:

  set PATH=%PATH%;"C:\Program Files\TortoiseSVN\"

Note: Your directory containing svn.exe might not be the same on your computer as the one used in this document. It is used here only as an example.


The following is optional:

To make this permanant

For Windows98 or lower, you can add the line above (or similar) to your C:\autoexec.bat file near the end.

For Windows2000 or greater you can add this directory to your PATH by:

  1. Right-Clicking on "My Computer"
  2. Select "Properties"
  3. Choose the "Advanced" tab.
  4. Click the "Environment Variables" button.
  5. Locate the "Path" line in "System Variables" and add: ;"C:\Program Files\TortoiseSVN\" to the end.

Note: Your directory containing svn.exe might not be the same on your computer as the one used in this document. It is used here only as an example.

Applying a patch

To apply a patch is simple. You can test the patch by using the --dry-run toggle switch like this:


  patch --dry-run < mypatch.diff


The output of the patch program will be identical to the actual patching, only it does not alter the sourcecode files. Very handy for testing, without wanting to screw up your source.

To do the final patching, you use the following commandline:


  patch < mypatch.diff