(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: <Redir_Great '>'>
                  fd: 16777215
                  arg_word: {(gitweb_config.perl)}
                )
                (HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 115
                  stdin_parts: [
                    ('#!/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')
                  ]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(.git/description)})
                (HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 129
                  stdin_parts: [($ VSub_Number '$0') (' test repository\n')]
                )
              ]
            )
            (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: [175]
                                )
                              ]
                              spids: [175]
                            )
                          ]
                          spids: [16777215 172]
                        )
                      ]
                      else_action: [
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:SCRIPT_NAME)
                              op: Equal
                              rhs: {(DQ ($ VSub_Name '$GITWEB_TEST_INSTALLED'))}
                              spids: [185]
                            )
                          ]
                          spids: [185]
                        )
                      ]
                      spids: [182 191]
                    )
                    (AndOr
                      ops: [Op_DPipe]
                      children: [
                        (C {(test)} {(-f)} {(DQ ($ VSub_Name '$SCRIPT_NAME'))})
                        (C {(error)} 
                          {
                            (DQ ('Cannot find gitweb at ') ($ VSub_Name '$GITWEB_TEST_INSTALLED') (.))
                          }
                        )
                      ]
                    )
                    (C {(say)} {(DQ ('# Testing ') ($ VSub_Name '$SCRIPT_NAME'))})
                  ]
                  spids: [16777215 160]
                )
              ]
              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: [228]
                    )
                  ]
                  spids: [228]
                )
              ]
              spids: [222 235]
            )
            (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: [253]
                )
              ]
              spids: [253]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:HTTP_ACCEPT)
                  op: Equal
                  rhs: {(SQ <'*/*'>)}
                  spids: [259]
                )
              ]
              spids: [259]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:REQUEST_METHOD)
                  op: Equal
                  rhs: {(SQ <GET>)}
                  spids: [265]
                )
              ]
              spids: [265]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:QUERY_STRING)
                  op: Equal
                  rhs: {(DQ ) ($ VSub_Number '$1') (DQ )}
                  spids: [271]
                )
              ]
              spids: [271]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:PATH_INFO)
                  op: Equal
                  rhs: {(DQ ) ($ VSub_Number '$2') (DQ )}
                  spids: [279]
                )
              ]
              spids: [279]
            )
            (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: [304 306]
                      ) (/gitweb_config.perl)
                    }
                  spids: [303]
                )
              ]
              spids: [303]
            )
            (C {(export)} {(GITWEB_CONFIG)})
            (AndOr
              ops: [Op_DAmp Op_DAmp Op_DAmp]
              children: [
                (C {(rm)} {(-f)} {(gitweb.log)})
                (SimpleCommand
                  words: [{(perl)} {(--)} {(DQ ($ VSub_Name '$SCRIPT_NAME'))}]
                  redirects: [
                    (Redir
                      op: <Redir_Great '>'>
                      fd: 16777215
                      arg_word: {(gitweb.output)}
                    )
                    (Redir op:<Redir_Great '2>'> fd:2 arg_word:{(gitweb.log)})
                  ]
                )
                (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: <Redir_Great '>'>
                                  fd: 16777215
                                  arg_word: {(/dev/null)}
                                )
                                (Redir
                                  op: <Redir_GreatAnd '2>&'>
                                  fd: 2
                                  arg_word: {(1)}
                                )
                              ]
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (AndOr
                          ops: [Op_DAmp]
                          children: [(C {(test_debug)} {(SQ <'cat gitweb.log >&2'>)}) (C {(false)})]
                        )
                      ]
                      spids: [16777215 399]
                    )
                  ]
                  else_action: [(C {(true)})]
                  spids: [414 420]
                )
              ]
            )
          ]
          spids: [250]
        )
      spids: [245 249]
    )
    (C {(.)} {(./test-lib.sh)})
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (Pipeline children:[(C {(test_have_prereq)} {(PERL)})] negated:T)
              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: [459]
                )
              ]
              spids: [459]
            )
            (C {(test_done)})
          ]
          spids: [16777215 456]
        )
      ]
      spids: [16777215 467]
    )
    (AndOr
      ops: [Op_DPipe]
      children: [
        (SimpleCommand
          words: [{(perl)} {(-MEncode)} {(-e)} {(SQ <'$e="";decode_utf8($e, Encode::FB_CROAK)'>)}]
          redirects: [
            (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})
            (Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)})
          ]
        )
        (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: [491]
                )
              ]
              spids: [491]
            )
            (C {(test_done)})
          ]
          spids: [488]
        )
      ]
    )
    (AndOr
      ops: [Op_DPipe]
      children: [
        (SimpleCommand
          words: [
            {(perl)}
            {(-MCGI)}
            {(-MCGI) (Lit_Other ':') (Lit_Other ':') (Util)}
            {(-MCGI) (Lit_Other ':') (Lit_Other ':') (Carp)}
            {(-e)}
            {(0)}
          ]
          redirects: [
            (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})
            (Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)})
          ]
        )
        (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: [531]
                )
              ]
              spids: [531]
            )
            (C {(test_done)})
          ]
          spids: [528]
        )
      ]
    )
    (C {(gitweb_init)})
  ]
)