[Vala] [PATCH] Properly detect pkglibdir, remove Bash-isms



---
 trunk/vapigen/ChangeLog       |    4 ++++
 trunk/vapigen/gidlgen/gidlgen |   14 +++++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/trunk/vapigen/ChangeLog b/trunk/vapigen/ChangeLog
index 2599369..0e352e8 100644
--- a/trunk/vapigen/ChangeLog
+++ b/trunk/vapigen/ChangeLog
@@ -1,3 +1,7 @@
+2007-03-24  Mathias Hasselmann  <mathias hasselmann gmx de>
+
+       * gidlgen/gidlgen: Properly detect pkglibdir, remove Bash-isms
+
 2007-03-21  Raffaele Sandrini  <rasa gmx ch>
 
        * packages/pango/pango.excludes: remove pangocairo.h
diff --git a/trunk/vapigen/gidlgen/gidlgen b/trunk/vapigen/gidlgen/gidlgen
index 163b61a..cdf1a38 100755
--- a/trunk/vapigen/gidlgen/gidlgen
+++ b/trunk/vapigen/gidlgen/gidlgen
@@ -1,13 +1,21 @@
 #!/bin/sh
 
-pkglibdir=$(dirname $0)
+realpath=`readlink $0`
+pkgbindir=`dirname $realpath`
+
+if [ -f "$pkgbindir/gapi2xml.pl" ]
+then
+       pkglibdir=$pkgbindir
+else
+       pkglibdir=`dirname $pkgbindir`/lib/vala
+fi
 
 SOURCE=$1
 PKGBASE=$2
 
 if [ $# -ne 2 ]
 then
-       echo "Usage: $0 SOURCE PKGBASE"
+       echo "Usage: `basename $0` SOURCE PKGBASE"
        exit 1
 fi
 
@@ -28,7 +36,7 @@ then
        patch -d $PKGBASE-src -Np1 < $PKGBASE.patch
 fi
 
-perl $pkglibdir/gapi_pp.pl $(cat $PKGBASE.files | sed -e "s ^@$PKGBASE-src/@") | perl $pkglibdir/gapi2xml.pl 
$(cat $PKGBASE.namespace) $PKGBASE.raw
+perl $pkglibdir/gapi_pp.pl `cat $PKGBASE.files | sed -e "s ^@$PKGBASE-src/@"` | perl $pkglibdir/gapi2xml.pl 
`cat $PKGBASE.namespace` $PKGBASE.raw
 
 xml_pp $PKGBASE.raw > $PKGBASE.gidl
 
-- 
1.4.4.2




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]