1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
#!/bin/sh
# CPTOPUBLIC [uv] [nouv]
# This is used in (copied into) each script to adjust
# our location to the code directory above dwarfdump, libdwarf, etc.
# This is the original copy (not used directly).
l=`pwd`
echo $l
lb=`basename $l`
ld=`dirname $l`
#echo " lb: $lb"
#echo " ld: $ld"
cdtarg=.
sloc=$l/scripts
if [ x$lb = "xscripts" ]
then
#echo "ld: $ld"
ldb=`basename $ld`
#echo "ldb: $ldb"
if [ x$ldb = "xcode" ]
then
cdtarg=..
sloc=$l
else
echo "Run from */code, not $l , giving up."
exit 1
fi
cd $cdtarg
if [ $? -ne 0 ]
then
echo "cd $cdtarg failed, giving up."
exit 1
fi
else
if [ x$lb = "xcode" ]
then
cdtarg="."
else
echo "Run from */code, not $l , giving up."
exit 1
fi
# No need to cd.
fi
l=`pwd`
#echo "Now at $l"
#echo "sloc $sloc"
usemsg()
{
echo "CPTOPUBLIC [uv] [nouv]"
echo "where uv means update version strings "
echo "where nouv means do not update version strings "
echo "One of uv or nouv is required..."
}
if [ $# -ne 1 ]
then
usemsg
exit 1
fi
uver="n"
case $1 in
uv) uver="y" ;;
nouv) uver="n" ;;
*) usemsg ; exit 1 ;;
esac
s=/home/davea/dwarf/code
cd $s
pwd
t=/var/tmp/dwarf
echo target is $t
if [ $uver = "y" ]
then
sh $sloc/UPDATEDWARFDUMPVERSION.sh
fi
rm -rf $t
mkdir $t
cp -rp * $t
|