Rev 3418 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
#!/bin/sh#URL=http://www.cise.ufl.edu/research/sparse/CSparsetarFile=CSparse.tar.gz## subdirectory *inside* tar file:sDir=CSparse/SourceiDir=CSparse/Include# ----------------- a "full path" for the current directory:MatrixDir=`dirname $0`; cd $MatrixDir; MatrixDir=`pwd`if [ -d $MatrixDir ]then echo "Downloading into directory '$MatrixDir' .."else echo "no directory '$MatrixDir' .. exiting"; exit 3ficd $MatrixDir#wget $URL/$tarFile#if [ ! -r $tarFile ]; then echo "no file $tarFile .. exiting"; exit 1 ; fi## extract only the part we wanttar zxf $tarFile $iDirif [ ! -d $iDir ]; then echo "no directory $iDir .. exiting"; exit 2 ; fiecho -n "Moving file from $iDir .. "(cd $iDir && chmod a+r cs.h && mv cs.h $MatrixDir)tar zxf $tarFile $sDirif [ ! -d $sDir ]; then echo "no directory $sDir .. exiting"; exit 2 ; fiecho -n "cat'ing files from $sDir .. "cd $sDircat cs_*.c | sed -e '1 p' -e '/^#include/d' > $MatrixDir/cs.cecho '[Ok]'echo -n "cleaning up $iDir $sDir .. "## keep the [TAB]s here ^^cd $MatrixDirrm -rf $tarFile $sDir $iDirrmdir `dirname $sDir`echo '[Ok]'