Пример #1
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')

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

    if verbose:
      _gtar_flags = 'zxvf'
    else:
      _gtar_flags = 'zxf'

    if verbose:
      callback ('msg', '$ ' + _gtar_path + ' ' + _gtar_flags + ' ' +
                os.path.normpath (self.path) + '\n', 2)
    if not dry_run:
      if os.spawnve (os.P_WAIT, _gtar_path, [_gtar_path, _gtar_flags,
                                             self.path], self.environ):
        raise prog.ProgArchiveError ('error using gtar 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 ()

    _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')
Пример #3
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')
Пример #4
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')

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

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

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

    _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', '$ ' + _gcpio_path + ' ' + _gcpio_flags +
                ' < ' + os.path.normpath (self.path) + '\n', 2)
    if not dry_run:
      if os.spawnve (os.P_WAIT, _gcpio_path, [_gcpio_path, _gcpio_flags,
                                             '-I', self.path],
                     self.environ):
        raise prog.ProgArchiveError ('error gcpio to unpack source')