diff --git a/pisi/scenarioapi/package.py b/pisi/scenarioapi/package.py index 5746e347..3689bcef 100644 --- a/pisi/scenarioapi/package.py +++ b/pisi/scenarioapi/package.py @@ -25,12 +25,13 @@ __trans = gettext.translation('pisi', fallback=True) _ = __trans.ugettext class Package: - def __init__(self, name, deps = [], cons = [], date = "2006-18-18", ver = "1.0"): + def __init__(self, name, deps = [], cons = [], date = "2006-18-18", ver = "1.0", partOf="None"): self.name = name self.dependencies = deps self.conflicts = cons self.version = ver self.date = date + self.partOf = partOf self.pspec = None self.actions = None self.create_package() @@ -40,7 +41,8 @@ class Package: def create_package(self): pspec = Pspec(self.name, consts.pspec_path) - pspec.set_source(consts.homepage, consts.summary % self.name, consts.description % self.name, consts.license) + pspec.set_source(consts.homepage, consts.summary % self.name, + consts.description % self.name, consts.license, self.partOf) pspec.set_packager(consts.packager_name, consts.packager_email) pspec.set_archive(consts.skel_sha1sum, consts.skel_type, consts.skel_uri) pspec.set_package(self.dependencies, self.conflicts) diff --git a/pisi/scenarioapi/pspec.py b/pisi/scenarioapi/pspec.py index 9329e661..4c5bc662 100644 --- a/pisi/scenarioapi/pspec.py +++ b/pisi/scenarioapi/pspec.py @@ -91,11 +91,11 @@ class Pspec: self.pspec.history.reverse() self.write() - def set_source(self, homepage, summary, description, license): + def set_source(self, homepage, summary, description, license, partOf): self.pspec.source.name = self.name self.pspec.source.homepage = homepage self.pspec.source.license = license - self.pspec.source.partOf = "None" + self.pspec.source.partOf = partOf self.pspec.source.summary = LocalText("Summary") self.pspec.source.description = LocalText("Description") self.pspec.source.summary["en"] = summary diff --git a/pisi/scenarioapi/repoops.py b/pisi/scenarioapi/repoops.py index 5b209ede..960a1663 100644 --- a/pisi/scenarioapi/repoops.py +++ b/pisi/scenarioapi/repoops.py @@ -29,6 +29,7 @@ def repo_added_package(package, *args): raise Exception(_("Repo already has package named %s.") % package) version = "1.0" + partOf = "None" dependencies = [] conflicts = [] @@ -42,7 +43,10 @@ def repo_added_package(package, *args): if with.types == VERSION and with.action == INIT: version = with.data - repodb[package] = Package(package, dependencies, conflicts, ver=version) + if with.types == PARTOF and with.action == INIT: + partOf = with.data + + repodb[package] = Package(package, dependencies, conflicts, ver=version, partOf=partOf) def repo_removed_package(package): if not repodb.has_key(package): diff --git a/pisi/scenarioapi/withops.py b/pisi/scenarioapi/withops.py index 1b4b4156..c9e926cc 100644 --- a/pisi/scenarioapi/withops.py +++ b/pisi/scenarioapi/withops.py @@ -13,7 +13,7 @@ # Authors: Faik Uygur ADDED, REMOVED, INIT = range(3) -VERSION, CONFLICT, DEPENDENCY = range(3) +PARTOF, VERSION, CONFLICT, DEPENDENCY = range(4) class with: def __init__(self): @@ -26,6 +26,9 @@ def with_action(types, action, data): w.data = data return w +def with_partof(partof): + return with_action(PARTOF, INIT, partof) + def with_version(version): return with_action(VERSION, INIT, version)