From 9ec850d6793b23ac31b1d4015b4638b6b1a79d0d Mon Sep 17 00:00:00 2001
From: Simon Rose <simon.rose@ess.eu>
Date: Tue, 8 Jun 2021 10:45:57 +0200
Subject: [PATCH] Clean up _ORIG variable

---
 configure/modules/CONFIG      | 1 -
 configure/modules/DEFINES_FT  | 4 ++--
 configure/modules/RULES_PATCH | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/configure/modules/CONFIG b/configure/modules/CONFIG
index f0339c77..0286b58b 100644
--- a/configure/modules/CONFIG
+++ b/configure/modules/CONFIG
@@ -1,7 +1,6 @@
 # -*- 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 e1a42e1b..c2772f4d 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_ORIG)/*.p0.patch 2> /dev/null); \
+patches=$$(ls $(TOP)/patch/Site/$(E3_MODULE_VERSION)/*.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"; \
@@ -27,7 +27,7 @@ fi
 endef
 
 define patch_revert_site
-patches=$$(ls $(TOP)/patch/Site/$(E3_MODULE_VERSION_ORIG)/*.p0.patch 2> /dev/null); \
+patches=$$(ls $(TOP)/patch/Site/$(E3_MODULE_VERSION)/*.p0.patch 2> /dev/null); \
 if [ -n "$$patches" ]; then \
   for i in $$patches; do\
     printf "\nReverting applied patch %s with the file : %s\n" "$(E3_MODULE_SRC_PATH)" "$$i"; \
diff --git a/configure/modules/RULES_PATCH b/configure/modules/RULES_PATCH
index 7af21b0c..19e968d0 100644
--- a/configure/modules/RULES_PATCH
+++ b/configure/modules/RULES_PATCH
@@ -3,7 +3,7 @@
 
 .PHONY: check_for_old_patches
 check_for_old_patches:
-	$(if $(wildcard $(TOP)/patch/Site/$(E3_MODULE_VERSION_ORIG)-*.p0.patch),$(warning Warning: old-style patches detected. Please move them to patch/Site/$$E3_MODULE_VERSION/.))
+	$(if $(wildcard $(TOP)/patch/Site/$(patsubst %+0,%,$(E3_MODULE_VERSION))*.p0.patch),$(warning Warning: old-style patches detected. Please move them to patch/Site/$$E3_MODULE_VERSION/.))
 
 
 ## Apply Patch Files 
-- 
GitLab