Permalink
Browse files

Remove obsoleted packages

  • Loading branch information...
1 parent e1aa699 commit 1f8a309008954d6ecb7b03fab2dce40f216ae193 Ozan Çağlayan committed Jan 31, 2011
Showing with 9 additions and 6 deletions.
  1. +1 −1 TODO
  2. +5 −4 buildfarm/utils.py
  3. +3 −1 scripts/buildfarm
View
2 TODO
@@ -13,8 +13,8 @@ TODO for buildfarm 3.0
(+) Use pisi.api for creating the indexes
(+) Use pisi methods if available to avoid redundancy
(+) Add hooks.d for running a number of hooks after each run
+(+) Support for the removal of obsoleted packages
(-) Drop waitqueue
-(-) Support for the removal of obsoleted packages
(-) A Web status page for current status
(-) Implement locking correctly
View
@@ -148,14 +148,15 @@ def remove_obsoleted_packages():
# Use directly distributions.xml to not rely on available
# repositories on the system.
dist = pisi.component.Distribution("%s/distribution.xml" % get_local_repository_url())
- obsoletes = [obsolete.package() for obsolete in dist.obsoletes]
+ obsoletes = [obsolete.package for obsolete in dist.obsoletes]
# Reduce the list so that already removed ones are excluded
- obsoletes = set(obsoletes).intersection(pisi.api.list_installed())
+ obsoletes = list(set(obsoletes).intersection(pisi.api.list_installed()))
if obsoletes:
- print obsoletes
- #pisi.api.remove(obsoletes)
+ pisi.api.remove(obsoletes)
+
+ return obsoletes
def is_arch_excluded(spec):
"""Returns True if the given pspec.xml shouldn't be built
View
@@ -42,7 +42,9 @@ def build_packages():
package_list = []
# Remove obsoleted packages
- utils.remove_obsoleted_packages()
+ removed_packages = utils.remove_obsoleted_packages()
+ if removed_packages:
+ logger.info("Removed the following obsoleted packages:\n%s" % "\n".join(removed_packages))
# Compiling current work queue

0 comments on commit 1f8a309

Please sign in to comment.