Overview
Comment:mtt copy does NOT now copy the CVS directory
$directory --> ${directory} (just to be tidy)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 2584596feb8bd84c449bc7c0f74c12eb2c8a40e948924646ea09b4ef08faa008
User & Date: gawthrop@users.sourceforge.net on 2002-04-16 14:58:00
Other Links: branch diff | manifest | tags
Context
2002-04-17
10:03:12
Marked .sg as a major representation. check-in: fd2d783583 user: geraint@users.sourceforge.net tags: origin/master, trunk
2002-04-16
14:58:00
mtt copy does NOT now copy the CVS directory
$directory --> ${directory} (just to be tidy)
check-in: 2584596feb user: gawthrop@users.sourceforge.net tags: origin/master, trunk
14:38:12
Added a blank - stiil tryg to get it to work with syncmail check-in: eed30c8eca user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/mtt from [e3e34a8d53] to [65a3b7f823].

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


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]