aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gen-gdbus-interfaces.sh
diff options
context:
space:
mode:
authorkremlin <ian@kremlin.cc>2014-07-22 07:16:57 +0800
committerkremlin <ian@kremlin.cc>2014-07-22 07:16:57 +0800
commit7539ecc4f949316c3c59cda432645158511a1749 (patch)
treedd51e7e4b471ef1f2f525e7153e5e6efd96e9413 /scripts/gen-gdbus-interfaces.sh
parenta5c308468e1575c2a2b0cdbd74d51a85839bedac (diff)
downloadsystembsd-7539ecc4f949316c3c59cda432645158511a1749.tar
systembsd-7539ecc4f949316c3c59cda432645158511a1749.tar.gz
systembsd-7539ecc4f949316c3c59cda432645158511a1749.tar.bz2
systembsd-7539ecc4f949316c3c59cda432645158511a1749.tar.lz
systembsd-7539ecc4f949316c3c59cda432645158511a1749.tar.xz
systembsd-7539ecc4f949316c3c59cda432645158511a1749.tar.zst
systembsd-7539ecc4f949316c3c59cda432645158511a1749.zip
change gen script to use ksh, remove namespace option, regen genfiles
rewrite scripts/gen-gdbus-interfaces.sh to use ksh (#!/bin/sh) to cut down on inbox spam, also fixed prior bug where generated files had bad paths in their #includes. removed namespacing option from gdbus-codegen as linked objects do not run into naming conflicts as the previous commits did. regenerate all genfiles (src/interfaces/foo/foo-gen.{c.h}) accordingly.
Diffstat (limited to 'scripts/gen-gdbus-interfaces.sh')
-rwxr-xr-xscripts/gen-gdbus-interfaces.sh25
1 files changed, 13 insertions, 12 deletions
diff --git a/scripts/gen-gdbus-interfaces.sh b/scripts/gen-gdbus-interfaces.sh
index 9dd20c0..632b8f3 100755
--- a/scripts/gen-gdbus-interfaces.sh
+++ b/scripts/gen-gdbus-interfaces.sh
@@ -1,5 +1,4 @@
-#!/usr/local/bin/bash
-# JUST for now
+#!/bin/sh
# Copyright (c) 2014 Ian Sutton <ian@kremlin.cc>
#
@@ -15,24 +14,26 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-# TODO fix #include, should be "foo-gen.h" instead of "src/interfaces/foo/foo-gen.h
+# cd to root of repository
+REPO=$(dirname "$(readlink -f $0)")/../
+cd $REPO
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../ && pwd )"
-
-if [[ -z "$1" ]]; then
+if [[ $# -ne 1 ]];then
echo "syntax: ./gen-dbus-interfaces <interface name>"
exit 1
-elif [[ "$1" != "hostnamed" && "$1" != "localed" && "$1" != "timedated" && "$1" != "logind" ]]; then
+elif [[ $1 != "hostnamed" && $1 != "localed" && $1 != "timedated" && $1 != "logind" ]];then
echo "<interface name> must be 'hostnamed', 'localed', 'timedated', or 'logind'"
exit 1
fi
+# cd to interface-specific source directory to avoid preprocessor pathing bug
+cd src/interfaces/$1
+
gdbus-codegen \
--interface-prefix org.freedesktop. \
---generate-docbook doc/$1-docbook.xml \
---generate-c-code src/interfaces/$1/$1-gen \
---c-namespace $1 \
-conf/$1-ispect.xml
+--generate-docbook $REPO/doc/$1-docbook.xml \
+--generate-c-code $1-gen \
+$REPO/conf/$1-ispect.xml
-echo "success"
+echo "Success"
exit 0