SYSREPO_CPPFLAGS="$SYSREPO_INCLUDEDIR `$SYSREPO_CONFIG --cflags-only-other libsysrepo`"
SYSREPO_LIBS="`$SYSREPO_CONFIG --libs libsysrepo`"
SYSREPO_VERSION=`$SYSREPO_CONFIG --modversion libsysrepo`
+ SYSREPO_REPO=`$SYSREPO_CONFIG --variable=SR_REPOSITORY_LOC libsysrepo`
# Now get the environment for C++ bindings for Sysrepo.
SYSREPOCPP_INCLUDEDIR=`$SYSREPO_CONFIG --cflags-only-I libSysrepo-cpp`
AC_SUBST(SYSREPO_CPPFLAGS)
AC_SUBST(SYSREPO_LIBS)
+ AC_SUBST(SYSREPO_REPO)
# Check that a simple program using Sysrepo functions can compile and link.
CPPFLAGS_SAVED="$CPPFLAGS"
src/lib/util/threads/Makefile
src/lib/util/threads/tests/Makefile
src/lib/util/unittests/Makefile
+ src/lib/yang/models/yang-install.sh
src/share/Makefile
src/share/database/Makefile
src/share/database/scripts/Makefile
chmod +x src/lib/log/tests/severity_test.sh
chmod +x src/lib/util/python/gen_wiredata.py
chmod +x src/lib/util/tests/process_spawn_app.sh
+ chmod +x src/lib/yang/models/yang-install.sh
chmod +x tools/path_replacer.sh
])
SYSREPO_VERSION: ${SYSREPO_VERSION}
SYSREPO_CPPFLAGS: ${SYSREPO_CPPFLAGS}
SYSREPO_LIBS: ${SYSREPO_LIBS}
+ SYSREPO_REPO: ${SYSREPO_REPO}
END
else
cat >> config.report << END
$ sysrepoctl -l
</screen>
-After installation the result should be similar to this:
+After installation the result should be similar to this, assuming that
+the sysrepo repository path is
+<filename>/home/thomson/devel/sysrepo-0.7.4/build/repository</filename>:
<screen>
Sysrepo schema directory: /home/thomson/devel/sysrepo-0.7.4/build/repository/yang/
Sysrepo data directory: /home/thomson/devel/sysrepo-0.7.4/build/repository/data/
<screen>
cd src/lib/yang/models
-sudo sysrepoctl -i -g kea-dhcpv4-server.yang -s /home/thomson/devel/sysrepo-0.7.4/build/repository/yang/ -s ./
-sudo sysrepoctl -i -g ietf-dhcpv6-server.yang -s /home/thomson/devel/sysrepo-0.7.4/build/repository/yang/ -s ./
+sudo ./yang-install.sh kea-dhcpv4-server.yang
+sudo ./yang-install.sh ietf-dhcpv6-server.yang
</screen>
-Note the first -s parameter specifies the location of your YANG schema
-directory. You can check it with sysrepoctl -l. This is a parameter that is
-configured during sysrepo compilation.
-
-
The installation should look similar to the following:
<screen>
-$ sudo sysrepoctl -i -g ietf-dhcpv4-server.yang -s /home/thomson/devel/sysrepo-0.7.4/build/repository/yang/ -s ./
+$ sudo ./yang-install.sh kea-dhcpv4-server.yang
Installing a new module from file 'ietf-dhcpv4-server.yang'...
Installing the YANG file to '/home/thomson/devel/sysrepo-0.7.4/build/repository/yang/ietf-dhcpv4-server@2018-07-14.yang'...
Resolving dependency: 'ietf-dhcpv4-server' imports 'ietf-dhcpv4-options'...
--- /dev/null
+#!/bin/sh
+# install a yang model
+
+if test $# -ne 1; then
+ echo "Usage: $0 <model>.yang"
+ exit 1
+fi
+
+exec sysrepoctl -i -g $1 -s @SYSREPO_REPO@/yang -s .
echo " get lib path"
echo "--modversion"
echo " get version"
+ echo "--variable=SR_REPOSITORY_LOC"
+ echo " get repo path"
echo "libraries:"
echo " libsysrepo"
exit 0
echo "${MAJOR}.${MINOR}.${PATCH}"
exit 0
fi
+if [ $1 == "--variable=SR_REPOSITORY_LOC" ]
+then
+ echo "${SYSREPO_PATH}/build/repository"
+fi
echo "wrong parameter"
echo "run: \`$0 --help\` for more help"