X-Git-Url: https://uglyman.kremlin.cc/gitweb/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fgen-gdbus-interfaces.sh;h=7b1390508b7b675d6e21d00a2002419111a7b909;hb=a3d2e50f33b4a595ff5fe44ed1d28de03d3da22d;hp=1e44b356024ea558370b04eb34154ace940d2941;hpb=5c102fa8312439e169e1322c2dca276742d8bbe3;p=systembsd.git diff --git a/scripts/gen-gdbus-interfaces.sh b/scripts/gen-gdbus-interfaces.sh index 1e44b35..7b13905 100755 --- a/scripts/gen-gdbus-interfaces.sh +++ b/scripts/gen-gdbus-interfaces.sh @@ -1,16 +1,39 @@ -#!/usr/local/bin/bash +#!/bin/sh -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../ && pwd )" +# Copyright (c) 2014 Ian Sutton +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -if [[ -z "$1" ]]; then +# cd to root of repository +REPO=$(dirname "$(readlink -f $0)")/../ +cd $REPO + +if [[ $# -ne 1 ]];then echo "syntax: ./gen-dbus-interfaces " exit 1 +elif [[ $1 != "hostnamed" && $1 != "localed" && $1 != "timedated" && $1 != "logind" ]];then + echo " 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 SystemdUtils \ -conf/$1-ispect.xml +--generate-docbook $REPO/doc/$1-docbook.xml \ +--generate-c-code $1-gen \ +$REPO/conf/introspect-xml/$1-ispect.xml +echo "Success" +exit 0