Mercurial > treepkg
comparison recipes/kde_enterprise_3_5/kde_i18n.py @ 277:4441aff001ac
Use base.BaseSourcePackager for building enterprise 35 kde-i18n and rely
on the base class do_package method.
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Thu, 07 May 2009 16:02:23 +0000 |
parents | 12facd1b5f19 |
children | 860bb7269caa |
comparison
equal
deleted
inserted
replaced
276:f3dee156e3e3 | 277:4441aff001ac |
---|---|
15 import treepkg.run as run | 15 import treepkg.run as run |
16 from treepkg.cmdexpand import cmdexpand | 16 from treepkg.cmdexpand import cmdexpand |
17 | 17 |
18 import base | 18 import base |
19 | 19 |
20 class SourcePackager(treepkg.packager.SourcePackager): | 20 class SourcePackager(base.BaseSourcePackager): |
21 | 21 |
22 """Creates the debian source package for the i18n files | 22 """Creates the debian source package for the i18n files |
23 | 23 |
24 This is quite complicated. The orig.tar.gz file of the debian | 24 This is quite complicated. The orig.tar.gz file of the debian |
25 source package contains one .tar.bz2 file for every language. Those | 25 source package contains one .tar.bz2 file for every language. Those |
85 run.call(cmdexpand("tar cjf $tarball -C $pkgbasedir $tarballdir", | 85 run.call(cmdexpand("tar cjf $tarball -C $pkgbasedir $tarballdir", |
86 **locals())) | 86 **locals())) |
87 logging.info("Created kde-i18n-de tarball") | 87 logging.info("Created kde-i18n-de tarball") |
88 return tarball | 88 return tarball |
89 | 89 |
90 def do_package(self): | 90 def prepare_sources_for_tarball(self, pkgbasedir, pkgbaseversion): |
91 # Create a new kde-i18n-de tarball from current SVN and the base | |
92 # kde-i18n-de tarball. | |
93 pkgbaseversion, pkgbasedir = self.export_sources() | |
94 tarball = self.create_i18n_de_tarball(pkgbasedir, pkgbaseversion) | |
95 | |
96 # We have to reuse the same directory when building the | 91 # We have to reuse the same directory when building the |
97 # orig.tar.gz. However, we need to preserver the scripts | 92 # orig.tar.gz. However, we need to preserve the scripts |
98 # sub-directory because it's not needed for the kde-i18n-de | 93 # sub-directory because it's not needed for the kde-i18n-de |
99 # tarball but for the .orig.tar.gz. | 94 # tarball but for the .orig.tar.gz. |
95 tarball = self.create_i18n_de_tarball(pkgbasedir, pkgbaseversion) | |
100 pkg_scripts_dir = os.path.join(pkgbasedir, "scripts") | 96 pkg_scripts_dir = os.path.join(pkgbasedir, "scripts") |
101 tmp_scripts_dir = os.path.join(self.work_dir, "scripts") | 97 tmp_scripts_dir = os.path.join(self.work_dir, "scripts") |
102 os.rename(pkg_scripts_dir, tmp_scripts_dir) | 98 os.rename(pkg_scripts_dir, tmp_scripts_dir) |
103 shutil.rmtree(pkgbasedir) | 99 shutil.rmtree(pkgbasedir) |
104 os.mkdir(pkgbasedir) | 100 os.mkdir(pkgbasedir) |
105 os.rename(tmp_scripts_dir, pkg_scripts_dir) | 101 os.rename(tmp_scripts_dir, pkg_scripts_dir) |
106 | |
107 pkgbasename = self.pkg_basename + "_" + pkgbaseversion | |
108 origtargz = os.path.join(self.work_dir, | |
109 pkgbasename + ".orig.tar.gz") | |
110 os.rename(tarball, os.path.join(pkgbasedir, | 102 os.rename(tarball, os.path.join(pkgbasedir, |
111 os.path.basename(tarball))) | 103 os.path.basename(tarball))) |
112 self.create_tarball(origtargz, self.work_dir, | |
113 os.path.basename(pkgbasedir)) | |
114 | |
115 changemsg = ("Update to SVN enterprise branch rev. %d" | |
116 % (self.revision,)) | |
117 self.copy_debian_directory(pkgbasedir, pkgbaseversion, | |
118 changemsg) | |
119 | |
120 self.create_source_package(pkgbasedir, origtargz) | |
121 self.move_source_package(pkgbasename) | |
122 | 104 |
123 | 105 |
124 class RevisionPackager(treepkg.packager.RevisionPackager): | 106 class RevisionPackager(treepkg.packager.RevisionPackager): |
125 | 107 |
126 source_packager_cls = SourcePackager | 108 source_packager_cls = SourcePackager |