######################################################################## # # # This software is part of the ast package # # Copyright (c) 1987-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 # # # ######################################################################## : rpm2cpio wrapper for pax global command := 'rpm2cpio' matchstr $[shell {getopts '[-][123:xyz]' opt --xyz; echo 0$opt}] { 0123 { global ARGV0 := ""-a $command"" global USAGE := "$' [-? @(#)$Id: rpm2cpio (AT&T Labs Research) 1999-12-25 $ ] '$USAGE_LICENSE$' [+NAME?rpm2cpio - convert rpm file to cpio file] [+DESCRIPTION?\brpm2cpio\b converts the input \brpm\b(1) \afile\a, or the standard input if \afile\a is omitted, to a \bcpio\b(1) file on the standard output.] [+?This command is provided for interface compatibility; use \bpax\b(1) to read \brpm\b files directly.] [n:show?Show the underlying \bpax\b(1) command but do not execute.] [v:verbose?List the package file members as they are converted.] [ file ] [+SEE ALSO?\bcpio\b(1), \bpax\b(1), \brpm\b(1)] "' } * { global ARGV0 := ''"" global USAGE := '"nv [ file ]'" } } proc usage { global OPTIND := '0' getopts $ARGV0 $USAGE OPT '-?' exit 2 } global show := '' global options := '' while getopts $ARGV0 "$USAGE" OPT { matchstr $OPT { n { global show := '"print --'" } v { global options := ""$options -v"" } * { echo "Usage: $command [-nv] [ file ]" > !2 exit 2 } } } shift $OPTIND-1 matchstr $Argc { 0 { global input := '-' } 1 { global input := $1 } * { usage } } $show pax $options -r -f $input -w -x cpio (CommandList children: [ (C {(Lit_Other ":")} {(rpm2cpio)} {(wrapper)} {(KW_For for)} {(pax)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:command) op:Equal rhs:{(rpm2cpio)} spids:[68])] spids: [68] ) (Case to_match: { (CommandSubPart command_list: (CommandList children: [ (Subshell child: (CommandList children: [ (Sentence child: (C {(getopts)} {(SQ <"[-][123:xyz]">)} {(opt)} {(--xyz)}) terminator: ) (C {(echo)} {(0) ($ VSub_Name "$opt")}) ] ) redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[92])] spids: [74 90] ) ] ) left_token: spids: [73 94] ) } 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: [101] ) ] spids: [101] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:USAGE) op: Equal rhs: { (SQ <"\n"> <"[-?\n"> <"@(#)$Id: rpm2cpio (AT&T Labs Research) 1999-12-25 $\n"> <"]\n"> ) ($ VSub_Name "$USAGE_LICENSE") (SQ <"\n"> <"[+NAME?rpm2cpio - convert rpm file to cpio file]\n"> <"[+DESCRIPTION?"> <" converts the input "> <"(1) "> <", or\n"> <"\tthe standard input if "> <" is omitted, to a "> <"(1)\n"> <"\tfile on the standard output.]\n"> <"[+?This command is provided for interface compatibility; use "> <"(1) to\n"> <"\tread "> <" files directly.]\n"> <"[n:show?Show the underlying "> <"(1) command but do not execute.]\n"> <"[v:verbose?List the package file members as they are converted.]\n"> <"\n"> <"[ file ]\n"> <"\n"> <"[+SEE ALSO?"> <"(1), "> <"(1), "> <"(1)]\n"> ) } spids: [108] ) ] spids: [108] ) ] spids: [98 99 177 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:ARGV0) op:Equal rhs:{(DQ )} spids:[182])] spids: [182] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:USAGE) op: Equal rhs: {(DQ ("nv [ file ]"))} spids: [187] ) ] spids: [187] ) ] spids: [179 180 193 -1] ) ] spids: [71 96 195] ) (FuncDef name: usage body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:OPTIND) op:Equal rhs:{(0)} spids:[205])] spids: [205] ) (C {(getopts)} {($ VSub_Name "$ARGV0")} {(DQ ($ VSub_Name "$USAGE"))} {(OPT)} {(SQ <"-?">)}) (C {(exit)} {(2)}) ] spids: [202] ) spids: [198 201] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:show) op:Equal rhs:{(SQ )} spids:[231])] spids: [231] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:options) op:Equal rhs:{(SQ )} spids:[233])] spids: [233] ) (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: [{(n)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:show) op: Equal rhs: {(DQ ("print --"))} spids: [259] ) ] spids: [259] ) ] spids: [256 257 264 -1] ) (case_arm pat_list: [{(v)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:options) op: Equal rhs: {(DQ ($ VSub_Name "$options") (" -v"))} spids: [270] ) ] spids: [270] ) ] spids: [267 268 276 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (SimpleCommand words: [{(echo)} {(DQ ("Usage: ") ($ VSub_Name "$command") (" [-nv] [ file ]"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[290])] ) (C {(exit)} {(2)}) ] spids: [279 280 299 -1] ) ] spids: [249 253 302] ) ] spids: [247 304] ) ) (C {(shift)} {($ VSub_Name "$OPTIND") (-1)}) (Case to_match: {($ VSub_Pound "$#")} arms: [ (case_arm pat_list: [{(0)}] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:input) op:Equal rhs:{(-)} spids:[320])] spids: [320] ) ] spids: [317 318 323 -1] ) (case_arm pat_list: [{(1)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:input) op: Equal rhs: {($ VSub_Number "$1")} spids: [328] ) ] spids: [328] ) ] spids: [325 326 331 -1] ) (case_arm pat_list:[{(Lit_Other "*")}] action:[(C {(usage)})] spids:[333334338-1]) ] spids: [311 315 340] ) (C {($ VSub_Name "$show")} {(pax)} {($ VSub_Name "$options")} {(-r)} {(-f)} {(DQ ($ VSub_Name "$input"))} {(-w)} {(-x)} {(cpio)} ) ] )