bandageApply patch

Have you opened a support ticket and received a patch or a link to a patch? Here’s the simple procedure to apply it!

Simplified procedure (Majority of cases)

circle-check

Place the patch in the correct location

Depending on where the encountered bug is, the patch may be intended for the core or a plugin. It is therefore necessary to place the patch in the correct location before applying it.


The patch concerns the GLPI core

  • A file was provided to you: Move the previously created file to the GLPI root folder.

  • A link was provided to you: Go to the GLPI root folder and run the following command to download the patch:

  • Then check that the file is present:

Alt text

The patch concerns a Plugin

  • A file was provided to you: Move the previously created file to the plugin root folder.

  • A link was provided to you: Go to the plugin root folder and run the following command to download the patch:

  • Then check that the file is present:

Alt text

Test the patch

Before appling patch, you have to test it with this command and parameter --dry-run

circle-info

Does your system indicate that the patch command is unknown? click here

Test is failed ❌

In case of an error you should have this

Many things can lead to failure :

  • Your version of GLPI is different from the version used to make the patch

  • The file that must be modified by the patch has already been previously

triangle-exclamation

Test is successfull ✅

In case of a success you should have this

or this


Apply the patch

Test successful ✅? You can now actually apply the patch with this command

Congratulation the patch is applied !


Special cases (rare)

circle-check

Cancel a patch

To cancel a patch, enter the command :

You have a commit number

Service support give you this commit number ex: adc9876

  • First, you need to retrieve changes from commit

  • Go to https://github.com/glpi-project/glpi/commit/ + COMMIT_NUMBER

circle-check
  • Then, transform the commit into a patch by adding .diff at the end of url.

Like this https://github.com/glpi-project/glpi/commit/adc9876.diff

Alt text
  • Copy the patch URL and run a wget on your GLPI server wget https://github.com/glpi-project/glpi/commit/adc9876.diff

circle-info

Info

If it's a core patch, perform the wget directly at the root of GLPI.

If it's a plugin patch, perform the wget directly in the folder of the plugin concerned.

Finally, go to apply patch section

You have PR number (Pull Request)

Service support give you a PR number 4770

  • First, you need to retrieve the PR

  • Go to https://github.com/glpi-project/glpi/pull/ + PR_NUMBER

circle-check
  • First , transform the PR into a patch by adding .diff at the end of url.

Like this https://github.com/glpi-project/glpi/pull/4770.diff

Alt text
  • Copy the patch URL and run a wget on your GLPI server wget https://github.com/glpi-project/glpi/pull/4770.diff

circle-info

Info

If it's a core patch, perform the wget directly at the root of GLPI.

If it's a plugin patch, perform the wget directly in the folder of the plugin concerned.

Finally, go to apply patch section

Finally, go to apply patch section


Check that the patch binary is installed

  • To known if it installed, just find the version of the binary patch installed

If it installed you should have this

If not you should have this

  • Install it with this command

Ubuntu/Debian

CentOS/RHEL

Last updated