Mercurial > treepkg
comparison recipes/kde/maemo/kde_l10n.py @ 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 | 7a1385c1207c |
children |
comparison
equal
deleted
inserted
replaced
380:2995f3042f82 | 381:51c447a6792e |
---|---|
1 # Copyright (C) 2007, 2008, 2009 by Intevation GmbH | 1 # Copyright (C) 2007 - 2010 by Intevation GmbH |
2 # Authors: | 2 # Authors: |
3 # Bernhard Herzog <bh@intevation.de> | 3 # Bernhard Herzog <bh@intevation.de> |
4 # Bjoern Ricks <bjoern.ricks@intevation.de> | 4 # Bjoern Ricks <bjoern.ricks@intevation.de> |
5 # | 5 # |
6 # This program is free software under the GPL (>=v2) | 6 # This program is free software under the GPL (>=v2) |
13 | 13 |
14 import treepkg.util | 14 import treepkg.util |
15 from treepkg.cmdexpand import cmdexpand | 15 from treepkg.cmdexpand import cmdexpand |
16 from treepkg import run | 16 from treepkg import run |
17 | 17 |
18 import recipes.kde.maemo.generic as generic | 18 import recipes.kde.enterprise.kde_l10n as generic |
19 | 19 |
20 | 20 |
21 class SourcePackager(generic.SourcePackager): | 21 class SourcePackager(generic.SourcePackager): |
22 | 22 |
23 """Creates the debian source package for the l10n files | 23 """Creates the debian source package for the l10n files |
61 """ | 61 """ |
62 | 62 |
63 | 63 |
64 def __init__(self, *args, **kw): | 64 def __init__(self, *args, **kw): |
65 super(SourcePackager, self).__init__(*args, **kw) | 65 super(SourcePackager, self).__init__(*args, **kw) |
66 self.enterprise_version = (time.strftime("%Y%m%d", time.localtime()) | |
67 + "." + str(self.revision)) | |
68 self.maemo_version = "%s.%s" % (self.revision, | |
69 self.parent.pkg_date) | |
70 | |
71 def determine_package_version(self, directory): | |
72 enterprise_version = self.enterprise_version | |
73 maemo_version = self.maemo_version | |
74 revision = self.revision | |
75 rules_revision = self.parent.rules_revision | |
76 pkg_revision = self.parent.pkg_revision | |
77 pkg_date = self.parent.pkg_date | |
78 | |
79 return self.track.version_template % locals() | |
80 | 66 |
81 def create_l10n_de_tarball(self, pkgbasedir, pkgbaseversion): | 67 def create_l10n_de_tarball(self, pkgbasedir, pkgbaseversion): |
82 logging.info("Creating kde-l10n-de tarball") | 68 logging.info("Creating kde-l10n-de tarball") |
83 de_tarball = os.path.join(self.work_dir, | 69 de_tarball = os.path.join(self.work_dir, |
84 "kde-l10n-de-" + pkgbaseversion + ".tar.bz2") | 70 "kde-l10n-de-" + pkgbaseversion + ".tar.bz2") |
89 basedir=pkgbasedir, version=pkgbaseversion)) | 75 basedir=pkgbasedir, version=pkgbaseversion)) |
90 script_name = os.path.join(self.work_dir, "createtarball") | 76 script_name = os.path.join(self.work_dir, "createtarball") |
91 treepkg.util.writefile(script_name, script, 0755) | 77 treepkg.util.writefile(script_name, script, 0755) |
92 treepkg.util.ensure_directory(self.src_dir) | 78 treepkg.util.ensure_directory(self.src_dir) |
93 treepkg.util.ensure_directory(self.log_dir) | 79 treepkg.util.ensure_directory(self.log_dir) |
80 # do not run scratchbox | |
94 #self.track.builder.run_script([script_name], | 81 #self.track.builder.run_script([script_name], |
95 # logfile=os.path.join(self.log_dir, | 82 # logfile=os.path.join(self.log_dir, |
96 # "tarball_log.txt"), | 83 # "tarball_log.txt"), |
97 # bindmounts=[self.work_dir]) | 84 # bindmounts=[self.work_dir]) |
98 self.run_script([script_name], logfile=os.path.join(self.log_dir, | 85 self.run_script([script_name], logfile=os.path.join(self.log_dir, |
99 "tarball_log.txt")) | 86 "tarball_log.txt")) |
100 | 87 |
101 return de_tarball | 88 return de_tarball |
102 | 89 |
103 def run_script(self, script_name, logfile): | 90 def run_script(self, script_name, logfile): |
91 ''' run script outside of scratchbox ''' | |
104 run.call(cmdexpand("@script", script=script_name), | 92 run.call(cmdexpand("@script", script=script_name), |
105 suppress_output=False, logfile=logfile) | 93 suppress_output=False, logfile=logfile) |
106 | |
107 def prepare_sources_for_tarball(self, pkgbasedir, pkgbaseversion): | |
108 de_tarball = self.create_l10n_de_tarball(pkgbasedir, pkgbaseversion) | |
109 shutil.rmtree(pkgbasedir) | |
110 os.mkdir(pkgbasedir) | |
111 os.rename(de_tarball, | |
112 os.path.join(pkgbasedir, os.path.basename(de_tarball))) | |
113 | |
114 | 94 |
115 class RevisionPackager(generic.RevisionPackager): | 95 class RevisionPackager(generic.RevisionPackager): |
116 | 96 |
117 source_packager_cls = SourcePackager | 97 source_packager_cls = SourcePackager |
118 | 98 |