Logo Search packages:      
Sourcecode: sabayon version File versions  Download package

def lib::storage::ProfileStorage::extract (   self,
  path,
  dst_dir,
  overwrite = False 
)

Extract a file or directory from the profile.

@path: the relative path of the file or directory to extract.
This is the same path used with ProfileStorage::add().
@dst_dir: the directory to which the file or directory specified
by @path should be extracted. Any subdirectories of @dst_dir
specified by @path will be created.

Definition at line 457 of file storage.py.

00457                                                         :
        """Extract a file or directory from the profile.

        @path: the relative path of the file or directory to extract.
        This is the same path used with ProfileStorage::add().
        @dst_dir: the directory to which the file or directory specified
        by @path should be extracted. Any subdirectories of @dst_dir
        specified by @path will be created.
        """
        dprint ("Extracting '%s' to '%s'", path, dst_dir)
        
        self.__unpack ()

        item_type = self.__get_item_type (path)

        if item_type == "directory":
            copy_tree (dst_dir, self.temp_path, path, None, overwrite)
        else:
            dst_path = os.path.join (dst_dir, path)
            if overwrite or not os.path.exists (dst_path):
                dirname = os.path.dirname (dst_path)
                if not os.path.exists (dirname):
                    os.makedirs (dirname)
                shutil.copy2 (os.path.join (self.temp_path, path), dst_path)

    def list (self, source = None):


Generated by  Doxygen 1.6.0   Back to index