changeset 381:51c447a6792e

merged maemo packager into enterprise packager maemo generic is obsolete with builder_cls: sbdmock setting maemo sepecific kde_l10n packager are still necessary
author Bjoern Ricks <bricks@intevation.de>
date Wed, 07 Jul 2010 09:33:49 +0000
parents 2995f3042f82
children a271eba1069e
files recipes/kde/enterprise/generic.py recipes/kde/enterprise/kde_l10n.py recipes/kde/enterprise/kde_l10n_tags.py recipes/kde/maemo/kde_l10n.py recipes/kde/maemo/kde_l10n_tags.py
diffstat 5 files changed, 25 insertions(+), 56 deletions(-) [+]
line wrap: on
line diff
--- a/recipes/kde/enterprise/generic.py	Mon Jun 21 13:06:51 2010 +0000
+++ b/recipes/kde/enterprise/generic.py	Wed Jul 07 09:33:49 2010 +0000
@@ -24,7 +24,12 @@
                                    + str(self.revision))
 
     def determine_package_version(self, directory):
+        revision = self.revision
+        rules_revision = self.parent.rules_revision
+        pkg_revision = self.parent.pkg_revision
+        pkg_date = self.parent.pkg_date
         enterprise_version = self.enterprise_version
+
         return self.track.version_template % locals()
 
     def prepare_sources_for_tarball(self, pkgbasedir, pkgbaseversion):
