]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
VERSION: main source for the project version
authorAleš Mrázek <ales.mrazek@nic.cz>
Mon, 29 Jun 2026 11:41:09 +0000 (13:41 +0200)
committerAleš Mrázek <ales.mrazek@nic.cz>
Fri, 24 Jul 2026 11:02:02 +0000 (13:02 +0200)
- scripts/make-archive.sh: use VERSION file instead of meson.build
- meson: files() supported since 0.57 version
- doc: sphinx: read version from file

doc/dev/conf.py
doc/user/conf.py
meson.build
scripts/make-archive.sh

index 45deb680c102cac2f763f0d795d818da7e0c4524..6b6dfe51c1217370c4936178577b0352ec28f4c1 100644 (file)
@@ -35,12 +35,9 @@ master_doc = 'index'
 # General information about the project.
 project = u'Knot Resolver'
 copyright = u'CZ.NIC labs'
-with open('../../meson.build') as f:
-    for line in f:
-        match = re.match(r"\s*version\s*:\s*'([^']+)'.*", line)
-        if match is not None:
-            version = match.groups()[0]
-release = version
+
+with open('../../VERSION') as version_file:
+    release = version_file.read().strip()
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
index 4fa364951d124258662fceaddd623ed27d81523b..ca0ba1f23c2f36a8f63e17717561dae0ae4d6c49 100644 (file)
@@ -10,12 +10,9 @@ import sphinx_rtd_theme
 # General information about the project.
 project = u'Knot Resolver'
 copyright = u'CZ.NIC labs'
-with open('../../meson.build') as f:
-    for line in f:
-        match = re.match(r"\s*version\s*:\s*'([^']+)'.*", line)
-        if match is not None:
-            version = match.groups()[0]
-release = version
+
+with open('../../VERSION') as version_file:
+    release = version_file.read().strip()
 
 # Add any Sphinx extension module names here, as strings.
 extensions = [
index f0c60e9ad45fc78e8bd0b114099ac617cdfab9f2..a4cde3bbbab1a0dd4881cb84e3a500be0e079404 100644 (file)
@@ -4,9 +4,9 @@ project(
   'knot-resolver',
   ['c', 'cpp'],
   license: 'GPLv3+',
-  version: '6.4.1',
+  version: files('VERSION'),
   default_options: ['c_std=gnu11', 'b_ndebug=true'],
-  meson_version: '>=0.53',
+  meson_version: '>=0.57',
 )
 
 
index d10ddd7d385a046758ed9b15516229842f77234d..67ae5100611581306339b874caf1ff911d600ab6 100755 (executable)
@@ -22,11 +22,11 @@ if ! git describe --tags --exact-match >&2; then
     N_COMMITS=$(git rev-list $VERSION_TAG.. --count)
     FULL_VERSION="$VERSION.dev$N_COMMITS+$GIT_HASH"
 
-    # modify and commit meson.build
-    sed -i "s/^\(\s*version\s*:\s*'\)\([^']\+\)\('.*\)/\1$FULL_VERSION\3/" meson.build
+    # modify and commit VERSION
+    echo "$FULL_VERSION" > VERSION
 
-    : changed version in meson.build, changes must be committed to git
-    git add meson.build >&2
+    : changed VERSION, changes must be committed to git
+    git add VERSION >&2
     git commit -m 'DROP: devel version archive' >&2
 
     cleanup() {