# HG changeset patch # User Bjoern Ricks # Date 1278495229 0 # Node ID 51c447a6792eca495d2d37e73d2057dba20bdbc8 # Parent 2995f3042f8276891eef14e5096e9605e3206d5b merged maemo packager into enterprise packager maemo generic is obsolete with builder_cls: sbdmock setting maemo sepecific kde_l10n packager are still necessary diff -r 2995f3042f82 -r 51c447a6792e recipes/kde/enterprise/generic.py --- 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): diff -r 2995f3042f82 -r 51c447a6792e recipes/kde/enterprise/kde_l10n.py --- 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 +# Bjoern Ricks # # 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): diff -r 2995f3042f82 -r 51c447a6792e recipes/kde/enterprise/kde_l10n_tags.py --- 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 +# Bjoern Ricks # # 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") diff -r 2995f3042f82 -r 51c447a6792e recipes/kde/maemo/kde_l10n.py --- 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 # Bjoern Ricks @@ -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 diff -r 2995f3042f82 -r 51c447a6792e recipes/kde/maemo/kde_l10n_tags.py --- 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