Spelling fixes
[oweals/cde.git] / cde / admin / IntegTools / dbTools / udbParseLib.awk
1  
2 # Awk Library file for parsing UDB files
3 #
4 function parseUdb() {
5         # nawk has already read the initial line.  
6         # Tokenize it before doing anything else.
7         tokenize() 
8         readDefaults(defaults)
9         # assign hp-ux ".db" file src and link defaults
10         # if none were designated.
11                 if ( SrcDefault == "" )
12                         SrcDefault = "a_out_location"
13                 if ( LnkDefault == "" )
14                         LnkDefault = "link_source"
15                 if ( TypDefault == "" )
16                         TypDefault = "type"
17                 if ( DestDefault == "" )
18                         DestDefault = "install_target"
19                 if ( ModeDefault == "" )
20                         ModeDefault = "mode"
21                 if ( OwnerDefault == "" )
22                         OwnerDefault = "owner"
23                 if ( GroupDefault == "" )
24                         GroupDefault = "group"
25                 readData()
26 }
27
28 # -------------------------------------------------------------
29 #  readDefaults
30 #    This routine reads the defaults at the front section 
31 #  of the universal database and salts the defaults away.
32 #
33 # -------------------------------------------------------------
34 function readDefaults(dflts)
35 {
36         if ( DeBug > 0 ) {
37                 Depth++
38                 for ( i=1; i < Depth; i++ )
39                         printf(" ") > DeBugFile
40                 print "Entering function readDefaults" > DeBugFile
41         }
42         do {
43                 os = getOS()
44                 if ( osQual != "defaults" )
45                         syntaxError("No defaults for: " BlockToken)
46                 if ( os == BlockToken || os == "default" )
47                         break
48                 skipToToken("}")
49         } while ( 1 )
50         fillDefaults()
51         if ( DeBug > 1 )
52                 print "Skipping remaining defaults" > DeBugFile
53         # skip remaining default specs
54         while ( lookAhead() == "{" ) {
55                 # This should be another default spec
56                 # skip it. (watch out for syntax errors)
57                 os = getOS()
58                 if ( osQual != "defaults" )
59                         syntaxError("Expected os:defaults found: \"" os ":" osQual "\"")
60                 if ( os == BlockToken && fileName == FILENAME )
61                         syntaxError("Only one \"defaults\" record allowed per os" )
62
63                 skipToToken("}");
64         }
65         if ( DeBug > 0 ) Depth--
66 }
67 # -------------------------------------------------------------
68 #  syntaxError
69 #      bail out
70 #
71 # (optionally) mail a message to an administrator if a syntax 
72 # error occurs in a database.
73 #
74 # -------------------------------------------------------------
75 function syntaxError(reason) {
76         if ( DeBug > 0 ) {
77                 Depth++
78                 for ( i=1; i < Depth; i++ )
79                         printf(" ") > DeBugFile
80                 print "Entering function syntaxError:" > DeBugFile
81         }
82         print "Syntax ERROR line: " NR " of file: " FILENAME 
83         if (reason)
84                 print " " reason
85         system( "rm -f /tmp/SyntaxError" )
86         system( "touch /tmp/SyntaxError" )
87         print "Syntax ERROR line: " NR " of file: " FILENAME > "/tmp/SyntaxError"
88         if (reason)
89                 print " " reason >> "/tmp/SyntaxError"
90         close( "/tmp/SyntaxError" )
91         if ( mailTo != "" ) {
92                 system( "mailx -s \"database syntax error\"  "mailTo"  < /tmp/SyntaxError" )
93         }
94         system( "rm -f /tmp/SyntaxError" )
95         exit 1
96 }
97 # -------------------------------------------------------------
98 #  fillDefaults
99 #    This routine reads the defaults in the OS
100 #  defaults section of the database.  It saves the defaults
101 #  in the "defaults" awk-style string array.
102 #
103 # -------------------------------------------------------------
104 function fillDefaults() {
105         if ( DeBug > 0 ) {
106                 Depth++
107                 for ( i=1; i < Depth; i++ )
108                         printf(" ") > DeBugFile
109                 print "Entering function fillDefaults:" > DeBugFile
110         }
111         tempDflt = ""
112         NumEntries = 1
113         do {
114                 if ( tempDflt != "" ) {
115                         keyword = tempDflt
116                         tempDflt = ""
117                 }
118                 else
119                         keyword = nextToken()
120         
121                 if ( keyword == "}" )
122                         break;
123                 if ( "=" != nextToken())
124                         syntaxError("Keyword: " keyword " not followed by \"=\" ");
125                 tempDflt = nextToken();
126                 if ( lookAhead() == "=" )
127                         defaults[keyword]=""
128                 else {
129                         if ( tempDflt == "<SRC>" ) {
130                                 SrcDefault = keyword;
131                                 tempDflt = ""
132                         }
133                         if ( tempDflt == "<LNK>" ) {
134                                 LnkDefault = keyword;
135                                 tempDflt = ""
136                         }
137                         if ( tempDflt == "<TYPE>" ) {
138                                 TypDefault = keyword;
139                                 tempDflt = "file"
140                         }
141                         if ( tempDflt == "<DEST>" ) {
142                                 DestDefault = keyword;
143                                 tempDflt = ""
144                         }
145                         if ( tempDflt == "<MODE>" ) {
146                                 ModeDefault = keyword;
147                                 tempDflt = "0444"
148                         }
149                         if ( tempDflt == "<OWNER>" ) {
150                                 OwnerDefault = keyword;
151                                 tempDflt = "bin"
152                         }
153                         if ( tempDflt == "<GROUP>" ) {
154                                 GroupDefault = keyword;
155                                 tempDflt = "bin"
156                         }
157                         defaults[keyword]= tempDflt
158
159                         tempDflt = ""
160                 }
161                 defOrder[NumEntries++] = keyword;
162         } while ( 1 )
163         if ( DeBug > 3 ) {
164                 DBGprintArray(defaults,"defaults") 
165                 print "SrcDefault =" SrcDefault  > DeBugFile
166                 print "LnkDefault =" LnkDefault  > DeBugFile
167                 print "TypDefault =" TypDefault  > DeBugFile
168         }
169         if ( DeBug > 0 ) Depth--
170 }
171 # -------------------------------------------------------------
172 #  getOS
173 #    This routine scans the database for an 
174 #  open brace, then a token, then a ":" indicating 
175 #  the start of an OS defaults section.
176 #
177 # -------------------------------------------------------------
178 function getOS()
179 {
180         if ( DeBug > 0 ) {
181                 Depth++
182                 for ( i=1; i < Depth; i++ )
183                         printf(" ") > DeBugFile
184                 print "Entering function getOS:" > DeBugFile
185         }
186         osQual = ""
187         gotOS = 0
188
189         if ( "{" != nextToken() )
190                 syntaxError("Missing initial {")
191         os = nextToken();
192         if ( lookAhead() == ":" ) {
193                 nextToken();
194                 osQual= nextToken();
195         } else 
196                 osQual= ""
197         if ( DeBug > 0 ) Depth--
198         return os
199 }
200 # -------------------------------------------------------------
201 #  nextToken
202 #    parse the incoming data stream into tokens.
203 #
204 # -------------------------------------------------------------
205 function nextToken() {
206         if ( DeBug > 0 ) {
207                 Depth++
208                 for ( i=1; i < Depth; i++ )
209                         printf(" ") > DeBugFile
210                 print "Entering function nextToken:" > DeBugFile
211         }
212         if ( EOF_Reached == 1 )
213                 syntaxError("Premature EOF");
214         tmpToken=tokens[TK++]
215         while ( TK > Ntokens || tokens[TK] == ";" ) {
216                 TK++
217                 if ( TK > Ntokens )
218                         if ( newLine() <= 0 ) {
219                                 EOF_Reached = 1;
220                                 break;
221                         }
222         }
223         if ( DeBug > 2 )
224                 print "Returning token: " tmpToken > DeBugFile
225         if ( DeBug > 0 ) Depth--
226         return tmpToken
227 }
228 # -------------------------------------------------------------
229 #  lookAhead
230 #     return the token at the head of the current list of
231 #  tokens, but do not bump the token count in TK
232 #
233 # -------------------------------------------------------------
234 function lookAhead() {
235         if ( DeBug > 0 ) {
236                 Depth++
237                 for ( i=1; i < Depth; i++ )
238                         printf(" ") > DeBugFile
239                 print "Entering function lookAhead" > DeBugFile
240         }
241         if ( DeBug > 0 ) Depth--
242         return tokens[TK];
243 }
244 # -------------------------------------------------------------
245 #  newLine, tokenize
246 #    read a new line of input and tokenize it.
247 #
248 # -------------------------------------------------------------
249 function newLine() {
250         if ( DeBug > 0 ) {
251                 Depth++
252                 for ( i=1; i < Depth; i++ )
253                         printf(" ") > DeBugFile
254                 print "Entering function newLine:" > DeBugFile
255         }
256         if ( (retval = getline) <= 0 ) {
257                 if ( DeBug > 0 ) Depth--
258                 return retval
259         }
260         retval =  tokenize()
261         if ( DeBug > 0 ) Depth--
262         return retval
263 }
264 function tokenize() {
265         if ( DeBug > 0 ) {
266                 Depth++
267                 for ( i=1; i < Depth; i++ )
268                         printf(" ") > DeBugFile
269                 print "Entering function tokenize:" > DeBugFile
270         }
271         # Workaround for a strange awk bug, seen on FreeBSD
272         # and results in .db files generated with
273         #   Syntax ERROR line: 10 of file: CDE-INC.udb
274         #           Missing initial {
275         #
276         DUMMY = $0
277
278         # Skip blank/comment lines
279         while ( NF == 0 || $0 ~ /^[     ]*#/  ) {
280                 if ( (getline) <= 0 ) {
281                         if ( DeBug > 0 ) Depth--
282                         return 0
283                 }
284         }
285         
286
287         #
288         # Make sure syntactically meaningful characters are surrounded by
289         # white space.  (I gave up on gsub for this purpose).
290         #
291         last=1
292         Str=""                  # temp string for modified input line
293         tstStr=$0               # part of input line being tested
294         newStr=$0               # current input line image with modifications
295 ##########################################################################
296 # REPLACE THE FOLLOWING LINE WITH A WORK_AROUND FOR A PROBLEM WITH
297 # THE MATCH FUNCTION FOR THE SUN VERSION OF "nawk"
298 #
299 #       while ( match(tstStr,"[^\\\][:=}{;]") ) {
300 #
301         while ( match(tstStr,"[:=}{;]") ) {
302                 if ( RSTART-1 > 0 && substr(tstStr,RSTART-1,1) != "\\") {
303                         RSTART=RSTART-1
304                         LENGTH=LENGTH+1
305                 } else {
306                         #
307                         # The character was escaped with a backslash.
308                         # Patch things up -- continue testing the rest
309                         # of the line.
310                         # 
311                         Str=Str substr($0,last,RSTART+1) 
312                         last = last + RSTART + 1
313                         tstStr =substr($0,last)
314                         newStr = Str tstStr
315                         continue;       
316                 }
317 #######################   end of workaround ################################
318 ############################################################################
319                 if ( DeBug > 1 ) {
320                         print "Tokenize: Match found in: " tstStr
321                         print "RSTART= " RSTART " ; RLENGTH = " RLENGTH
322                 }
323                 # match found -- 
324                 # the temp string is now modified to contain:
325                 # 1) all characters up to the match and the first char of match
326                 # 2) blank before the  syntactically significant char
327                 # 3) the significant character
328                 # 4) blank following the significant character
329
330                 Str=Str substr($0,last,RSTART) " " substr($0,last+RSTART,1) " "
331                 last = last + RSTART + 1;
332                 #
333                 # Test remaining part of input line for additional occurrences
334                 # of syntactically significant characters.
335                 #
336                 tstStr=substr($0,last)
337                 #
338                 # Our best guess for the new string is the part of the
339                 # input line already tested plus the part yet to be tested.
340                 #
341                 newStr=Str tstStr
342         }
343         #
344         # Check for any instances of syntax chars at the start of the line
345         #
346         sub("^[:=}{;]","& ",newStr);
347         $0 = newStr
348
349         #
350         # allow escaping of significant syntax characters
351         #
352         gsub("[\\][{]","{")
353         gsub("\\:",":")
354         gsub("\\;",";")
355         gsub("\\=","=")
356         gsub("[\\][}]","}")
357
358         #
359         # Having insured that interesting chars are surrounded by blanks
360         # now tokenize the input line.
361         #
362
363         Ntokens = split($0,tokens)
364         TK = 1
365         if ( DeBug > 3 )
366                 DBGprintTokens()
367         if ( DeBug > 0 ) Depth--
368         return Ntokens
369 }
370 function DBGprintTokens()
371 {
372         for ( i = 1; i <= Ntokens ; i++ )
373                 print "tokens[" i "] = " tokens[i] > DeBugFile
374         return 0
375 }
376 function DBGprintArray(array,name) {
377         for ( i in array) {
378                 print name "[" i "] = " array[i]  > DeBugFile
379         }
380 }
381 # -------------------------------------------------------------
382 #  skipToToken
383 #     read until the passed in token is encountered
384 #
385 # -------------------------------------------------------------
386 function skipToToken(tok)
387 {
388         if ( DeBug > 0 ) {
389                 Depth++
390                 for ( i=1; i < Depth; i++ )
391                         printf(" ") > DeBugFile
392                 print "Entering function skipToToken:" > DeBugFile
393         }
394         while ( nextToken() != tok )
395                 ;
396         if ( DeBug > 0 ) Depth--
397 }
398 # -------------------------------------------------------------
399 #  readData
400 #
401 # -------------------------------------------------------------
402 function readData() {
403         if ( DeBug > 0 ) {
404                 Depth++
405                 for ( i=1; i < Depth; i++ )
406                         printf(" ") > DeBugFile
407                 print "Entering function readData" > DeBugFile
408         }
409         while ( EOF_Reached == 0 ) {
410                 if ( fileName != FILENAME ) {
411                         if ( DeBug > 1 ) {
412                                 print "====>Files Changed" > DeBugFile
413                                 print "fileName= " fileName > DeBugFile
414                                 print "FILENAME= " FILENAME > DeBugFile
415                         }
416                         fileName = FILENAME
417                         # skip over defaults section of the new file
418                         while ( lookAhead() == "{" ) {
419                                 # This should be another default spec
420                                 # skip it. (watch out for syntax errors)
421                                 os = getOS()
422                                 if ( osQual != "defaults" )
423                                         syntaxError("Expected os:defaults found: \"" os ":" osQual "\"")
424                                 #
425                                 # Relax this restriction since we are
426                                 # ignoring this defaults record
427                                 #if ( os == BlockToken )
428                                 #       syntaxError("Only one \"defaults\" record allowed per os" )
429
430                                 skipToToken("}");
431                         }
432                 }
433                 if ( getNextRecord(record) > 0 )
434                         PRTREC(record);
435                 # skip remaining os entries for this source
436                 # sorry no error checking.
437                 while ( EOF_Reached == 0 && lookAhead() == "{" )
438                         skipToToken("}")
439         if ( DeBug > 1 )
440                 print "EOF_Reached = " EOF_Reached > DeBugFile
441         }
442         if ( DeBug > 0 ) Depth--
443 }
444
445 # -------------------------------------------------------------
446 #  getNextRecord
447 #
448 #    this function fills the rec[] array with defaults
449 #
450 #    then it scans for a block that has a token maching
451 #    BlockToken, or accepts a block with the "default" 
452 #    token.  The "default" token is not accepted if 
453 #    defaults are disallowed.
454 #
455 #    finally fillRecord is called to read in the lines
456 #    in the block and override the entries in the rec[] array.
457 #
458 # -------------------------------------------------------------
459 function getNextRecord(rec) {
460         if ( DeBug > 0 ) {
461                 Depth++
462                 for ( i=1; i < Depth; i++ )
463                         printf(" ") > DeBugFile
464                 print "Entering function getNextRecord:" > DeBugFile
465         }
466         # fill with defaults
467         for ( i in defaults ) 
468                 rec[i] = defaults[i];
469         do {
470                 src = nextToken()
471                 if ( DeBug > 2 )
472                         print "src=" src > DeBugFile
473 # Allow special characters to appear in src names if they have been backslashed
474 #                       if ( src ~ /[{:=}]/ )
475 #                               syntaxError("Invalid source: \"" src "\"");
476                 do {
477                         os = getOS()
478                         if ( DeBug > 1 ) {
479                                 print "Got os " os " and qual= " osQual > DeBugFile
480                                 print "NR= " NR " : " $0 > DeBugFile
481                         }
482                         if (( os != BlockToken || osQual == "not" ) \
483                                 && ( os != "default" || UseDefaultBlocks != "Y" ) ) {
484
485                                 if ( DeBug > 2)
486                                         print "Skipping to end of os rec" > DeBugFile
487                                 skipToToken("}");
488                         }
489                         if ( EOF_Reached == 1 || fileName != FILENAME ){
490                                 if ( DeBug > 0 ) Depth--
491                                 return 0
492                         }
493                         if ( DeBug > 2 )
494                                 print "Look Ahead is: " tokens[TK] > DeBugFile
495                 } while ( lookAhead() == "{" )
496         } while (( os != BlockToken ) && ( os != "default" || UseDefaultBlocks != "Y"))
497                 if ( DeBug > 2)
498                         print "About to call fillRecord" > DeBugFile
499         fillRecord(rec)
500         if ( DeBug > 0 ) Depth--
501         return 1
502 }
503 function fillRecord(rec) {
504         if ( DeBug > 0 ) {
505                 Depth++
506                 for ( i=1; i < Depth; i++ )
507                         printf(" ") > DeBugFile
508                 print "Entering fillRecord:" > DeBugFile
509         }
510         tempEntry = ""
511         do {
512                 if ( tempEntry != "" ) {
513                         keyword = tempEntry;
514                         tempEntry = ""
515                 } else
516                         keyword = nextToken();
517                 if ( keyword == "}" )
518                         break;
519                 if ( "=" != nextToken())
520                         syntaxError("Keyword: " keyword " not followed by \"=\"");
521                 tempEntry = nextToken();
522                 if ( lookAhead() == "=" )
523                         rec[keyword] = ""
524                 else {
525                         rec[keyword] = tempEntry
526                         tempEntry = ""
527                 }
528         } while (1)
529         #
530         # check for source entry
531         # THIS IMPLIES KNOWLEDGE OF .db FILE ENTRIES!!
532         if ( DeBug > 2)
533                 print "TYPE= " rec[TypDefault]  > DeBugFile
534         if ( src == "-" )
535                 if ( rec[TypDefault]=="directory" || rec[TypDefault]=="empty_dir")
536                 {
537                         # no source required for a directory
538                         if ( rec[SrcDefault] != "" )
539                                 syntaxError(SrcDefault " \"" rec[SrcDefault] "\" specified for a directory.")
540                         if ( rec[LnkDefault] != "" )
541                                 syntaxError(LnkDefault " \"" rec[LnkDefault] "\" specified for a directory.")
542    
543                         rec[SrcDefault] = src;
544                 } else if ( rec["status"] == "---cu-" ) {
545                         # This is used for some reason (X11-SERV.db)
546                         if ( rec[SrcDefault] != "" )
547                                 syntaxError( "File: \"" rec["install_target"] "\" with special status: \"---cu-\" should have no source.");
548                 } else
549                         syntaxError("Invalid source: \"" src "\" for type: \"" rec[TypDefault] )
550         else if ( rec[TypDefault] ~ /link/ )
551                 if ( src ~ /^\// || src ~ /^\./ ) {
552                         if ( rec[SrcDefault] != "")
553                                 syntaxError( SrcDefault ": \""  rec[SrcDefault] "\" specified for link: \"" src "\"")
554                         if ( rec[LnkDefault] == "" )
555                                 rec[LnkDefault]=src;
556                 } else
557                         syntaxError("Invalid source: \"" src "\" for type: \"" rec[TypDefault] "\"")
558         else if ( rec[TypDefault] == "file" || rec[TypDefault] == "control" )
559                 rec[SrcDefault] = src;
560         else
561                 syntaxError("Unrecognized type:\"" rec[TypDefault] "\"")
562
563         if ( DeBug > 0 ) Depth--
564         
565 }
566
567 # -------------------------------------------------------------
568 #  printDB
569 #       Print records in ".db" format
570 # -------------------------------------------------------------
571 function printDb(rec) {
572         if ( DeBug > 0 ) {
573                 Depth++
574                 for ( i=1; i < Depth; i++ )
575                         printf(" ") > DeBugFile
576                 print "Entering printDb:"        > DeBugFile
577         }
578         # NumEntries should be one greater than the number of defaults
579         # read in.
580         for ( i = 1; i< NumEntries; i++ ) {
581                 printf("%-40s %s %s\n",defOrder[i], ":",rec[defOrder[i]])
582         }               
583         print "#"
584         if ( DeBug > 0 ) Depth--
585 }
586
587
588 # -------------------------------------------------------------
589 #  printLst
590 #       Print records in ".lst" format
591 # -------------------------------------------------------------
592 function printLst(rec) {
593         if ( DeBug > 0 ) {
594                 Depth++
595                 for ( i=1; i < Depth; i++ )
596                         printf(" ") > DeBugFile
597                 print "Entering printLst:"       > DeBugFile
598         }
599         if ( rec[TypDefault] ~ /link/ ) 
600                 Source = LnkDefault
601         else
602                 Source = SrcDefault
603
604         printf("%s %s %s %s %s %s %s %s %s\n",
605                                    rec[ DestDefault],
606                                    rec[ ModeDefault ],
607                                    rec[ Source ],
608                                    rec[ TypDefault ],
609                                    rec[ OwnerDefault ],
610                                    rec[ GroupDefault ],
611                                    rec[ "status" ],
612                                    rec[ "processor" ],
613                                    rec[ "responsible_project" ] ) 
614                                 
615         if ( DeBug > 0 ) Depth--
616 }
617
618 # -------------------------------------------------------------
619 #  printGather
620 #       print records in one of the formats expected by Gather.ksh
621 #       (Jim Andreas print routine).
622 # -------------------------------------------------------------
623 function printGather(rec) {
624 # print "Entering printRecord:  "
625
626     if (( BlockToken == "hp-ux" ) && ( rec[ "processor" ] != "378" ))
627     {
628         if ( index( rec[ "processor" ], Machine ) == 0 )
629         {
630 #printf( "skipping %s, Machine %s machines %s\n", src, Machine, rec[ "processor" ] );
631             return
632         }
633     }
634     if ( action == "toSDD" )
635     {
636         if ( rec[ "type" ] == "file" )
637         {
638             printf("%s:F:%s:%s:%s:*::\n", 
639                 rec[ "install_target" ], rec[ "owner" ],
640                 rec[ "group" ], rec[ "mode" ])
641         }
642     }
643     else if ( action == "toReleaseTree" )
644     {
645       if ( ( rec[ "type" ] == "hard_link" ) ||
646              ( rec[ "type" ] == "sym_link" )  || 
647              ( rec[ "type" ] == "file" )   ) 
648       {
649
650 #
651 # if this is a link, then fudge a source file for Gather.ksh
652 # to check on.  Really we are linking two dest files together
653 # so the hack is to get around the check in Gather.ksh
654 #
655
656         if ( ( rec[ "type" ] == "hard_link" ) ||
657              ( rec[ "type" ] == "sym_link" ) )
658         {
659             printf( "   {s}%s {d}%s\n", "-", rec[ "install_target" ] );
660         }
661         else if ( length( src ) > 34 )
662                 printf( "   {s}%s {d}%s\n",   src, rec[ "install_target" ] );
663             else
664                 printf( "   {s}%-34s {d}%s\n", src, rec[ "install_target" ] );
665
666         if ( rec[ "install_rule_name" ] == "c-" )
667         {
668             printf( "compress -c < {s}%s > {d}%s\n", src, 
669                 rec[ "install_target" ] );
670         }
671         else if ( rec[ "type" ] == "sym_link" )
672         {
673             printf( "ln -s %s {d}%s\n", src, 
674                 rec[ "install_target" ] );
675         }
676         else if ( rec[ "type" ] == "hard_link" )
677         {
678             printf( "ln {d}%s {d}%s\n", src, 
679                 rec[ "install_target" ] );
680         }
681         else if ( rec[ "uncompress" ] == "true" )
682         {
683             printf( "uncompress -c < {s}%s > {d}%s\n", src, 
684                 rec[ "install_target" ] );
685         }
686         else if ( length( src ) > 34 )
687         {
688             printf( "cp {s}%s {d}%s\n", src, 
689                 rec[ "install_target" ] );
690         }
691         else
692         {
693             printf( "cp {s}%-34s {d}%s\n", src, 
694                 rec[ "install_target" ] );
695         }
696         printf( "%s %s %s\n", rec[ "owner" ], rec[ "group" ], rec[ "mode" ])
697         rec[ "install_rule_name" ] = "";
698         rec[ "uncompress" ] = "";
699       }
700     }
701     else if ( action == "toDeliverArgs" )
702     {
703         temp = rec[ "install_target" ];
704         m = n = index( temp, "/" );
705         while ( n != 0 )
706         {
707             temp = substr( temp, n+1 );
708             n = index( temp, "/" );
709             m += n;
710         }
711         dirnametarget = substr( rec[ "install_target" ], 1, m-1 );
712
713         if ( length( rec[ "install_target" ] ) > 40 )
714         {
715             printf("%s -d .%s\n", rec[ "install_target" ], dirnametarget );
716         }
717         else
718         {
719             printf("%-40s -d .%s\n", rec[ "install_target" ], dirnametarget );
720         }
721     }
722     else if ( action == "toCheckBuild" )
723     {
724 # print "Entering printRecord - toCheckBuild:  "
725         #
726         # skip any link info
727         #
728         if ( rec[ "type" ] == "file" )
729         {
730             #
731             # just print the source path for the checker tool
732             #
733             printf("%s\n", src );
734         }
735     }
736     else if ( action == "toFileList" )
737     {
738         #
739         # skip any link info
740         #
741         if ( rec[ "type" ] == "file" )
742         {
743             #
744             # print the source and install_target for the human person
745             #
746             if ( length( src ) > 40 || length( rec[ "install_target" ] ) > 40 )
747             {
748                 printf("%s -> %s %s\n", src,
749                    rec[ "install_target" ], rec[ "mode" ] );
750             }
751             else
752             {
753                 printf("%-40s -> %-40s %s\n", src,
754                    rec[ "install_target" ], rec[ "mode" ] );
755             }
756         }
757     }
758     else if ( action == "toTargetList" )
759     {
760         #
761         # skip any link info
762         #
763         if ( rec[ "type" ] == "file" )
764         {
765             #
766             # just print the install_target
767             #
768             printf("%s\n", rec[ "install_target" ] );
769         }
770     }
771 }
772