(command.CommandList children: [ (command.ShFunction name: _pkgutil_url2catalog body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'filename=') (DQ ($ Id.VSub_Number '$1'))}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:filename) op: assign_op.Equal rhs: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:filename span_id:26) suffix_op: (suffix_op.Unary op_id: Id.VOp1_DPound arg_word: {('*:') (Id.Lit_Slash /) (Id.Lit_Slash /)} ) ) ) } spids: [23] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:filename) op: assign_op.Equal rhs: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:filename span_id:38) suffix_op: (suffix_op.PatSub pat: { (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\/' span_id:41) ) } replace: {(_)} replace_mode: Id.Lit_Slash ) ) ) } spids: [35] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:filename) op: assign_op.Equal rhs: { (DQ (/var/opt/csw/pkgutil/catalog.) (${ Id.VSub_Name filename) (_) (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:55) command_list: (command.CommandList children:[(C {(uname)} {(-p)})]) ) (_) (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:61) command_list: (command.CommandList children:[(C {(uname)} {(-r)})]) ) ) } spids: [48] ) ] ) (C {(echo)} {(DQ ($ Id.VSub_DollarName '$filename'))}) ] ) ) (command.ShFunction name: _pkgutil body: (command.BraceGroup children: [ (C {(local)} {(cur)} {(prev)} {(words)} {(cword)}) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(_init_completion)} {(-n)} {(Id.Lit_Other ':')}) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:106) ) ] ) (C {(local)} {(command)} {(catalog_files)} {(configuration_files)}) (C {(declare)} {(-a)} {(Id.Lit_VarLike 'configuration_files=') (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:124) words: [{(DQ (/opt/csw/etc/pkgutil.conf))} {(DQ (/etc/opt/csw/pkgutil.conf))}] ) } ) (C {(declare)} {(-a)} {(Id.Lit_VarLike 'catalog_files=') (sh_array_literal left:(Token id:Id.Op_LParen val:'(' span_id:140)) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:i) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$cword')} spids: [145] ) ] ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:149) cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_gt left: { (word_part.ArithSub anode: (arith_expr.UnaryAssign op_id: Id.Node_PostDMinus child: (sh_lhs_expr.Name name:i) ) ) } right: {(1)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:164) ) ] body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:words span_id:175) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$i')} ) ) ) ) } right: {(-) (word_part.ExtGlob op: (Token id:Id.ExtGlob_At val:'@(' span_id:185) arms: [{(t)} {(-temp)}] ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:192) ) ] action: [ (C {(local)} {(Id.Lit_VarLike 'url=') (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:words span_id:202) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.VarRef token: (Token id: Id.Lit_ArithVarLike val: i span_id: 205 ) ) right: (arith_expr.ArithWord w: {(Id.Lit_Digits 1)} ) ) ) } ) ) ) ) } ) (C {(local)} {(Id.Lit_VarLike 'catalog=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:218) command_list: (command.CommandList children: [ (C {(_pkgutil_url2catalog)} {(DQ ($ Id.VSub_DollarName '$url'))}) ] ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:catalog_files) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:228) words: [{(DQ ($ Id.VSub_DollarName '$catalog'))}] ) } spids: [227] ) ] ) ] spids: [169 194] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:words span_id:241) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$i')} ) ) ) ) } right: {(--config)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:253) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:configuration_files) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:259) words: [ { (DQ (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 262 ) command_list: (command.CommandList children: [ (C {(dequote)} { (braced_var_sub token: (Token id: Id.VSub_Name val: words span_id: 266 ) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.VarRef token: (Token id: Id.Lit_ArithVarLike val: i span_id: 269 ) ) right: (arith_expr.ArithWord w: { ( Id.Lit_Digits 1 ) } ) ) ) } ) ) ) } ) ] ) ) ) } ] ) } spids: [258] ) ] ) ] spids: [235 255] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:words span_id:288) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$i')} ) ) ) ) } right: {(-) (word_part.ExtGlob op: (Token id:Id.ExtGlob_At val:'@(' span_id:298) arms: [ {('[iurdacUS]')} {(-install)} {(-upgrade)} {(-remove)} {(-download)} {(-available)} {(-compare)} {(-catalog)} {(-stream)} ] ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:319) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:command) op: assign_op.Equal rhs: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:words span_id:327) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$i')} ) ) ) ) } spids: [324] ) ] ) ] spids: [282 321] ) ] ) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$prev'))} right: {(-) (word_part.ExtGlob op: (Token id:Id.ExtGlob_At val:'@(' span_id:354) arms: [{('[WPR]')} {(-workdir)} {(-pkgdir)} {(-rootpath)}] ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:365) ) ] action: [ (C {(_filedir)} {(-d)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:375) arg_word: {(0)} ) ] spids: [343 367] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$prev'))} right: {(-) (word_part.ExtGlob op: (Token id:Id.ExtGlob_At val:'@(' span_id:395) arms: [{(o)} {(-output)} {(-config)}] ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:404) ) ] action: [ (C {(_filedir)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:412) arg_word: {(0)} ) ] spids: [384 406] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$prev'))} right: {(-) (word_part.ExtGlob op: (Token id:Id.ExtGlob_At val:'@(' span_id:432) arms: [{(p)} {(-param)}] ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:439) ) ] action: [ (C {(compopt)} {(-o)} {(nospace)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:COMPREPLY) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:452) words: [ { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:454) command_list: (command.CommandList children: [ (C {(compgen)} {(-W)} { (DQ ( 'mirror: pkgaddopts: pkgrmopts: wgetopts: use_gpg: use_md5: pkgliststyle: maxpkglist: noncsw: stop_on_hook_soft_error: exclude_pattern: gpg_homedir: root_path: deptree_filter_common: show_current: catalog_not_cached: catalog_update:' ) ) } {(--)} {($ Id.VSub_DollarName '$cur')} ) ] ) ) } ] ) } spids: [451] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:471) arg_word: {(0)} ) ] spids: [421 441] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$prev'))} right: { (word_part.ExtGlob op: (Token id:Id.ExtGlob_At val:'@(' span_id:490) arms: [{(-T)} {(--target)}] ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:497) ) ] action: [ (C {(local)} {(Id.Lit_VarLike 'colonprefixes=') (braced_var_sub token: (Token id:Id.VSub_Name val:cur span_id:518) suffix_op: (suffix_op.Unary op_id: Id.VOp1_Percent arg_word: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:cur span_id:522) suffix_op: (suffix_op.Unary op_id: Id.VOp1_DPound arg_word: {('*:')} ) ) ) } ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:COMPREPLY) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:531) words: [ { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:533) command_list: (command.CommandList children: [ (C {(compgen)} {(-W)} { (DQ ( 'sparc:5.9 sparc:5.10 sparc:5.11 i386:5.9 i386:5.10 i386:5.11' ) ) } {(--)} {($ Id.VSub_DollarName '$cur')} ) ] ) ) } ] ) } spids: [530] ) ] ) (C {(local)} {(Id.Lit_VarLike 'i=') (braced_var_sub token: (Token id:Id.VSub_Name val:COMPREPLY span_id:555) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) ) } ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:562) cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} { (word_part.ArithSub anode: (arith_expr.UnaryAssign op_id: Id.Arith_DMinus child: (sh_lhs_expr.Name name:i) ) ) } {(-ge)} {(0)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:577) ) ] body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.IndexedName name: COMPREPLY index: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')}) ) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:COMPREPLY span_id:586) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$i')} ) ) suffix_op: (suffix_op.Unary op_id: Id.VOp1_Pound arg_word: {(DQ ($ Id.VSub_DollarName '$colonprefixes'))} ) ) } spids: [582] ) ] ) ] ) ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:602) arg_word: {(0)} ) ] spids: [480 499] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: {(DQ ($ Id.VSub_DollarName '$command'))} ) ) (command.DBracket expr: (bool_expr.LogicalNot child: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$cur'))} right: {(-) (Id.Lit_Other '*')} ) ) ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:639) ) ] action: [ (C {(local)} {(mirrors)} {(mirror_url)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:mirrors) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:653) command_list: (command.CommandList children: [ (C {(awk)} {(-F) (Id.Lit_Equals '=')} { (SQ (Token id: Id.Lit_Chars val: ' $1 ~ /^ *mirror *$/ { print $2 }' span_id: 660 ) ) } { (braced_var_sub token: (Token id: Id.VSub_Name val: configuration_files span_id: 664 ) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) } ) ] ) ) } spids: [652] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:mirrors) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:mirrors span_id:674) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonHyphen arg_word: {('http:') (Id.Lit_Slash /) (Id.Lit_Slash /) (mirror.opencsw.org) (Id.Lit_Slash /) (opencsw) (Id.Lit_Slash /) (testing) } ) ) } spids: [672] ) ] ) (command.ForEach iter_name: mirror_url iter_words: [{($ Id.VSub_DollarName '$mirrors')}] do_arg_iter: F body: (command.DoGroup children: [ (C {(local)} {(Id.Lit_VarLike 'catalog=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:702) command_list: (command.CommandList children: [ (C {(_pkgutil_url2catalog)} {(DQ ($ Id.VSub_DollarName '$mirror_url'))} ) ] ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:catalog_files) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:712) words: [ { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: catalog_files span_id: 716 ) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } {(DQ ($ Id.VSub_DollarName '$catalog'))} ] ) } spids: [711] ) ] ) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$command'))} right: {(-) (word_part.ExtGlob op: (Token id:Id.ExtGlob_At val:'@(' span_id:745) arms: [ {('[dius]')} {(-download)} {(-install)} {(-upgrade)} {(-stream)} ] ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:758) ) ] action: [ (C {(local)} {(Id.Lit_VarLike 'packages_list=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:766) command_list: (command.CommandList children: [ (C {(awk)} { (SQ (Token id: Id.Lit_Chars val: ' $0 ~ /BEGIN PGP SIGNATURE/ { exit } $1 ~ /^Hash:/ || $1 ~ /^ *(-|#|$)/ { next } { print $1 }' span_id: 770 ) ) } { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: catalog_files span_id: 775 ) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ) ] ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:COMPREPLY) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:785) words: [ { (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 787 ) command_list: (command.CommandList children: [ (C {(compgen)} {(-W)} {(DQ (${ Id.VSub_Name packages_list))} {(--)} {($ Id.VSub_DollarName '$cur')} ) ] ) ) } ] ) } spids: [784] ) ] ) ] spids: [734 760] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$command'))} right: { (word_part.ExtGlob op: (Token id:Id.ExtGlob_At val:'@(' span_id:817) arms: [{(-r)} {(--remove)}] ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:824) ) ] action: [ (C {(local)} {(Id.Lit_VarLike 'packages_list=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:832) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(pkginfo)}) (C {(awk)} { (SQ (Token id: Id.Lit_Chars val: ' $2 ~ /^CSW/ { printf ("%s|",$2) }' span_id: 840 ) ) } ) ] negated: F ) ] ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:packages_list) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:packages_list span_id:847) suffix_op: (suffix_op.Unary op_id: Id.VOp1_Percent arg_word: {('|')} ) ) } spids: [845] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:packages_list) op: assign_op.Equal rhs: { (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 854 ) command_list: (command.CommandList children: [ (C {(nawk)} { (DQ (' ') (word_part.EscapedLiteral token: (Token id: Id.Lit_EscapedChar val: '\\$' span_id: 859 ) ) ('3 ~ /^') ($ Id.VSub_DollarName '$packages_list') (word_part.EscapedLiteral token: (Token id: Id.Lit_EscapedChar val: '\\$' span_id: 862 ) ) ('/ { print ') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\$' span_id:864)) ('1 }') ) } { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: catalog_files span_id: 870 ) bracket_op: (bracket_op.WholeArray op_id: Id.Lit_At ) ) ) } ) ] ) ) } spids: [853] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:COMPREPLY) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:880) words: [ { (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 882 ) command_list: (command.CommandList children: [ (C {(compgen)} {(-W)} {(DQ (${ Id.VSub_Name packages_list))} {(--)} {($ Id.VSub_DollarName '$cur')} ) ] ) ) } ] ) } spids: [879] ) ] ) ] spids: [807 826] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:904) arg_word: {(0)} ) ] spids: [611 641] ) ] ) (C {(local)} {(Id.Lit_VarLike 'commands=') (DQ ( '-i --install -u --upgrade -r --remove -d --download -U --catalog -a --available --describe -c --compare -C --compare-diff -A --compare-avail -e --email -t --temp -x --exclude -W --workdir -P --pkgdir -R --rootpath --config -y --yes -f --force -n --nomod -N --nodeps -D --debug --trace -h --help -v --version -V --syscheck -l --list -L --listfile -F --findfile --deptree --extract -s --stream -o --output -T --target --single -p --param --parse --cleanup --catinfo' ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:COMPREPLY) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:922) words: [ { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:924) command_list: (command.CommandList children: [ (C {(compgen)} {(-W)} {(DQ (${ Id.VSub_Name commands))} {(--)} {($ Id.VSub_DollarName '$cur')} ) ] ) ) } ] ) } spids: [921] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:943) arg_word: {(0)} ) ] ) ) (C {(complete)} {(-F)} {(_pkgutil)} {(pkgutil)}) ] )