(command.CommandList
  children: [
    (command.FuncDef
      name: gitweb_init
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:safe_pwd spids:[32])
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (word_part.CommandSubPart
                          command_list: 
                            (command.CommandList
                              children: [
                                (C {(perl)} {(-MPOSIX) (Lit_Other '=') (getcwd)} {(-e)} 
                                  {(SQ <'print quotemeta(getcwd)'>)}
                                )
                              ]
                            )
                          left_token: <Left_CommandSub '$('>
                          spids: [34 46]
                        )
                      )
                    }
                  spids: [32]
                )
              ]
              spids: [32]
            )
            (command.SimpleCommand
              words: [{(cat)}]
              redirects: [
                (redir.Redir
                  op: <Redir_Great '>'>
                  fd: 16777215
                  arg_word: {(gitweb_config.perl)}
                )
                (redir.HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 123
                  stdin_parts: [
                    ('#!/usr/bin/perl\n')
                    ('\n')
                    ('# gitweb configuration for tests\n')
                    ('\n')
                    ('our ')
                    (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)
                    ("version = 'current';\n")
                    ('our ')
                    (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)
                    ("GIT = 'git';\n")
                    ('our ')
                    (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)
                    ('projectroot = ')
                    (Right_DoubleQuote '"')
                    ($ VSub_Name '$safe_pwd')
                    (Right_DoubleQuote '"')
                    (';\n')
                    ('our ')
                    (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)
                    ('project_maxdepth = 8;\n')
                    ('our ')
                    (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)
                    ("home_link_str = 'projects';\n")
                    ('our ')
                    (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)
                    ("site_name = '[localhost]';\n")
                    ('our ')
                    (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)
                    ("site_html_head_string = '';\n")
                    ('our ')
                    (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)
                    ("site_header = '';\n")
                    ('our ')
                    (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)
                    ("site_footer = '';\n")
                    ('our ')
                    (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)
                    ("home_text = 'indextext.html';\n")
                    ("our @stylesheets = ('file:///")
                    ($ VSub_Name '$GIT_BUILD_DIR')
                    ("/gitweb/static/gitweb.css');\n")
                    ('our ')
                    (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)
                    ("logo = 'file:///")
                    ($ VSub_Name '$GIT_BUILD_DIR')
                    ("/gitweb/static/git-logo.png';\n")
                    ('our ')
                    (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)
                    ("favicon = 'file:///")
                    ($ VSub_Name '$GIT_BUILD_DIR')
                    ("/gitweb/static/git-favicon.png';\n")
                    ('our ')
                    (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)
                    ("projects_list = '';\n")
                    ('our ')
                    (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)
                    ("export_ok = '';\n")
                    ('our ')
                    (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)
                    ("strict_export = '';\n")
                    ('our ')
                    (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>)
                    ('maxload = undef;\n')
                    ('\n')
                  ]
                )
              ]
            )
            (command.SimpleCommand
              words: [{(cat)}]
              redirects: [
                (redir.Redir
                  op: <Redir_Great '>'>
                  fd: 16777215
                  arg_word: {(.git/description)}
                )
                (redir.HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 137
                  stdin_parts: [($ VSub_Number '$0') (' test repository\n')]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: (C {(test)} {(-n)} {(DQ ($ VSub_Name '$GITWEB_TEST_INSTALLED'))})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: (C {(test)} {(-d)} {($ VSub_Name '$GITWEB_TEST_INSTALLED')})
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (command.Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:SCRIPT_NAME spids:[183])
                                  op: Equal
                                  rhs: {(DQ ($ VSub_Name '$GITWEB_TEST_INSTALLED') (/gitweb.cgi))}
                                  spids: [183]
                                )
                              ]
                              spids: [183]
                            )
                          ]
                          spids: [16777215 180]
                        )
                      ]
                      else_action: [
                        (command.Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (lhs_expr.LhsName name:SCRIPT_NAME spids:[193])
                              op: Equal
                              rhs: {(DQ ($ VSub_Name '$GITWEB_TEST_INSTALLED'))}
                              spids: [193]
                            )
                          ]
                          spids: [193]
                        )
                      ]
                      spids: [190 199]
                    )
                    (command.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 168]
                )
              ]
              else_action: [
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:SCRIPT_NAME spids:[236])
                      op: Equal
                      rhs: {(DQ ($ VSub_Name '$GIT_BUILD_DIR') (/gitweb/gitweb.perl))}
                      spids: [236]
                    )
                  ]
                  spids: [236]
                )
              ]
              spids: [230 243]
            )
            (C {(export)} {(SCRIPT_NAME)})
          ]
          spids: [29]
        )
      spids: [24 28]
    )
    (command.FuncDef
      name: gitweb_run
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:GATEWAY_INTERFACE spids:[261])
                  op: Equal
                  rhs: {(SQ <CGI/1.1>)}
                  spids: [261]
                )
              ]
              spids: [261]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:HTTP_ACCEPT spids:[267])
                  op: Equal
                  rhs: {(SQ <'*/*'>)}
                  spids: [267]
                )
              ]
              spids: [267]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:REQUEST_METHOD spids:[273])
                  op: Equal
                  rhs: {(SQ <GET>)}
                  spids: [273]
                )
              ]
              spids: [273]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:QUERY_STRING spids:[279])
                  op: Equal
                  rhs: {(DQ ) ($ VSub_Number '$1') (DQ )}
                  spids: [279]
                )
              ]
              spids: [279]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:PATH_INFO spids:[287])
                  op: Equal
                  rhs: {(DQ ) ($ VSub_Number '$2') (DQ )}
                  spids: [287]
                )
              ]
              spids: [287]
            )
            (C {(export)} {(GATEWAY_INTERFACE)} {(HTTP_ACCEPT)} {(REQUEST_METHOD)} {(QUERY_STRING)} 
              {(PATH_INFO)}
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:GITWEB_CONFIG spids:[311])
                  op: Equal
                  rhs: 
                    {
                      (word_part.CommandSubPart
                        command_list: (command.CommandList children:[(C {(pwd)})])
                        left_token: <Left_CommandSub '$('>
                        spids: [312 314]
                      ) (/gitweb_config.perl)
                    }
                  spids: [311]
                )
              ]
              spids: [311]
            )
            (C {(export)} {(GITWEB_CONFIG)})
            (command.AndOr
              ops: [Op_DAmp Op_DAmp Op_DAmp]
              children: [
                (C {(rm)} {(-f)} {(gitweb.log)})
                (command.SimpleCommand
                  words: [{(perl)} {(--)} {(DQ ($ VSub_Name '$SCRIPT_NAME'))}]
                  redirects: [
                    (redir.Redir
                      op: <Redir_Great '>'>
                      fd: 16777215
                      arg_word: {(gitweb.output)}
                    )
                    (redir.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)}
                )
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.SimpleCommand
                              words: [{(grep)} {(SQ <'^[[]'>)} {(gitweb.log)}]
                              redirects: [
                                (redir.Redir
                                  op: <Redir_Great '>'>
                                  fd: 16777215
                                  arg_word: {(/dev/null)}
                                )
                                (redir.Redir
                                  op: <Redir_GreatAnd '2>&'>
                                  fd: 2
                                  arg_word: {(1)}
                                )
                              ]
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (command.AndOr
                          ops: [Op_DAmp]
                          children: [(C {(test_debug)} {(SQ <'cat gitweb.log >&2'>)}) (C {(false)})]
                        )
                      ]
                      spids: [16777215 407]
                    )
                  ]
                  else_action: [(C {(true)})]
                  spids: [422 428]
                )
              ]
            )
          ]
          spids: [258]
        )
      spids: [253 257]
    )
    (C {(.)} {(./test-lib.sh)})
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: (command.Pipeline children:[(C {(test_have_prereq)} {(PERL)})] negated:T)
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:skip_all spids:[467])
                  op: Equal
                  rhs: {(SQ <'skipping gitweb tests, perl not available'>)}
                  spids: [467]
                )
              ]
              spids: [467]
            )
            (C {(test_done)})
          ]
          spids: [16777215 464]
        )
      ]
      spids: [16777215 475]
    )
    (command.AndOr
      ops: [Op_DPipe]
      children: [
        (command.SimpleCommand
          words: [{(perl)} {(-MEncode)} {(-e)} {(SQ <'$e="";decode_utf8($e, Encode::FB_CROAK)'>)}]
          redirects: [
            (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})
            (redir.Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)})
          ]
        )
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:skip_all spids:[499])
                  op: Equal
                  rhs: {(SQ <'skipping gitweb tests, perl version is too old'>)}
                  spids: [499]
                )
              ]
              spids: [499]
            )
            (C {(test_done)})
          ]
          spids: [496]
        )
      ]
    )
    (command.AndOr
      ops: [Op_DPipe]
      children: [
        (command.SimpleCommand
          words: [
            {(perl)}
            {(-MCGI)}
            {(-MCGI) (Lit_Other ':') (Lit_Other ':') (Util)}
            {(-MCGI) (Lit_Other ':') (Lit_Other ':') (Carp)}
            {(-e)}
            {(0)}
          ]
          redirects: [
            (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})
            (redir.Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)})
          ]
        )
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:skip_all spids:[539])
                  op: Equal
                  rhs: {(SQ <'skipping gitweb tests, CGI module unusable'>)}
                  spids: [539]
                )
              ]
              spids: [539]
            )
            (C {(test_done)})
          ]
          spids: [536]
        )
      ]
    )
    (C {(gitweb_init)})
  ]
)