Overview
Comment:*** empty log message ***
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 870754adb4201db7dc6947ea37b22adaa00622e54f124f763d2e0e2fa24f79d6
User & Date: gawthrop@users.sourceforge.net on 2000-10-03 18:29:57
Other Links: branch diff | manifest | tags
Context
2000-10-03
18:34:00
Initial revision check-in: e0bb42b0c7 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
18:29:57
*** empty log message *** check-in: 870754adb4 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
18:29:26
crs now works after a fashion check-in: 69d1e18ae9 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/mtt_find from [912c88e929] to [f98e05dd96].

10
11
12
13
14
15
16



17
18
19
20
21
22
23
# Copyright (c) P.J.Gawthrop 1996

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.5  1998/07/17 07:50:33  peterg
## Now handles library name
## Returns a status
##   0 if exactly one result
##   1 if no results
##   2 if two or more results
##   3 if utterly confused







>
>
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright (c) P.J.Gawthrop 1996

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.6  1998/07/17 19:47:35  peterg
## Minor changes
##
## Revision 1.5  1998/07/17 07:50:33  peterg
## Now handles library name
## Returns a status
##   0 if exactly one result
##   1 if no results
##   2 if two or more results
##   3 if utterly confused
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

80
81
82
83
84
85
86
# Interpret the arguments
path="$1"

if [ -n "$2" ]; then
    name=`basename $2`
    longname=$2
    Name="-name $name"


fi

# If this is non-empty just print the path
path_only=$3

# Find all dirs in path with same name as component
# AND the path contains the full (name+library) name
paths=`echo $path | tr ":" " "`
foundpath=`\
for thepath in $paths; do
    find $thepath -type d  $Name -print 
done |\
sort -u |\
grep "$longname"`






# If non-null result, check that the name_lbl.txt file exists in dir name
# and print dirname and file name and last access time

if [ -n "$foundpath" ]; then
  if [ -n "$path_only" ]; then
    format='%h\n';
  else
    format='%h\t%f\t%Ac\n';
  fi
 for thepath in $foundpath ;  do






  dirname=`echo $thepath | awk -F/ '{print $NF}'`



  fullname="$dirname"_lbl.txt

  find $thepath -maxdepth 1 -name $fullname  -printf $format;
 done |\
 tee mtt_junk
fi

# Check exit status and return 
hits=`wc mtt_junk | awk '{print $1}'`







>
>















>
>
>
>
>
|

<






|
>
>
>
>
>
>
|
>
>
>
|
>







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

80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Interpret the arguments
path="$1"

if [ -n "$2" ]; then
    name=`basename $2`
    longname=$2
    Name="-name $name"
else
    name='*'
fi

# If this is non-empty just print the path
path_only=$3

# Find all dirs in path with same name as component
# AND the path contains the full (name+library) name
paths=`echo $path | tr ":" " "`
foundpath=`\
for thepath in $paths; do
    find $thepath -type d  $Name -print 
done |\
sort -u |\
grep "$longname"`

# If empty set foundpath to the simple components path
if [  -z "$foundpath"  ]; then
  foundpath="$MTT_LIB/comp/simple"
fi

# If non-null result, check that the name_ext file exists in dir name
# and print dirname and file name and last access time

if [ -n "$foundpath" ]; then
  if [ -n "$path_only" ]; then
    format='%h\n';
  else
    format='%h\t%f\t%Ac\n';
  fi
  for thepath in $foundpath ;  do
    if [ "$thepath" = "$MTT_COMPONENTS/simple" ]; then
        ext='cause.m'; # finds _cause.m
        simple='simple';
    else
        ext='lbl.txt'; # finds _lbl.txt
    fi    
     dirname=`basename $thepath`
     if [ -n "$simple" ]; then
      fullname="$name"_"$ext"
    else
      fullname="$dirname"_"$ext"
    fi
  find $thepath -maxdepth 1 -name $fullname  -printf $format;
 done |\
 tee mtt_junk
fi

# Check exit status and return 
hits=`wc mtt_junk | awk '{print $1}'`


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