From 2d3f121a76017cce049f30a3045c2f522d7e7f60 Mon Sep 17 00:00:00 2001
From: Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com>
Date: Fri, 18 Jul 2014 21:49:01 +0200
Subject: [PATCH] build-system: Allow emergency patches to streamline the
 release process

Refs: #51465

Change-Id: I513996df42d9662e1dae401a2768bc210fe470ae
---
 .../build-system/launch-build-machine-jenkins.sh | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/tools/build-system/launch-build-machine-jenkins.sh b/tools/build-system/launch-build-machine-jenkins.sh
index e3740e2430..de18d3fcd8 100755
--- a/tools/build-system/launch-build-machine-jenkins.sh
+++ b/tools/build-system/launch-build-machine-jenkins.sh
@@ -154,7 +154,17 @@ fi
 
 # If release, checkout the latest tag
 if [ ${IS_RELEASE} ]; then
-  git checkout ${CURRENT_RELEASE_TAG_NAME}
+	git checkout ${CURRENT_RELEASE_TAG_NAME}
+
+    # When we need to apply an emergency patch for the release builds
+    # This should only be used to temporarily patch packaging tools, not
+    # daemon/client code (or anything else that build_tarball would grab).
+    if [ -d /tmp/sflphone_release_patch ]; then
+        echo "Applying patch(es) to packaging tools..."
+        git apply /tmp/sflphone_release_patch/*
+        rm -rf /tmp/sflphone_release_patch
+        REQUIRE_RESET=1
+    fi
 fi
 
 echo "Retrieve build info"
@@ -303,6 +313,10 @@ done
 # Archive source tarball for Debian maintainer
 . ${WORKING_DIR}/build_tarball.sh ${SOFTWARE_VERSION}
 
+# Undo any modifications caused by temporary patches
+if [ "$REQUIRE_RESET" == "1" ]; then
+	git reset --hard
+fi
 
 # close file descriptor
 exec 3>&-
-- 
GitLab