(command.CommandList children: [ (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_Other '[')} {(-n)} {(DQ ($ VSub_DollarName '$PROJROOT'))} {(Lit_Other ']')}) (command.BraceGroup children: [ (command.Sentence child: (command.SimpleCommand words: [{(echo)} {(DQ ('Require environment var PROJROOT'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) terminator: <Op_Semi ';'> ) ] spids: [16] ) ] ) (command.SimpleCommand words: [{(echo)} {(DQ (' -> Checking Version'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:version_parts spids:[45]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(grep)} {(-i)} {(version)} {($ VSub_DollarName '$PROJROOT') (/Changes)}) (C {(head)} {(-n)} {(1)}) (C {(sed)} {(-ne)} { (SQ < 's/Version *\\([0-9]*\\)\\.\\([0-9]*\\)\\.\\([0-9]*\\)[^0-9]*\\([-0-9]*\\)/\\1 \\2 \\3 \\4/p' > ) } ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [46 73] ) } spids: [45] ) ] spids: [45] ) (command.SimpleCommand words: [{(read)} {(major)} {(minor)} {(release)} {(date)}] redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(END)} here_end_span_id: 91 stdin_parts: [($ VSub_DollarName '$version_parts') ('\n')] ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:extra spids:[92]) op: Equal rhs: {(SQ )} spids: [92] ) ] spids: [92] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_DollarName '$major'))} {(-o)} {(-z)} {(DQ ($ VSub_DollarName '$date'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.SimpleCommand words: [{(echo)} {(DQ ("Can't get version from ./Changes"))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 117] ) ] spids: [16777215 134] ) (command.SimpleCommand words: [ {(echo)} { (DQ (' Changes version is ') ($ VSub_DollarName '$major') (.) ($ VSub_DollarName '$minor') (.) ($ VSub_DollarName '$release') (' (') ($ VSub_DollarName '$date') (')') ) } ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(-d)} {(DQ ($ VSub_DollarName '$PROJROOT') (/.git))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(export)} {(Lit_VarLike 'GIT_DIR=') (DQ ($ VSub_DollarName '$PROJROOT') (/.git))}) (C {(export)} {(Lit_VarLike 'GIT_WORK_TREE=') (DQ ($ VSub_DollarName '$PROJROOT'))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:head_hash spids:[188]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(log)} {(-n)} {(1)} {(--format) (Lit_Other '=') (format) (Lit_Other ':') (Lit_Other '%') (h)} ) ] ) left_token: <Left_CommandSub '$('> spids: [189 204] ) } spids: [188] ) ] spids: [188] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tag_hash spids:[207]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.SimpleCommand words: [ {(git)} {(log)} {(-n)} {(1)} {(--format) (Lit_Other '=') (format) (Lit_Other ':') (Lit_Other '%') (h) } {(v) ($ VSub_DollarName '$major') (.) ($ VSub_DollarName '$minor') (.) ($ VSub_DollarName '$release') } {(--)} ] redirects: [ (redir.Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(/dev/null)} ) ] ) ] ) left_token: <Left_CommandSub '$('> spids: [208 235] ) } spids: [207] ) ] spids: [207] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:git_dirty spids:[238]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [(C {(git)} {(status)} {(--porcelain)}) (C {(wc)} {(-l)})] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [239 251] ) } spids: [238] ) ] spids: [238] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_DollarName '$git_dirty'))} {(-gt)} {(0)} {(-o)} {(DQ ($ VSub_DollarName '$tag_hash'))} {(KW_Bang '!') (Lit_Other '=')} {(DQ ($ VSub_DollarName '$head_hash'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.SimpleCommand words: [{(echo)} {(DQ (' Git state differs from ./Changes'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:extra spids:[295]) op: Equal rhs: {(DQ ($ VSub_DollarName '$head_hash'))} spids: [295] ) ] spids: [295] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:date spids:[301]) op: Equal rhs: { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(git)} {(log)} {(-n)} {(1)} {(--format) (Lit_Other '=') (format) (Lit_Other ':') (Lit_Other '%') (ci) } ) (C {(sed)} {(-e)} {(SQ <'s/ /T/;s/ //'>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [303 328] ) ) } spids: [301] ) ] spids: [301] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_DollarName '$git_dirty'))} {(-gt)} {(0)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:extra spids:[350]) op: Equal rhs: {(DQ ($ VSub_DollarName '$extra') ('+changes'))} spids: [350] ) ] spids: [350] ) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:date spids:[357]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(date)} {(DQ ('+%Y-%m-%dT%H:%M:%S'))})] ) left_token: <Left_Backtick '`'> spids: [358 364] ) } spids: [357] ) ] spids: [357] ) terminator: <Op_Semi ';'> ) ] spids: [16777215 347] ) ] spids: [16777215 368] ) ] spids: [16777215 282] ) ] spids: [16777215 371] ) ] spids: [16777215 168] ) ] spids: [16777215 373] ) (command.Sentence child: (command.SimpleCommand words: [ {(echo)} { (DQ (' Version is ') ($ VSub_DollarName '$major') (' ') ($ VSub_DollarName '$minor') (' ') ($ VSub_DollarName '$release') (' ') ($ VSub_DollarName '$extra') (' ') ($ VSub_DollarName '$date') ) } ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.AndOr ops: [Op_DAmp Op_DPipe] children: [ (C {(Lit_Other '[')} {(-n)} {(DQ ($ VSub_DollarName '$extra'))} {(Lit_Other ']')}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:suffix spids:[408]) op: Equal rhs: {(DQ (-) ($ VSub_DollarName '$extra'))} spids: [408] ) ] spids: [408] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:suffix spids:[416]) op: Equal rhs: {(SQ )} spids: [416] ) ] spids: [416] ) ] ) terminator: <Op_Semi ';'> ) (command.SimpleCommand words: [{(echo)} {(DQ (' -> Regenerating Version.c'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(END)} here_end_span_id: 469 stdin_parts: [ ('/* Generated by build-version.sh */\n') ('\n') ('const int CGLVER_Major=') ($ VSub_DollarName '$major') (';\n') ('const int CGLVER_Minor=') ($ VSub_DollarName '$minor') (';\n') ('const int CGLVER_Release=') ($ VSub_DollarName '$release') (';\n') ('const char* CGLVER_Extra=') (Right_DoubleQuote '"') ($ VSub_DollarName '$extra') (Right_DoubleQuote '"') (';\n') ('const char* CGLVER_Date=') (Right_DoubleQuote '"') ($ VSub_DollarName '$date') (Right_DoubleQuote '"') (';\n') ('const char* CGLVER_String=') (Right_DoubleQuote '"') ($ VSub_DollarName '$major') (.) ($ VSub_DollarName '$minor') (.) ($ VSub_DollarName '$release') ($ VSub_DollarName '$suffix') (Right_DoubleQuote '"') (';\n') ('\n') ] ) ] ) ] )