(command.CommandList children: [ (C {(set)} {(-euo)} {(pipefail)}) (C {(shopt)} {(-s)} {(extglob)}) (C {(rm)} {(-rf)} {(bundle)}) (command.FuncDef name: fail body: (command.BraceGroup children: [ (command.SimpleCommand words: [{(echo)} {(DQ ('make-bundle.sh: FAILED at line ') ($ VSub_Number '$1'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (C {(rm)} {(-rf)} {(bundle)}) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [76] ) spids: [72 75] ) (C {(trap)} {(SQ <'fail ${LINENO}'>)} {(ERR)}) (command.FuncDef name: copyDep body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:FILE spids:[127]) op: Equal rhs: {($ VSub_Number '$1')} spids: [127] ) ] spids: [125] ) (command.Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:DST spids:[133]) op: Equal rhs: {(bundle) (DQ (word_part.BracedVarSub token: <VSub_Name FILE> suffix_op: (suffix_op.PatSub pat: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\/'>) (usr) (word_part.EscapedLiteralPart token: <Lit_EscapedChar '\\/'> ) (local) } replace: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\/'>) (usr)} replace_mode: Lit_Pound spids: [138] ) spids: [136 147] ) ) } spids: [133] ) ] spids: [131] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(-e)} {(DQ ($ VSub_DollarName '$DST'))} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(Lit_Other ':')})] spids: [16777215 165] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_DollarName '$FILE'))} right: {(/etc/) (Lit_Other '*')} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(-f)} {(DQ ($ VSub_DollarName '$FILE'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.SimpleCommand words: [{(echo)} {(DQ ($ VSub_DollarName '$FILE'))}] redirects: [ (redir.Redir op: <Redir_DGreat '>>'> fd: 16777215 arg_word: {(tmp/host.list)} ) ] ) ] spids: [16777215 211] ) ] spids: [16777215 225] ) ] spids: [175 191] ) (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(-h)} {(DQ ($ VSub_DollarName '$FILE'))} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (C {(mkdir)} {(-p)} { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(dirname)} {(DQ ($ VSub_DollarName '$DST'))})] ) left_token: <Left_CommandSub '$('> spids: [272 278] ) } ) (command.Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:LINK spids:[283]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(readlink)} {(-f)} {(DQ ($ VSub_DollarName '$FILE'))}) ] ) left_token: <Left_CommandSub '$('> spids: [284 292] ) } spids: [283] ) ] spids: [281] ) (C {(ln)} {(-sf)} { (DQ (word_part.BracedVarSub token: <VSub_Name LINK> suffix_op: (suffix_op.PatSub pat: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\/'>) (usr) (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\/'>) (local) } replace: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\/'>) (usr) } replace_mode: Lit_Pound spids: [302] ) spids: [300 311] ) ) } {(DQ ($ VSub_DollarName '$DST'))} ) (C {(copyDep)} {(DQ ($ VSub_DollarName '$LINK'))}) ] spids: [228 241] ) (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(-d)} {(DQ ($ VSub_DollarName '$FILE'))} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(mkdir)} {(-p)} {(DQ ($ VSub_DollarName '$DST'))})] spids: [326 339] ) (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(-f)} {(DQ ($ VSub_DollarName '$FILE'))} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (C {(mkdir)} {(-p)} { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(dirname)} {(DQ ($ VSub_DollarName '$DST'))})] ) left_token: <Left_CommandSub '$('> spids: [379 385] ) } ) (C {(cp)} {(DQ ($ VSub_DollarName '$FILE'))} {(DQ ($ VSub_DollarName '$DST'))}) ] spids: [355 368] ) ] spids: [16777215 399] ) ] spids: [117] ) spids: [113 116] ) (command.FuncDef name: copyDeps body: (command.BraceGroup children: [ (command.WhileUntil keyword: <KW_While while> cond: [(command.Sentence child:(C {(read)} {(FILE)}) terminator:<Op_Semi ';'>)] body: (command.DoGroup children: [(C {(copyDep)} {(DQ ($ VSub_DollarName '$FILE'))})] spids: [423 433] ) ) ] spids: [408] ) spids: [404 407] ) (command.ForEach iter_name: CMD iter_words: [{(zip)} {(unzip)} {(xz)} {(gpg)}] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.SimpleCommand words: [{(which)} {(DQ ($ VSub_DollarName '$CMD'))}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (command.SimpleCommand words: [{(echo)} {(DQ ('Please install ') ($ VSub_DollarName '$CMD'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (C {(fail)} {(${ VSub_Name LINENO)}) ] spids: [16777215 474] ) ] spids: [16777215 495] ) ] spids: [456 497] ) spids: [446 454] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:METEOR_DEV_BUNDLE spids:[500]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(./find-meteor-dev-bundle.sh)})]) left_token: <Left_CommandSub '$('> spids: [501 503] ) } spids: [500] ) ] spids: [500] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:NODE_BUILD_ROOT spids:[530]) op: Equal rhs: {(/var/tmp/sandstorm-node-build-dir)} spids: [530] ) ] spids: [530] ) (C {(echo)} {(DQ ('Building node out-of-tree'))}) (C {(rm)} {(-rf)} {(DQ ($ VSub_DollarName '$NODE_BUILD_ROOT'))}) (C {(mkdir)} {(-p)} {(DQ ($ VSub_DollarName '$NODE_BUILD_ROOT'))}) (C {(cp)} {(-a)} {(deps/node)} {(DQ ($ VSub_DollarName '$NODE_BUILD_ROOT'))}) (C {(pushd)} {(DQ ($ VSub_DollarName '$NODE_BUILD_ROOT') (/node))}) (C {(./configure)} {(--partly-static)}) (C {(make)} {(-j) (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(nproc)})]) left_token: <Left_CommandSub '$('> spids: [582 584] ) } ) (C {(popd)}) (C {(mkdir)} {(-p)} {(deps/node/out)}) (C {(rm)} {(-rf)} {(deps/node/out/) (Lit_Other '*')}) (C {(mv)} {(DQ ($ VSub_DollarName '$NODE_BUILD_ROOT') (/node/out)) (/) (Lit_Other '*')} {(deps/node/out/)} ) (C {(cp)} {(-r)} {(shell-build/bundle)} {(bundle)}) (C {(rm)} {(-f)} {(bundle/README)}) (C {(cp)} {(meteor-bundle-main.js)} {(bundle/sandstorm-main.js)}) (command.Subshell child: (command.AndOr ops: [Op_DAmp] children: [ (C {(cd)} {(bundle/programs/server)}) (command.SimpleCommand words: [{(DQ ($ VSub_DollarName '$METEOR_DEV_BUNDLE') (/bin/npm))} {(install)}] more_env: [ (env_pair name: PATH val: {($ VSub_DollarName '$PWD') (/deps/node/out/Release) (Lit_Other ':') ($ VSub_DollarName '$METEOR_DEV_BUNDLE') (/lib/node_modules/.bin) (Lit_Other ':') ($ VSub_DollarName '$METEOR_DEV_BUNDLE') (/bin) (Lit_Other ':') ($ VSub_DollarName '$PATH') } spids: [670] ) ] ) ] ) spids: [661 688] ) (C {(mkdir)} {(-p)} {(bundle/bin)}) (C {(cp)} {(bin/sandstorm-http-bridge)} {(bundle/bin/sandstorm-http-bridge)}) (C {(cp)} {(bin/sandstorm)} {(bundle/sandstorm)}) (C {(cp)} {(deps/node/out/Release/node)} {(bundle/bin)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:OLD_BUNDLE_BASE spids:[735]) op: Equal rhs: {(sandstorm-171)} spids: [735] ) ] spids: [735] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:OLD_BUNDLE_FILENAME spids:[738]) op: Equal rhs: {($ VSub_DollarName '$OLD_BUNDLE_BASE') (.tar.xz)} spids: [738] ) ] spids: [738] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:OLD_BUNDLE_PATH spids:[742]) op: Equal rhs: {(hack/) ($ VSub_DollarName '$OLD_BUNDLE_FILENAME')} spids: [742] ) ] spids: [742] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:OLD_BUNDLE_SHA256 spids:[746]) op: Equal rhs: {(ebffd643dffeba349f139bee34e4ce33fd9b1298fafc1d6a31eb35a191059a99)} spids: [746] ) ] spids: [746] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:OLD_MONGO_FILES spids:[749]) op: Equal rhs: { (DQ ($ VSub_DollarName '$OLD_BUNDLE_BASE') ('/bin/mongo ') ($ VSub_DollarName '$OLD_BUNDLE_BASE') (/bin/mongod) ) } spids: [749] ) ] spids: [749] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-e)} {(DQ ($ VSub_DollarName '$OLD_BUNDLE_PATH'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ('Fetching ') ($ VSub_DollarName '$OLD_BUNDLE_FILENAME') (' to extract a mongo 2.6...') ) } ) (C {(curl)} {(--output)} {(DQ ($ VSub_DollarName '$OLD_BUNDLE_PATH'))} {(https) (Lit_Other ':') (//dl.sandstorm.io/) ($ VSub_DollarName '$OLD_BUNDLE_FILENAME')} ) ] spids: [16777215 773] ) ] spids: [16777215 798] ) (command.SimpleCommand words: [{(sha256sum)} {(--check)}] redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 816 stdin_parts: [ ($ VSub_DollarName '$OLD_BUNDLE_SHA256') (' ') ($ VSub_DollarName '$OLD_BUNDLE_PATH') ('\n') ] ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:rc spids:[820]) op: Equal rhs: {($ VSub_QMark '$?')} spids: [820] ) ] spids: [820] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {($ VSub_DollarName '$rc')} {(-ne)} {(0)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} {(DQ ('Old bundle did not match expected checksum. Aborting.'))}) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 836] ) ] spids: [16777215 850] ) (C {(tar)} {(xf)} {($ VSub_DollarName '$OLD_BUNDLE_PATH')} {(--transform) (Lit_Other '=') (s/) (Lit_Other '^') (${ VSub_Name OLD_BUNDLE_BASE) (/bundle/)} {($ VSub_DollarName '$OLD_MONGO_FILES')} ) (C {(cp)} { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(which)} {(zip)} {(unzip)} {(xz)} {(gpg)})] ) left_token: <Left_CommandSub '$('> spids: [876 886] ) } {(bundle/bin)} ) (C {(ln)} {(-s)} {(../sandstorm)} {(bundle/bin/spk)}) (C {(chmod)} {(u) (Lit_Other '+') (w)} {(bundle/bin/) (Lit_Other '*')}) (C {(mkdir)} {(-p)} (word.BracedWordTree parts: [(bundle/usr/include/) (word_part.BracedAltPart words:[{(capnp)} {(sandstorm)}])] ) ) (C {(cp)} {(src/capnp/) (word_part.ExtGlobPart op: <ExtGlob_Bang '!('> arms: [{(Lit_Other '*') (test) (Lit_Other '*')}] spids: [942 946] ) (.capnp) } {(bundle/usr/include/capnp)} ) (C {(cp)} {(src/sandstorm/) (Lit_Other '*') (.capnp)} {(bundle/usr/include/sandstorm)}) (C {(cp)} {(-r)} {(node_modules)} {(bundle)}) (command.Pipeline children: [ (command.Subshell child: (command.AndOr ops: [Op_DPipe] children: [ (C {(ldd)} {(bundle/bin/) (Lit_Other '*')} { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(find)} {(bundle)} {(-name)} {(SQ <'*.node'>)})] ) left_token: <Left_CommandSub '$('> spids: [981 991] ) } ) (C {(true)}) ] ) spids: [975 996] ) (C {(grep)} {(-o)} {(SQ <'[[:space:]]/[^ ]*'>)}) (C {(copyDeps)}) ] negated: F ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(tmp/dnstest.c)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(SQ <__EOF__>)} here_end_span_id: 1044 stdin_parts: [ ('#include <sys/types.h>\n') ('#include <sys/socket.h>\n') ('#include <netdb.h>\n') ('#include <stdlib.h>\n') ('\n') ('int main() {\n') (' struct addrinfo* result;\n') (' getaddrinfo("example.com", "http", NULL, &result);\n') (' return 0;\n') ('}\n') ] ) ] ) (C {(gcc)} {(tmp/dnstest.c)} {(-o)} {(tmp/dnstest)}) (command.Pipeline children: [ (command.SimpleCommand words: [{(strace)} {(tmp/dnstest)}] redirects: [(redir.Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)})] ) (C {(grep)} {(-o)} {(SQ <'"/[^"]*"'>)}) (C {(tr)} {(-d)} {(SQ <'"'>)}) (C {(copyDeps)}) ] negated: F ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(tmp/host.list)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(SQ <__EOF__>)} here_end_span_id: 1122 stdin_parts: [ ('/etc/gai.conf\n') ('/etc/host.conf\n') ('/etc/hosts\n') ('/etc/nsswitch.conf\n') ('/etc/resolvconf\n') ('/etc/resolv.conf\n') ('/etc/services\n') ('/run/resolvconf\n') ('/run/systemd/resolve/resolv.conf\n') ] ) ] ) (command.Pipeline children: [ (C {(cat)} {(tmp/host.list)}) (C {(grep)} {(-v)} {(SQ <'/ld[.]so[.]'>)}) (C {(sort)}) (command.SimpleCommand words: [{(uniq)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(bundle/host.list)})] ) ] negated: F ) (C {(mkdir)} {(-p)} (word.BracedWordTree parts: [ (bundle/) (word_part.BracedAltPart words: [{(dev)} {(proc)} {(tmp)} {(etc)} {(etc.host)} {(run)} {(run.host)} {(var)}] ) ] ) ) (C {(touch)} (word.BracedWordTree parts: [ (bundle/dev/) (word_part.BracedAltPart words: [{(null)} {(zero)} {(random)} {(urandom)} {(fuse)}] ) ] ) ) (C {(mkdir)} {(-p)} {(bundle/usr/lib/locale)}) (C {(localedef)} {(--no-archive)} {(--inputfile) (Lit_Other '=') (./localedata-C)} {(--charmap) (Lit_Other '=') (UTF-8)} {(bundle/usr/lib/locale/C.UTF-8)} ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(-e)} {(.git)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (command.SimpleCommand words: [{(git)} {(rev-parse)} {(HEAD)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(bundle/git-revision)} ) ] ) ] spids: [16777215 1241] ) ] else_action: [ (command.SimpleCommand words: [{(echo)} {(DQ (unknown))}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(bundle/git-revision)})] ) ] spids: [1254 1267] ) (command.SimpleCommand words: [ {(echo)} { (DQ ($ VSub_DollarName '$USER') ('@') ($ VSub_DollarName '$HOSTNAME') (' ') (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(date)})]) left_token: <Left_CommandSub '$('> spids: [1276 1278] ) ) } ] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(bundle/buildstamp)})] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(bundle/README.md)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(SQ <__EOF__>)} here_end_span_id: 1316 stdin_parts: [ ('# Sandstorm Bundle\n') ('\n') ('See: http://sandstorm.io\n') ('\n') ('This is a self-contained, batteries-included Sandstorm server. It should\n') ('work on any Linux kernel whose version is 3.13 or newer. The rest of your\n') ('filesystem is not touched and may as well be empty; everything will run in\n') ('a chroot.\n') ('\n') ('This bundle is intended to be installed using the Sandstorm installer or\n') ('updater. To install Sandstorm, please run:\n') ('\n') (' curl https://install.sandstorm.io | bash\n') ('\n') ('If you have already installed Sandstorm, you can update your installation to\n') ('this version by running:\n') ('\n') (' service sandstorm update <filename>.tar.xz\n') ] ) ] ) ] )