]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: fix empty package release number
authorRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 17 Nov 2016 02:09:58 +0000 (03:09 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 29 Nov 2016 09:47:11 +0000 (10:47 +0100)
Was broken for major releases since b0e6b25e:
  $ blkid -V
  blkid from util-linux 2.28  (libblkid 2.28., 12-Apr-2016)

Now we also set 0 in this case, like:
  $ blkid -V
  blkid from util-linux 2.30  (libblkid 2.30.0, 12-Apr-2016)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
configure.ac

index b17ccd69b5922e72182e50d826026baa8de0e69d..8391c00c7b025584ae95d98cfe81cde18382d4f6 100644 (file)
@@ -23,10 +23,8 @@ dnl version details from <major>.<minor>[-<suffix>]
 PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}')
 PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{print $2}' \
                                              | awk -F- '{print $1}')
-
-PACKAGE_VERSION_RELEASE=$(echo $PACKAGE_VERSION | awk -F. '{print $3}' \
-                                               | sed 's/.*@<:@^@<:@:digit:@:>@@:>@.*/0/')
-
+PACKAGE_VERSION_RELEASE=$(echo $PACKAGE_VERSION | awk -F. '{
+                                       print $3 ~ /^@<:@[0-9]@:>@+$/ ? $3 : 0}')
 
 dnl libblkid version
 LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"