(CommandList children: [ (C {(set)} {(-o)} {(errexit)}) (C {(set)} {(-o)} {(nounset)}) (C {(set)} {(-o)} {(pipefail)}) (C {(export)} {(Lit_VarLike "LANG=") (C)}) (C {(export)} {(Lit_VarLike "LC_ALL=") (C)}) (FuncDef name: process_content body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:package) op: Equal rhs: {($ VSub_Number "$1")} spids: [138] ) ] spids: [136] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:type) op: Equal rhs: {($ VSub_Number "$2")} spids: [144] ) ] spids: [142] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:package_root) op:Equal spids:[151])] spids: [149] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:ensure_pattern) op:Equal spids:[156])] spids: [154] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:dir_root) op:Equal spids:[161])] spids: [159] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:find_maxdepth) op:Equal spids:[166])] spids: [164] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:find_names) op:Equal spids:[171])] spids: [169] ) (Assignment keyword: Assign_Local flags: ["'-a'"] pairs: [ (assign_pair lhs: (LhsName name:local_files) op: Equal rhs: {(ArrayLiteralPart)} spids: [178] ) ] spids: [174] ) (Case to_match: {(${ VSub_Name type)} arms: [ (case_arm pat_list: [{(LICENSE)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:find_names) op: Equal rhs: {(ArrayLiteralPart words:[{(-iname)}{(SQ <"licen[sc]e*">)}])} spids: [200] ) ] spids: [200] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:find_maxdepth) op: Equal rhs: {(1)} spids: [210] ) ] spids: [210] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ensure_pattern) op: Equal rhs: {(DQ ("license|copyright"))} spids: [226] ) ] spids: [226] ) ] spids: [197 198 232 -1] ) (case_arm pat_list: [{(COPYRIGHT)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:find_names) op: Equal rhs: { (ArrayLiteralPart words: [{(-iname)} {(SQ <"notice*">)} {(-o)} {(-iname)} {(SQ <"readme*">)}] ) } spids: [246] ) ] spids: [246] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:find_maxdepth) op: Equal rhs: {(3)} spids: [264] ) ] spids: [264] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ensure_pattern) op: Equal rhs: {(DQ (copyright))} spids: [268] ) ] spids: [268] ) ] spids: [243 244 274 -1] ) ] spids: [188 194 277] ) (Case to_match: {(${ VSub_Name package)} arms: [ (case_arm pat_list: [ {(github.com/) (Lit_Other "*")} {(golang.org/) (Lit_Other "*")} {(bitbucket.org/) (Lit_Other "*")} ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:package_root) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(${ VSub_Name package)}) (C {(awk)} {(-F/)} {(SQ <"{ print $1\"/\"$2\"/\"$3 }">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [306 321] ) } spids: [305] ) ] spids: [305] ) ] spids: [294 302 324 -1] ) (case_arm pat_list: [{(go4.org/) (Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:package_root) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(${ VSub_Name package)}) (C {(awk)} {(-F/)} {(SQ <"{ print $1 }">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [333 348] ) } spids: [332] ) ] spids: [332] ) ] spids: [327 329 351 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:package_root) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(${ VSub_Name package)}) (C {(awk)} {(-F/)} {(SQ <"{ print $1\"/\"$2 }">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [359 374] ) } spids: [358] ) ] spids: [358] ) ] spids: [354 355 377 -1] ) ] spids: [285 291 380] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:local_files) op: Equal rhs: { (ArrayLiteralPart words: [ { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (ForEach iter_name: dir_root iter_words: [ {(${ VSub_Name package)} {(${ VSub_Name package_root)} ] do_arg_iter: False body: (DoGroup children: [ (AndOr children: [ (DBracket expr: (BoolUnary op_id: BoolUnary_d child: {(${ VSub_Name DEPS_DIR) (/) (${ VSub_Name dir_root) } ) ) (ControlFlow token: <ControlFlow_Continue continue> ) ] op_id: Op_DPipe ) (C {(find)} {(${ VSub_Name DEPS_DIR) (/) (${ VSub_Name dir_root) } {(-xdev)} {(-follow)} {(-maxdepth)} {(${ VSub_Name find_maxdepth)} {(-type)} {(f)} { (DQ (BracedVarSub token: <VSub_Name find_names> bracket_op: (WholeArray op_id:Lit_At) spids: [464 469] ) ) } ) ] spids: [408 473] ) spids: [398 406] ) (C {(sort)} {(-u)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [390 480] ) } ] ) } spids: [388] ) ] spids: [388] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:index) op:Equal spids:[487])] spids: [485] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:f) op:Equal spids:[492])] spids: [490] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:index) op: Equal rhs: {(DQ (${ VSub_Name package) (-) (${ VSub_Name type))} spids: [495] ) ] spids: [495] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_z child: { (DQ (BracedVarSub token: <VSub_Name CONTENT> bracket_op: (ArrayIndex expr:(ArithWord w:{(${ VSub_Name index)})) suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )}) spids: [514 522] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (ForEach iter_name: f iter_words: [ { (BracedVarSub token: <VSub_Name local_files> bracket_op: (WholeArray op_id:Lit_At) suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{}) spids: [537 543] ) } ] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(egrep)} {(-i)} {(-wq)} {(DQ (${ VSub_Name ensure_pattern))} {(DQ (${ VSub_Name f))} ) terminator: <Op_Semi ";"> ) ] action: [ (C {(CONTENT) (Lit_Other "[") (${ VSub_Name index) (Lit_Other "]") (Lit_Other "=") (DQ (${ VSub_Name f)) } ) (ControlFlow token: <ControlFlow_Break break> ) ] spids: [-1 574] ) ] spids: [-1 594] ) ] spids: [546 597] ) spids: [536 544] ) ] spids: [-1 528] ) ] spids: [-1 600] ) ] spids: [133] ) spids: [128 132] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_ROOT) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(dirname)} {(DQ (${ VSub_Name BASH_SOURCE))})] ) left_token: <Left_CommandSub "$("> spids: [616 624] ) (/..) } spids: [615] ) ] spids: [615] ) (C {(source)} {(DQ (${ VSub_Name KUBE_ROOT) (/hack/lib/init.sh))}) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Less left: (ArithWord w: { (BracedVarSub token: <VSub_Name BASH_VERSINFO> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [643 648] ) } ) right: (ArithWord w:{(Lit_Digits 4)}) ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)}) (C {(echo)} {(DQ ("ERROR: Bash v4+ required."))}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(uname)} {(-s)})]) left_token: <Left_CommandSub "$("> spids: [677 681] ) ) } right: {(DQ (Darwin))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)}) (C {(echo)} {(DQ ("Ensure you are up to date on the following packages:"))}) (C {(echo)} {(DQ (Lit_Other "$") (" brew install md5sha1sum bash jq"))}) ] spids: [-1 693] ) ] spids: [-1 714] ) (C {(echo)}) ] spids: [-1 655] ) ] spids: [-1 719] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:LICENSE_ROOT) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name LICENSE_ROOT> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(${ VSub_Name KUBE_ROOT)}) spids: [727 733] ) ) } spids: [725] ) ] spids: [725] ) (C {(cd)} {(DQ (${ VSub_Name LICENSE_ROOT))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:GODEPS_LICENSE_FILE) op: Equal rhs: {(DQ (Godeps/LICENSES))} spids: [745] ) ] spids: [745] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TMP_LICENSE_FILE) op: Equal rhs: {(DQ (/tmp/Godeps.LICENSES.) ($ VSub_Dollar "$$"))} spids: [750] ) ] spids: [750] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:DEPS_DIR) op:Equal rhs:{(DQ (vendor))} spids:[756])] spids: [756] ) (Assignment keyword: Assign_Declare flags: ["'-Ag'"] pairs: [(assign_pair lhs:(LhsName name:CONTENT) op:Equal spids:[765])] spids: [761] ) (Subshell child: (CommandList children: [ (C {(echo)} { (DQ ( "================================================================================" ) ) } ) (C {(echo)} {(DQ ("= Kubernetes licensed under: ="))}) (C {(echo)}) (C {(cat)} {(${ VSub_Name LICENSE_ROOT) (/LICENSE)}) (C {(echo)}) (C {(echo)} { (DQ ("= LICENSE ") (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(${ VSub_Name LICENSE_ROOT) (/LICENSE)}) (C {(md5sum)}) (C {(awk)} {(SQ <"{print $1}">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [800 819] ) ) } ) (C {(echo)} { (DQ ( "================================================================================" ) ) } ) ] ) redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(${ VSub_Name TMP_LICENSE_FILE)} spids: [830] ) ] spids: [771 828] ) (ForEach iter_name: PACKAGE iter_words: [ { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(Godeps/Godeps.json)}) (C {(jq)} {(-r)} {(DQ (".Deps[].ImportPath"))}) (C {(sort)} {(-f)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [846 870] ) } ] do_arg_iter: False body: (DoGroup children: [ (C {(process_content)} {(${ VSub_Name PACKAGE)} {(LICENSE)}) (C {(process_content)} {(${ VSub_Name PACKAGE)} {(COPYRIGHT)}) (C {(echo)}) (C {(echo)} { (DQ ( "================================================================================" ) ) } ) (C {(echo)} {(DQ ("= ") (${ VSub_Name DEPS_DIR) (/) (${ VSub_Name PACKAGE) (" licensed under: ="))} ) (C {(echo)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:file) op:Equal rhs:{(DQ )} spids:[928])] spids: [928] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (DQ (BracedVarSub token: <VSub_Name CONTENT> bracket_op: (ArrayIndex expr: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{(${ VSub_Name PACKAGE)}) right: (ArithVarRef name:LICENSE) ) ) suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )}) spids: [940 950] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name CONTENT> bracket_op: (ArrayIndex expr: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{(${ VSub_Name PACKAGE)}) right: (ArithVarRef name:LICENSE) ) ) suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )}) spids: [961 971] ) ) } spids: [959] ) ] spids: [959] ) ] spids: [-1 956] ) (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (DQ (BracedVarSub token: <VSub_Name CONTENT> bracket_op: (ArrayIndex expr: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{(${ VSub_Name PACKAGE)}) right: (ArithVarRef name:COPYRIGHT) ) ) suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )}) spids: [982 992] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name CONTENT> bracket_op: (ArrayIndex expr: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{(${ VSub_Name PACKAGE)}) right: (ArithVarRef name:COPYRIGHT) ) ) suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )}) spids: [1003 1013] ) ) } spids: [1001] ) ] spids: [1001] ) ] spids: [975 998] ) ] spids: [-1 1017] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id:BoolUnary_z child:{(DQ (${ VSub_Name file))}) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/stderr)} spids: [1040] ) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("No license could be found for ") (${ VSub_Name PACKAGE) (" - aborting.\n") ("\n") ("Options:\n") ("1. Check if the upstream repository has a newer version with LICENSE and/or\n") (" COPYRIGHT files.\n") ("2. Contact the author of the package to ensure there is a LICENSE and/or\n") (" COPYRIGHT file present.\n") ("3. Do not use this package in Kubernetes.\n") ) } do_expansion: True here_end: __EOF__ was_filled: True spids: [1044] ) ] ) (C {(exit)} {(9)}) ] spids: [-1 1035] ) ] spids: [-1 1066] ) (C {(cat)} {(DQ (${ VSub_Name file))}) (C {(echo)}) (C {(echo)} { (DQ ("= ") (${ VSub_Name file) (" ") (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(${ VSub_Name file)}) (C {(md5sum)}) (C {(awk)} {(SQ <"{print $1}">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [1090 1108] ) ) } ) (C {(echo)} { (DQ ( "================================================================================" ) ) } ) (C {(echo)}) ] spids: [873 1121] ) redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(${ VSub_Name TMP_LICENSE_FILE)} spids: [1123] ) ] spids: [845 871] ) (SimpleCommand words: [{(cat)} {(${ VSub_Name TMP_LICENSE_FILE)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(${ VSub_Name GODEPS_LICENSE_FILE)} spids: [1136] ) ] ) ] )