@@ -36,6 +41,10 @@
         override this method if necessary.
         """
 
+    def get_change_msg(self):
+        return self.changemsg_template % dict(revision=self.revision,
+                                     pkg_date=self.parent.pkg_date,
+                                     rules_revision=self.parent.rules_revision)
 
 class RevisionPackager(treepkg.packager.RevisionPackager):
 
--- a/recipes/kde/enterprise/kde_l10n.py	Mon Jun 21 13:06:51 2010 +0000
+++ b/recipes/kde/enterprise/kde_l10n.py	Wed Jul 07 09:33:49 2010 +0000
@@ -1,6 +1,7 @@
-# Copyright (C) 2007, 2008, 2009 by Intevation GmbH
+# Copyright (C) 2007 - 2010 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh@intevation.de>
+# Bjoern Ricks    <bjoern.ricks@intevation.de>
 #
 # This program is free software under the GPL (>=v2)
 # Read the file COPYING coming with the software for details.
@@ -63,6 +64,11 @@
 
     def determine_package_version(self, directory):
         enterprise_version = self.enterprise_version
+        revision = self.revision
+        rules_revision = self.parent.rules_revision
+        pkg_revision = self.parent.pkg_revision
+        pkg_date = self.parent.pkg_date
+
         return self.track.version_template % locals()
 
     def create_l10n_de_tarball(self, pkgbasedir, pkgbaseversion):
--- a/recipes/kde/enterprise/kde_l10n_tags.py	Mon Jun 21 13:06:51 2010 +0000
+++ b/recipes/kde/enterprise/kde_l10n_tags.py	Wed Jul 07 09:33:49 2010 +0000
@@ -1,6 +1,7 @@
-# Copyright (C) 2007, 2008, 2009 by Intevation GmbH
+# Copyright (C) 2007 - 2010 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh@intevation.de>
+# Bjoern Ricks    <bjoern.ricks@intevation.de>
 #
 # This program is free software under the GPL (>=v2)
 # Read the file COPYING coming with the software for details.
@@ -42,7 +43,7 @@
 # that it gets removed along with the build environment.  Otherwise we
 # end up with a directory containing files that cannot be removed by
 # treepkg
-workdir=/tmp/work
+workdir=/tmp/work-tags
 cp -a %(basedir)s $workdir
 cd $workdir
 
@@ -58,12 +59,6 @@
 
     def __init__(self, *args, **kw):
         super(SourcePackager, self).__init__(*args, **kw)
-        self.enterprise_version = (time.strftime("%Y%m%d", time.localtime())
-                                   + "." + str(self.revision))
-
-    def determine_package_version(self, directory):
-        enterprise_version = self.enterprise_version
-        return self.track.version_template % locals()
 
     def create_l10n_de_tarball(self, pkgbasedir, pkgbaseversion):
         logging.info("Creating kde-l10n-de tarball")
--- a/recipes/kde/maemo/kde_l10n.py	Mon Jun 21 13:06:51 2010 +0000
+++ b/recipes/kde/maemo/kde_l10n.py	Wed Jul 07 09:33:49 2010 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2007, 2008, 2009 by Intevation GmbH
+# Copyright (C) 2007 - 2010 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh@intevation.de>
 # Bjoern Ricks <bjoern.ricks@intevation.de>
@@ -15,7 +15,7 @@
 from treepkg.cmdexpand import cmdexpand
 from treepkg import run
 
-import recipes.kde.maemo.generic as generic
+import recipes.kde.enterprise.kde_l10n as generic
 
 
 class SourcePackager(generic.SourcePackager):
@@ -63,20 +63,6 @@
 
     def __init__(self, *args, **kw):
         super(SourcePackager, self).__init__(*args, **kw)
-        self.enterprise_version = (time.strftime("%Y%m%d", time.localtime())
-                                   + "." + str(self.revision))
-        self.maemo_version =  "%s.%s" % (self.revision,
-                              self.parent.pkg_date)
-
-    def determine_package_version(self, directory):
-        enterprise_version = self.enterprise_version
-        maemo_version = self.maemo_version
-        revision = self.revision
-        rules_revision = self.parent.rules_revision
-        pkg_revision = self.parent.pkg_revision
-        pkg_date = self.parent.pkg_date
-
-        return self.track.version_template % locals()
 
     def create_l10n_de_tarball(self, pkgbasedir, pkgbaseversion):
         logging.info("Creating kde-l10n-de tarball")
@@ -91,6 +77,7 @@
         treepkg.util.writefile(script_name, script, 0755)
         treepkg.util.ensure_directory(self.src_dir)
         treepkg.util.ensure_directory(self.log_dir)
+        # do not run scratchbox
         #self.track.builder.run_script([script_name],
         #                              logfile=os.path.join(self.log_dir,
         #                                                   "tarball_log.txt"),
@@ -101,17 +88,10 @@
         return de_tarball
 
     def run_script(self, script_name, logfile):
+        ''' run script outside of scratchbox '''
         run.call(cmdexpand("@script", script=script_name),
                  suppress_output=False, logfile=logfile)
 
-    def prepare_sources_for_tarball(self, pkgbasedir, pkgbaseversion):
-        de_tarball = self.create_l10n_de_tarball(pkgbasedir, pkgbaseversion)
-        shutil.rmtree(pkgbasedir)
-        os.mkdir(pkgbasedir)
-        os.rename(de_tarball,
-                  os.path.join(pkgbasedir, os.path.basename(de_tarball)))
-
-
 class RevisionPackager(generic.RevisionPackager):
 
     source_packager_cls = SourcePackager
--- a/recipes/kde/maemo/kde_l10n_tags.py	Mon Jun 21 13:06:51 2010 +0000
+++ b/recipes/kde/maemo/kde_l10n_tags.py	Wed Jul 07 09:33:49 2010 +0000
@@ -15,7 +15,7 @@
 from treepkg.cmdexpand import cmdexpand
 from treepkg import run
 
-import recipes.kde.maemo.tags as tags
+import recipes.kde.generic.kde_l10n_tags as tags
 
 
 class SourcePackager(tags.SourcePackager):
@@ -63,20 +63,6 @@
 
     def __init__(self, *args, **kw):
         super(SourcePackager, self).__init__(*args, **kw)
-        self.enterprise_version = (time.strftime("%Y%m%d", time.localtime())
-                                   + "." + str(self.revision))
-        self.maemo_version =  "%s.%s" % (self.revision,
-                              self.parent.pkg_date)
-
-    def determine_package_version(self, directory):
-        enterprise_version = self.enterprise_version
-        maemo_version = self.maemo_version
-        revision = self.revision
-        rules_revision = self.parent.rules_revision
-        pkg_revision = self.parent.pkg_revision
-        pkg_date = self.parent.pkg_date
-
-        return self.track.version_template % locals()
 
     def create_l10n_de_tarball(self, pkgbasedir, pkgbaseversion):
         logging.info("Creating kde-l10n-de tarball")
@@ -101,17 +87,10 @@
         return de_tarball
 
     def run_script(self, script_name, logfile):
+        ''' run script without builder '''
         run.call(cmdexpand("@script", script=script_name),
                  suppress_output=False, logfile=logfile)
 
-    def prepare_sources_for_tarball(self, pkgbasedir, pkgbaseversion):
-        de_tarball = self.create_l10n_de_tarball(pkgbasedir, pkgbaseversion)
-        shutil.rmtree(pkgbasedir)
-        os.mkdir(pkgbasedir)
-        os.rename(de_tarball,
-                  os.path.join(pkgbasedir, os.path.basename(de_tarball)))
-
-
 class RevisionPackager(tags.RevisionPackager):
 
     source_packager_cls = SourcePackager
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)