Commit 0917373e4a9f42333d8b70b79b1f6f76282e10af

Authored by Tássia Camões Araújo
1 parent 237bf2f2
Exists in master and in 1 other branch add_vagrant

Added app_pkg_profile() to keep only application packages.

Showing 1 changed file with 18 additions and 0 deletions   Show diff stats
src/user.py
... ... @@ -152,6 +152,24 @@ class User:
152 152 desc_profile = self.desc_profile(items_repository,size)[:size/2]
153 153 return tag_profile+desc_profile
154 154  
  155 + def app_pkg_profile(self,axi):
  156 + """
  157 + Return list of packages that are applications.
  158 + """
  159 + old_profile_size = len(self.pkg_profile)
  160 + for p in self.pkg_profile[:]: #iterate list copy
  161 + tags = data.axi_search_pkg_tags(axi,p)
  162 + try:
  163 +
  164 + if not "XTrole::program" in tags:
  165 + self.pkg_profile.remove(p)
  166 + except:
  167 + logging.debug("Package not found in axi: %s" % p)
  168 + profile_size = len(self.pkg_profile)
  169 + logging.debug("App package profile: reduced packages profile size \
  170 + from %d to %d." % (old_profile_size, profile_size))
  171 + return self.pkg_profile
  172 +
155 173 def maximal_pkg_profile(self):
156 174 """
157 175 Return list of packages that are not dependence of any other package in
... ...