(command.CommandList
  children: [
    (C {(KW_Set set)} {(-o)} {(nounset)})
    (C {(KW_Set set)} {(-o)} {(pipefail)})
    (C {(KW_Set set)} {(-o)} {(errexit)})
    (C {(readonly)} 
      {(Lit_VarLike 'ROOTFS_URL=') 
        (SQ 
          <
'http://dl-cdn.alpinelinux.org/alpine/v3.6/releases/x86_64/alpine-minirootfs-3.6.2-x86_64.tar.gz'
          >
        )
      }
    )
    (C {(readonly)} {(Lit_VarLike 'CHROOT_DIR=') (_chroot/alpine1)})
    (C {(readonly)} {(Lit_VarLike 'DISTRO_BUILD_CHROOT_DIR=') (_chroot/alpine-distro-build)})
    (command.ShFunction
      name: download
      body: 
        (command.BraceGroup
          children: [
            (C {(wget)} {(--no-clobber)} {(--directory)} {(_tmp)} {($ VSub_DollarName '$ROOTFS_URL')})
          ]
        )
    )
    (command.ShFunction
      name: _extract
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} 
              {(Lit_VarLike 'dest=') 
                (braced_var_sub
                  token: <VSub_Number 1>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: {($ VSub_DollarName '$CHROOT_DIR')}
                    )
                )
              }
            )
            (C {(local)} 
              {(Lit_VarLike 'tarball=') (_tmp/) 
                (command_sub
                  left_token: <Left_DollarParen '$('>
                  command_list: 
                    (command.CommandList
                      children: [(C {(basename)} {($ VSub_DollarName '$ROOTFS_URL')})]
                    )
                )
              }
            )
            (C {(mkdir)} {(-p)} {($ VSub_DollarName '$dest')})
            (command.Simple
              words: [
                {(tar)}
                {(--extract)}
                {(--gzip)}
                {(--verbose)}
                {(--directory)}
                {($ VSub_DollarName '$dest')}
              ]
              redirects: [
                (redir.Redir
                  op: <Redir_Less '<'>
                  fd: 16777215
                  arg_word: {($ VSub_DollarName '$tarball')}
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: extract
      body: 
        (command.BraceGroup
          children: [
            (command.Sentence
              child: (C {(sudo)} {($ VSub_Number '$0')} {(_extract)} {(DQ ($ VSub_At '$@'))})
              terminator: <Op_Semi ';'>
            )
          ]
        )
    )
    (command.ShFunction
      name: extract-distro-build
      body: 
        (command.BraceGroup
          children: [
            (command.Sentence
              child: 
                (C {(sudo)} {($ VSub_Number '$0')} {(_extract)} 
                  {($ VSub_DollarName '$DISTRO_BUILD_CHROOT_DIR')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
        )
    )
    (command.ShFunction
      name: chmod-chroot
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} 
              {(Lit_VarLike 'dest=') 
                (braced_var_sub
                  token: <VSub_Number 1>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: {($ VSub_DollarName '$CHROOT_DIR')}
                    )
                )
              }
            )
            (C {(sudo)} {(chmod)} {(755)} {($ VSub_DollarName '$dest')})
          ]
        )
    )
    (command.ShFunction
      name: _setup-dns
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} 
              {(Lit_VarLike 'chroot_dir=') 
                (braced_var_sub
                  token: <VSub_Number 1>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: {($ VSub_DollarName '$CHROOT_DIR')}
                    )
                )
              }
            )
            (command.Simple
              words: [{(cat)}]
              redirects: [
                (redir.Redir
                  op: <Redir_Great '>'>
                  fd: 16777215
                  arg_word: {($ VSub_DollarName '$chroot_dir') (/etc/resolv.conf)}
                )
                (redir.HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 255
                  stdin_parts: [('nameserver 8.8.8.8\n') ('nameserver 8.8.4.4\n')]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: setup-dns
      body: 
        (command.BraceGroup
          children: [
            (command.Sentence
              child: (C {(sudo)} {($ VSub_Number '$0')} {(_setup-dns)} {(DQ ($ VSub_At '$@'))})
              terminator: <Op_Semi ';'>
            )
          ]
        )
    )
    (command.ShFunction
      name: add-oil-build-deps
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} 
              {(Lit_VarLike 'chroot_dir=') 
                (braced_var_sub
                  token: <VSub_Number 1>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: {($ VSub_DollarName '$CHROOT_DIR')}
                    )
                )
              }
            )
            (command.Simple
              words: [{(sudo)} {(chroot)} {($ VSub_DollarName '$chroot_dir')} {(/bin/sh)}]
              redirects: [
                (redir.HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 312
                  stdin_parts: [('apk update\n') ('apk add bash make gcc musl-dev \n')]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: add-alpine-sdk
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} 
              {(Lit_VarLike 'chroot_dir=') 
                (braced_var_sub
                  token: <VSub_Number 1>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: {($ VSub_DollarName '$DISTRO_BUILD_CHROOT_DIR')}
                    )
                )
              }
            )
            (command.Simple
              words: [{(sudo)} {(chroot)} {($ VSub_DollarName '$chroot_dir')} {(/bin/sh)}]
              redirects: [
                (redir.HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 369
                  stdin_parts: [('apk update\n') ('apk add bash alpine-sdk\n')]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: list-packages
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} 
              {(Lit_VarLike 'chroot_dir=') 
                (braced_var_sub
                  token: <VSub_Number 1>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: {($ VSub_DollarName '$DISTRO_BUILD_CHROOT_DIR')}
                    )
                )
              }
            )
            (C {(sudo)} {(chroot)} {($ VSub_DollarName '$chroot_dir')} {(apk)} {(info)})
          ]
        )
    )
    (command.ShFunction
      name: destroy-chroot
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} 
              {(Lit_VarLike 'chroot_dir=') 
                (braced_var_sub
                  token: <VSub_Number 1>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: {($ VSub_DollarName '$CHROOT_DIR')}
                    )
                )
              }
            )
            (C {(sudo)} {(rm)} {(-r)} {(-rf)} {($ VSub_DollarName '$chroot_dir')})
          ]
        )
    )
    (command.ShFunction
      name: enter-chroot
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} 
              {(Lit_VarLike 'chroot_dir=') 
                (braced_var_sub
                  token: <VSub_Number 1>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: {($ VSub_DollarName '$CHROOT_DIR')}
                    )
                )
              }
            )
            (C {(shift)})
            (C {(sudo)} {(chroot)} {($ VSub_DollarName '$chroot_dir')} {(DQ ($ VSub_At '$@'))})
          ]
        )
    )
    (command.ShFunction
      name: interactive
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} 
              {(Lit_VarLike 'chroot_dir=') 
                (braced_var_sub
                  token: <VSub_Number 1>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: {($ VSub_DollarName '$CHROOT_DIR')}
                    )
                )
              }
            )
            (C {(enter-chroot)} {($ VSub_DollarName '$chroot_dir')} {(/bin/sh)})
          ]
        )
    )
    (C {(readonly)} 
      {(Lit_VarLike 'OIL_VERSION=') 
        (command_sub
          left_token: <Left_DollarParen '$('>
          command_list: 
            (command.CommandList
              children: [(C {(head)} {(-n)} {(1)} {(oil-version.txt)})]
            )
        )
      }
    )
    (command.ShFunction
      name: _copy-tar
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} 
              {(Lit_VarLike 'chroot_dir=') 
                (braced_var_sub
                  token: <VSub_Number 1>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: {($ VSub_DollarName '$CHROOT_DIR')}
                    )
                )
              }
            )
            (C {(local)} 
              {(Lit_VarLike 'name=') 
                (braced_var_sub
                  token: <VSub_Number 2>
                  suffix_op: (suffix_op.Unary op_id:VTest_ColonHyphen arg_word:{(oil)})
                )
              }
            )
            (C {(local)} 
              {(Lit_VarLike 'version=') 
                (braced_var_sub
                  token: <VSub_Number 3>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: {($ VSub_DollarName '$OIL_VERSION')}
                    )
                )
              }
            )
            (C {(local)} {(Lit_VarLike 'dest=') ($ VSub_DollarName '$chroot_dir') (/src)})
            (C {(mkdir)} {(-p)} {($ VSub_DollarName '$dest')})
            (C {(cp)} {(-v)} 
              {(_release/) ($ VSub_DollarName '$name') (-) ($ VSub_DollarName '$version') (.tar.gz)} {($ VSub_DollarName '$dest')}
            )
          ]
        )
    )
    (command.ShFunction
      name: copy-tar
      body: 
        (command.BraceGroup
          children: [
            (command.Sentence
              child: (C {(sudo)} {($ VSub_Number '$0')} {(_copy-tar)} {(DQ ($ VSub_At '$@'))})
              terminator: <Op_Semi ';'>
            )
          ]
        )
    )
    (command.ShFunction
      name: _test-tar
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} 
              {(Lit_VarLike 'chroot_dir=') 
                (braced_var_sub
                  token: <VSub_Number 1>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: {($ VSub_DollarName '$CHROOT_DIR')}
                    )
                )
              }
            )
            (C {(local)} 
              {(Lit_VarLike 'name=') 
                (braced_var_sub
                  token: <VSub_Number 2>
                  suffix_op: (suffix_op.Unary op_id:VTest_ColonHyphen arg_word:{(oil)})
                )
              }
            )
            (C {(local)} 
              {(Lit_VarLike 'version=') 
                (braced_var_sub
                  token: <VSub_Number 3>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: {($ VSub_DollarName '$OIL_VERSION')}
                    )
                )
              }
            )
            (C {(local)} {(Lit_VarLike 'target=') (_bin/) (${ VSub_Name name) (.ovm)})
            (command.Simple
              words: [{(enter-chroot)} {(DQ ($ VSub_DollarName '$chroot_dir'))} {(/bin/sh)}]
              redirects: [
                (redir.HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 705
                  stdin_parts: [
                    ('set -e\n')
                    ('cd src\n')
                    ('tar --extract -z < ')
                    ($ VSub_DollarName '$name')
                    (-)
                    ($ VSub_DollarName '$version')
                    ('.tar.gz\n')
                    ('cd ')
                    ($ VSub_DollarName '$name')
                    (-)
                    ($ VSub_DollarName '$version')
                    ('\n')
                    ('./configure\n')
                    ('time make ')
                    ($ VSub_DollarName '$target')
                    ('\n')
                    ('echo\n')
                    ('echo ')
                    (Right_DoubleQuote '"')
                    ('*** Running ')
                    ($ VSub_DollarName '$target')
                    (Right_DoubleQuote '"')
                    ('\n')
                    ('#PYTHONVERBOSE=9 \n')
                    ($ VSub_DollarName '$target')
                    (' --version\n')
                    ('./install\n')
                    ('echo\n')
                    ('echo ')
                    (Right_DoubleQuote '"')
                    ('*** Running osh')
                    (Right_DoubleQuote '"')
                    ('\n')
                    ('osh --version\n')
                    ('echo status=')
                    ($ VSub_QMark '$?')
                    ('\n')
                    ('echo DONE\n')
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test-tar
      body: 
        (command.BraceGroup
          children: [
            (command.Sentence
              child: (C {(sudo)} {($ VSub_Number '$0')} {(_test-tar)} {(DQ ($ VSub_At '$@'))})
              terminator: <Op_Semi ';'>
            )
          ]
        )
    )
    (C {(DQ ($ VSub_At '$@'))})
  ]
)