13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# Copyright (C) 2001 by Peter J. Gawthrop
###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.327 2001/11/15 02:56:17 geraint
## Added DASSL as an option for solution of algebraic equations (-ae dassl).
## Requires octave-2.1.35.
##
## Revision 1.326 2001/10/26 01:01:47 geraint
## fixcc when rdae_is_dae (-cr).
##
|
>
>
>
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# Copyright (C) 2001 by Peter J. Gawthrop
###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.328 2002/02/19 16:27:05 geraint
## Changes to make MTT work out of the box with Debian.
##
## Revision 1.327 2001/11/15 02:56:17 geraint
## Added DASSL as an option for solution of algebraic equations (-ae dassl).
## Requires octave-2.1.35.
##
## Revision 1.326 2001/10/26 01:01:47 geraint
## fixcc when rdae_is_dae (-cr).
##
|
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
|
if [ "$1" = "copy" ]; then
#set up source and destination dirs
source=$3
if [ -z "$source" ]; then
source=$MTT_Examples
fi
destination=$4
if [ -z "$destination" ]; then
destination=$2
fi
# check that its not here already
file_exists=`ls $destination/$2_abg.fig 2> /dev/null`
if [ -n "$file_exists" ]; then
if [ "$quiet" != "quiet" ]; then
echo System $2 exists already - no action taken
fi
else
source=$3
if [ -z "$source" ]; then
source=$MTT_EXAMPLES
fi
destination=$4
if [ -z "$destination" ]; then
destination=$2
fi
echo Copying system $2 from $source into directory $destination
find $source -name "$2" -exec cp -rf {} . \;
fi
exit
fi
# Copy components from the library
if [ "$1" = "compcopy" ]; then
#Pull out the base name (we may have a library as well)
name=`basename $2`
#set up source and destination dirs
source=$3
if [ -z "$source" ]; then
source=$MTT_COMPONENTS
fi
destination=$4
if [ -z "$destination" ]; then
destination='.'
fi
# check that its not here already
file_exists=`ls $destination/"$name"_abg.fig 2> /dev/null`
if [ -n "$file_exists" ]; then
if [ "$quiet" != "quiet" ]; then
echo Component $name exists already - no action taken
fi
else
if [ $source = "." ]; then
cp -u *_*.* $destination
else
comp_path=`mtt_find $source $2 path_only`
n_found=`echo $comp_path | wc | awk '{print $2}'`
if [ "$n_found" = "1" ]; then
echo Copying $2 from $comp_path to $destination
cp $comp_path/*_*.* $destination
exit 0
elif [ "$n_found" = "0" ]; then
if [ "$quiet" != "quiet" ]; then
echo Component $2 not found - is MTT_COMPONENTS set correctly?
fi
exit 1
elif [ "$n_found" > "1" ]; then
|
|
|
|
|
|
>
|
|
|
|
|
|
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
|
if [ "$1" = "copy" ]; then
#set up source and destination dirs
source=$3
if [ -z "$source" ]; then
source=$MTT_Examples
fi
destination=$4
if [ -z "${destination}" ]; then
destination=$2
fi
# check that its not here already
file_exists=`ls ${destination}/$2_abg.fig 2> /dev/null`
if [ -n "$file_exists" ]; then
if [ "$quiet" != "quiet" ]; then
echo System $2 exists already - no action taken
fi
else
source=$3
if [ -z "$source" ]; then
source=$MTT_EXAMPLES
fi
destination=$4
if [ -z "${destination}" ]; then
destination=$2
fi
echo Copying system $2 from $source into directory ${destination}
find $source -name "$2" -exec cp -fr {} . \;
rm -rf ${destination}/CVS
fi
exit
fi
# Copy components from the library
if [ "$1" = "compcopy" ]; then
#Pull out the base name (we may have a library as well)
name=`basename $2`
#set up source and destination dirs
source=$3
if [ -z "$source" ]; then
source=$MTT_COMPONENTS
fi
destination=$4
if [ -z "${destination}" ]; then
destination='.'
fi
# check that its not here already
file_exists=`ls ${destination}/"$name"_abg.fig 2> /dev/null`
if [ -n "$file_exists" ]; then
if [ "$quiet" != "quiet" ]; then
echo Component $name exists already - no action taken
fi
else
if [ $source = "." ]; then
cp -u *_*.* ${destination}
else
comp_path=`mtt_find $source $2 path_only`
n_found=`echo $comp_path | wc | awk '{print $2}'`
if [ "$n_found" = "1" ]; then
echo Copying $2 from $comp_path to ${destination}
cp $comp_path/*_*.* ${destination}
exit 0
elif [ "$n_found" = "0" ]; then
if [ "$quiet" != "quiet" ]; then
echo Component $2 not found - is MTT_COMPONENTS set correctly?
fi
exit 1
elif [ "$n_found" > "1" ]; then
|