primary repository is now called "source" instead of "repo"
authorTimo Savola <tsavola@movial.fi>
Sat, 12 Apr 2008 11:25:51 +0000 (14:25 +0300)
committerTimo Savola <tsavola@movial.fi>
Sat, 12 Apr 2008 11:25:51 +0000 (14:25 +0300)
remote repository layout:
    host:/path/source/component.git
    host:/path/meta/component.git

matrix/build.py
matrix/cache.py
matrix/components.py
matrix/matrix.py

index e4f3992..d2f46e3 100644 (file)
@@ -179,14 +179,14 @@ class Builder(object):
                       len(self.jobs) < config.jobs
 
        def start_build(self, c):
-               if not c.repo.exists():
-                       c.repo.clone()
+               if not c.source.exists():
+                       c.source.clone()
 
-               print 'Building', c.repo
+               print 'Building', c
                self.start_job(c, 'build')
 
        def start_install(self, c):
-               print 'Installing', c.repo
+               print 'Installing', c
                self.start_job(c, 'install')
 
        def start_job(self, c, action):
@@ -211,7 +211,7 @@ class Builder(object):
 
                        self.progress.increment()
                        if config.debug:
-                               print 'Built', c.repo
+                               print 'Built', c
 
                        c.state = 'wait-install'
                        self.wait_install.append(c)
@@ -225,7 +225,7 @@ class Builder(object):
                                return
 
                        self.progress.increment()
-                       print 'Finished', c.repo
+                       print 'Finished', c
 
                        c.state = 'done'
                        self.in_install = None
index d5e0c84..229b7fc 100644 (file)
@@ -25,7 +25,7 @@ def __contains(c):
                if os.path.exists(path):
                        os.remove(path)
 
-               msg = 'Dirty files in %s' % c.repo
+               msg = 'Dirty files in %s' % c
                if config.force:
                        if config.debug:
                                print msg
@@ -51,7 +51,7 @@ def __contains(c):
 
        if hash != get_hash(c):
                if config.debug:
-                       print 'New changes in', c.repo.path
+                       print 'New changes in', c
                return False
 
        if flagstring:
@@ -61,7 +61,7 @@ def __contains(c):
 
        if set(flags) != set(c.flags):
                if config.debug:
-                       print 'Obsolete flags for', c.repo.path
+                       print 'Obsolete flags for', c
                return False
 
        return True
@@ -95,4 +95,4 @@ def get_path(c):
        return os.path.join(config.cache_dir, c.name)
 
 def get_hash(c):
-       return '%s+%s' % (c.repo.get_hash(), c.meta.get_hash())
+       return '%s+%s' % (c.source.get_hash(), c.meta.get_hash())
index 50b9663..6f20b4c 100644 (file)
@@ -28,8 +28,8 @@ class Component(object):
 
                self.name = name
 
-               self.repo = Repository(
-                       'repo/%s' % name,
+               self.source = Repository(
+                       'source/%s' % name,
                        os.path.join(config.top_dir, 'src', name),
                        commits,
                        exclude=['meta'])
@@ -44,10 +44,13 @@ class Component(object):
                self.packages = {}
                self.depends = set()
 
+       def __str__(self):
+               return str(self.source)
+
        def is_dirty(self):
                if self.__dirty is None:
                        self.__dirty = False
-                       for repo in (self.repo, self.meta):
+                       for repo in (self.source, self.meta):
                                if repo.dirty_files():
                                        self.__dirty = True
                                        break
index b4590fc..33b0eab 100644 (file)
@@ -188,21 +188,21 @@ def clone(targets):
                clone_component(c)
 
 def clone_component(c, overwrite=False):
-       have_repo = c.repo.exists()
+       have_source = c.source.exists()
        have_meta = c.meta.exists()
 
-       if not overwrite and have_repo and have_meta:
+       if not overwrite and have_source and have_meta:
                return
 
-       if overwrite and os.path.exists(c.repo.path):
-               print 'Removing', c.repo
+       if overwrite and os.path.exists(c.source.path):
+               print 'Removing', c
 
-               remove_tree(c.repo.path)
-               have_repo = False
+               remove_tree(c.source.path)
+               have_source = False
                have_meta = False
 
-       if not have_repo:
-               c.repo.clone()
+       if not have_source:
+               c.source.clone()
        if not have_meta:
                c.meta.clone()
 
@@ -211,7 +211,7 @@ def clean(targets):
 
        for name in targets:
                c = config.components[name]
-               c.repo.clean()
+               c.source.clean()
                cache.remove(c)
 
                if not config.force:
@@ -225,8 +225,8 @@ def for_each_repository(func, targets=None):
 
        for name in targets:
                c = config.components[name]
-               if c.repo.exists():
-                       value = func(c.repo)
+               if c.source.exists():
+                       value = func(c.source)
                        if value:
                                ret = value
                value = func(c.meta)
@@ -247,8 +247,8 @@ def changes(targets):
        for name in targets:
                c = config.components[name]
 
-               if c.repo.exists():
-                       if check_changes(c.repo):
+               if c.source.exists():
+                       if check_changes(c.source):
                                changed = True
 
                if check_changes(c.meta):
@@ -284,10 +284,10 @@ def source_dist(targets):
 
 def dist_changes(c, location):
        path = os.path.join(location, c.name) + '.changes'
-       c.repo.dump_log(path)
+       c.source.dump_log(path)
 
 def dist_sources(c, location):
-       rev = c.repo.describe()
+       rev = c.source.describe()
        if rev:
                rev = '_' + rev
        else:
@@ -298,7 +298,7 @@ def dist_sources(c, location):
        if os.path.exists(path):
                os.remove(path)
 
-       c.repo.archive(name, path)
+       c.source.archive(name, path)
 
 def build_rootfs(clean=True, rootfs_only=False, jffs2_only=False, devrootfs_only=False):
        config.parse('rootfs')