~ubuntu-branches/ubuntu/feisty/libtelepathy/feisty

« back to all changes in this revision

Viewing changes to xml/fix-xml.sh

  • Committer: Bazaar Package Importer
  • Author(s): Sjoerd Simons
  • Date: 2007-03-12 11:43:26 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20070312114326-v4aezxb6sr8utds1
Tags: 0.0.51-2
Bump shlibs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
# This is a convenience script that works around some limitations in
4
 
# the current dbus-binding-tool. It will probably become unnecessary
5
 
# in the future.
6
 
 
7
 
set -e
8
 
 
9
 
ANT="    \<annotation name=\"org.freedesktop.DBus.GLib.ClientCSymbol\" value="
10
 
 
11
 
grep -v "^#" - | while read IF_NAME IF_FILE
12
 
do
13
 
    echo "$IF_NAME > $IF_FILE.xml"
14
 
 
15
 
    IF_UNAME=`echo $IF_FILE | sed s/-/_/g`
16
 
    IF_BASE=`echo $IF_NAME | cut -f1 -d.`
17
 
    IF_IN_FILE="$top_srcdir/xml/orig/$IF_FILE.xml"
18
 
    IF_OUT_FILE="$top_builddir/xml/modified/$IF_FILE.xml"
19
 
 
20
 
    # strip the DBus introspection definition
21
 
    perl -ne '$/=undef; s/<interface name.*DBus.*>(.|\n)*?<\/interface>//;
22
 
    print "$_"' $IF_IN_FILE > $IF_OUT_FILE
23
 
 
24
 
    # strip the redefinition of the channel base interface
25
 
    if [ "$IF_BASE" != "$IF_NAME" ]; then
26
 
        perl -ni -e '$/=undef; s/<interface name.*'$IF_BASE'.>(.|\n)*?<\/interface>//; print "$_"' $IF_OUT_FILE
27
 
    fi
28
 
 
29
 
    # add the annotation tag
30
 
    sed -i s/org.freedesktop.Telepathy.$IF_BASE.*$/\&\\n"$ANT\"$IF_UNAME\"\/\>"/ $IF_OUT_FILE
31
 
done
32