Skip to content

Commit e416852

Browse files
fxdupontandrei-pavel
authored andcommitted
[#3729] Added share/yang stuff
1 parent b898ce1 commit e416852

File tree

4 files changed

+72
-8
lines changed

4 files changed

+72
-8
lines changed

src/share/yang/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
subdir('modules')

src/share/yang/modules/meson.build

+33-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
1-
list = run_command('grabber.sh', check: true)
2-
api_files = list.stdout().strip().split('\n')
3-
install_dir = f'@DATADIR@/kea/api'
4-
install_data(api_files, install_dir: install_dir)
1+
if not NETCONF_DEPS_FOUND
2+
subdir_done()
3+
endif
4+
5+
subdir('utils')
6+
7+
yangmodulesdir = f'@DATADIR@/kea/yang/modules'
8+
yangmodules_list = [
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
]
25+
list = run_command('utils/grabber.sh', check: true)
26+
grabbed_modules = list.stdout().strip().split('\n')
27+
foreach file : grabbed_modules
28+
assert(
29+
yangmodules_list.contains(file),
30+
'module file list mismatch: no ' + file,
31+
)
32+
endforeach
33+
install_data(yangmodules_list, install_dir: yangmodulesdir)
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
for i in upgrade_*_to_*.sh.in
3+
for i in [a-z]*.yang
44
do
55
echo "$i"
66
done
+37-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
1-
subdir('mysql')
2-
subdir('pgsql')
1+
yangdir = f'@DATADIR@/kea/yang/modules/utils'
2+
yang_utils_conf_data = configuration_data()
3+
# Comment says sources (vs build)
4+
yang_utils_conf_data.set('abs_top_builddir', TOP_SOURCE_DIR)
5+
# Beware that top_srcdir here must be a relative path.
6+
yang_utils_conf_data.set('top_srcdir', '../../../../..')
7+
yang_utils_conf_data.set('datarootdir', f'@PREFIX@/@DATADIR@')
8+
yang_lint = find_program('/opt/bin/yanglint', required: false)
9+
if yang_lint.found()
10+
yang_utils_conf_data.set('LIBYANG_PREFIX', '/opt')
11+
yang_utils_conf_data.set('SYSREPO_PREFIX', '/opt')
12+
else
13+
yang_utils_conf_data.set('SYSREPO_PREFIX', '/usr/local')
14+
yang_lint = find_program('/usr/local/bin/yanglint', required: false)
15+
if yang_lint.found()
16+
yang_utils_conf_data.set('LIBYANG_PREFIX', '/usr/local')
17+
else
18+
yang_lint = find_program('yanglint', required: true)
19+
yang_utils_conf_data.set('LIBYANG_PREFIX', '')
20+
endif
21+
endif
22+
23+
configure_file(
24+
input: 'check-hashes.sh.in',
25+
output: 'check-hashes.sh',
26+
configuration: yang_utils_conf_data,
27+
)
28+
configure_file(
29+
input: 'check-revisions.sh.in',
30+
output: 'check-revisions.sh',
31+
configuration: yang_utils_conf_data,
32+
)
33+
configure_file(
34+
input: 'reinstall.sh.in',
35+
output: 'reinstall.sh',
36+
configuration: yang_utils_conf_data,
37+
)

0 commit comments

Comments
 (0)