fixed logic/math bugs in set-time, still broken with GNOME tools
[systembsd.git] / scripts / gen-gdbus-interfaces.sh
CommitLineData
7539ecc4 1#!/bin/sh
5c102fa8 2
3b82e3c1 3# Copyright (c) 2014 Ian Sutton <ian@kremlin.cc>
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
7539ecc4 17# cd to root of repository
18REPO=$(dirname "$(readlink -f $0)")/../
19cd $REPO
f84d928e 20
7539ecc4 21if [[ $# -ne 1 ]];then
5c102fa8 22 echo "syntax: ./gen-dbus-interfaces <interface name>"
23 exit 1
7539ecc4 24elif [[ $1 != "hostnamed" && $1 != "localed" && $1 != "timedated" && $1 != "logind" ]];then
5047f6bf 25 echo "<interface name> must be 'hostnamed', 'localed', 'timedated', or 'logind'"
26 exit 1
5c102fa8 27fi
28
7539ecc4 29# cd to interface-specific source directory to avoid preprocessor pathing bug
30cd src/interfaces/$1
31
5c102fa8 32gdbus-codegen \
33--interface-prefix org.freedesktop. \
7539ecc4 34--generate-docbook $REPO/doc/$1-docbook.xml \
35--generate-c-code $1-gen \
eb9f042e 36$REPO/conf/introspect-xml/$1-ispect.xml
5c102fa8 37
7539ecc4 38echo "Success"
5047f6bf 39exit 0