[Pkg-xen-devel] [PATCH] debian/rules: Adjust Xen version matching

Elliott Mitchell ehem+debian at m5p.com
Fri Feb 25 22:40:55 GMT 2022


We're looking strictly for major and minor of upstream version.  We
don't care whether the separator for patch level is period or something
else.  Given this, the regular expression can match major and minor
while ignoring anything else.

Signed-off-by: Elliott Mitchell <ehem+debian at m5p.com>
---
 debian/rules | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index 69da9aea8d..1398c64128 100755
--- a/debian/rules
+++ b/debian/rules
@@ -68,7 +68,10 @@ flavour=$(flavour_$(DEB_HOST_ARCH))
 # (Everywhere else, it is handled dynamically.)
 #
 upstream_version := \
- $(shell dpkg-parsechangelog -SVersion | sed 's/\(\.[0-9]*\)\..*/\1/' )
+ $(shell dpkg-parsechangelog -SVersion | sed -n -e's/^\([0-9]\+\.[0-9]\+\).*/\1/p' )
+ifeq ($(upstream_version),)
+ $(error Failed to determine package version)
+endif
 
 # Many of the debhelper files are most conveniently provided as
 # templates which depend on the flavour and the upstream version.
-- 
2.30.2




More information about the Pkg-xen-devel mailing list