(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SOURCE_DIR)
          op: assign_op.Equal
          rhs: {<'/usr/local/src'>}
          spids: [30]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:OVERWRITE)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [36]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SOFTWARE_DIR)
          op: assign_op.Equal
          rhs: {(DQ <'http://www.minix3.org/software'>)}
          spids: [42]
        )
      ]
    )
    (command.Case
      to_match: {($ Id.VSub_Pound '$#')}
      arms: [
        (case_arm
          pat_list: [{<0>}]
          action: [
            (C {<echo>} {<Usage> <Id.Lit_Colon ':'>} {($ Id.VSub_Number '$0')} {<package>} 
              {<Id.Lit_TDot ...>}
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
          ]
          spids: [58 59 75 -1]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:ORIG_DIR)
          op: assign_op.Equal
          rhs: {(command_sub left_token:<Id.Left_Backtick '`'> child:(C {<pwd>}))}
          spids: [83]
        )
      ]
    )
    (C {<rm>} {<-f>} {<Log>})
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [(C {<mkdir>} {($ Id.VSub_DollarName '$SOURCE_DIR')}) (C {<true>})]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<cd>} {($ Id.VSub_DollarName '$SOURCE_DIR')})
        (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (C {<Id.Lit_LBracket '['>} 
                  {(DQ (command_sub left_token:<Id.Left_Backtick '`'> child:(C {<id>} {<-u>})))} {<-ne>} {<0>} {<Id.Lit_RBracket ']'>}
                )
              ]
            )
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: (condition.Shell commands:[(C {<test>} {<Id.KW_Bang '!'>} {<-w>} {<.>})])
                  action: [
                    (C {<echo>} {<You>} {<Id.KW_Do do>} {<not>} {<have>} {<write>} {<permission>} 
                      {<Id.KW_For for>} {($ Id.VSub_DollarName '$SOURCE_DIR')}
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [143 155]
                )
              ]
            )
          ]
          spids: [116 136]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [(C {<test>} {($ Id.VSub_Number '$1')} {<Id.Lit_Equals '='>} {(DQ <-o>)})]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:OVERWRITE)
                  op: assign_op.Equal
                  rhs: {<1>}
                  spids: [204]
                )
              ]
            )
            (C {<shift>})
          ]
          spids: [189 202]
        )
      ]
    )
    (command.ForEach
      iter_name: i
      do_arg_iter: T
      body: 
        (command.DoGroup
          children: [
            (command.Sentence child:(C {<echo>} {(DQ <' '>)}) terminator:<Id.Op_Semi _>)
            (C {<echo>} {<Start>} {<fetching>} {<package>} {($ Id.VSub_DollarName '$i')})
            (command.Simple
              words: [{<echo>} {(DQ <' '>)}]
              redirects: [
                (redir
                  op: <Id.Redir_DGreat '>>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {($ Id.VSub_DollarName '$ORIG_DIR') <'/Log'>}
                )
              ]
              do_fork: T
            )
            (command.Simple
              words: [
                {<echo>}
                {<------------->}
                {<Start>}
                {<fetching>}
                {($ Id.VSub_DollarName '$i')}
                {<------------------>}
              ]
              redirects: [
                (redir
                  op: <Id.Redir_DGreat '>>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {($ Id.VSub_DollarName '$ORIG_DIR') <'/Log'>}
                )
              ]
              do_fork: T
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [(C {<test>} {<-r>} {($ Id.VSub_DollarName '$i')})]
                    )
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (C {<test>} {($ Id.VSub_DollarName '$OVERWRITE')} {<Id.Lit_Equals '='>} 
                                  {<0>}
                                )
                              ]
                            )
                          action: [
                            (C {<echo>} {($ Id.VSub_DollarName '$i')} {<already>} {<exists.>} {<Skipping>} 
                              {<this>} {<package>}
                            )
                            (command.ControlFlow
                              token: <Id.ControlFlow_Continue continue>
                            )
                          ]
                          spids: [289 300]
                        )
                      ]
                      else_action: [
                        (C {<rm>} {<-rf>} {($ Id.VSub_DollarName '$i')})
                        (C {<echo>} {<Existing>} {<directory>} {($ Id.VSub_DollarName '$i')} {<removed>})
                      ]
                    )
                  ]
                  spids: [274 283]
                )
              ]
            )
            (C {<rm>} {<-f>} {($ Id.VSub_DollarName '$i') <.tar.bz2>} 
              {($ Id.VSub_DollarName '$i') <.tar>}
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:URL)
                  op: assign_op.Equal
                  rhs: 
                    {($ Id.VSub_DollarName '$SOFTWARE_DIR') <'/'> ($ Id.VSub_DollarName '$i') 
                      <.tar.bz2>
                    }
                  spids: [371]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:TARBZ)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$i') <.tar.bz2>}
                  spids: [378]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Simple
                          words: [{<urlget>} {($ Id.VSub_DollarName '$URL')}]
                          redirects: [
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {($ Id.VSub_DollarName '$TARBZ')}
                            )
                            (redir
                              op: <Id.Redir_Great '2>'>
                              loc: (redir_loc.Fd fd:2)
                              arg: {<'/dev/null'>}
                            )
                          ]
                          do_fork: T
                        )
                      ]
                    )
                  action: [(C {<Id.Lit_Colon ':'>})]
                  spids: [383 396]
                )
              ]
              else_action: [
                (C {<echo>} {<Cannot>} {<get>} {($ Id.VSub_DollarName '$i') <.>})
                (C {<echo>} {(DQ <'   '>)} {<Tried>} {($ Id.VSub_DollarName '$URL')})
                (C {<echo>} {(DQ <'   '>)} {<Skipping>} {<this>} {<package>})
                (C {<rm>} {<-f>} {($ Id.VSub_DollarName '$TARBZ')})
                (command.ControlFlow token:<Id.ControlFlow_Continue continue>)
              ]
            )
            (C {<echo>} {<Package>} {($ Id.VSub_DollarName '$i')} {<fetched>})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<bunzip2>} {($ Id.VSub_DollarName '$TARBZ')})
                (C {<smallbunzip2>} {($ Id.VSub_DollarName '$TARBZ')})
              ]
            )
            (command.Simple
              words: [{<pax>} {<-r>}]
              redirects: [
                (redir
                  op: <Id.Redir_Less '<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: {($ Id.VSub_DollarName '$i') <.tar>}
                )
              ]
              do_fork: T
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [(C {<test>} {<Id.KW_Bang '!'>} {<-d>} {($ Id.VSub_DollarName '$i')})]
                    )
                  action: [
                    (C {<echo>} {<Unable>} {<to>} {<unpack>} {($ Id.VSub_DollarName '$i')})
                    (command.ControlFlow token:<Id.ControlFlow_Continue continue>)
                  ]
                  spids: [486 497]
                )
              ]
              else_action: [(C {<echo>} {<Package>} {($ Id.VSub_DollarName '$i')} {<unpacked>})]
            )
            (C {<cd>} {($ Id.VSub_DollarName '$i')})
            (C {<binsizes>} {<big>})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<-f>} {<build.minix>} {<Id.Lit_RBracket ']'>})
                      ]
                    )
                  action: [
                    (command.Simple
                      words: [{<sh>} {<build.minix>}]
                      redirects: [
                        (redir
                          op: <Id.Redir_DGreat '>>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {($ Id.VSub_DollarName '$ORIG_DIR') <'/Log'>}
                        )
                        (redir
                          op: <Id.Redir_GreatAnd '2>&'>
                          loc: (redir_loc.Fd fd:2)
                          arg: {<1>}
                        )
                      ]
                      do_fork: T
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:r)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_QMark '$?')}
                          spids: [567]
                        )
                      ]
                    )
                  ]
                  spids: [542 553]
                )
              ]
              else_action: [
                (command.Simple
                  words: [{<sh>} {<build>}]
                  redirects: [
                    (redir
                      op: <Id.Redir_DGreat '>>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {($ Id.VSub_DollarName '$ORIG_DIR') <'/Log'>}
                    )
                    (redir
                      op: <Id.Redir_GreatAnd '2>&'>
                      loc: (redir_loc.Fd fd:2)
                      arg: {<1>}
                    )
                  ]
                  do_fork: T
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:r)
                      op: assign_op.Equal
                      rhs: {($ Id.VSub_QMark '$?')}
                      spids: [585]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$r')} {<-eq>} {<0>} 
                          {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [(C {<echo>} {<Package>} {($ Id.VSub_DollarName '$i')} {<installed>})]
                  spids: [592 606]
                )
              ]
              else_action: [
                (C {<echo>} {<Package>} {($ Id.VSub_DollarName '$i')} {<failed>} {<to>} 
                  {<install> <Id.Lit_Comma ','>} {<see>} {<Log>}
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<-f>} {<.postinstall>} {<Id.Lit_RBracket ']'>})
                      ]
                    )
                  action: [
                    (C {<echo>} {<Running>} {<postinstall>} {<script.>})
                    (C {<sh>} {<-e>} {<.postinstall>})
                  ]
                  spids: [640 651]
                )
              ]
            )
            (C {<binsizes>} {<normal>})
            (C {<cd>} {<..>})
            (C {<rm>} {<-f>} {($ Id.VSub_DollarName '$i') <.tar>} {($ Id.VSub_DollarName '$TARBZ')})
          ]
        )
    )
  ]
)