(CommandList children: [ (C {(set)} {(-e)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:install_prefix) op: Equal rhs: { (BracedVarSub token: <VSub_Number 1> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(DQ (/usr/local))}) spids: [57 63] ) } spids: [56] ) ] spids: [56] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:progname) op: Equal rhs: {(DQ ($ VSub_Number "$0"))} spids: [66] ) ] spids: [66] ) (C {(echo)} {(DQ ("Bazel installer"))}) (C {(echo)} {(DQ (---------------))}) (C {(echo)}) (C {(echo)} {(DQ ("Bazel is bundled with software licensed under the GPLv2 with Classpath exception."))} ) (C {(echo)} {(DQ ("You can find the sources next to the installer on our release page:"))}) (C {(echo)} {(DQ (" https://github.com/bazelbuild/bazel/releases"))}) (C {(echo)}) (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("%release_info%\n")} do_expansion: False here_end: EOF was_filled: True spids: [109] ) ] ) (FuncDef name: usage body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ("Usage: ") ($ VSub_Name "$progname") (" [options]"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[130])] ) (SimpleCommand words: [{(echo)} {(DQ ("Options are:"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[140])] ) (SimpleCommand words: [ {(echo)} {(DQ (" --prefix=/some/path set the prefix path (default=/usr/local)."))} ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[150])] ) (SimpleCommand words: [{(echo)} {(DQ (" --bin= set the binary folder path (default=%prefix%/bin)."))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[160])] ) (SimpleCommand words: [ {(echo)} {(DQ (" --base= set the base install path (default=%prefix%/lib/bazel)."))} ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[170])] ) (SimpleCommand words: [ {(echo)} {(DQ (" --bazelrc= set the path to bazelrc (default=/etc/bazel.bazelrc)."))} ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[180])] ) (SimpleCommand words: [{(echo)} {(DQ (" --user configure for user install, expands to:"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[190])] ) (SimpleCommand words: [ {(echo)} {(SQ <" --bin=$HOME/bin --base=$HOME/.bazel --bazelrc=$HOME/.bazelrc">)} ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[200])] ) (C {(exit)} {(1)}) ] spids: [119] ) spids: [115 118] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:prefix) op:Equal rhs:{(DQ (/usr/local))} spids:[211])] spids: [211] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:bin) op:Equal rhs:{(DQ ("%prefix%/bin"))} spids:[216])] spids: [216] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:base) op: Equal rhs: {(DQ ("%prefix%/lib/bazel"))} spids: [221] ) ] spids: [221] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bazelrc) op: Equal rhs: {(DQ (/etc/bazel.bazelrc))} spids: [226] ) ] spids: [226] ) (ForEach iter_name: opt iter_words: [{(DQ (${ VSub_At "@"))}] do_arg_iter: False body: (DoGroup children: [ (Case to_match: {($ VSub_Name "$opt")} arms: [ (case_arm pat_list: [{(--prefix) (Lit_Other "=") (Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:prefix) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name "$opt"))}) (C {(cut)} {(-d)} {(SQ <"=">)} {(-f)} {(2-)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [263 283] ) ) } spids: [261] ) ] spids: [261] ) ] spids: [255 258 287 -1] ) (case_arm pat_list: [{(--bazelrc) (Lit_Other "=") (Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bazelrc) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name "$opt"))}) (C {(cut)} {(-d)} {(SQ <"=">)} {(-f)} {(2-)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [298 318] ) ) } spids: [296] ) ] spids: [296] ) ] spids: [290 293 322 -1] ) (case_arm pat_list: [{(--bin) (Lit_Other "=") (Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bin) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name "$opt"))}) (C {(cut)} {(-d)} {(SQ <"=">)} {(-f)} {(2-)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [333 353] ) ) } spids: [331] ) ] spids: [331] ) ] spids: [325 328 357 -1] ) (case_arm pat_list: [{(--base) (Lit_Other "=") (Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:base) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name "$opt"))}) (C {(cut)} {(-d)} {(SQ <"=">)} {(-f)} {(2-)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [368 388] ) ) } spids: [366] ) ] spids: [366] ) ] spids: [360 363 392 -1] ) (case_arm pat_list: [{(--user)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bin) op: Equal rhs: {(DQ ($ VSub_Name "$HOME") (/bin))} spids: [399] ) ] spids: [399] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:base) op: Equal rhs: {(DQ ($ VSub_Name "$HOME") (/.bazel))} spids: [406] ) ] spids: [406] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bazelrc) op: Equal rhs: {(DQ ($ VSub_Name "$HOME") (/.bazelrc))} spids: [413] ) ] spids: [413] ) ] spids: [395 396 420 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [(C {(usage)})] spids: [423 424 430 -1] ) ] spids: [248 252 433] ) ] spids: [245 435] ) spids: [237 243] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bin) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name bin> suffix_op: (PatSub pat: {(Lit_Percent "%") (prefix) (Lit_Percent "%")} replace: {(${ VSub_Name prefix)} do_all: True do_prefix: False do_suffix: False ) spids: [440 451] ) ) } spids: [438] ) ] spids: [438] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:base) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name base> suffix_op: (PatSub pat: {(Lit_Percent "%") (prefix) (Lit_Percent "%")} replace: {(${ VSub_Name prefix)} do_all: True do_prefix: False do_suffix: False ) spids: [456 467] ) ) } spids: [454] ) ] spids: [454] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bazelrc) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name bazelrc> suffix_op: (PatSub pat: {(Lit_Percent "%") (prefix) (Lit_Percent "%")} replace: {(${ VSub_Name prefix)} do_all: True do_prefix: False do_suffix: False ) spids: [472 483] ) ) } spids: [470] ) ] spids: [470] ) (FuncDef name: test_write body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [496] ) ] spids: [494] ) (While cond: [ (Sentence child: (AndOr children: [ (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$file"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ (/))} {(Lit_Other "]")} ) (AndOr children: [ (C {(Lit_Other "[")} {(-n)} {(DQ (${ VSub_Name file))} {(Lit_Other "]")}) (C {(Lit_Other "[")} {(KW_Bang "!")} {(-e)} {(DQ ($ VSub_Name "$file"))} {(Lit_Other "]")} ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) terminator: <Op_Semi ";"> ) ] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(dirname)} {(DQ (${ VSub_Name file))})] ) left_token: <Left_CommandSub "$("> spids: [553 561] ) ) } spids: [551] ) ] spids: [551] ) ] spids: [548 565] ) ) (AndOr children: [ (C {(Lit_Other "[")} {(-w)} {(DQ (${ VSub_Name file))} {(Lit_Other "]")}) (BraceGroup children: [ (SimpleCommand words: [{(echo)}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[587])] ) (SimpleCommand words: [ {(echo)} { (DQ ("The Bazel installer must have write access to ") ($ VSub_Number "$1") ("!") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[599])] ) (SimpleCommand words: [ {(echo)} { (DQ ("Consider using the --user flag to install Bazel under ") ($ VSub_Name "$HOME") ("/bin instead.") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[611])] ) (SimpleCommand words: [{(echo)}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[617])] ) (C {(usage)}) ] spids: [582] ) ] op_id: Op_DPipe ) ] spids: [491] ) spids: [487 490] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [{(which)} {(unzip)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[643])] ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[652])] ) (SimpleCommand words: [{(echo)} {(DQ ("unzip not found, please install the corresponding package."))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[662])] ) (SimpleCommand words: [ {(echo)} {(DQ ("See http://bazel.build/docs/install.html for more information on"))} ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[672])] ) (SimpleCommand words: [{(echo)} {(DQ ("dependencies of Bazel."))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[682])] ) (C {(exit)} {(1)}) ] spids: [-1 647] ) ] spids: [-1 690] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-z)} { (DQ (BracedVarSub token: <VSub_Name JAVA_HOME> suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )}) spids: [703 706] ) ) } {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Case to_match: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [(C {(uname)} {(-s)}) (C {(tr)} {(SQ <A-Z>)} {(SQ <a-z>)})] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [718 734] ) ) } arms: [ (case_arm pat_list: [{(linux)}] action: [ (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:JAVA_HOME) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (SimpleCommand words: [ {(readlink)} {(-f)} { (CommandSubPart command_list: (CommandList children: [(C {(which)} {(javac)})] ) left_token: <Left_CommandSub "$("> spids: [751 755] ) } ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [757] ) ] ) (C {(sed)} {(SQ <s_/bin/javac__>)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [746 767] ) ) } spids: [744] ) ] spids: [744] ) (C {(true)}) ] op_id: Op_DPipe ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:BASHRC) op: Equal rhs: {(DQ ("~/.bashrc"))} spids: [775] ) ] spids: [775] ) ] spids: [740 741 781 -1] ) (case_arm pat_list: [{(freebsd)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:JAVA_HOME) op: Equal rhs: {(DQ (/usr/local/openjdk8))} spids: [788] ) ] spids: [788] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:BASHRC) op: Equal rhs: {(DQ ("~/.bashrc"))} spids: [794] ) ] spids: [794] ) ] spids: [784 785 800 -1] ) (case_arm pat_list: [{(darwin)}] action: [ (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:JAVA_HOME) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [ {(/usr/libexec/java_home)} {(-v)} {(${ VSub_Name JAVA_VERSION) (Lit_Other "+")} ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [819] ) ] ) ] ) left_token: <Left_CommandSub "$("> spids: [809 822] ) ) } spids: [807] ) ] spids: [807] ) (C {(true)}) ] op_id: Op_DPipe ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:BASHRC) op: Equal rhs: {(DQ ("~/.bash_profile"))} spids: [830] ) ] spids: [830] ) ] spids: [803 804 836 -1] ) ] spids: [715 737 839] ) ] spids: [-1 712] ) ] spids: [-1 841] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(-x)} {(DQ (${ VSub_Name JAVA_HOME) (/bin/javac))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[866])] ) (SimpleCommand words: [{(echo)} {(DQ ("Java not found, please install the corresponding package"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[876])] ) (SimpleCommand words: [ {(echo)} {(DQ ("See http://bazel.build/docs/install.html for more information on"))} ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[886])] ) (SimpleCommand words: [{(echo)} {(DQ ("dependencies of Bazel."))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[896])] ) (C {(exit)} {(1)}) ] spids: [-1 861] ) ] spids: [-1 904] ) (C {(test_write)} {(DQ (${ VSub_Name bin))}) (C {(test_write)} {(DQ (${ VSub_Name base))}) (C {(test_write)} {(DQ (${ VSub_Name bazelrc))}) (C {(echo)} {(-n)} {(DQ (Uncompressing.))}) (C {(rm)} {(-f)} {(DQ (${ VSub_Name bin) (/bazel))}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-d)} {(DQ (${ VSub_Name base))} {(-a)} {(-x)} {(DQ (${ VSub_Name base) (/bin/bazel))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [(C {(rm)} {(-fr)} {(DQ (${ VSub_Name base))})] spids: [-1 987] ) ] spids: [-1 1000] ) (C {(mkdir)} {(-p)} {(${ VSub_Name bin)} {(${ VSub_Name base)} {(${ VSub_Name base) (/bin)} {(${ VSub_Name base) (/etc)} ) (C {(echo)} {(-n)} {(.)}) (C {(unzip)} {(-q)} { (DQ (BracedVarSub token: <VSub_Name BASH_SOURCE> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [1037 1042] ) ) } {(bazel)} {(bazel-real)} {(bazel-complete.bash)} {(-d)} {(DQ (${ VSub_Name base) (/bin))} ) (C {(echo)} {(-n)} {(.)}) (C {(chmod)} {(0755)} {(DQ (${ VSub_Name base) (/bin/bazel))} {(DQ (${ VSub_Name base) (/bin/bazel-real))} ) (C {(echo)} {(-n)} {(.)}) (C {(chmod)} {(-R)} {(og-w)} {(DQ (${ VSub_Name base))}) (C {(chmod)} {(-R)} {(og) (Lit_Other "+") (rX)} {(DQ (${ VSub_Name base))}) (C {(chmod)} {(-R)} {(u) (Lit_Other "+") (rwX)} {(DQ (${ VSub_Name base))}) (C {(echo)} {(-n)} {(.)}) (C {(ln)} {(-s)} {(DQ (${ VSub_Name base) (/bin/bazel))} {(DQ (${ VSub_Name bin) (/bazel))}) (C {(echo)} {(-n)} {(.)}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} {(DQ (${ VSub_Name bazelrc))} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)}) (C {(echo)} { (DQ (${ VSub_Name bazelrc) (" already exists, moving it to ") (${ VSub_Name bazelrc) (.bak.) ) } ) (C {(mv)} {(DQ (${ VSub_Name bazelrc))} {(DQ (${ VSub_Name bazelrc) (.bak))}) ] spids: [-1 1177] ) ] spids: [-1 1212] ) (C {(touch)} {(DQ (${ VSub_Name bazelrc))}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ (${ VSub_Name UID))} {(-eq)} {(0)} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [(C {(chmod)} {(0644)} {(DQ (${ VSub_Name bazelrc))})] spids: [-1 1243] ) ] else_action: [ (SimpleCommand words: [{(DQ (${ VSub_Name bin) (/bazel))} {(help)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[1272])] ) ] spids: [1256 1275] ) (C {(echo)} {(.)}) (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("\n") ("Bazel is now installed!\n") ("\n") ("Make sure you have ") (Right_DoubleQuote "\"") (${ VSub_Name bin) (Right_DoubleQuote "\"") (" in your path. You can also activate bash\n") ("completion by adding the following line to your ") (${ VSub_Name BASHRC) (":\n") (" source ") (${ VSub_Name base) ("/bin/bazel-complete.bash\n") ("\n") ("See http://bazel.build/docs/getting-started.html to start a new project!\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [1284] ) ] ) (C {(exit)} {(0)}) ] )