(CommandList children: [ (Assignment keyword: Assign_Readonly pairs: [ (assign_pair lhs: (LhsName name:GCS_BUCKET) op: Equal rhs: {(DQ ("gs://kythe-builds"))} spids: [45] ) ] spids: [43] ) (FuncDef name: usage body: (BraceGroup children: [ (SimpleCommand words: [ {(echo)} { (DQ ("usage: ") (CommandSubPart command_list: (CommandList children: [(C {(basename)} {(DQ ($ VSub_Number "$0"))})] ) left_token: <Left_CommandSub "$("> spids: [62 68] ) (" cache-dir") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[72])] ) ] spids: [55] ) spids: [51 54] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id:BoolBinary_GlobNEqual left:{($ VSub_Pound "$#")} right:{(1)}) ) terminator: <Op_Semi ";"> ) ] action: [(C {(usage)}) (C {(exit)} {(1)})] spids: [-1 91] ) ] spids: [-1 101] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CACHE) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(readlink)} {(-m)} {(DQ ($ VSub_Number "$1"))})] ) left_token: <Left_CommandSub "$("> spids: [106 114] ) ) } spids: [104] ) ] spids: [104] ) (C {(echo)} {(DQ ("Cache Root: ") ($ VSub_Name "$CACHE"))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:REPO) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(readlink)} {(-e)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(dirname)} {(DQ ($ VSub_Number "$0"))})] ) left_token: <Left_CommandSub "$("> spids: [133 139] ) (/..) ) } ) ] ) left_token: <Left_CommandSub "$("> spids: [127 142] ) ) } spids: [125] ) ] spids: [125] ) (C {(echo)} {(DQ ("Repository Root: ") ($ VSub_Name "$REPO"))}) (C {(.)} {(tools/modules/versions.sh)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:NAME) op: Equal rhs: {(DQ (llvm-) (${ VSub_Name FULL_SHA))} spids: [157] ) ] spids: [157] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:LLVM) op: Equal rhs: {(DQ ($ VSub_Name "$CACHE") (/) ($ VSub_Name "$NAME"))} spids: [165] ) ] spids: [165] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalNot child: (BoolUnary op_id:BoolUnary_d child:{(DQ ($ VSub_Name "$LLVM"))}) ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TMP) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(mktemp)} {(-d)})]) left_token: <Left_CommandSub "$("> spids: [193 197] ) ) } spids: [191] ) ] spids: [191] ) (C {(trap)} {(DQ ("rm -rf '") ($ VSub_Name "$TMP") ("'"))} {(EXIT)} {(ERR)} {(INT)}) (C {(cd)} {(DQ ($ VSub_Name "$TMP"))}) (C {(gsutil)} {(cp)} {(DQ (${ VSub_Name GCS_BUCKET) (/) ($ VSub_Name "$NAME") (.tar.gz))} {(.)} ) (C {(tar)} {(xzf)} {(DQ ($ VSub_Name "$NAME") (.tar.gz))}) (C {(mkdir)} {(-p)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(dirname)} {(DQ ($ VSub_Name "$LLVM"))})] ) left_token: <Left_CommandSub "$("> spids: [254 260] ) ) } ) (C {(mv)} {(llvm)} {(DQ ($ VSub_Name "$LLVM"))}) ] spids: [-1 188] ) ] else_action: [(C {(echo)} {(DQ ("Reusing cached LLVM version at ") ($ VSub_Name "$LLVM"))})] spids: [272 282] ) (C {(rm)} {(-rf)} {(DQ ($ VSub_Name "$REPO")) (/third_party/llvm/llvm)}) (C {(cp)} {(-r)} {(DQ ($ VSub_Name "$LLVM"))} {(DQ ($ VSub_Name "$REPO")) (/third_party/llvm/llvm)}) ] )