[jhbuild] modtypes: use tree_id() consistently as revsion



commit 73ad52d56bac11f353fc02157488ca4d7bda83fd
Author: Dirk Wallenstein <halsmit t-online de>
Date:   Wed Dec 29 13:54:20 2010 +0100

    modtypes: use tree_id() consistently as revsion
    
    Move the definition that uses tree_id() into the common base class and
    override it in the MetaModule class.  The modtypes that used branchname
    as revision are apparently not used much and so it did not attract
    attention.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=647545

 jhbuild/modtypes/__init__.py   |    4 +++-
 jhbuild/modtypes/ant.py        |    3 ---
 jhbuild/modtypes/autotools.py  |    3 ---
 jhbuild/modtypes/cmake.py      |    3 ---
 jhbuild/modtypes/distutils.py  |    3 ---
 jhbuild/modtypes/linux.py      |    3 ---
 jhbuild/modtypes/perl.py       |    3 ---
 jhbuild/modtypes/testmodule.py |    3 ---
 jhbuild/modtypes/waf.py        |    3 ---
 9 files changed, 3 insertions(+), 25 deletions(-)
---
diff --git a/jhbuild/modtypes/__init__.py b/jhbuild/modtypes/__init__.py
index a559b3a..6b27eeb 100644
--- a/jhbuild/modtypes/__init__.py
+++ b/jhbuild/modtypes/__init__.py
@@ -145,7 +145,7 @@ class Package:
         raise NotImplementedError
 
     def get_revision(self):
-        return None
+        return self.branch.tree_id()
 
     def skip_phase(self, buildscript, phase, last_phase):
         try:
@@ -286,6 +286,8 @@ class MetaModule(Package):
     def get_builddir(self, buildscript):
         return buildscript.config.buildroot or \
                self.get_srcdir(buildscript)
+    def get_revision(self):
+        return None
 
     def to_sxml(self):
         return [sxml.metamodule(id=self.name),
diff --git a/jhbuild/modtypes/ant.py b/jhbuild/modtypes/ant.py
index 0684d17..f6cbeb1 100644
--- a/jhbuild/modtypes/ant.py
+++ b/jhbuild/modtypes/ant.py
@@ -56,9 +56,6 @@ class AntModule(Package, DownloadableModule):
         else:
             return self.get_srcdir(buildscript)
 
-    def get_revision(self):
-        return self.branch.branchname
-
     def do_build(self, buildscript):
         buildscript.set_action(_('Building'), self)
         srcdir = self.get_srcdir(buildscript)
diff --git a/jhbuild/modtypes/autotools.py b/jhbuild/modtypes/autotools.py
index c07e5ab..215df91 100644
--- a/jhbuild/modtypes/autotools.py
+++ b/jhbuild/modtypes/autotools.py
@@ -78,9 +78,6 @@ class AutogenModule(Package, DownloadableModule):
         else:
             return self.get_srcdir(buildscript)
 
-    def get_revision(self):
-        return self.branch.tree_id()
-
     def skip_configure(self, buildscript, last_phase):
         # skip if manually instructed to do so
         if self.skip_autogen is True:
diff --git a/jhbuild/modtypes/cmake.py b/jhbuild/modtypes/cmake.py
index 4d8d719..27f1d41 100644
--- a/jhbuild/modtypes/cmake.py
+++ b/jhbuild/modtypes/cmake.py
@@ -56,9 +56,6 @@ class CMakeModule(Package, DownloadableModule):
         else:
             return self.get_srcdir(buildscript)
 
-    def get_revision(self):
-        return self.branch.tree_id()
-
     def eval_args(self, args):
         args = args.replace('${prefix}', self.config.prefix)
         libsubdir = 'lib'
diff --git a/jhbuild/modtypes/distutils.py b/jhbuild/modtypes/distutils.py
index 036a794..bed6b47 100644
--- a/jhbuild/modtypes/distutils.py
+++ b/jhbuild/modtypes/distutils.py
@@ -55,9 +55,6 @@ class DistutilsModule(Package, DownloadableModule):
         else:
             return self.get_srcdir(buildscript)
 
-    def get_revision(self):
-        return self.branch.tree_id()
-
     def do_build(self, buildscript):
         buildscript.set_action(_('Building'), self)
         srcdir = self.get_srcdir(buildscript)
diff --git a/jhbuild/modtypes/linux.py b/jhbuild/modtypes/linux.py
index 194688f..57c86f2 100644
--- a/jhbuild/modtypes/linux.py
+++ b/jhbuild/modtypes/linux.py
@@ -75,9 +75,6 @@ class LinuxModule(Package):
     def get_builddir(self, buildscript):
         return self.get_srcdir(buildscript)
 
-    def get_revision(self):
-        return self.branch.branchname
-
     def skip_checkout(self, buildscript, last_phase):
         # skip the checkout stage if the nonetwork flag is set
         # (can't just call Package.skip_checkout() as build policy won't work
diff --git a/jhbuild/modtypes/perl.py b/jhbuild/modtypes/perl.py
index ca9eb13..f5173b6 100644
--- a/jhbuild/modtypes/perl.py
+++ b/jhbuild/modtypes/perl.py
@@ -51,9 +51,6 @@ class PerlModule(Package, DownloadableModule):
         # does not support non-srcdir builds
         return self.get_srcdir(buildscript)
 
-    def get_revision(self):
-        return self.branch.branchname
-
     def do_build(self, buildscript):
         buildscript.set_action(_('Building'), self)
         builddir = self.get_builddir(buildscript)
diff --git a/jhbuild/modtypes/testmodule.py b/jhbuild/modtypes/testmodule.py
index f9c3719..cba3528 100644
--- a/jhbuild/modtypes/testmodule.py
+++ b/jhbuild/modtypes/testmodule.py
@@ -60,9 +60,6 @@ class TestModule(Package, DownloadableModule):
     def get_srcdir(self, buildscript):
         return self.branch.srcdir
 
-    def get_revision(self):
-        return self.branch.branchname
-
     def _get_display(self):
         # get free display
         servernum = 99
diff --git a/jhbuild/modtypes/waf.py b/jhbuild/modtypes/waf.py
index f8c5fe9..c62106d 100644
--- a/jhbuild/modtypes/waf.py
+++ b/jhbuild/modtypes/waf.py
@@ -56,9 +56,6 @@ class WafModule(Package, DownloadableModule):
     def get_builddir(self, buildscript):
         return self.get_srcdir(buildscript)
 
-    def get_revision(self):
-        return self.branch.tree_id()
-
     def skip_configure(self, buildscript, last_phase):
         # don't skip this stage if we got here from one of the
         # following phases:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]