Hello,

On IRC I asked for something that could install my embeddedsystem in a binary way. This is what I currently made. it satisfies dependencies. But is made a bit too simplistic (and lacks the 'current'-symlink infrastructure).

But it is a RFC. The final version I would like to write in C. Should there be any other feature in?


Stefan
#!/bin/ash

PROGRAM=$1
VERSION=$2
FILENAME="$PROGRAM--$VERSION--i686.tar.bz2"

cd /tmp

if [ "$PROGRAM" == "" ]; then
        echo "No Packagename is given"
        exit;
fi

if [ "$VERSION" == "" ]; then
        wget http://gobo.calica.com/packages/official/MANIFEST.bz2
        FILENAME=`bzcat MANIFEST.bz2 | grep $PROGRAM | tail -n 1`
fi

if [ ! -f "/tmp/$FILENAME" ]
then
        wget http://gobo.calica.com/packages/official/$FILENAME
        VERSION=`echo $FILENAME | sed -e "s/.*--\(.*\)--.*/\1/"`
fi

if [ ! -f "/tmp/$FILENAME" ]
then
        wget http://gobo.calica.com/packages/official/MANIFEST.bz2
        FILENAME=`bzcat MANIFEST.bz2 | grep $PROGRAM | tail -n 1`
        wget http://gobo.calica.com/packages/official/$FILENAME
        VERSION=`echo $FILENAME | sed -e "s/.*--\(.*\)--.*/\1/"`
fi

if [ ! -f "/tmp/$FILENAME" ]
then
        echo "Download Failed!"
        exit
fi

cd /Programs
tar jxf /tmp/$FILENAME
/bin/SymlinkProgram $PROGRAM $VERSION

DEPS=`cat /Programs/$1/$2/Resources/Dependencies`

if [ ! "$DEPS" == "" ]
then
cat /Programs/$1/$2/Resources/Dependencies |while read line; do

rm /tmp/.found 2>/dev/null

DPROGRAM=`echo $line | awk '{ print $1 }'`
DCOMPARE=`echo $line | awk '{ print $2 }'`
DVERSION=`echo $line | awk '{ print $3 }'`
DCMPVERSION=`echo $line | awk '{ print $3 }' | sed 's|\.||g'`

if [ -d "/Programs/$DPROGRAM" ]
then
        cd /Programs/$DPROGRAM
        if [ "$DCOMPARE" == "==" -a -d "/Programs/$DPROGRAM/$DVERSION" ]
        then
                touch /tmp/.found
        else
                ls -1 |while read dir; do
                        if [ -d "/Programs/$DPROGRAM/$dir" ]
                        then
                                THISVERSION=`echo $dir | sed 's|[/\.]||g'`
                                
                                if [ $THISVERSION -eq $THISVERSION 2> /dev/null 
]
                                then
                                
                                        if [ "$DCOMPARE" == ">=" -a 
$DCMPVERSION -ge $THISVERSION ]
                                        then
                                                touch /tmp/.found
                                        elif [ "$DCOMPARE" == "<=" -a 
$DCMPVERSION -le $THISVERSION ]
                                        then
                                                touch /tmp/.found
                                        fi
                                fi
                        fi
                        
                done
        fi

fi


if [ ! -f "/tmp/.found" ]
then
        BinaryPackage $DPROGRAM $DVERSION
fi

done

fi

exit
_______________________________________________
gobolinux-devel mailing list
gobolinux-devel@lists.gobolinux.org
http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel

Reply via email to