~mmcg069/software-center/Bug846204

« back to all changes in this revision

Viewing changes to softwarecenter/backend/channel_impl/aptchannels.py

  • Committer: Matthew McGowan
  • Date: 2011-09-20 20:53:11 UTC
  • mfrom: (2362.10.2 trunk)
  • mto: This revision was merged to the branch mainline in revision 2397.
  • Revision ID: matthew.joseph.mcgowan@gmail.com-20110920205311-lrdoiz3l4su2wu44
merge w trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
170
170
        returns True is a update is needed
171
171
        """
172
172
        # the operation get_origins can take some time (~60s?)
173
 
        cache_origins = self.db._aptcache.get_all_origins()
174
 
        db_origins = set()
175
 
        for channel in self.channels:
176
 
            origin = channel.origin
177
 
            if origin:
178
 
                db_origins.add(origin)
 
173
        cache_origins = set(self.db._aptcache.get_all_origins())
 
174
        db_origins = set(self.db.get_origins_from_db())
179
175
        # origins
180
176
        self._logger.debug("cache_origins: %s" % cache_origins)
181
177
        self._logger.debug("db_origins: %s" % db_origins)
182
 
        if cache_origins != db_origins:
 
178
        # the db_origins will contain origins from the s-c-agent, so
 
179
        # we don't need to rebuild if the db has more origins then
 
180
        # the cache, but we need to rebuild if the cache has origins
 
181
        # that a-x-i does not have
 
182
        if not cache_origins.issubset(db_origins):
183
183
            return True
184
184
        return False
185
185