(CommandList
  children: [
    (FuncDef
      name: noversion
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LeftVar name:LOGRUS)
                  rhs: 
                    {
                      (SQ 
                        <
"s/-*\\(\\([0-9\\.]\\)*\\([_-]rc\\)*\\(-pre\\)*\\([0-9][a-zA-Z]\\)*\\)*\\(\\.tar\\(\\..z2*\\)*\\)$"
                        >
                      )
                    }
                  spids: [131]
                )
              ]
              spids: [131]
            )
            (AndOr
              children: [
                (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Number "$2"))} {(Lit_Other "]")})
                (AndOr
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LeftVar name:LOGRUS)
                          rhs: {(DQ ($ VSub_Name "$LOGRUS") (//))}
                          spids: [149]
                        )
                      ]
                      spids: [149]
                    )
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LeftVar name:LOGRUS)
                          rhs: 
                            {
                              (DQ ($ VSub_Name "$LOGRUS") (/) ($ VSub_Number "$2") 
                                (EscapedLiteralPart
                                  token: <Lit_EscapedChar "\\\\">
                                ) (6/)
                              )
                            }
                          spids: [157]
                        )
                      ]
                      spids: [157]
                    )
                  ]
                  op_id: Op_DPipe
                )
              ]
              op_id: Op_DAmp
            )
            (Pipeline
              children: [
                (C {(echo)} {(DQ ($ VSub_Number "$1"))})
                (C {(sed)} {(-e)} {(DQ ($ VSub_Name "$LOGRUS"))})
              ]
              negated: False
            )
          ]
          spids: [128]
        )
      spids: [124 127]
    )
    (FuncDef
      name: gather_patches
      body: 
        (BraceGroup
          children: [
            (Pipeline
              children: [
                (SimpleCommand
                  words: [
                    {(ls)}
                    {(DQ ($ VSub_Name "$PATCHDIR") (/) (${ VSub_Name PACKAGE)) (-) (Lit_Other "*") 
                      (.patch)
                    }
                  ]
                  redirects: [(Redirect op_id:Redir_Great arg_word:{(/dev/null)} fd:2 spids:[207])]
                )
                (C {(sort)})
                (While
                  cond: (C {(read)} {(i)})
                  body: 
                    (DoGroup
                      child: 
                        (If
                          arms: [
                            (if_arm
                              cond: 
                                (C {(Lit_Other "[")} {(-f)} {(DQ ($ VSub_Name "$i"))} {(Lit_Other "]")})
                              action: (C {(echo)} {(DQ ($ VSub_Name "$i"))})
                              spids: [-1 240]
                            )
                          ]
                          spids: [-1 250]
                        )
                      spids: [224 253]
                    )
                )
              ]
              negated: False
            )
            (If
              arms: [
                (if_arm
                  cond: 
                    (AndOr
                      children: [
                        (C {(Lit_Other "[")} {(KW_Bang "!")} {(-z)} {(DQ ($ VSub_Name "$MY_PATCH_DIR"))} 
                          {(Lit_Other "]")}
                        )
                        (C {(Lit_Other "[")} {(-d)} 
                          {(DQ (${ VSub_Name MY_PATCH_DIR) (/) (${ VSub_Name PACKAGE))} {(Lit_Other "]")}
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  action: 
                    (ForEach
                      iter_name: i
                      iter_words: [
                        {(DQ (${ VSub_Name MY_PATCH_DIR) (/) (${ VSub_Name PACKAGE) (/)) 
                          (Lit_Other "*") (.patch)
                        }
                      ]
                      do_arg_iter: False
                      body: 
                        (DoGroup
                          child: 
                            (If
                              arms: [
                                (if_arm
                                  cond: 
                                    (C {(Lit_Other "[")} {(-f)} {(DQ ($ VSub_Name "$i"))} 
                                      {(Lit_Other "]")}
                                    )
                                  action: (C {(echo)} {(DQ ($ VSub_Name "$i"))})
                                  spids: [-1 333]
                                )
                              ]
                              spids: [-1 343]
                            )
                          spids: [317 346]
                        )
                      spids: [302 -1]
                    )
                  spids: [-1 294]
                )
              ]
              spids: [-1 349]
            )
          ]
          spids: [191]
        )
      spids: [187 190]
    )
    (FuncDef
      name: patch_package
      body: 
        (BraceGroup
          children: [
            (Pipeline
              children: [
                (C {(gather_patches)})
                (While
                  cond: (C {(read)} {(i)})
                  body: 
                    (DoGroup
                      child: 
                        (If
                          arms: [
                            (if_arm
                              cond: 
                                (C {(Lit_Other "[")} {(-f)} {(DQ ($ VSub_Name "$i"))} {(Lit_Other "]")})
                              action: 
                                (CommandList
                                  children: [
                                    (C {(echo)} {(DQ ("Applying ") ($ VSub_Name "$i"))})
                                    (AndOr
                                      children: [
                                        (Subshell
                                          children: [
                                            (AndOr
                                              children: [
                                                (C {(cd)} 
                                                  {
                                                    (DQ (${ VSub_Name SRCTREE) (/) 
                                                      (${ VSub_Name PACKAGE)
                                                    )
                                                  }
                                                )
                                                (AndOr
                                                  children: [
                                                    (C {(patch)} {(-p1)} {(-i)} {(DQ ($ VSub_Name "$i"))})
                                                    (SimpleCommand
                                                      words: [{(sha1file)} {(DQ ($ VSub_Name "$i"))}]
                                                      redirects: [
                                                        (Redirect
                                                          op_id: Redir_DGreat
                                                          arg_word: {(DQ ($ VSub_Name "$SHA1FILE"))}
                                                          fd: -1
                                                          spids: [437]
                                                        )
                                                      ]
                                                    )
                                                  ]
                                                  op_id: Op_DAmp
                                                )
                                              ]
                                              op_id: Op_DAmp
                                            )
                                          ]
                                          spids: [402 442]
                                        )
                                        (If
                                          arms: [
                                            (if_arm
                                              cond: 
                                                (C {(Lit_Other "[")} {(-z)} 
                                                  {(DQ ($ VSub_Name "$ALLOW_PATCH_FAILURE"))} {(Lit_Other "]")}
                                                )
                                              action: (C {(dienow)})
                                              spids: [-1 460]
                                            )
                                          ]
                                          spids: [-1 466]
                                        )
                                      ]
                                      op_id: Op_DPipe
                                    )
                                  ]
                                )
                              spids: [-1 391]
                            )
                          ]
                          spids: [-1 469]
                        )
                      spids: [375 472]
                    )
                )
              ]
              negated: False
            )
          ]
          spids: [361]
        )
      spids: [357 360]
    )
    (FuncDef
      name: find_package_tarball
      body: 
        (BraceGroup
          children: [
            (Pipeline
              children: [
                (SimpleCommand
                  words: [
                    {(ls)}
                    {(-tc)}
                    {(DQ ($ VSub_Name "$SRCDIR") (/) ($ VSub_Number "$1") (-)) (Lit_Other "*") (.tar) 
                      (Lit_Other "*")
                    }
                  ]
                  redirects: [(Redirect op_id:Redir_Great arg_word:{(/dev/null)} fd:2 spids:[519])]
                )
                (While
                  cond: (C {(read)} {(i)})
                  body: 
                    (DoGroup
                      child: 
                        (If
                          arms: [
                            (if_arm
                              cond: 
                                (C {(Lit_Other "[")} 
                                  {
                                    (DQ 
                                      (CommandSubPart
                                        command_list: 
                                          (C {(noversion)} 
                                            {
                                              (DQ 
                                                (BracedVarSub
                                                  token: <VSub_Name i>
                                                  suffix_op: 
                                                    (PatSub
                                                      pat: 
                                                        {("*") 
                                                          (EscapedLiteralPart
                                                            token: <Lit_EscapedChar "\\/">
                                                          )
                                                        }
                                                      replace: {}
                                                      do_all: False
                                                      do_prefix: False
                                                      do_suffix: False
                                                    )
                                                  spids: [543 549]
                                                )
                                              )
                                            }
                                          )
                                        spids: [539 551]
                                      )
                                    )
                                  } {(Lit_Other "=") (Lit_Other "=")} {(DQ ($ VSub_Number "$1"))} {(Lit_Other "]")}
                                )
                              action: 
                                (CommandList
                                  children: [(C {(echo)} {(DQ ($ VSub_Name "$i"))}) (C {(break)})]
                                )
                              spids: [-1 564]
                            )
                          ]
                          spids: [-1 577]
                        )
                      spids: [531 580]
                    )
                )
              ]
              negated: False
            )
          ]
          spids: [485]
        )
      spids: [481 484]
    )
    (FuncDef
      name: package_cache
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LeftVar name:SNAPFROM)
                  rhs: {(DQ ($ VSub_Name "$SRCDIR") (/) ($ VSub_Number "$1"))}
                  spids: [592]
                )
              ]
              spids: [592]
            )
            (AndOr
              children: [
                (Subshell
                  children: [
                    (AndOr
                      children: [
                        (C {(is_in_list)} {(DQ ($ VSub_Number "$1"))} 
                          {(DQ ($ VSub_Name "$IGNORE_REPOS"))}
                        )
                        (C {(Lit_Other "[")} {(KW_Bang "!")} {(-d)} {(DQ ($ VSub_Name "$SNAPFROM"))} 
                          {(Lit_Other "]")}
                        )
                      ]
                      op_id: Op_DPipe
                    )
                  ]
                  spids: [600 624]
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LeftVar name:SNAPFROM)
                      rhs: {(DQ ($ VSub_Name "$SRCTREE") (/) ($ VSub_Number "$1"))}
                      spids: [629]
                    )
                  ]
                  spids: [629]
                )
              ]
              op_id: Op_DAmp
            )
            (If
              arms: [
                (if_arm
                  cond: 
                    (C {(Lit_Other "[")} {(KW_Bang "!")} {(-d)} {(DQ ($ VSub_Name "$SNAPFROM"))} 
                      {(Lit_Other "]")}
                    )
                  action: 
                    (CommandList
                      children: [
                        (SimpleCommand
                          words: [
                            {(echo)}
                            {(DQ ($ VSub_Number "$1") (" not found.  Did you run download.sh?"))}
                          ]
                          redirects: [
                            (Redirect
                              op_id: Redir_GreatAnd
                              arg_word: {(2)}
                              fd: -1
                              spids: [663]
                            )
                          ]
                        )
                        (C {(dienow)})
                      ]
                    )
                  spids: [-1 653]
                )
              ]
              spids: [-1 670]
            )
            (C {(echo)} {(DQ ($ VSub_Name "$SNAPFROM"))})
          ]
          spids: [589]
        )
      spids: [585 588]
    )
    (FuncDef
      name: extract_package
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [(C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$SRCTREE"))}) (C {(dienow)})]
              op_id: Op_DPipe
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LeftVar name:PACKAGE)
                  rhs: {(DQ ($ VSub_Number "$1"))}
                  spids: [719]
                )
              ]
              spids: [719]
            )
            (C {(announce)} {(DQ ($ VSub_Name "$PACKAGE"))})
            (AndOr
              children: [
                (Pipeline
                  children: [(C {(is_in_list)} {(DQ (PACKAGE))} {(DQ ($ VSub_Name "$IGNORE_REPOS"))})]
                  negated: True
                )
                (AndOr
                  children: [
                    (C {(Lit_Other "[")} {(-d)} 
                      {(DQ ($ VSub_Name "$SRCDIR") (/) ($ VSub_Name "$PACKAGE"))} {(Lit_Other "]")}
                    )
                    (C {(return)} {(0)})
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LeftVar name:FILENAME)
                  rhs: 
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: (C {(find_package_tarball)} {(DQ ($ VSub_Name "$PACKAGE"))})
                          spids: [775 781]
                        )
                      )
                    }
                  spids: [773]
                )
              ]
              spids: [773]
            )
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LeftVar name:DECOMPRESS) rhs:{(DQ )} spids:[785])]
              spids: [785]
            )
            (AndOr
              children: [
                (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$FILENAME"))} {(KW_Bang "!") (Lit_Other "=")} 
                  {
                    (DQ 
                      (BracedVarSub
                        token: <VSub_Name FILENAME>
                        suffix_op: 
                          (PatSub
                            pat: 
                              {(EscapedLiteralPart token:<Lit_EscapedChar "\\.">) (tar) 
                                (EscapedLiteralPart
                                  token: <Lit_EscapedChar "\\.">
                                ) (bz2)
                              }
                            replace: {}
                            do_all: False
                            do_prefix: True
                            do_suffix: False
                          )
                        spids: [800 809]
                      )
                    )
                  } {(Lit_Other "]")}
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [(assign_pair lhs:(LeftVar name:DECOMPRESS) rhs:{(DQ (j))} spids:[816])]
                  spids: [816]
                )
              ]
              op_id: Op_DAmp
            )
            (AndOr
              children: [
                (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$FILENAME"))} {(KW_Bang "!") (Lit_Other "=")} 
                  {
                    (DQ 
                      (BracedVarSub
                        token: <VSub_Name FILENAME>
                        suffix_op: 
                          (PatSub
                            pat: 
                              {(EscapedLiteralPart token:<Lit_EscapedChar "\\.">) (tar) 
                                (EscapedLiteralPart
                                  token: <Lit_EscapedChar "\\.">
                                ) (gz)
                              }
                            replace: {}
                            do_all: False
                            do_prefix: True
                            do_suffix: False
                          )
                        spids: [832 841]
                      )
                    )
                  } {(Lit_Other "]")}
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [(assign_pair lhs:(LeftVar name:DECOMPRESS) rhs:{(DQ (z))} spids:[848])]
                  spids: [848]
                )
              ]
              op_id: Op_DAmp
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LeftVar name:SHA1NAME)
                  rhs: {(DQ (sha1-for-source.txt))}
                  spids: [864]
                )
              ]
              spids: [864]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LeftVar name:SHA1FILE)
                  rhs: 
                    {
                      (DQ ($ VSub_Name "$SRCTREE") (/) ($ VSub_Name "$PACKAGE") (/) 
                        ($ VSub_Name "$SHA1NAME")
                      )
                    }
                  spids: [870]
                )
              ]
              spids: [870]
            )
            (If
              arms: [
                (if_arm
                  cond: (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$FILENAME"))} {(Lit_Other "]")})
                  action: 
                    (CommandList
                      children: [
                        (If
                          arms: [
                            (if_arm
                              cond: 
                                (C {(Lit_Other "[")} {(KW_Bang "!")} {(-e)} 
                                  {(DQ ($ VSub_Name "$SRCTREE") (/) ($ VSub_Name "$PACKAGE"))} {(Lit_Other "]")}
                                )
                              action: 
                                (CommandList
                                  children: [
                                    (SimpleCommand
                                      words: [
                                        {(echo)}
                                        {(DQ ("No tarball for ") ($ VSub_Name "$PACKAGE"))}
                                      ]
                                      redirects: [
                                        (Redirect
                                          op_id: Redir_GreatAnd
                                          arg_word: {(2)}
                                          fd: -1
                                          spids: [923]
                                        )
                                      ]
                                    )
                                    (C {(dienow)})
                                  ]
                                )
                              spids: [-1 913]
                            )
                          ]
                          spids: [-1 930]
                        )
                        (AndOr
                          children: [
                            (C {(Lit_Other "[")} {(KW_Bang "!")} {(-e)} {(DQ ($ VSub_Name "$SHA1FILE"))} 
                              {(Lit_Other "]")}
                            )
                            (C {(patch_package)})
                          ]
                          op_id: Op_DAmp
                        )
                        (C {(return)} {(0)})
                      ]
                    )
                  spids: [-1 893]
                )
              ]
              spids: [-1 960]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LeftVar name:SHA1TAR)
                  rhs: 
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: (C {(sha1file)} {(DQ ($ VSub_Name "$FILENAME"))})
                          spids: [975 981]
                        )
                      )
                    }
                  spids: [973]
                )
              ]
              spids: [973]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LeftVar name:SHALIST)
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (SimpleCommand
                            words: [{(cat)} {(DQ ($ VSub_Name "$SHA1FILE"))}]
                            redirects: [
                              (Redirect
                                op_id: Redir_Great
                                arg_word: {(/dev/null)}
                                fd: 2
                                spids: [993]
                              )
                            ]
                          )
                        spids: [986 996]
                      )
                    }
                  spids: [985]
                )
              ]
              spids: [985]
            )
            (If
              arms: [
                (if_arm
                  cond: 
                    (C {(Lit_Other "[")} {(KW_Bang "!")} {(-z)} {(DQ ($ VSub_Name "$SHALIST"))} 
                      {(Lit_Other "]")}
                    )
                  action: 
                    (CommandList
                      children: [
                        (ForEach
                          iter_name: i
                          iter_words: [
                            {(DQ ($ VSub_Name "$SHA1TAR"))}
                            {
                              (CommandSubPart
                                command_list: 
                                  (C {(sha1file)} 
                                    {
                                      (CommandSubPart
                                        command_list: (C {(gather_patches)})
                                        spids: [1030 1032]
                                      )
                                    }
                                  )
                                spids: [1027 1033]
                              )
                            }
                          ]
                          do_arg_iter: False
                          body: 
                            (DoGroup
                              child: 
                                (CommandList
                                  children: [
                                    (If
                                      arms: [
                                        (if_arm
                                          cond: 
                                            (C {(Lit_Other "[")} {(-z)} 
                                              {
                                                (DQ 
                                                  (CommandSubPart
                                                    command_list: 
                                                      (Pipeline
                                                        children: [
                                                          (C {(echo)} {(DQ ($ VSub_Name "$SHALIST"))})
                                                          (C {(grep)} {(DQ ($ VSub_Name "$i"))})
                                                        ]
                                                        negated: False
                                                      )
                                                    spids: [1050 1064]
                                                  )
                                                )
                                              } {(Lit_Other "]")}
                                            )
                                          action: 
                                            (CommandList
                                              children: [
                                                (Assignment
                                                  keyword: Assign_None
                                                  pairs: [
                                                    (assign_pair
                                                      lhs: (LeftVar name:SHALIST)
                                                      rhs: {(missing)}
                                                      spids: [1073]
                                                    )
                                                  ]
                                                  spids: [1073]
                                                )
                                                (C {(break)})
                                              ]
                                            )
                                          spids: [-1 1070]
                                        )
                                      ]
                                      spids: [-1 1080]
                                    )
                                    (Assignment
                                      keyword: Assign_None
                                      pairs: [
                                        (assign_pair
                                          lhs: (LeftVar name:SHALIST)
                                          rhs: 
                                            {
                                              (DQ 
                                                (CommandSubPart
                                                  command_list: 
                                                    (Pipeline
                                                      children: [
                                                        (C {(echo)} {(DQ ($ VSub_Name "$SHALIST"))})
                                                        (C {(sed)} {(DQ (s/) ($ VSub_Name "$i") (//))})
                                                      ]
                                                      negated: False
                                                    )
                                                  spids: [1089 1106]
                                                )
                                              )
                                            }
                                          spids: [1087]
                                        )
                                      ]
                                      spids: [1087]
                                    )
                                  ]
                                )
                              spids: [1036 1110]
                            )
                          spids: [1022 -1]
                        )
                        (AndOr
                          children: [
                            (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$SHALIST"))} {(Lit_Other "]")})
                            (C {(return)} {(0)})
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                    )
                  spids: [-1 1014]
                )
              ]
              spids: [-1 1134]
            )
            (C {(echo)} {(-n)} {(DQ ("Extracting '") ($ VSub_Name "$PACKAGE") ("'"))})
            (Subshell
              children: [
                (CommandList
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LeftVar name:UNIQUE)
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: (C {(readlink)} {(/proc/self)})
                                spids: [1158 1162]
                              )
                            }
                          spids: [1157]
                        )
                      ]
                      spids: [1157]
                    )
                    (C {(trap)} {(SQ <"rm -rf \"$BUILD/temp-">) ($ VSub_Name "$UNIQUE") (SQ <"\"">)} 
                      {(EXIT)}
                    )
                    (SimpleCommand
                      words: [{(rm)} {(-rf)} {(DQ ($ VSub_Name "$SRCTREE") (/) ($ VSub_Name "$PACKAGE"))}]
                      redirects: [
                        (Redirect
                          op_id: Redir_Great
                          arg_word: {(/dev/null)}
                          fd: 2
                          spids: [1188]
                        )
                      ]
                    )
                    (AndOr
                      children: [
                        (C {(mkdir)} {(-p)} 
                          {(DQ ($ VSub_Name "$BUILD") (/temp-) ($ VSub_Name "$UNIQUE"))} {(DQ ($ VSub_Name "$SRCTREE"))}
                        )
                        (C {(dienow)})
                      ]
                      op_id: Op_DPipe
                    )
                    (Pipeline
                      children: [
                        (BraceGroup
                          children: [
                            (AndOr
                              children: [
                                (C {(tar)} {(-xv) (${ VSub_Name DECOMPRESS)} {(-f)} 
                                  {(DQ ($ VSub_Name "$FILENAME"))} {(-C)} {(DQ ($ VSub_Name "$BUILD") (/temp-) ($ VSub_Name "$UNIQUE"))}
                                )
                                (AndOr
                                  children: [
                                    (Assignment
                                      keyword: Assign_None
                                      pairs: [
                                        (assign_pair
                                          lhs: (LeftVar name:TARDIR)
                                          rhs: 
                                            {
                                              (DQ 
                                                (CommandSubPart
                                                  command_list: 
                                                    (C {(readlink)} {(-f)} 
                                                      {
                                                        (DQ ($ VSub_Name "$BUILD") (/temp-) 
                                                          ($ VSub_Name "$UNIQUE")
                                                        ) (/) (Lit_Other "*")
                                                      }
                                                    )
                                                  spids: [1248 1260]
                                                )
                                              )
                                            }
                                          spids: [1246]
                                        )
                                      ]
                                      spids: [1246]
                                    )
                                    (C {(touch)} 
                                      {(DQ ($ VSub_Name "$TARDIR") (/) ($ VSub_Name "$SHA1NAME"))}
                                    )
                                  ]
                                  op_id: Op_DAmp
                                )
                              ]
                              op_id: Op_DAmp
                            )
                          ]
                          spids: [1212]
                        )
                        (C {(dotprogress)})
                      ]
                      negated: False
                    )
                    (AndOr
                      children: [
                        (C {(Lit_Other "[")} {(-e)} 
                          {(DQ ($ VSub_Name "$BUILD") (/temp-) ($ VSub_Name "$UNIQUE")) (/) 
                            (Lit_Other "*") (/) (DQ ($ VSub_Name "$SHA1NAME"))
                          } {(Lit_Other "]")}
                        )
                        (AndOr
                          children: [
                            (C {(mv)} 
                              {(DQ ($ VSub_Name "$BUILD") (/temp-) ($ VSub_Name "$UNIQUE") (/)) 
                                (Lit_Other "*")
                              } {(DQ ($ VSub_Name "$SRCTREE") (/) ($ VSub_Name "$PACKAGE"))}
                            )
                            (SimpleCommand
                              words: [{(echo)} {(DQ ($ VSub_Name "$SHA1TAR"))}]
                              redirects: [
                                (Redirect
                                  op_id: Redir_DGreat
                                  arg_word: {(DQ ($ VSub_Name "$SHA1FILE"))}
                                  fd: -1
                                  spids: [1329]
                                )
                              ]
                            )
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                )
              ]
              spids: [1154 1336]
            )
            (AndOr
              children: [
                (C {(Lit_Other "[")} {($ VSub_QMark "$?")} {(-ne)} {(0)} {(Lit_Other "]")})
                (C {(dienow)})
              ]
              op_id: Op_DAmp
            )
            (C {(patch_package)})
          ]
          spids: [697]
        )
      spids: [693 696]
    )
    (FuncDef
      name: confirm_checksum
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LeftVar name:SUM)
                  rhs: 
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: 
                            (SimpleCommand
                              words: [
                                {(sha1file)}
                                {(DQ ($ VSub_Name "$SRCDIR") (/) ($ VSub_Name "$FILENAME"))}
                              ]
                              redirects: [
                                (Redirect
                                  op_id: Redir_Great
                                  arg_word: {(/dev/null)}
                                  fd: 2
                                  spids: [1386]
                                )
                              ]
                            )
                          spids: [1377 1388]
                        )
                      )
                    }
                  spids: [1375]
                )
              ]
              spids: [1375]
            )
            (If
              arms: [
                (if_arm
                  cond: 
                    (AndOr
                      children: [
                        (C {(Lit_Other "[")} {(x) (DQ ($ VSub_Name "$SUM"))} 
                          {(Lit_Other "=") (Lit_Other "=")} {(x) (DQ ($ VSub_Name "$SHA1"))} {(Lit_Other "]")}
                        )
                        (AndOr
                          children: [
                            (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$SHA1"))} {(Lit_Other "]")})
                            (C {(Lit_Other "[")} {(-f)} 
                              {(DQ ($ VSub_Name "$SRCDIR") (/) ($ VSub_Name "$FILENAME"))} {(Lit_Other "]")}
                            )
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                      op_id: Op_DPipe
                    )
                  action: 
                    (CommandList
                      children: [
                        (If
                          arms: [
                            (if_arm
                              cond: 
                                (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$SHA1"))} 
                                  {(Lit_Other "]")}
                                )
                              action: 
                                (C {(echo)} 
                                  {
                                    (DQ ("No SHA1 for ") ($ VSub_Name "$FILENAME") (" (") 
                                      ($ VSub_Name "$SUM") (")")
                                    )
                                  }
                                )
                              spids: [-1 1454]
                            )
                          ]
                          else_action: (C {(echo)} {(DQ ("Confirmed ") ($ VSub_Name "$FILENAME"))})
                          spids: [1468 1479]
                        )
                        (AndOr
                          children: [
                            (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$EXTRACT_ALL"))} 
                              {(Lit_Other "]")}
                            )
                            (C {(return)} {(0)})
                          ]
                          op_id: Op_DAmp
                        )
                        (C {(extract_package)} {(DQ ($ VSub_Name "$BASENAME"))})
                        (C {(return)} {($ VSub_QMark "$?")})
                      ]
                    )
                  spids: [-1 1438]
                )
              ]
              spids: [-1 1517]
            )
            (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$SRCDIR") (/) ($ VSub_Name "$FILENAME"))})
            (C {(return)} {(1)})
          ]
          spids: [1372]
        )
      spids: [1368 1371]
    )
    (FuncDef
      name: download_from
      body: 
        (BraceGroup
          children: [
            (AndOr children:[(C {(confirm_checksum)})(C {(return)} {(0)})] op_id:Op_DAmp)
            (AndOr
              children: [
                (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Number "$1"))} {(Lit_Other "]")})
                (C {(return)} {(1)})
              ]
              op_id: Op_DAmp
            )
            (AndOr
              children: [
                (C {(wget)} {(-t)} {(2)} {(-T)} {(20)} {(-O)} 
                  {(DQ ($ VSub_Name "$SRCDIR") (/) ($ VSub_Name "$FILENAME"))} {(DQ ($ VSub_Number "$1"))}
                )
                (Subshell
                  children: [
                    (CommandList
                      children: [
                        (Sentence
                          command: 
                            (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$SRCDIR") (/) ($ VSub_Name "$FILENAME"))})
                          terminator: <Op_Semi ";">
                        )
                        (C {(return)} {(2)})
                      ]
                    )
                  ]
                  spids: [1622 1637]
                )
              ]
              op_id: Op_DPipe
            )
            (C {(touch)} {(-c)} {(DQ ($ VSub_Name "$SRCDIR") (/) ($ VSub_Name "$FILENAME"))})
            (C {(confirm_checksum)})
          ]
          spids: [1557]
        )
      spids: [1553 1556]
    )
    (FuncDef
      name: download
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LeftVar name:FILENAME)
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (Pipeline
                            children: [
                              (C {(echo)} {(DQ ($ VSub_Name "$URL"))})
                              (C {(sed)} {(SQ <"s .*/  ">)})
                            ]
                            negated: False
                          )
                        spids: [1669 1683]
                      )
                    }
                  spids: [1668]
                )
              ]
              spids: [1668]
            )
            (AndOr
              children: [
                (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$RENAME"))} {(Lit_Other "]")})
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LeftVar name:FILENAME)
                      rhs: 
                        {
                          (DQ 
                            (CommandSubPart
                              command_list: 
                                (Pipeline
                                  children: [
                                    (C {(echo)} {(DQ ($ VSub_Name "$FILENAME"))})
                                    (C {(sed)} {(-r)} {(DQ ($ VSub_Name "$RENAME"))})
                                  ]
                                  negated: False
                                )
                              spids: [1700 1716]
                            )
                          )
                        }
                      spids: [1698]
                    )
                  ]
                  spids: [1698]
                )
              ]
              op_id: Op_DPipe
            )
            (If
              arms: [
                (if_arm
                  cond: 
                    (C {(Lit_Other "[")} {(-z)} 
                      {
                        (DQ 
                          (CommandSubPart
                            command_list: 
                              (SimpleCommand
                                words: [{(sha1sum)}]
                                redirects: [
                                  (Redirect
                                    op_id: Redir_Less
                                    arg_word: {(/dev/null)}
                                    fd: -1
                                    spids: [1731]
                                  )
                                ]
                              )
                            spids: [1728 1734]
                          )
                        )
                      } {(Lit_Other "]")}
                    )
                  action: 
                    (CommandList
                      children: [
                        (SimpleCommand
                          words: [{(echo)} {(DQ ("Error: please install sha1sum"))}]
                          redirects: [
                            (Redirect
                              op_id: Redir_GreatAnd
                              arg_word: {(2)}
                              fd: -1
                              spids: [1749]
                            )
                          ]
                        )
                        (C {(exit)} {(1)})
                      ]
                    )
                  spids: [-1 1740]
                )
              ]
              spids: [-1 1758]
            )
            (C {(echo)} {(-ne)} 
              {
                (DQ ("checking ") ($ VSub_Name "$FILENAME") 
                  (EscapedLiteralPart token:<Lit_EscapedChar "\\r">)
                )
              }
            )
            (SimpleCommand
              words: [{(touch)} {(-c)} {(DQ ($ VSub_Name "$SRCDIR")) (/) (DQ ($ VSub_Name "$FILENAME"))}]
              redirects: [(Redirect op_id:Redir_Great arg_word:{(/dev/null)} fd:2 spids:[1791])]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LeftVar name:BASENAME)
                  rhs: 
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: (C {(noversion)} {(DQ ($ VSub_Name "$FILENAME"))})
                          spids: [1802 1808]
                        )
                      )
                    }
                  spids: [1800]
                )
              ]
              spids: [1800]
            )
            (If
              arms: [
                (if_arm
                  cond: 
                    (AndOr
                      children: [
                        (Pipeline
                          children: [
                            (C {(is_in_list)} {(DQ ($ VSub_Name "$BASENAME"))} 
                              {(DQ ($ VSub_Name "$IGNORE_REPOS"))}
                            )
                          ]
                          negated: True
                        )
                        (C {(Lit_Other "[")} {(-d)} 
                          {(DQ ($ VSub_Name "$SRCDIR") (/) ($ VSub_Name "$BASENAME"))} {(Lit_Other "]")}
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  action: 
                    (CommandList
                      children: [
                        (C {(echo)} 
                          {(DQ ("Using ") ($ VSub_Name "$SRCDIR") (/) ($ VSub_Name "$BASENAME"))}
                        )
                        (If
                          arms: [
                            (if_arm
                              cond: 
                                (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$EXTRACT_ALL"))} 
                                  {(Lit_Other "=") (Lit_Other "=")} {(force)} {(Lit_Other "]")}
                                )
                              action: 
                                (AndOr
                                  children: [
                                    (C {(rm)} {(-rf)} 
                                      {(DQ ($ VSub_Name "$SRCTREE") (/) ($ VSub_Name "$BASENAME"))}
                                    )
                                    (AndOr
                                      children: [
                                        (C {(cp)} {(-a)} 
                                          {
                                            (DQ ($ VSub_Name "$SRCDIR") (/) ($ VSub_Name "$BASENAME"))
                                          } {(DQ ($ VSub_Name "$SRCTREE") (/) ($ VSub_Name "$BASENAME"))}
                                        )
                                        (C {(dienow)})
                                      ]
                                      op_id: Op_DPipe
                                    )
                                  ]
                                  op_id: Op_DAmp
                                )
                              spids: [-1 1870]
                            )
                          ]
                          spids: [-1 1907]
                        )
                        (C {(return)} {(0)})
                      ]
                    )
                  spids: [-1 1841]
                )
              ]
              spids: [-1 1916]
            )
            (If
              arms: [
                (if_arm
                  cond: 
                    (C {(Lit_Other "[")} {(KW_Bang "!")} {(-z)} {(DQ ($ VSub_Name "$PREFERRED_MIRROR"))} 
                      {(Lit_Other "]")}
                    )
                  action: 
                    (AndOr
                      children: [
                        (C {(download_from)} 
                          {(DQ ($ VSub_Name "$PREFERRED_MIRROR") (/) ($ VSub_Name "$FILENAME"))}
                        )
                        (C {(return)} {(0)})
                      ]
                      op_id: Op_DAmp
                    )
                  spids: [-1 1940]
                )
              ]
              spids: [-1 1958]
            )
            (AndOr
              children: [(C {(download_from)} {(DQ ($ VSub_Name "$URL"))}) (C {(return)} {(0)})]
              op_id: Op_DAmp
            )
            (ForEach
              iter_name: i
              iter_words: [{($ VSub_Name "$MIRROR_LIST")}]
              do_arg_iter: False
              body: 
                (DoGroup
                  child: 
                    (AndOr
                      children: [
                        (C {(download_from)} {(DQ ($ VSub_Name "$i") (/) ($ VSub_Name "$FILENAME"))})
                        (C {(return)} {(0)})
                      ]
                      op_id: Op_DAmp
                    )
                  spids: [1993 2011]
                )
              spids: [1989 -1]
            )
            (C {(echo)} {(DQ ("Could not download ") ($ VSub_Name "$FILENAME"))})
            (C {(echo)} {(-en)} {(DQ (EscapedLiteralPart token:<Lit_EscapedChar "\\e">) ("[0m"))})
            (C {(return)} {(1)})
          ]
          spids: [1665]
        )
      spids: [1661 1664]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LeftVar name:START_TIME)
          rhs: 
            {
              (CommandSubPart
                command_list: (C {(date)} {(Lit_Other "+") (Lit_Other "%") (s)})
                spids: [2050 2056]
              )
            }
          spids: [2049]
        )
      ]
      spids: [2049]
    )
    (FuncDef
      name: cleanup_oldfiles
      body: 
        (BraceGroup
          children: [
            (C {(wait)})
            (ForEach
              iter_name: i
              iter_words: [{(DQ (${ VSub_Name SRCDIR)) (/) (Lit_Other "*")}]
              do_arg_iter: False
              body: 
                (DoGroup
                  child: 
                    (If
                      arms: [
                        (if_arm
                          cond: 
                            (AndOr
                              children: [
                                (C {(Lit_Other "[")} {(-f)} {(DQ ($ VSub_Name "$i"))} {(Lit_Other "]")})
                                (C {(Lit_Other "[")} 
                                  {
                                    (DQ 
                                      (CommandSubPart
                                        command_list: 
                                          (C {(date)} {(Lit_Other "+") (Lit_Other "%") (s)} {(-r)} 
                                            {(DQ ($ VSub_Name "$i"))}
                                          )
                                        spids: [2110 2122]
                                      )
                                    )
                                  } {(-lt)} {(DQ (${ VSub_Name START_TIME))} {(Lit_Other "]")}
                                )
                              ]
                              op_id: Op_DAmp
                            )
                          action: 
                            (CommandList
                              children: [
                                (C {(echo)} {(Removing)} {(old)} {(file)} {(DQ ($ VSub_Name "$i"))})
                                (C {(rm)} {(-rf)} {(DQ ($ VSub_Name "$i"))})
                              ]
                            )
                          spids: [-1 2136]
                        )
                      ]
                      spids: [-1 2161]
                    )
                  spids: [2090 2164]
                )
              spids: [2080 -1]
            )
          ]
          spids: [2063]
        )
      spids: [2059 2062]
    )
  ]
)