From 14a30e0d7b9030859f042285fa4175dd200f8e35 Mon Sep 17 00:00:00 2001 From: jwalz Date: Sat, 5 Jan 2002 21:05:55 +0000 Subject: [PATCH] *** empty log message *** --- sys/amiga/ship/mkfd.awk | 92 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sys/amiga/ship/mkfd.awk diff --git a/sys/amiga/ship/mkfd.awk b/sys/amiga/ship/mkfd.awk new file mode 100644 index 000000000..deeea644b --- /dev/null +++ b/sys/amiga/ship/mkfd.awk @@ -0,0 +1,92 @@ +# mkfd.awk +# make filldir script from shipping list +function chknam(x){ + if( ! (x in dirlist) ){ + dirlist[x]=x +# print "if not exists -" x > "filldir" +# print " makedir -" x > "filldir" +# print "endif" > "filldir" + } + } +BEGIN { + print ".key prefix/a" > "filldir" + print "; This file generated by mkfd.awk - do not edit!" > "filldir" + + # kludge to avoid a proper but complex chknam to deal with subdirs + # d is also broken + print "if not exists -1" > "filldir" + print " makedir -1" > "filldir" + print "endif" > "filldir" + print "if not exists -2" > "filldir" + print " makedir -2" > "filldir" + print "endif" > "filldir" + + print "if not exists -2/HackExe" > "filldir" + print " makedir -2/HackExe" > "filldir" + print "endif" > "filldir" + print "if not exists -1/NetHack" > "filldir" + print " makedir -1/NetHack" > "filldir" + print "endif" > "filldir" + + print "if not exists -2/HackExe2" > "filldir" + print " makedir -2/HackExe2" > "filldir" + print "endif" > "filldir" + + print "if not exists -1/NetHack/hack" > "filldir" + print " makedir -1/NetHack/hack" > "filldir" + print "endif" > "filldir" + + print "if not exists -1/NetHack/sounds" > "filldir" + print " makedir -1/NetHack/sounds" > "filldir" + print "endif" > "filldir" + + } +/^#/ {} +/^f/ { + chknam($3) + print "cmove nethack:" $2 " -" $3 "/" $4 "/" $2 > "filldir" + } +/^B/ { + chknam($3) + print "slink nethack:" $2 " to -" $3 "/" $4 "/" $2 " ND" > "filldir" + } +/^E/ { + chknam($3) + print "copy NIL: -" $3 "/" $4 "/" $2 > "filldir" + } +/^F/ { + chknam($3) + if(sub(":","",$4)){ + div=":" + } else { + div ="/" + } + print "cmove " $4 div $2 " -" $3 "/" $4 "/" $2 > "filldir" + } +#/^r/ { +# chknam($3) +# print "cmove nethack:" $2 " -" $3 "/" $4 > "filldir" +# } +#/^R/ { +# chknam($3) +# print "cmove " $4 "/" $2 " -" $3 "/" $5 > "filldir" +# } +/^d/ { + chknam($3) + chknam($3 "/" $2) +# DO WE NEED A DUMMY FILE HERE? +# NO - do it in shiplist +# print "if not exists -" $3 "/" $2 > "filldir" +# print " makedir -" $3 > "filldir" +# print "endif" > "filldir" + } +/^S/ { + print "blink nethack:nethack to ram:nethack ND" > "filldir" + print "set here=`cd`" > "filldir" + print "cd ram:" > "filldir" + print "amiga:splitter/splitter nethack" > "filldir" + print "cd $here" > "filldir" + } +/^[^f#dFrRBES]/{ #out of date + print "line " $0 " rejected - bad type" + }