]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
naoki: Fix toolchain build.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 20 Mar 2010 15:43:41 +0000 (16:43 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 20 Mar 2010 15:43:41 +0000 (16:43 +0100)
naoki/backend.py
naoki/chroot.py

index 0ee1a467cb08e9d42cd66066ea8779c37a2a2014..e4b20220fdf973924f158e7d742b9aecc20f5716 100644 (file)
@@ -41,7 +41,8 @@ def parse_package_info(names, toolchain=False):
 def parse_package(names, toolchain=False, naoki=None):
        packages = parse_package_info(names, toolchain)
 
-       return [Package(package.name, naoki=naoki) for package in packages]
+       return [Package(package.name, naoki=naoki, toolchain=toolchain) \
+               for package in packages]
 
 def get_package_names(toolchain=False):
        if not __cache["package_names"]:
@@ -341,8 +342,8 @@ class PackageInfo(object):
 
 
 class Package(object):
-       def __init__(self, name, naoki):
-               self.info = find_package_info(name)
+       def __init__(self, name, naoki, toolchain=False):
+               self.info = find_package_info(name, toolchain)
                self.naoki = naoki
 
                #self.log.debug("Initialized package object %s" % name)
@@ -379,7 +380,7 @@ class Package(object):
 
 def get_repositories(toolchain=False):
        if toolchain:
-               return Repository("toolchain")
+               return [Repository("toolchain")]
 
        repos = []
        for repo in os.listdir(PKGSDIR):
index 2a108842da425103e8be4e9fd1e63b763eb39cd6..f63013d47a00c1fa614f8bd3ee4f4e172337a685 100644 (file)
@@ -6,6 +6,7 @@ import os
 import random
 import stat
 
+import backend
 import util
 from constants import *
 from exception import *
@@ -121,9 +122,11 @@ class Environment(object):
                                "PKG_ARCH"       : self.arch["name"],
                        })
 
-                       if os.path.exists(self.chrootPath("usr", "ccache")):
+                       ccache_path = os.path.join("tools_%s" % self.arch["name"],
+                               "usr", "ccache", "bin")
+                       if os.path.exists(self.chrootPath(ccache_path)):
                                env.update({
-                                       "PATH" : "/usr/ccache/bin:%s" % env["PATH"],
+                                       "PATH" : "/%s:%s" % (ccache_path, env["PATH"]),
                                        "CCACHE_DIR" : "/usr/src/ccache",
                                })
 
@@ -331,9 +334,11 @@ class Toolchain(object):
        def build(self):
                self.log.info("Building toolchain...")
 
-               packages = package.depsort(package.list(toolchain=True))
+               packages = backend.get_package_names(toolchain=True)
+               packages = backend.parse_package(packages, toolchain=True)
+               packages = backend.depsort(packages)
                for pkg in packages:
-                       if pkg.isBuilt:
+                       if os.path.exists(os.path.join(self.path, pkg.name)):
                                continue
                        self.build_package(pkg)
                self.compress()