(command.CommandList children: [ (C {<Id.KW_Set set>} {<-euo>} {<pipefail>}) (C {<shopt>} {<-s>} {<extglob>}) (C {<rm>} {<-rf>} {<bundle>}) (command.ShFunction name: fail body: (BraceGroup children: [ (command.Simple words: [{<echo>} {(DQ <'make-bundle.sh: FAILED at line '> ($ Id.VSub_Number '$1'))}] redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})] do_fork: T ) (C {<rm>} {<-rf>} {<bundle>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] ) ) (C {<trap>} {(SQ <'fail ${LINENO}'>)} {<ERR>}) (command.ShFunction name: copyDep body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'FILE='> ($ Id.VSub_Number '$1')}) (C {<local>} {<Id.Lit_VarLike 'DST='> <bundle> (DQ (braced_var_sub token: <Id.VSub_Name FILE> suffix_op: (suffix_op.PatSub pat: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\/'>) <usr> (word_part.EscapedLiteral token: <Id.Lit_EscapedChar '\\/'> ) <local> } replace: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\/'>) <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: <Id.Op_Semi _> ) ] action: [(C {<Id.Lit_Colon ':'>})] 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: <Id.Op_Semi _> ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-f>} {(DQ ($ Id.VSub_DollarName '$FILE'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (command.Simple words: [{<echo>} {(DQ ($ Id.VSub_DollarName '$FILE'))}] redirects: [ (redir op: <Id.Redir_DGreat '>>'> loc: (redir_loc.Fd fd:1) arg: {<'tmp/host.list'>} ) ] do_fork: T ) ] 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: <Id.Op_Semi _> ) ] action: [ (C {<mkdir>} {<-p>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<dirname>} {(DQ ($ Id.VSub_DollarName '$DST'))}) ) } ) (C {<local>} {<Id.Lit_VarLike 'LINK='> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<readlink>} {<-f>} {(DQ ($ Id.VSub_DollarName '$FILE'))}) ) } ) (C {<ln>} {<-sf>} { (DQ (braced_var_sub token: <Id.VSub_Name LINK> suffix_op: (suffix_op.PatSub pat: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\/'>) <usr> (word_part.EscapedLiteral token: <Id.Lit_EscapedChar '\\/'> ) <local> } replace: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\/'>) <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: <Id.Op_Semi _> ) ] 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: <Id.Op_Semi _> ) ] action: [ (C {<mkdir>} {<-p>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (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: (BraceGroup children: [ (command.WhileUntil keyword: <Id.KW_While while> cond: [(command.Sentence child:(C {<read>} {<FILE>}) terminator:<Id.Op_Semi _>)] 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 op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) ] do_fork: T ) ] negated: T ) terminator: <Id.Op_Semi _> ) ] action: [ (command.Simple words: [{<echo>} {(DQ <'Please install '> ($ Id.VSub_DollarName '$CMD'))}] redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})] do_fork: T ) (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: <Id.Left_DollarParen '$('> child: (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:<Id.Left_DollarParen '$('> child:(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 child: (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_Colon ':'> ($ Id.VSub_DollarName '$METEOR_DEV_BUNDLE') <'/lib/node_modules/.bin'> <Id.Lit_Colon ':'> ($ Id.VSub_DollarName '$METEOR_DEV_BUNDLE') <'/bin'> <Id.Lit_Colon ':'> ($ Id.VSub_DollarName '$PATH') } spids: [670] ) ] do_fork: T ) ] ) ) (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: <Id.Op_Semi _> ) ] 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_Colon ':'> <'//dl.sandstorm.io/'> ($ Id.VSub_DollarName '$OLD_BUNDLE_FILENAME') } ) ] spids: [757 773] ) ] ) (command.Simple words: [{<sha256sum>} {<--check>}] redirects: [ (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine here_begin: {<EOF>} here_end_span_id: 816 stdin_parts: [ ($ Id.VSub_DollarName '$OLD_BUNDLE_SHA256') <' '> ($ Id.VSub_DollarName '$OLD_BUNDLE_PATH') <'\n'> ] ) ) ] do_fork: T ) (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: <Id.Op_Semi _> ) ] action: [ (C {<echo>} {(DQ <'Old bundle did not match expected checksum. Aborting.'>)}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> 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: <Id.Left_DollarParen '$('> child: (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: <Id.ExtGlob_Bang '!('> 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 child: (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<ldd>} {<'bundle/bin/'> <Id.Lit_Star '*'>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<find>} {<bundle>} {<-name>} {(SQ <'*.node'>)}) ) } ) (C {<true>}) ] ) ) (C {<grep>} {<-o>} {(SQ <'[[:space:]]/[^ ]*'>)}) (C {<copyDeps>}) ] negated: F ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'tmp/dnstest.c'>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine 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'> ] ) ) ] do_fork: T ) (C {<gcc>} {<'tmp/dnstest.c'>} {<-o>} {<'tmp/dnstest'>}) (command.Pipeline children: [ (command.Simple words: [{<strace>} {<'tmp/dnstest'>}] redirects: [(redir op:<Id.Redir_GreatAnd '2>&'> loc:(redir_loc.Fd fd:2) arg:{<1>})] do_fork: T ) (C {<grep>} {<-o>} {(SQ <'"/[^"]*"'>)}) (C {<tr>} {<-d>} {(SQ <'"'>)}) (C {<copyDeps>}) ] negated: F ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<'tmp/host.list'>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine 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'> ] ) ) ] do_fork: T ) (command.Pipeline children: [ (C {<cat>} {<'tmp/host.list'>}) (C {<grep>} {<-v>} {(SQ <'/ld[.]so[.]'>)}) (C {<sort>}) (command.Simple words: [{<uniq>}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'bundle/host.list'>} ) ] do_fork: T ) ] 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: <Id.Op_Semi _> ) ] action: [ (command.Simple words: [{<git>} {<rev-parse>} {<HEAD>}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'bundle/git-revision'>} ) ] do_fork: T ) ] spids: [1230 1241] ) ] else_action: [ (command.Simple words: [{<echo>} {(DQ <unknown>)}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'bundle/git-revision'>} ) ] do_fork: T ) ] ) (command.Simple words: [ {<echo>} { (DQ ($ Id.VSub_DollarName '$USER') <'@'> ($ Id.VSub_DollarName '$HOSTNAME') <' '> (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<date>})) ) } ] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'bundle/buildstamp'>})] do_fork: T ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'bundle/README.md'>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine 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'> ] ) ) ] do_fork: T ) ] )