Skip to content
This repository was archived by the owner on Aug 9, 2021. It is now read-only.

Commit 9995869

Browse files
committed
refactor(travis): factorize patch arguments
Also prevents patch to detect already applied patch and revert them Signed-off-by: Thierry Bugier <[email protected]>
1 parent 1404ed0 commit 9995869

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/before_script.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,20 @@ mkdir plugins/fusioninventory && git clone --depth=35 $FI_SOURCE -b $FI_BRANCH p
3434
IFS=/ read -a repo <<< $TRAVIS_REPO_SLUG
3535
mv ../${repo[1]} plugins/flyvemdm
3636

37+
# patch settings
38+
PATCH_ARGS="-p1 -N --batch"
39+
3740
# patch Fusion Inventory when needed
3841
cd plugins/fusioninventory
39-
if [[ $FI_BRANCH == "master" ]] ; then patch -p1 --batch < ../flyvemdm/tests/patches/fusioninventory/fi-raise-max-version.patch; fi
40-
if [[ $FI_BRANCH == "master" ]] ; then patch -p1 --batch < ../flyvemdm/tests/patches/fusioninventory/compat-glpi-9-3-2.diff; fi
41-
if [[ $FI_BRANCH == "glpi9.3" ]] ; then patch -p1 --batch < ../flyvemdm/tests/patches/fusioninventory/compat-glpi-9-3-2.diff; fi
42+
if [[ $FI_BRANCH == "master" ]] ; then patch $PATCH_ARGS < ../flyvemdm/tests/patches/fusioninventory/fi-raise-max-version.patch; fi
43+
if [[ $FI_BRANCH == "master" ]] ; then patch $PATCH_ARGS < ../flyvemdm/tests/patches/fusioninventory/compat-glpi-9-3-2.diff; fi
44+
if [[ $FI_BRANCH == "glpi9.3" ]] ; then patch $PATCH_ARGS < ../flyvemdm/tests/patches/fusioninventory/compat-glpi-9-3-2.diff; fi
4245
cd ../..
4346

4447
# patch GLPI when needed
45-
# if [[ $GLPI_BRANCH == "9.2.1" ]] ; then patch -p1 --batch < plugins/flyvemdm/tests/patches/glpi/10f8dabfc5e20bb5a4e7d4ba4b93706871156a8a.diff; fi
4648

4749
# prepare plugin to test
4850
cd plugins/flyvemdm
49-
if [[ $GLPI_BRANCH == "master" ]] ; then patch -p1 --batch < tests/patches/allow-test-on-master-branch.patch; fi
51+
if [[ $GLPI_BRANCH == "master" ]] ; then patch $PATCH_ARGS < tests/patches/allow-test-on-master-branch.patch; fi
5052
composer install --no-interaction
5153

0 commit comments

Comments
 (0)