home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 10
/
Fresh_Fish_10_2352.bin
/
genindex
< prev
next >
Wrap
AmigaDOS Script File
|
1995-08-17
|
4KB
|
95 lines
.KEY arg_outfile,arg_pilist,arg_id,arg_desc
.BRA [
.KET ]
; Using arg_pilist, arg_id, and arg_desc, append amigaguide output to
; the file arg_outfile, which may contain output from previous executions
; of this script. The arg_pilist file contains a list of fully qualified
; product info file names.
;
; The output consists of a node named INDEX-arg_id, with the description
; arg_desc, containing lines of the form
;
; @{"name" ...} @{"version" ...} @{"short description" ...}
;
; The name field invokes an amigaguide system call that runs a script that
; extracts the ".run" field from the associated product info file and tries
; to run it.
;
; The version field will eventually cause a search for other versions to be
; run. For now it invokes a script that does nothing but throw up a requester
; and return.
;
; The short description field includes a link to a node in the CONTENTS.guide
; file that contains the longer description of the associated product.
;
; After the INDEX-arg_id node comes a series of nodes that are referenced
; by entries in the INDEX-arg_id node, one node for extended contents
; information for each INDEX-arg_id entry.
;
; IMPORTANT! At the time the entries in INDEX.guide are accessed, the
; current directory may be somewhere other than the current directory at
; the time this script is envoked, so arg_pilist should contain fully
; qualified pathnames (which are inserted as part of the INDEX.guide entry).
; HACK! FIXME! ARG!
set volname "FreshFish-Vol10"
set tmp_tmp1 "t:GenINDEX-0-[$$].tmp"
set tmp_tmp2 "t:GenINDEX-1-[$$].tmp"
set tmp_sorted "t:GenINDEX-2-[$$].tmp"
set tmp_accum "t:GenINDEX-3-[$$].tmp"
; Generate a temporary file containing the same product info filenames as
; arg_pilist, but sorted by the name of the product.
$volname:Tools/c/pitool <[arg_pilist] -b -F "@%N@%i\n" -f - - >$tmp_tmp1
$volname:Tools/c/sort -f <$tmp_tmp1 >$tmp_tmp2
$volname:Tools/c/sed "s:@.*@::" <$tmp_tmp2 >$tmp_sorted
; Output the header of the INDEX entries node.
; Echo insists on writing its output to the screen when run inside
; a script with execute, even if that script's output has been redirected
; to a file. Furthermore, it can't even append to a file, so we have to
; interleave echos and joins to get what we need. How did this 1960's
; scripting environment end up in a 1990's computer?
echo "@node INDEX-[arg_id] @dq@[arg_desc]@dq@" to $tmp_accum
echo "To run a program, view a picture, etc, click on the name field below." to $tmp_tmp2
copy $tmp_accum $tmp_tmp1
join $tmp_tmp1 $tmp_tmp2 as $tmp_accum
echo "For more information about a particular program, click on the" to $tmp_tmp2
copy $tmp_accum $tmp_tmp1
join $tmp_tmp1 $tmp_tmp2 as $tmp_accum
echo "description field." to $tmp_tmp2
copy $tmp_accum $tmp_tmp1
join $tmp_tmp1 $tmp_tmp2 as $tmp_accum
echo "" >>$tmp_accum to $tmp_tmp2
copy $tmp_accum $tmp_tmp1
join $tmp_tmp1 $tmp_tmp2 as $tmp_accum
; Generate the INDEX.guide entries.
$volname:Tools/c/pitool <$tmp_sorted -b -F "@{@dq@%-16.16N@dq@ system @dq@run >nil: execute $volname:tools/scripts/RunDotRun %i@dq@}@{@dq@%-40.40S@dq@ link %N-%V}\n" -f - - >>$tmp_accum
; Finish off the INDEX node.
echo "@endnode" >>$tmp_tmp2
copy $tmp_accum $tmp_tmp1
join $tmp_tmp1 $tmp_tmp2 as $tmp_accum
; Generate the full contents node for each product.
$volname:Tools/c/pitool <$tmp_sorted -b -F "@node %N-%V @dq@%S@dq@\n\n%N %V %S\n\n%d\n\nAuthor: %a\nPath: %P\n\n@endnode\n\n" -f - - >>$tmp_accum
; Note that we first generate the entries in a temporary file, and then
; post process it with sed to replace occurances of @dq@ with double quotes,
; since we can't seem to escape them in the pitool command line.
$volname:Tools/c/sed -f $volname:tools/scripts/addquotes.sed <$tmp_accum >>[arg_outfile]
; Clean up
delete $tmp_tmp1 $tmp_tmp2 $tmp_sorted $tmp_accum quiet force >nil:
unset volname