diff --git a/pisi/scenarioapi/package.py b/pisi/scenarioapi/package.py index f19ee8b4..5746e347 100644 --- a/pisi/scenarioapi/package.py +++ b/pisi/scenarioapi/package.py @@ -70,16 +70,19 @@ class Package: def version_bump(self, *args): for with in args: if with.types == CONFLICT and with.action == ADDED: - self.pspec.add_conflicts(with.pkgs) + self.pspec.add_conflicts(with.data) if with.types == CONFLICT and with.action == REMOVED: - self.pspec.remove_conflicts(with.pkgs) + self.pspec.remove_conflicts(with.data) if with.types == DEPENDENCY and with.action == ADDED: - self.pspec.add_dependencies(with.pkgs) + self.pspec.add_dependencies(with.data) if with.types == DEPENDENCY and with.action == REMOVED: - self.pspec.remove_dependencies(with.pkgs) + self.pspec.remove_dependencies(with.data) + + if with.types == VERSION and with.action == INIT: + self.version = with.data self.pspec.update_history(self.date, self.version) self.actions.name = self.name diff --git a/pisi/scenarioapi/repoops.py b/pisi/scenarioapi/repoops.py index b50d5a55..b9ba4529 100644 --- a/pisi/scenarioapi/repoops.py +++ b/pisi/scenarioapi/repoops.py @@ -33,12 +33,15 @@ def repo_added_package(package, *args): for with in args: if with.types == CONFLICT and with.action == INIT: - conflicts = with.pkgs + conflicts = with.data if with.types == DEPENDENCY and with.action == INIT: - dependencies = with.pkgs + dependencies = with.data - repodb[package] = Package(package, dependencies, conflicts) + if with.types == VERSION and with.action == INIT: + version = with.data + + repodb[package] = Package(package, dependencies, conflicts, ver=version) def repo_removed_package(package): if not repodb.has_key(package): diff --git a/pisi/scenarioapi/withops.py b/pisi/scenarioapi/withops.py index 12ffc8b0..da8c8103 100644 --- a/pisi/scenarioapi/withops.py +++ b/pisi/scenarioapi/withops.py @@ -13,19 +13,22 @@ # Authors: Faik Uygur ADDED, REMOVED, INIT = range(3) -CONFLICT, DEPENDENCY = range(2) +VERSION, CONFLICT, DEPENDENCY = range(3) class with: def __init__(self): pass -def with_action(types, action, pkgs): +def with_action(types, action, data): w = with() w.types = types w.action = action - w.pkgs = pkgs + w.data = data return w +def with_version(version): + return with_action(VERSION, INIT, version) + def with_conflicts(*cons): return with_action(CONFLICT, INIT, cons)