######################################################################## # # # This software is part of the ast package # # Copyright (c) 1996-2011 AT&T Intellectual Property # # and is licensed under the # # Eclipse Public License, Version 1.0 # # by AT&T Intellectual Property # # # # A copy of the License is available at # # http://www.eclipse.org/org/documents/epl-v10.html # # (with md5 checksum b35adb5213ca9657e911e9befb180842) # # # # Information and Software Systems Research # # AT&T Research # # Florham Park NJ # # # # Glenn Fowler # # # ######################################################################## : download item hosttype ... global command := 'download' matchstr $[getopts '[-][123:xyz]' opt --xyz !2 >/dev/null; echo 0$opt] { 0123 { global ARGV0 := ""-a $command"" global USAGE := "$' [-? @(#)$Id: download (AT&T Research) 2000-12-07 $ ] '$USAGE_LICENSE$' [+NAME?download - generate web site download instructions for an mm document] [+DESCRIPTION?\bdownload\b is a \bksh\b(1) script that generates web site download instructions for an \bmm\b(1) document. \aitem\a names the item to be downloaded and \atype\a ... names the supported architecture type(s) as reported by \bpackage\b(1).] [+?\bdownload\b is most often used in the \b.sh\b directive of \bmm2html\b(1) or \btroff2html\b(1): \b.sh download warp sgi.mips3 linux.i386\b.] item [ type ... ] [+SEE ALSO?\bmm2html\b(1), \bpackage\b(1), \btroff2html\b(1)] "' global id := $(USAGE##????) global id := $(id%']'*) } * { global ARGV0 := ''"" global USAGE := ''i:[file] [ file ... ]'' global id := ''mm2html (AT&T Research) 1999-04-15'' } } proc usage { global OPTIND := '0' getopts $ARGV0 $USAGE OPT '-?' exit 2 } while getopts $ARGV0 "$USAGE" OPT { matchstr $OPT { i { source $OPT || exit 1 } * { usage } } } shift $OPTIND-1 matchstr $Argc { 0|1 { usage } } global item := $1 shift print -r -- ".H 1 Download" print -r -- "Check the" print -r -- ".xx link=\"../faq.html FAQ\"" print -r -- "for information on binary installations." print -r -- "Source and binary packages for" print -r -- ".B $(item)" print -r -- "are available at the" print -r -- ".xx link=\"/sw/download/ package\"" print -r -- "download site; evaluation binaries containing only" print -r -- ".B $(item)" print -r -- "are also available for these system architectures:" print -r -- ".BLfor type in @Argv { print -r -- ".LI" print -r -- ".xx link=\"./$(item)-$(type).tgz $(type)\"" } print -r -- ".LE" print -r -- ".PP" print -r -- "NOTE: Click the right mouse button to make sure the file is" print -r -- "dowloaded and not displayed (go figure)." (CommandList children: [ (C {(Lit_Other ":")} {(download)} {(item)} {(hosttype)} {(...)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:command) op:Equal rhs:{(download)} spids:[68])] spids: [68] ) (Case to_match: { (CommandSubPart command_list: (CommandList children: [ (Sentence child: (SimpleCommand words: [{(getopts)} {(SQ <"[-][123:xyz]">)} {(opt)} {(--xyz)}] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[84])] ) terminator: ) (C {(echo)} {(0) ($ VSub_Name "$opt")}) ] ) left_token: spids: [73 92] ) } arms: [ (case_arm pat_list: [{(0123)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ARGV0) op: Equal rhs: {(DQ ("-a ") ($ VSub_Name "$command"))} spids: [99] ) ] spids: [99] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:USAGE) op: Equal rhs: { (SQ <"\n"> <"[-?\n"> <"@(#)$Id: download (AT&T Research) 2000-12-07 $\n"> <"]\n">) ($ VSub_Name "$USAGE_LICENSE") (SQ <"\n"> < "[+NAME?download - generate web site download instructions for an mm document]\n" > <"[+DESCRIPTION?"> <" is a "> <"(1) script that generates web site\n"> <"\tdownload instructions for an "> <"(1) document. "> <" names the\n"> <"\titem to be downloaded and "> <" ... names the supported architecture\n"> <"\ttype(s) as reported by "> <"(1).]\n"> <"[+?"> <" is most often used in the "> <.sh> <" directive of "> <"(1)\n"> <"\tor "> <"(1): "> <".sh download warp sgi.mips3 linux.i386"> <".]\n"> <"\n"> <"item [ type ... ]\n"> <"\n"> <"[+SEE ALSO?"> <"(1), "> <"(1), "> <"(1)]\n"> ) } spids: [106] ) ] spids: [106] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:id) op: Equal rhs: { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_DPound arg_word:{("????")}) spids: [187 191] ) } spids: [186] ) ] spids: [186] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:id) op: Equal rhs: { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Percent arg_word:{(SQ <"]">) ("*")}) spids: [195 202] ) } spids: [194] ) ] spids: [194] ) ] spids: [96 97 205 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:ARGV0) op:Equal rhs:{(DQ )} spids:[210])] spids: [210] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:USAGE) op: Equal rhs: {(SQ <"i:[file] [ file ... ]">)} spids: [215] ) ] spids: [215] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:id) op: Equal rhs: {(SQ <"mm2html (AT&T Research) 1999-04-15">)} spids: [221] ) ] spids: [221] ) ] spids: [207 208 227 -1] ) ] spids: [71 94 229] ) (FuncDef name: usage body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:OPTIND) op:Equal rhs:{(0)} spids:[239])] spids: [239] ) (C {(getopts)} {($ VSub_Name "$ARGV0")} {(DQ ($ VSub_Name "$USAGE"))} {(OPT)} {(SQ <"-?">)}) (C {(exit)} {(2)}) ] spids: [236] ) spids: [232 235] ) (While cond: [(C {(getopts)} {($ VSub_Name "$ARGV0")} {(DQ ($ VSub_Name "$USAGE"))} {(OPT)})] body: (DoGroup children: [ (Case to_match: {($ VSub_Name "$OPT")} arms: [ (case_arm pat_list: [{(i)}] action: [ (AndOr children: [(C {(.)} {($ VSub_Name "$OPT")}) (C {(exit)} {(1)})] op_id: Op_DPipe ) ] spids: [286 287 299 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [(C {(usage)})] spids: [302 303 307 -1] ) ] spids: [279 283 310] ) ] spids: [277 312] ) ) (C {(shift)} {($ VSub_Name "$OPTIND") (-1)}) (Case to_match: {($ VSub_Pound "$#")} arms: [(case_arm pat_list:[{(0)}{(1)}] action:[(C {(usage)})] spids:[325328332-1])] spids: [319 323 334] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:item) op:Equal rhs:{($ VSub_Number "$1")} spids:[337])] spids: [337] ) (C {(shift)}) (C {(print)} {(-r)} {(--)} {(DQ (".H 1 Download"))}) (C {(print)} {(-r)} {(--)} {(DQ ("Check the"))}) (C {(print)} {(-r)} {(--)} { (DQ (".xx link=") (EscapedLiteralPart token:) ("../faq.html\tFAQ") (EscapedLiteralPart token:) ) } ) (C {(print)} {(-r)} {(--)} {(DQ ("for information on binary installations."))}) (C {(print)} {(-r)} {(--)} {(DQ ("Source and binary packages for"))}) (C {(print)} {(-r)} {(--)} {(DQ (".B ") (${ VSub_Name item))}) (C {(print)} {(-r)} {(--)} {(DQ ("are available at the"))}) (C {(print)} {(-r)} {(--)} { (DQ (".xx link=") (EscapedLiteralPart token:) ("/sw/download/\tpackage") (EscapedLiteralPart token:) ) } ) (C {(print)} {(-r)} {(--)} {(DQ ("download site; evaluation binaries containing only"))}) (C {(print)} {(-r)} {(--)} {(DQ (".B ") (${ VSub_Name item))}) (C {(print)} {(-r)} {(--)} {(DQ ("are also available for these system architectures:"))}) (C {(print)} {(-r)} {(--)} {(DQ (.BL))}) (ForEach iter_name: type do_arg_iter: True body: (DoGroup children: [ (C {(print)} {(-r)} {(--)} {(DQ (.LI))}) (C {(print)} {(-r)} {(--)} { (DQ (".xx link=") (EscapedLiteralPart token:) (./) (${ VSub_Name item) (-) (${ VSub_Name type) (".tgz\t") (${ VSub_Name type) (EscapedLiteralPart token:) ) } ) ] spids: [478 515] ) spids: [-1 -1] ) (C {(print)} {(-r)} {(--)} {(DQ (.LE))}) (C {(print)} {(-r)} {(--)} {(DQ (.PP))}) (C {(print)} {(-r)} {(--)} {(DQ ("NOTE: Click the right mouse button to make sure the file is"))}) (C {(print)} {(-r)} {(--)} {(DQ ("dowloaded and not displayed (go figure)."))}) ] )