Exemplo n.º 1
0
    def build(self, storage_dir, environment=None, output_to_file=True):
        """
        Run the standard PackageBuilder then pack up the results in a package.
        """

        # Create our temporary directory
        name = self._xpd.name
        self._work_dir = tempfile.mkdtemp(suffix = '-xpkg-install-' + name)

        # TODO: make this a hash of something meaning, full
        pad_hash = util.hash_string(name)
        install_dir = os.path.join(self._work_dir, 'install-' + pad_hash)

        # TODO: LOG THIS
        print 'Binary working in:',self._work_dir

        try:
            # Build the package(s)
            builder = PackageBuilder(self._xpd)
            infos = builder.build(install_dir, environment, output_to_file)

            # Build packages and get their paths
            dest_paths = [self._create_package(install_dir, storage_dir, info)
                          for info in infos]

        finally:
            # Make sure we cleanup after we are done
            # Don't do this right now
            shutil.rmtree(self._work_dir)

        return dest_paths
Exemplo n.º 2
0
Arquivo: core.py Projeto: jlisee/xpkg
    def __init__(self, path, name):
        self._path = path

        # Determine the path to our cache
        cache_root = Environment.local_cache_dir()

        hash_key = self._path + name
        hash_file = 'md5-%s.json' % util.hash_string(hash_key)

        self._cache_path = os.path.join(cache_root, name, hash_file)

        # Load the cache from disk
        self.load_from_disk()
Exemplo n.º 3
0
    def __init__(self, path, name):
        self._path = path

        # Determine the path to our cache
        cache_root = Environment.local_cache_dir()

        hash_key = self._path + name
        hash_file = 'md5-%s.json' % util.hash_string(hash_key)

        self._cache_path = os.path.join(cache_root, name, hash_file)

        # Load the cache from disk
        self.load_from_disk()