#!/bin/sh
# (C) 2003-2007 Willem Jan Hengeveld <itsme@xs4all.nl>
# Web: http://www.xs4all.nl/~itsme/
#      http://wiki.xda-developers.com/
#
# $Id$
#
HOMEBIN=$HOME/bin
if [ ! -e $HOMEBIN ]; then
    echo Your $HOMEBIN directory does not exist, please create it
    exit 1
fi
if [ ! -d $HOMEBIN ]; then
    echo $HOMEBIN is not a directory
    exit 1
fi

if [ ! -e $HOME/.pl2shrc ]; then
    echo Please set CVS sourcepath to xda-devtools in .pl2shrc
    exit 1
fi
CVSSRCPATH=`head -1 $HOME/.pl2shrc`
makepl()
{
    echo "#!/bin/sh" >$HOMEBIN/$2
    echo "perl $CVSSRCPATH/$1 \"\$@\"" >>$HOMEBIN/$2
    chmod a+x $HOMEBIN/$2
}
makesh()
{
    cp $CVSSRCPATH/$1  $HOMEBIN/$2
    chmod a+x $HOMEBIN/$2
}
if [ ! -e $CVSSRCPATH ]; then
    echo .pl2shrc path $CVSSRCPATH does not exist
    exit 1
fi
if [ ! -d $CVSSRCPATH ]; then
    echo .pl2shrc path $CVSSRCPATH is not a directory
    exit 1
fi

if [ $HOMEBIN/pl2sh -ot $CVSSRCPATH/perlutils/pl2sh ]; then
    makesh perlutils/pl2sh  pl2sh
    exec pl2sh
fi



makepl perlutils/winresdumper.pl      winresdumper
makepl perlutils/hexedit      hexedit
makepl perlutils/imagedmp.pl  imagedmp
makepl perlutils/symboldecode.pl symboldecode
makepl perlutils/add          add
makepl perlutils/base64       base64
makepl romtools/cabdump.pl    cabdump
makepl romtools/sdtool.pl     sdtool
makepl romtools/regsort.pl    regsort
makepl perlutils/dirsummary   dirsummary
makepl dumprom/dumpxip.pl     dumpxip
makepl dumprom/rdmsflsh.pl    rdmsflsh
makepl dumprom/editimgfs.pl   editimgfs
makepl romtools/fatinfo.pl    fatinfo
makepl romtools/dumpptable.pl      dumpptable
makepl romtools/dumpbootsec.pl     dumpbootsec
makepl perlutils/findstr      findstr
makepl perlutils/google.pl    google
makepl perlutils/uncomp.pl    uncomp
makepl perlutils/lstm         lstm
makepl perlutils/pfind        pfind
makepl perlutils/pgrep        pgrep
makepl perlutils/rfscopy      rfscopy
makepl perlutils/rfsdir       rfsdir
makepl romtools/splitrom.pl   splitrom
makepl perlutils/sumdiff      sumdiff
makepl perlutils/tdiff        tdiff
makepl perlutils/transpose    transpose
makepl perlutils/urldecode    urldecode
makepl perlutils/which        which
makepl perlutils/xcalc        xcalc
makepl perlutils/asn1dump.pl  asn1dump
makepl perlutils/eventtime.pl eventtime
makepl perlutils/clocks       clocks
makepl perlutils/mimedecode   mimedecode
makepl perlutils/dnstrace     dnstrace
makepl perlutils/cvslog       cvslog
makepl perlutils/cvsstat      cvsstat
makepl perlutils/cvsupd       cvsupd
makepl perlutils/crc32        crc32
makepl perlutils/cvsls        cvsls
makepl perlutils/svnls        svnls
makepl perlutils/mp3tag       mp3tag
makepl perlutils/peinfo.pl    peinfo
#makepl perlutils/pl2bat       pl2bat
#makepl perlutils/updatedb     updatedb
makepl perlutils/vcpdiff      vcpdiff
#makepl perlutils/xdu          xdu
makepl perlutils/lsq          lsq
makepl perlutils/decodesms.pl decodesms
makepl perlutils/zipdbg.pl    zipdbg
makepl xda2nbftool/alpinenbfdecode.pl   alpinenbfdecode
makepl xda2nbftool/decoderadio.pl       decoderadio
makepl xda2nbftool/typhoonnbfdecode.pl  typhoonnbfdecode
makepl xda2nbftool/dbhdecode.pl  dbhdecode
makepl xda2nbftool/nbh2dbh.pl    nbh2dbh
makepl xda2nbftool/gsmv2hash.pl    gsmv2hash
makepl xda2nbftool/parsegsmv2.pl    parsegsmv2
makepl perlutils/iphonebk2fs.pl iphonebk2fs
makepl perlutils/xml2pl         xml2pl
#makepl perlutils/kpnhot         kpnhot
makepl perlutils/get            get
makepl itsutils/comm/pppdump.pl            pppdump
makepl iphone/tools/decodeimg3.pl decodeimg3
makepl perlutils/cmpbin.pl  cmpbin
makepl perlutils/tpb.pl  tpb
makepl perlutils/anonssh.pl  anonssh
makepl perlutils/torscan.pl  torscan
makepl perlutils/tracsubmit.pl  tracsubmit
makepl perlutils/outdated outdated
makepl torxfer/tornewid.pl tornewid
makepl ida/idcscripts/mkenum.pl mkenum

makesh perlutils/svntag svntag
makesh perlutils/pldump pldump
makesh perlutils/x0     x0
makesh perlutils/unhex  unhex
makesh perlutils/cmpx  cmpx

makesh romtools/gsmcompress.sh gsmcompress.sh
makesh romtools/gsmsplit.sh    gsmsplit.sh
makesh miscscripts/utils/stopmds stopmds
makesh miscscripts/utils/sclist sclist
makesh miscscripts/utils/lsofdiff lsofdiff 
makesh miscscripts/utils/nonsvn nonsvn
makesh miscscripts/utils/nongit nongit
makesh miscscripts/utils/term term
makesh miscscripts/utils/log log
makesh miscscripts/utils/findbssid findbssid
makesh miscscripts/utils/openmap   openmap
makesh miscscripts/utils/checktorrent.sh checktorrent

makepl ida/idbutil/tstidb.pl  dumpidb
makepl macosx/hfstool/dumphfstree.pl dumphfs
makepl perlutils/cv2wav.pl cv2wav
