]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3866] Meson: reinstall.sh now looks into the srcdir for YANG modules
authorAndrei Pavel <andrei@isc.org>
Wed, 30 Apr 2025 04:42:37 +0000 (07:42 +0300)
committerAndrei Pavel <andrei@isc.org>
Mon, 5 May 2025 05:14:43 +0000 (08:14 +0300)
src/share/yang/modules/utils/meson.build
src/share/yang/modules/utils/reinstall.sh.in

index a287ed5baf0bd02bf8e95008c77fbb5024575da5..d2a0b14132adfb39f24c86e22192ce3b0c2c5441 100644 (file)
@@ -1,7 +1,7 @@
 yangdir = DATADIR / 'kea/yang/modules/utils'
 yang_utils_conf_data = configuration_data()
 # Comment says sources (vs build)
-yang_utils_conf_data.set('abs_top_builddir', TOP_BUILD_DIR)
+yang_utils_conf_data.set('abs_top_srcdir', TOP_SOURCE_DIR)
 # Beware that top_srcdir here must be a relative path.
 yang_utils_conf_data.set('top_srcdir', '../../../../..')
 yang_utils_conf_data.set('datarootdir', '${prefix}/' + DATADIR)
index fad634e394b70bcf70e799f148cebedd35bc9154..d7fc1729cdea9a2dfa4b1745c61dabe16ac4bbe2 100755 (executable)
@@ -83,20 +83,15 @@ script_path=$(cd "$(dirname "${0}")" && pwd)
 # reason: prefix is used in datarootdir (@datarootdir@) below.
 prefix="@prefix@"
 
-# Find modules location.
+# Find modules location. Prioritize installation.
 # If script is in sources, use modules from sources.
 # If script is in installation, use modules from installation.
-for i in \
-  "@datarootdir@/kea/yang/modules" \
-  "@abs_top_builddir@/src/share/yang/modules" \
-; do
-  if test "${script_path}" = "${i}/utils"; then
-    modules="${i}"
-    break
-  fi
-done
+modules='@abs_top_srcdir@/src/share/yang/modules'
+if test "${script_path}" = '@datarootdir@/kea/yang/modules/utils'; then
+  modules='@datarootdir@/kea/yang/modules'
+fi
 if test -z "${modules+x}"; then
-  printf 'ERROR: cannot find location of modules. Use this script from sources or from installation.' >&2
+  printf 'ERROR: cannot find location of modules. Use this script from sources or from installation.\n' >&2
   exit 1
 fi