Mercurial > treepkg
comparison recipes/kde_enterprise_3_5/kdepim.py @ 161:710538908609
kdepim recipe: raise an error if not all version replacements could be done
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Thu, 19 Jun 2008 12:26:07 +0000 |
parents | 3f2ec4314855 |
children | 12facd1b5f19 |
comparison
equal
deleted
inserted
replaced
160:017179427c7f | 161:710538908609 |
---|---|
41 | 41 |
42 def update_version_numbers(self, pkgbasedir): | 42 def update_version_numbers(self, pkgbasedir): |
43 """Overrides the inherited method to update version numbers in the code | 43 """Overrides the inherited method to update version numbers in the code |
44 """ | 44 """ |
45 versionstring = "(enterprise35 %s)" % self.enterprise_version | 45 versionstring = "(enterprise35 %s)" % self.enterprise_version |
46 failed = [] | |
46 for versionfile in ["kmail/kmversion.h", "kontact/src/main.cpp", | 47 for versionfile in ["kmail/kmversion.h", "kontact/src/main.cpp", |
47 "korganizer/version.h"]: | 48 "korganizer/version.h"]: |
48 #FIXME: should check successful replacements | 49 if not treepkg.util.replace_in_file(os.path.join(pkgbasedir, |
49 treepkg.util.replace_in_file(os.path.join(pkgbasedir, versionfile), | 50 versionfile), |
50 "\(enterprise35 ([^)]*)\)", | 51 "\(enterprise35 ([^)]*)\)", |
51 versionstring) | 52 versionstring): |
53 failed.append(versionfile) | |
54 if failed: | |
55 raise RuntimeError("kdepim: failed to update version numbers in %s" | |
56 % (", ".join(failed),)) | |
52 | 57 |
53 def do_package(self): | 58 def do_package(self): |
54 pkgbaseversion, pkgbasedir = self.export_sources() | 59 pkgbaseversion, pkgbasedir = self.export_sources() |
55 self.update_version_numbers(pkgbasedir) | 60 self.update_version_numbers(pkgbasedir) |
56 | 61 |