From e47c5336a1aa01f3d970e612fa3d6b0b02ced3f3 Mon Sep 17 00:00:00 2001
From: Wayne Lewis <wayne.lewis@ess.eu>
Date: Thu, 4 Mar 2021 22:03:36 +0100
Subject: [PATCH] Add extra variable to store original version number

---
 configure/modules/CONFIG     | 1 +
 configure/modules/DEFINES_FT | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure/modules/CONFIG b/configure/modules/CONFIG
index 0286b58b..f0339c77 100644
--- a/configure/modules/CONFIG
+++ b/configure/modules/CONFIG
@@ -1,6 +1,7 @@
 # -*- mode: Makefile;-*-
 
 # Update the module version (for numeric versions) with a build number of 0 if none is specified
+E3_MODULE_VERSION_ORIG:=$(E3_MODULE_VERSION)
 E3_MODULE_VERSION:=$(E3_MODULE_VERSION)$(shell [[ "$(E3_MODULE_VERSION)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$$ ]] && echo +0)
 
 include $(EPICS_BASE)/configure/CONFIG_BASE_VERSION
diff --git a/configure/modules/DEFINES_FT b/configure/modules/DEFINES_FT
index 2da72875..908d65ed 100644
--- a/configure/modules/DEFINES_FT
+++ b/configure/modules/DEFINES_FT
@@ -15,7 +15,7 @@ git submodule update --remote --merge $@/
 endef
 
 define patch_site
-patches=$$(ls $(TOP)/patch/Site/$(E3_MODULE_VERSION)-*.p0.patch 2> /dev/null); \
+patches=$$(ls $(TOP)/patch/Site/$(E3_MODULE_VERSION_ORIG)-*.p0.patch 2> /dev/null); \
 if [ -n "$$patches" ]; then \
   for i in $$patches; do \
     printf "\nPatching %s with the file : %s\n" "$(E3_MODULE_SRC_PATH)" "$$i"; \
-- 
GitLab