discuss-gnustep
[Top][All Lists]
Advanced

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

Simple XML discovery script


From: Dennis Leeuw
Subject: Simple XML discovery script
Date: Wed, 11 Apr 2001 14:44:42 +0200

Hi all,

Since the XML seems to keep popping up it's ugly head, I thought I'd
look for a fix, but I don't understand what is going on in
base/configure, so I wrote a little script that detects which xml*config
scripts are available and picks the highest.

Here is the small script, maybe someone with more knowledge can comment
on it.

Greetings,


Dennis

#!/bin/sh

XML_MAJOR="0"
XML_MINOR="0"
XML_BUG="0"
XMLCONFIGS=""

# Find the paths xml*-config could live in

PAD=`env| grep ^PATH | awk -F= '{ print $2 }' | awk -F: '{ n = "1";
while (n < N
F) { print $n; n++ } }'`

# Collect different xml*-configs

for DIR in $PAD; do
        ls $DIR/xml*-config > /dev/null 2>&1
        if [ "$?" = "0" ]; then
                XMLCONFIG=`ls $DIR/xml*config`
                XMLCONFIGS="$XMLCONFIGS $XMLCONFIG"
        fi
done

# Find the newest available version

for XMLCONF in $XMLCONFIGS; do
        XML_VERSION_FOUND=`$XMLCONF --version`
        XML_MAJOR_FOUND=`echo $XML_VERSION_FOUND | awk -F. '{ print $1
}'`
        XML_MINOR_FOUND=`echo $XML_VERSION_FOUND | awk -F. '{ print $2
}'`
        XML_BUG_FOUND=`echo $XML_VERSION_FOUND | awk -F. '{ print $3 }'`

        if [ $XML_MAJOR_FOUND -le $XML_MAJOR ]; then
                break
        elif [ $XML_MINOR_FOUND -le $XML_MINOR ]; then
                break
        elif [ $XML_BUG_FOUND -le $XML_BUG ]; then
                break
        else
                XML_MAJOR=$XML_MAJOR_FOUND
                XML_MINOR=$XML_MINOR_FOUND
                XML_BUG=$XML_BUG_FOUND
                XML_VERSION=$XML_VERSION_FOUND
                XMLCONFIG=$XMLCONF
        fi

done



Attachment: dleeuw.vcf
Description: Card for Dennis Leeuw


reply via email to

[Prev in Thread] Current Thread [Next in Thread]