src/modules/misc.py
changeset 1970 60471574c487
parent 1968 c0540b1e4f7e
child 1974 6af683c5bde5
--- a/src/modules/misc.py	Wed Jul 07 16:08:05 2010 -0700
+++ b/src/modules/misc.py	Thu Jul 08 18:25:06 2010 -0700
@@ -419,51 +419,6 @@
 
         return int(size)
 
-def get_inventory_list(image, pargs, all_known, all_versions):
-        most_recent = {}
-        installed = []
-        res = image.inventory(pargs, all_known, ordered=not all_versions)
-        ppub = image.get_preferred_publisher()
-        # All_Versions reduces the output so that only the most recent
-        # version and installed version of packages appear.
-        if all_versions:
-                for pfmri, state in res:
-                        if state["state"] == PKG_STATE_INSTALLED:
-                                installed.append((pfmri, state))
-                        hv = pfmri.get_pkg_stem(include_scheme=False)
-                        if hv in most_recent:
-                                stored_pfmri, stored_state = \
-                                    most_recent[hv]
-                                if pfmri.is_successor(stored_pfmri):
-                                        most_recent[hv] = (pfmri, state)
-                        else:
-                                most_recent[hv] = (pfmri, state)
-                res = installed + most_recent.values()
-
-                # This method is necessary because fmri.__cmp__ does
-                # not provide the desired ordering. It uses the same
-                # ordering on package names as fmri.__cmp__ but it
-                # reverse sorts on version, so that 98 comes before 97.
-                # Also, publishers are taken into account so that
-                # preferred publishers come before others. Finally,
-                # publishers are presented in alphabetical order.
-                def __fmri_cmp((f1, s1), (f2, s2)):
-                        t = cmp(f1.pkg_name, f2.pkg_name)
-                        if t != 0:
-                                return t
-                        t = cmp(f2.version, f1.version)
-                        if t != 0:
-                                return t
-                        if f1.get_publisher() == ppub:
-                                return -1
-                        if f2.get_publisher() == ppub:
-                                return 1
-                        return cmp(f1.get_publisher(),
-                            f2.get_publisher())
-
-                res.sort(cmp=__fmri_cmp)
-        return res
-
 def get_data_digest(data, length=None, return_content=False):
         """Returns a tuple of (SHA-1 hexdigest, content).