(CommandList
  children: [
    (FuncDef
      name: gitweb_init
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:safe_pwd)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [
                                (C {(perl)} {(-MPOSIX) (Lit_Other '=') (getcwd)} {(-e)} 
                                  {(SQ <'print quotemeta(getcwd)'>)}
                                )
                              ]
                            )
                          left_token: <Left_CommandSub '$('>
                          spids: [26 38]
                        )
                      )
                    }
                  spids: [24]
                )
              ]
              spids: [24]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: 16777215
                  arg_word: {(gitweb_config.perl)}
                  spids: [44]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: 16777215
                  body: 
                    {
                      (DQ ('#!/usr/bin/perl\n') ('\n') ('# gitweb configuration for tests\n') ('\n') 
                        ('our ') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ("version = 'current';\n") ('our ') 
                        (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ("GIT = 'git';\n") ('our ') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('projectroot = ') 
                        (Right_DoubleQuote '"') ($ VSub_Name '$safe_pwd') (Right_DoubleQuote '"') (';\n') ('our ') 
                        (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('project_maxdepth = 8;\n') ('our ') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) 
                        ("home_link_str = 'projects';\n") ('our ') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ("site_name = '[localhost]';\n") ('our ') 
                        (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ("site_html_head_string = '';\n") ('our ') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) 
                        ("site_header = '';\n") ('our ') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ("site_footer = '';\n") ('our ') 
                        (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ("home_text = 'indextext.html';\n") ("our @stylesheets = ('file:///") ($ VSub_Name '$GIT_BUILD_DIR') 
                        ("/gitweb/static/gitweb.css');\n") ('our ') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ("logo = 'file:///") 
                        ($ VSub_Name '$GIT_BUILD_DIR') ("/gitweb/static/git-logo.png';\n") ('our ') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) 
                        ("favicon = 'file:///") ($ VSub_Name '$GIT_BUILD_DIR') ("/gitweb/static/git-favicon.png';\n") ('our ') 
                        (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ("projects_list = '';\n") ('our ') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) 
                        ("export_ok = '';\n") ('our ') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ("strict_export = '';\n") ('our ') 
                        (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('maxload = undef;\n') ('\n')
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [47]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: 16777215
                  arg_word: {(.git/description)}
                  spids: [119]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: 16777215
                  body: {(DQ ($ VSub_Number '$0') (' test repository\n'))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [122]
                )
              ]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(test)} {(-n)} {(DQ ($ VSub_Name '$GITWEB_TEST_INSTALLED'))})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: (C {(test)} {(-d)} {($ VSub_Name '$GITWEB_TEST_INSTALLED')})
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:SCRIPT_NAME)
                                  op: Equal
                                  rhs: {(DQ ($ VSub_Name '$GITWEB_TEST_INSTALLED') (/gitweb.cgi))}
                                  spids: [173]
                                )
                              ]
                              spids: [173]
                            )
                          ]
                          spids: [16777215 170]
                        )
                      ]
                      else_action: [
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:SCRIPT_NAME)
                              op: Equal
                              rhs: {(DQ ($ VSub_Name '$GITWEB_TEST_INSTALLED'))}
                              spids: [183]
                            )
                          ]
                          spids: [183]
                        )
                      ]
                      spids: [180 189]
                    )
                    (AndOr
                      children: [
                        (C {(test)} {(-f)} {(DQ ($ VSub_Name '$SCRIPT_NAME'))})
                        (C {(error)} 
                          {
                            (DQ ('Cannot find gitweb at ') ($ VSub_Name '$GITWEB_TEST_INSTALLED') (.))
                          }
                        )
                      ]
                      op_id: Op_DPipe
                    )
                    (C {(say)} {(DQ ('# Testing ') ($ VSub_Name '$SCRIPT_NAME'))})
                  ]
                  spids: [16777215 158]
                )
              ]
              else_action: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:SCRIPT_NAME)
                      op: Equal
                      rhs: {(DQ ($ VSub_Name '$GIT_BUILD_DIR') (/gitweb/gitweb.perl))}
                      spids: [226]
                    )
                  ]
                  spids: [226]
                )
              ]
              spids: [220 233]
            )
            (C {(export)} {(SCRIPT_NAME)})
          ]
          spids: [21]
        )
      spids: [16 20]
    )
    (FuncDef
      name: gitweb_run
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:GATEWAY_INTERFACE)
                  op: Equal
                  rhs: {(SQ <CGI/1.1>)}
                  spids: [251]
                )
              ]
              spids: [251]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:HTTP_ACCEPT)
                  op: Equal
                  rhs: {(SQ <'*/*'>)}
                  spids: [257]
                )
              ]
              spids: [257]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:REQUEST_METHOD)
                  op: Equal
                  rhs: {(SQ <GET>)}
                  spids: [263]
                )
              ]
              spids: [263]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:QUERY_STRING)
                  op: Equal
                  rhs: {(DQ ) ($ VSub_Number '$1') (DQ )}
                  spids: [269]
                )
              ]
              spids: [269]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:PATH_INFO)
                  op: Equal
                  rhs: {(DQ ) ($ VSub_Number '$2') (DQ )}
                  spids: [277]
                )
              ]
              spids: [277]
            )
            (C {(export)} {(GATEWAY_INTERFACE)} {(HTTP_ACCEPT)} {(REQUEST_METHOD)} {(QUERY_STRING)} 
              {(PATH_INFO)}
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:GITWEB_CONFIG)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: (CommandList children:[(C {(pwd)})])
                        left_token: <Left_CommandSub '$('>
                        spids: [302 304]
                      ) (/gitweb_config.perl)
                    }
                  spids: [301]
                )
              ]
              spids: [301]
            )
            (C {(export)} {(GITWEB_CONFIG)})
            (AndOr
              children: [
                (C {(rm)} {(-f)} {(gitweb.log)})
                (AndOr
                  children: [
                    (SimpleCommand
                      words: [{(perl)} {(--)} {(DQ ($ VSub_Name '$SCRIPT_NAME'))}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(gitweb.output)}
                          spids: [345]
                        )
                        (Redir
                          op_id: Redir_Great
                          fd: 2
                          arg_word: {(gitweb.log)}
                          spids: [348]
                        )
                      ]
                    )
                    (AndOr
                      children: [
                        (C {(perl)} {(-w)} {(-e)} 
                          {
                            (SQ <'\n'> <'\t\topen O, ">gitweb.headers";\n'> <'\t\twhile (<>) {\n'> 
                              <'\t\t\tprint O;\n'> <'\t\t\tlast if (/^\\r$/ || /^$/);\n'> <'\t\t}\n'> <'\t\topen O, ">gitweb.body";\n'> 
                              <'\t\twhile (<>) {\n'> <'\t\t\tprint O;\n'> <'\t\t}\n'> <'\t\tclose O;\n'> <'\t'>
                            )
                          } {(gitweb.output)}
                        )
                        (If
                          arms: [
                            (if_arm
                              cond: [
                                (Sentence
                                  child: 
                                    (SimpleCommand
                                      words: [{(grep)} {(SQ <'^[[]'>)} {(gitweb.log)}]
                                      redirects: [
                                        (Redir
                                          op_id: Redir_Great
                                          fd: 16777215
                                          arg_word: {(/dev/null)}
                                          spids: [390]
                                        )
                                        (Redir
                                          op_id: Redir_GreatAnd
                                          fd: 2
                                          arg_word: {(1)}
                                          spids: [393]
                                        )
                                      ]
                                    )
                                  terminator: <Op_Semi ';'>
                                )
                              ]
                              action: [
                                (AndOr
                                  children: [
                                    (C {(test_debug)} {(SQ <'cat gitweb.log >&2'>)})
                                    (C {(false)})
                                  ]
                                  op_id: Op_DAmp
                                )
                              ]
                              spids: [16777215 397]
                            )
                          ]
                          else_action: [(C {(true)})]
                          spids: [412 418]
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [248]
        )
      spids: [243 247]
    )
    (C {(.)} {(./test-lib.sh)})
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (Pipeline children:[(C {(test_have_prereq)} {(PERL)})] negated:True)
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:skip_all)
                  op: Equal
                  rhs: {(SQ <'skipping gitweb tests, perl not available'>)}
                  spids: [457]
                )
              ]
              spids: [457]
            )
            (C {(test_done)})
          ]
          spids: [16777215 454]
        )
      ]
      spids: [16777215 465]
    )
    (AndOr
      children: [
        (SimpleCommand
          words: [{(perl)} {(-MEncode)} {(-e)} {(SQ <'$e="";decode_utf8($e, Encode::FB_CROAK)'>)}]
          redirects: [
            (Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[478])
            (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[481])
          ]
        )
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:skip_all)
                  op: Equal
                  rhs: {(SQ <'skipping gitweb tests, perl version is too old'>)}
                  spids: [489]
                )
              ]
              spids: [489]
            )
            (C {(test_done)})
          ]
          spids: [486]
        )
      ]
      op_id: Op_DPipe
    )
    (AndOr
      children: [
        (SimpleCommand
          words: [
            {(perl)}
            {(-MCGI)}
            {(-MCGI) (Lit_Other ':') (Lit_Other ':') (Util)}
            {(-MCGI) (Lit_Other ':') (Lit_Other ':') (Carp)}
            {(-e)}
            {(0)}
          ]
          redirects: [
            (Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[518])
            (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[521])
          ]
        )
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:skip_all)
                  op: Equal
                  rhs: {(SQ <'skipping gitweb tests, CGI module unusable'>)}
                  spids: [529]
                )
              ]
              spids: [529]
            )
            (C {(test_done)})
          ]
          spids: [526]
        )
      ]
      op_id: Op_DPipe
    )
    (C {(gitweb_init)})
  ]
)