Пример #1
0
  def unpack (self, dry_run, verbose, callback, dest = None,
              filelist = None, list_files = False):
    if not dry_run:
      self.verify_md5_sig ()

    _gpatch_path = misclib.find_path_prog ('gpatch', self.environ)
    if not _gpatch_path:
      raise prog.ProgProgramNotFound ('gpatch')
    _gzip_path = misclib.find_path_prog ('gzip', self.environ)
    if not _gzip_path:
      raise prog.ProgProgramNotFound ('gzip')

    if not dry_run:
      if not os.path.exists (self.build_prefix):
        prog.ProgArchiveError ('build prefix "' + self.build_prefix +
                               '" does not exist. maybe you \
specified the wrong build directory in the build-name element?')
        raise ProgUnpackError

    arg = self.arg
    if not arg:
      arg = '-p0'

    if verbose:
      callback ('msg', '$ ' + _gzip_path + ' -dc ' +
                        os.path.normpath (self.path) + ' | ' +
                _gpatch_path + ' ' + arg + '\n', 2)
    if not dry_run:
      if pipe_two_commands (_gzip_path, [ '-dc', self.path ],
                            _gpatch_path, [ arg ], self.environ):
        prog.ProgArchiveError ('error using gzip | gpatch to unpack source')
Пример #2
0
  def unpack (self, dry_run, verbose, callback, dest = None,
              filelist = None, list_files = False):
    if not dry_run:
      self.verify_md5_sig ()

    _gzip_path = misclib.find_path_prog ('gzip', self.environ)
    if not _gzip_path:
      raise prog.ProgProgramNotFound ('gzip')

    _gcpio_path = misclib.find_path_prog ('gcpio', self.environ)
    if not _gcpio_path:
      raise prog.ProgProgramNotFound ('gcpio')

    if verbose:
      _gcpio_flags = '-idmuv'
    else:
      _gcpio_flags = '-idmu'

    if verbose:
      callback ('msg', '$ ' + _gzip_path + ' -dc ' +
                        os.path.normpath (self.path) + ' | ' +
                _gcpio_path + ' ' + _gcpio_flags + '\n', 2)
    if not dry_run:
      if pipe_two_commands (_gzip_path, [ '-dc', self.path ],
                            _gcpio_path, [ _gcpio_flags ],
                            self.environ):
        raise prog.ProgArchiveError ('error using gzip | gcpio to \
unpack source')