]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
fixed script
authorRazvan Becheriu <ravan@isc.org>
Thu, 7 Mar 2019 05:12:11 +0000 (07:12 +0200)
committerRazvan Becheriu <razvan@isc.org>
Thu, 16 May 2019 15:12:40 +0000 (18:12 +0300)
tools/sysrepo_config

index 5f4aac500ea493029cb4856c4e609f8f50197d80..486e289de3b20c65659c3f199563010321c544ee 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
 #
@@ -12,8 +12,7 @@
 
 sysrepo_lib="libsysrepo"
 
-if [ -z "${YANG_LIBRARY_PATH}" ]
-then
+if [ -z "${YANG_LIBRARY_PATH}" ]; then
     YANG_LIBRARY_PATH=/
 fi
 
@@ -33,11 +32,11 @@ fi
 # shellcheck disable=SC1090
 . "${DIR}/sysrepo_config_defines.sh"
 
-if [ $# -ne 1 ] && [ $# -ne 2 ]
-then
-       echo "run: \`$0 --help\` for more help1"
-       exit 0
+if [ $# -ne 1 ] && [ $# -ne 2 ]; then
+    echo "run: \`$0 --help\` for more help"
+    exit 0
 fi
+<<<<<<< HEAD
 if [ "$1" = "--help" ]
 then
        echo "sysrepo_config 'option' ['library']"
@@ -71,11 +70,33 @@ else if [ $# -ne 2 ]
                        sysrepo_lib=$2
                fi
        fi
+=======
+
+if [ "$1" = "--help" ]; then
+    echo "sysrepo_config 'option' ['library']"
+    echo "options:"
+    echo "--help"
+    echo "    print this help message"
+    echo "--cflags-only-other"
+    echo "    get cpp compilation flags"
+    echo "--cflags-only-I"
+    echo "    get include path"
+    echo "--libs"
+    echo "    get lib path"
+    echo "--modversion"
+    echo "    get version"
+    echo "--variable=SR_REPOSITORY_LOC"
+    echo "    get repo path"
+    echo "libraries:"
+    echo "    libsysrepo"
+    echo "    libSysrepo-cpp"
+    exit 0
+>>>>>>> fixed script
 fi
 
 if [ $# -ne 2 ]; then
     echo "Incorrect number of parameters specified"
-    echo "run: \`$0 --help\` for more help2"
+    echo "run: \`$0 --help\` for more help"
     exit 0
 elif [ "$2" != "libsysrepo" ] && [ "$2" != "libSysrepo-cpp" ]; then
     echo "library $2 not supported"
@@ -101,10 +122,13 @@ if [ "$1" = "--libs" ]; then
     echo "-L${SYSREPO_PATH}/build/src -L${SYSREPO_PATH}/build/swig -L$YANG_LIBRARY_PATH -l:${sysrepo_lib}.a -lSysrepo-cpp -lyang -pthread -lpcre -lev -lavl -lprotobuf-c"
     exit 0
 fi
-if [ $1 == "--variable=SR_REPOSITORY_LOC" ]
-then
-       echo "${SYSREPO_PATH}/build/repository"
-       exit 0
+
+if [ "$1" = "--modversion" ]; then
+    MAJOR="1"
+    MINOR="0"
+    PATCH="0"
+    echo "${MAJOR}.${MINOR}.${PATCH}"
+    exit 0
 fi
 
 if [ "$1" = "--variable=SR_REPOSITORY_LOC" ]; then
@@ -113,3 +137,5 @@ fi
 
 echo "wrong parameter"
 echo "run: \`$0 --help\` for more help"
+
+exit 1