Exemplo n.º 1
0
    def build(self):
        os.system("mkdir -p " + self.installerdir)
        install_manager = gup.DependencyManager(self.installer_root, dbdir=self.installer_db, clean=True)

        install_manager.include_build_deps = False
        install_manager.read_package_headers(self.settings.packages, self.branch_dict)
        install_manager.read_package_headers(self.settings.cross_packages, self.branch_dict)

        self.package_manager = install_manager

        def get_dep(x):
            return install_manager.dependencies(x)

        package_names = gup.topologically_sorted(self.arguments, {}, get_dep, None)
        self.checksum_matches = False
        checksum_file = self.installer_checksum_file
        self.checksum = self.calculate_checksum(package_names)
        if os.path.exists(checksum_file) and open(checksum_file).read() == self.checksum:
            raise ChecksumShortCircuit(checksum_file)

        for a in package_names:
            install_manager.install_package(a)

        version = install_manager.package_dict(self.name)["version"]
        version_tup = misc.string_to_version(version)
        buildnumber = "%d" % self.version_db.get_next_build_number(version_tup)

        self.installer_version = version
        self.installer_build = buildnumber
Exemplo n.º 2
0
    def build(self):
        os.system('mkdir -p ' + self.installerdir)
        install_manager = gup.DependencyManager(self.installer_root,
                                                dbdir=self.installer_db,
                                                clean=True)

        install_manager.include_build_deps = False
        install_manager.read_package_headers(self.settings.packages,
                                             self.branch_dict)
        install_manager.read_package_headers(self.settings.cross_packages,
                                             self.branch_dict)

        self.package_manager = install_manager

        def get_dep(x):
            return install_manager.dependencies(x)

        package_names = gup.topologically_sorted(self.arguments, {}, get_dep,
                                                 None)
        self.checksum_matches = False
        checksum_file = self.installer_checksum_file
        self.checksum = self.calculate_checksum(package_names)
        if os.path.exists(checksum_file) and open(
                checksum_file).read() == self.checksum:
            raise ChecksumShortCircuit(checksum_file)

        for a in package_names:
            install_manager.install_package(a)

        version = install_manager.package_dict(self.name)['version']
        version_tup = misc.string_to_version(version)
        buildnumber = '%d' % self.version_db.get_next_build_number(version_tup)

        self.installer_version = version
        self.installer_build = buildnumber