(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: -1
                  arg_word: {(gitweb_config.perl)}
                  spids: [44]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  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: -1
                  arg_word: {(.git/description)}
                  spids: [118]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: {(DQ ($ VSub_Number "$0") (" test repository\n"))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [121]
                )
              ]
            )
            (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: [171]
                                )
                              ]
                              spids: [171]
                            )
                          ]
                          spids: [-1 168]
                        )
                      ]
                      else_action: [
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:SCRIPT_NAME)
                              op: Equal
                              rhs: {(DQ ($ VSub_Name "$GITWEB_TEST_INSTALLED"))}
                              spids: [181]
                            )
                          ]
                          spids: [181]
                        )
                      ]
                      spids: [178 187]
                    )
                    (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: [-1 156]
                )
              ]
              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: [224]
                    )
                  ]
                  spids: [224]
                )
              ]
              spids: [218 231]
            )
            (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: [249]
                )
              ]
              spids: [249]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:HTTP_ACCEPT)
                  op: Equal
                  rhs: {(SQ <"*/*">)}
                  spids: [255]
                )
              ]
              spids: [255]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:REQUEST_METHOD)
                  op: Equal
                  rhs: {(SQ <GET>)}
                  spids: [261]
                )
              ]
              spids: [261]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:QUERY_STRING)
                  op: Equal
                  rhs: {(DQ ) ($ VSub_Number "$1") (DQ )}
                  spids: [267]
                )
              ]
              spids: [267]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:PATH_INFO)
                  op: Equal
                  rhs: {(DQ ) ($ VSub_Number "$2") (DQ )}
                  spids: [275]
                )
              ]
              spids: [275]
            )
            (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: [300 302]
                      ) (/gitweb_config.perl)
                    }
                  spids: [299]
                )
              ]
              spids: [299]
            )
            (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: -1
                          arg_word: {(gitweb.output)}
                          spids: [343]
                        )
                        (Redir
                          op_id: Redir_Great
                          fd: 2
                          arg_word: {(gitweb.log)}
                          spids: [346]
                        )
                      ]
                    )
                    (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: -1
                                          arg_word: {(/dev/null)}
                                          spids: [388]
                                        )
                                        (Redir
                                          op_id: Redir_GreatAnd
                                          fd: 2
                                          arg_word: {(1)}
                                          spids: [391]
                                        )
                                      ]
                                    )
                                  terminator: <Op_Semi ";">
                                )
                              ]
                              action: [
                                (AndOr
                                  children: [
                                    (C {(test_debug)} {(SQ <"cat gitweb.log >&2">)})
                                    (C {(false)})
                                  ]
                                  op_id: Op_DAmp
                                )
                              ]
                              spids: [-1 395]
                            )
                          ]
                          else_action: [(C {(true)})]
                          spids: [410 416]
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [246]
        )
      spids: [241 245]
    )
    (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: [455]
                )
              ]
              spids: [455]
            )
            (C {(test_done)})
          ]
          spids: [-1 452]
        )
      ]
      spids: [-1 463]
    )
    (AndOr
      children: [
        (SimpleCommand
          words: [{(perl)} {(-MEncode)} {(-e)} {(SQ <"$e=\"\";decode_utf8($e, Encode::FB_CROAK)">)}]
          redirects: [
            (Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[476])
            (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[479])
          ]
        )
        (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: [487]
                )
              ]
              spids: [487]
            )
            (C {(test_done)})
          ]
          spids: [484]
        )
      ]
      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:-1 arg_word:{(/dev/null)} spids:[516])
            (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[519])
          ]
        )
        (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: [527]
                )
              ]
              spids: [527]
            )
            (C {(test_done)})
          ]
          spids: [524]
        )
      ]
      op_id: Op_DPipe
    )
    (C {(gitweb_init)})
  ]
)