(command.CommandList children: [ (C {(Id.KW_Set set)} {(-euo)} {(pipefail)}) (C {(shopt)} {(-s)} {(extglob)}) (C {(rm)} {(-rf)} {(bundle)}) (command.ShFunction name: fail body: (command.BraceGroup children: [ (command.Simple words: [{(echo)} {(DQ ('make-bundle.sh: FAILED at line ') ($ Id.VSub_Number '$1'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:86) fd: -1 arg_word: {(2)} ) ] ) (C {(rm)} {(-rf)} {(bundle)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:97) arg_word: {(1)} ) ] ) ) (C {(trap)} {(SQ (Token id:Id.Lit_Chars val:'fail ${LINENO}' span_id:107))} {(ERR)}) (command.ShFunction name: copyDep body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'FILE=') ($ Id.VSub_Number '$1')}) (C {(local)} {(Id.Lit_VarLike 'DST=') (bundle) (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:FILE span_id:137) suffix_op: (suffix_op.PatSub pat: { (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\/' span_id:140) ) (usr) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\/' span_id:142)) (local) } replace: { (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\/' span_id:145) ) (usr) } replace_mode: Id.Lit_Pound ) ) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(-e)} {(DQ ($ Id.VSub_DollarName '$DST'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:163) ) ] action: [(C {(Id.Lit_Other ':')})] spids: [152 165] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$FILE'))} right: {(/etc/) (Id.Lit_Other '*')} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:189) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(-f)} {(DQ ($ Id.VSub_DollarName '$FILE'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:209) ) ] action: [ (command.Simple words: [{(echo)} {(DQ ($ Id.VSub_DollarName '$FILE'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_DGreat val:'>>' span_id:220) fd: -1 arg_word: {(tmp/host.list)} ) ] ) ] spids: [198 211] ) ] ) ] spids: [175 191] ) (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(-h)} {(DQ ($ Id.VSub_DollarName '$FILE'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:239) ) ] action: [ (C {(mkdir)} {(-p)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:272) command_list: (command.CommandList children: [(C {(dirname)} {(DQ ($ Id.VSub_DollarName '$DST'))})] ) ) } ) (C {(local)} {(Id.Lit_VarLike 'LINK=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:284) command_list: (command.CommandList children: [(C {(readlink)} {(-f)} {(DQ ($ Id.VSub_DollarName '$FILE'))})] ) ) } ) (C {(ln)} {(-sf)} { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:LINK span_id:301) suffix_op: (suffix_op.PatSub pat: { (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\/' span_id:304) ) (usr) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\/' span_id:306)) (local) } replace: { (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\/' span_id:309) ) (usr) } replace_mode: Id.Lit_Pound ) ) ) } {(DQ ($ Id.VSub_DollarName '$DST'))} ) (C {(copyDep)} {(DQ ($ Id.VSub_DollarName '$LINK'))}) ] spids: [228 241] ) (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(-d)} {(DQ ($ Id.VSub_DollarName '$FILE'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:337) ) ] action: [(C {(mkdir)} {(-p)} {(DQ ($ Id.VSub_DollarName '$DST'))})] spids: [326 339] ) (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(-f)} {(DQ ($ Id.VSub_DollarName '$FILE'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:366) ) ] action: [ (C {(mkdir)} {(-p)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:379) command_list: (command.CommandList children: [(C {(dirname)} {(DQ ($ Id.VSub_DollarName '$DST'))})] ) ) } ) (C {(cp)} {(DQ ($ Id.VSub_DollarName '$FILE'))} {(DQ ($ Id.VSub_DollarName '$DST'))}) ] spids: [355 368] ) ] ) ] ) ) (command.ShFunction name: copyDeps body: (command.BraceGroup children: [ (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:416) cond: [ (command.Sentence child: (C {(read)} {(FILE)}) terminator: (Token id:Id.Op_Semi val:';' span_id:421) ) ] body: (command.DoGroup children: [(C {(copyDep)} {(DQ ($ Id.VSub_DollarName '$FILE'))})] ) ) ] ) ) (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.Simple words: [{(which)} {(DQ ($ Id.VSub_DollarName '$CMD'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:469) fd: -1 arg_word: {(/dev/null)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:472) ) ] action: [ (command.Simple words: [{(echo)} {(DQ ('Please install ') ($ Id.VSub_DollarName '$CMD'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:484) fd: -1 arg_word: {(2)} ) ] ) (C {(fail)} {(${ Id.VSub_Name LINENO)}) ] spids: [459 474] ) ] ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:METEOR_DEV_BUNDLE) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:501) command_list: (command.CommandList children:[(C {(./find-meteor-dev-bundle.sh)})]) ) } spids: [500] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:NODE_BUILD_ROOT) op: assign_op.Equal rhs: {(/var/tmp/sandstorm-node-build-dir)} spids: [530] ) ] ) (C {(echo)} {(DQ ('Building node out-of-tree'))}) (C {(rm)} {(-rf)} {(DQ ($ Id.VSub_DollarName '$NODE_BUILD_ROOT'))}) (C {(mkdir)} {(-p)} {(DQ ($ Id.VSub_DollarName '$NODE_BUILD_ROOT'))}) (C {(cp)} {(-a)} {(deps/node)} {(DQ ($ Id.VSub_DollarName '$NODE_BUILD_ROOT'))}) (C {(pushd)} {(DQ ($ Id.VSub_DollarName '$NODE_BUILD_ROOT') (/node))}) (C {(./configure)} {(--partly-static)}) (C {(make)} {(-j) (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:582) command_list: (command.CommandList children:[(C {(nproc)})]) ) } ) (C {(popd)}) (C {(mkdir)} {(-p)} {(deps/node/out)}) (C {(rm)} {(-rf)} {(deps/node/out/) (Id.Lit_Star '*')}) (C {(mv)} {(DQ ($ Id.VSub_DollarName '$NODE_BUILD_ROOT') (/node/out)) (/) (Id.Lit_Star '*')} {(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 command_list: (command.CommandList children: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {(cd)} {(bundle/programs/server)}) (command.Simple words: [{(DQ ($ Id.VSub_DollarName '$METEOR_DEV_BUNDLE') (/bin/npm))} {(install)}] more_env: [ (env_pair name: PATH val: {($ Id.VSub_DollarName '$PWD') (/deps/node/out/Release) (Id.Lit_Other ':') ($ Id.VSub_DollarName '$METEOR_DEV_BUNDLE') (/lib/node_modules/.bin) (Id.Lit_Other ':') ($ Id.VSub_DollarName '$METEOR_DEV_BUNDLE') (/bin) (Id.Lit_Other ':') ($ Id.VSub_DollarName '$PATH') } spids: [670] ) ] ) ] ) ] ) ) (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.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:OLD_BUNDLE_BASE) op: assign_op.Equal rhs: {(sandstorm-171)} spids: [735] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:OLD_BUNDLE_FILENAME) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$OLD_BUNDLE_BASE') (.tar.xz)} spids: [738] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:OLD_BUNDLE_PATH) op: assign_op.Equal rhs: {(hack/) ($ Id.VSub_DollarName '$OLD_BUNDLE_FILENAME')} spids: [742] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:OLD_BUNDLE_SHA256) op: assign_op.Equal rhs: {(ebffd643dffeba349f139bee34e4ce33fd9b1298fafc1d6a31eb35a191059a99)} spids: [746] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:OLD_MONGO_FILES) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$OLD_BUNDLE_BASE') ('/bin/mongo ') ($ Id.VSub_DollarName '$OLD_BUNDLE_BASE') (/bin/mongod) ) } spids: [749] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-e)} {(DQ ($ Id.VSub_DollarName '$OLD_BUNDLE_PATH'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:771) ) ] action: [ (C {(echo)} { (DQ ('Fetching ') ($ Id.VSub_DollarName '$OLD_BUNDLE_FILENAME') (' to extract a mongo 2.6...') ) } ) (C {(curl)} {(--output)} {(DQ ($ Id.VSub_DollarName '$OLD_BUNDLE_PATH'))} {(https) (Id.Lit_Other ':') (//dl.sandstorm.io/) ($ Id.VSub_DollarName '$OLD_BUNDLE_FILENAME') } ) ] spids: [757 773] ) ] ) (command.Simple words: [{(sha256sum)} {(--check)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:808) fd: -1 here_begin: {(EOF)} here_end_span_id: 816 stdin_parts: [ ($ Id.VSub_DollarName '$OLD_BUNDLE_SHA256') (' ') ($ Id.VSub_DollarName '$OLD_BUNDLE_PATH') ('\n') ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:rc) op: assign_op.Equal rhs: {($ Id.VSub_QMark '$?')} spids: [820] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$rc')} {(-ne)} {(0)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:834) ) ] action: [ (C {(echo)} {(DQ ('Old bundle did not match expected checksum. Aborting.'))}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:846) arg_word: {(1)} ) ] spids: [823 836] ) ] ) (C {(tar)} {(xf)} {($ Id.VSub_DollarName '$OLD_BUNDLE_PATH')} {(--transform) (Id.Lit_Equals '=') (s/) (Id.Lit_Other '^') (${ Id.VSub_Name OLD_BUNDLE_BASE) (/bundle/) } {($ Id.VSub_DollarName '$OLD_MONGO_FILES')} ) (C {(cp)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:876) command_list: (command.CommandList children: [(C {(which)} {(zip)} {(unzip)} {(xz)} {(gpg)})] ) ) } {(bundle/bin)} ) (C {(ln)} {(-s)} {(../sandstorm)} {(bundle/bin/spk)}) (C {(chmod)} {(u) (Id.Lit_Other '+') (w)} {(bundle/bin/) (Id.Lit_Star '*')}) (C {(mkdir)} {(-p)} (word.BracedTree parts: [(bundle/usr/include/) (word_part.BracedTuple words:[{(capnp)} {(sandstorm)}])] ) ) (C {(cp)} {(src/capnp/) (word_part.ExtGlob op: (Token id:Id.ExtGlob_Bang val:'!(' span_id:942) arms: [{(Id.Lit_Other '*') (test) (Id.Lit_Other '*')}] ) (.capnp) } {(bundle/usr/include/capnp)} ) (C {(cp)} {(src/sandstorm/) (Id.Lit_Star '*') (.capnp)} {(bundle/usr/include/sandstorm)}) (C {(cp)} {(-r)} {(node_modules)} {(bundle)}) (command.Pipeline children: [ (command.Subshell command_list: (command.CommandList children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(ldd)} {(bundle/bin/) (Id.Lit_Star '*')} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:981) command_list: (command.CommandList children: [ (C {(find)} {(bundle)} {(-name)} {(SQ (Token id:Id.Lit_Chars val:'*.node' span_id:989))} ) ] ) ) } ) (C {(true)}) ] ) ] ) ) (C {(grep)} {(-o)} {(SQ (Token id:Id.Lit_Chars val:'[[:space:]]/[^ ]*' span_id:1005))}) (C {(copyDeps)}) ] negated: F ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:1024) fd: -1 arg_word: {(tmp/dnstest.c)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:1028) fd: -1 here_begin: {(SQ (Token id:Id.Lit_Chars val:__EOF__ span_id:1031))} 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.Simple words: [{(strace)} {(tmp/dnstest)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:1058) fd: 2 arg_word: {(1)} ) ] ) (C {(grep)} {(-o)} {(SQ (Token id:Id.Lit_Chars val:'"/[^"]*"' span_id:1068))}) (C {(tr)} {(-d)} {(SQ (Token id:Id.Lit_Chars val:'"' span_id:1078))}) (C {(copyDeps)}) ] negated: F ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_DGreat val:'>>' span_id:1103) fd: -1 arg_word: {(tmp/host.list)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:1107) fd: -1 here_begin: {(SQ (Token id:Id.Lit_Chars val:__EOF__ span_id:1110))} 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 (Token id:Id.Lit_Chars val:'/ld[.]so[.]' span_id:1138))}) (C {(sort)}) (command.Simple words: [{(uniq)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:1149) fd: -1 arg_word: {(bundle/host.list)} ) ] ) ] negated: F ) (C {(mkdir)} {(-p)} (word.BracedTree parts: [ (bundle/) (word_part.BracedTuple words: [ {(dev)} {(Id.KW_Proc proc)} {(tmp)} {(etc)} {(etc.host)} {(run)} {(run.host)} {(Id.KW_Var var)} ] ) ] ) ) (C {(touch)} (word.BracedTree parts: [ (bundle/dev/) (word_part.BracedTuple words:[{(null)} {(zero)} {(random)} {(urandom)} {(fuse)}]) ] ) ) (C {(mkdir)} {(-p)} {(bundle/usr/lib/locale)}) (C {(localedef)} {(--no-archive)} {(--inputfile) (Id.Lit_Equals '=') (./localedata-C)} {(--charmap) (Id.Lit_Equals '=') (UTF-8)} {(bundle/usr/lib/locale/C.UTF-8)} ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(-e)} {(.git)} {(Id.Lit_RBracket ']')}) terminator: (Token id:Id.Op_Semi val:';' span_id:1239) ) ] action: [ (command.Simple words: [{(git)} {(rev-parse)} {(HEAD)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:1250) fd: -1 arg_word: {(bundle/git-revision)} ) ] ) ] spids: [1230 1241] ) ] else_action: [ (command.Simple words: [{(echo)} {(DQ (unknown))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:1263) fd: -1 arg_word: {(bundle/git-revision)} ) ] ) ] ) (command.Simple words: [ {(echo)} { (DQ ($ Id.VSub_DollarName '$USER') ('@') ($ Id.VSub_DollarName '$HOSTNAME') (' ') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1276) command_list: (command.CommandList children:[(C {(date)})]) ) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:1281) fd: -1 arg_word: {(bundle/buildstamp)} ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:1288) fd: -1 arg_word: {(bundle/README.md)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:1292) fd: -1 here_begin: {(SQ (Token id:Id.Lit_Chars val:__EOF__ span_id:1295))} 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') ] ) ] ) ] )