Mercurial > treepkg
changeset 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 | 017179427c7f |
children | 876db132431a |
files | recipes/kde_enterprise_3_5/kdepim.py |
diffstat | 1 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/recipes/kde_enterprise_3_5/kdepim.py Thu Jun 19 12:25:30 2008 +0000 +++ b/recipes/kde_enterprise_3_5/kdepim.py Thu Jun 19 12:26:07 2008 +0000 @@ -43,12 +43,17 @@ """Overrides the inherited method to update version numbers in the code """ versionstring = "(enterprise35 %s)" % self.enterprise_version + failed = [] for versionfile in ["kmail/kmversion.h", "kontact/src/main.cpp", "korganizer/version.h"]: - #FIXME: should check successful replacements - treepkg.util.replace_in_file(os.path.join(pkgbasedir, versionfile), - "\(enterprise35 ([^)]*)\)", - versionstring) + if not treepkg.util.replace_in_file(os.path.join(pkgbasedir, + versionfile), + "\(enterprise35 ([^)]*)\)", + versionstring): + failed.append(versionfile) + if failed: + raise RuntimeError("kdepim: failed to update version numbers in %s" + % (", ".join(failed),)) def do_package(self): pkgbaseversion, pkgbasedir = self.export_sources()