summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Packages/Collection.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Server/Plugins/Packages/Collection.py')
-rw-r--r--src/lib/Server/Plugins/Packages/Collection.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/Server/Plugins/Packages/Collection.py b/src/lib/Server/Plugins/Packages/Collection.py
index f5e5bbe02..269ce90f5 100644
--- a/src/lib/Server/Plugins/Packages/Collection.py
+++ b/src/lib/Server/Plugins/Packages/Collection.py
@@ -191,6 +191,24 @@ class Collection(Bcfg2.Server.Plugin.Debuggable):
default="auto"),
type=self.ptype, origin='Packages')
+ def get_new_packages(self, initial, complete):
+ """ Compute the difference between the complete package list
+ (as returned by :func:`complete`) and the initial package list
+ computed from the specification. This is necessary because
+ the format may be different between the two lists due to
+ :func:`packages_to_entry` and :func:`packages_from_entry`. See
+ :ref:`pkg-objects` for more details.
+
+ :param initial: The initial package list
+ :type initial: set of strings, but see :ref:`pkg-objects`
+ :param complete: The final package list
+ :type complete: set of strings, but see :ref:`pkg-objects`
+ :return: set of strings, but see :ref:`pkg-objects` - the set
+ of packages that are in ``complete`` but not in
+ ``initial``
+ """
+ return list(complete.difference(initial))
+
def complete(self, packagelist, pinnings=None, recommended=None):
'''Build the transitive closure of all package dependencies