def extract_files
      while file = @package_file.next_header
        if file.pathname == "control.tar.gz"
          control_tar_gz = Archive.read_open_memory(@package_file.read_data)
          while control_entry = control_tar_gz.next_header
            case control_entry.pathname
            when "./control"
              @control_file_contents = control_tar_gz.read_data
            when "./preinst"
              @preinst_contents = control_tar_gz.read_data
            when "./prerm"
              @prerm_contents = control_tar_gz.read_data
            when "./postinst"
              @postinst_contents = control_tar_gz.read_data
            when "./postrm"
              @postrm_contents = control_tar_gz.read_data
            end
          end
        end
        if file.pathname == "data.tar.gz"
          data_tar_gz = Archive.read_open_memory(@package_file.read_data)
          while data_entry = data_tar_gz.next_header
            # Skip dirs; they're listed with a / as the last character
            @filelist << data_entry.pathname.sub(/^\./, "") unless data_entry.pathname =~ /\/$/
          end
        end
      end
    end
def extract_files
      while file = @package_file.next_header
        if file.pathname == "control.tar.gz"
          control_tar_gz = Archive.read_open_memory(@package_file.read_data)
          while control_entry = control_tar_gz.next_header
            case control_entry.pathname
            when "./control"
              @control_file_contents = control_tar_gz.read_data
            when "./preinst"
              @preinst_contents = control_tar_gz.read_data
            when "./prerm"
              @prerm_contents = control_tar_gz.read_data
            when "./postinst"
              @postinst_contents = control_tar_gz.read_data
            when "./postrm"
              @postrm_contents = control_tar_gz.read_data
            end
          end
        end
        if file.pathname == "data.tar.gz"
          data_tar_gz = Archive.read_open_memory(@package_file.read_data)
          while data_entry = data_tar_gz.next_header
            # Skip dirs; they're listed with a / as the last character
            @filelist << data_entry.pathname.sub(/^\./, "") unless data_entry.pathname =~ /\/$/
          end
        end
      end
    end
Poke inside the package to find the control file,
 the pre/post install scripts, and a list of
 all the files it will deploy.