[kteam-tools,1/1] linux-package-cleaner: Renamed linux-meta-cleaner and added additional packages.

Message ID 82cf4c657f238a7d54507507d0a7c7d775023168.1525801531.git.joseph.salisbury@canonical.com
State New
Headers show
Series
  • [kteam-tools,1/1] linux-package-cleaner: Renamed linux-meta-cleaner and added additional packages.
Related show

Commit Message

Joseph Salisbury May 8, 2018, 6:03 p.m.
Renamed the script and added the linux-signed and linux-hwe packages.  The
script will move any packages defined in it to the linux package.

Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
---
 ...nux-meta-cleaner => linux-package-cleaner} | 35 +++++++++++--------
 1 file changed, 20 insertions(+), 15 deletions(-)
 rename bugs/{linux-meta-cleaner => linux-package-cleaner} (67%)

Patch

diff --git a/bugs/linux-meta-cleaner b/bugs/linux-package-cleaner
similarity index 67%
rename from bugs/linux-meta-cleaner
rename to bugs/linux-package-cleaner
index f44324b8..10e88d11 100755
--- a/bugs/linux-meta-cleaner
+++ b/bugs/linux-package-cleaner
@@ -13,9 +13,9 @@ 
 from lpltk.LaunchpadService          import LaunchpadService
 from datetime                        import datetime
 
-# LinuxMetaCleaner
+# LinuxPackageCleaner
 #
-class LinuxMetaCleaner():
+class LinuxPackageCleaner():
     # main
     #
     def main(self):
@@ -28,6 +28,8 @@  class LinuxMetaCleaner():
         distro        = lp.distributions['ubuntu']
         linux_package = distro.get_source_package('linux')
         meta_package  = distro.get_source_package('linux-meta')
+        signed_package  = distro.get_source_package('linux-signed')
+        hwe_package  = distro.get_source_package('linux-hwe')
 
         # Searching for bug tasks, the search can be quite complicated and made up
         # of several components. The following can be combined in many ways to get
@@ -40,21 +42,24 @@  class LinuxMetaCleaner():
         search_tags            = ['-kj-triage'] # A list of the tags we care about
         search_tags_combinator = "All"
         search_status          = ["New", "Confirmed"] # A list of the bug statuses that we care about
-        tasks = meta_package.search_tasks(status=search_status, tags=search_tags, tags_combinator=search_tags_combinator)
-
-        for task in tasks:
-            try:
-                # Temp. Hack
-                task.target = linux_package.lp_source_package
-                bug = task.bug
-                print(bug.id)
-            except:
-                bug = task.bug
-                print(bug.id)
-                print("  *** Warning: Exception thrown while processing %s" % (bug.id))
+        packages_to_clean = {meta_package, signed_package, hwe_package}
+
+        for key in packages_to_clean:
+            tasks = key.search_tasks(status=search_status, tags=search_tags, tags_combinator=search_tags_combinator)
+        
+            for task in tasks:
+                try:
+                    # Temp. Hack
+                    task.target = linux_package.lp_source_package
+                    bug = task.bug
+                    print(bug.id)
+                except:
+                    bug = task.bug
+                    print(bug.id)
+                    print("  *** Warning: Exception thrown while processing %s" % (bug.id))
 
 if __name__ == '__main__':
-    app = LinuxMetaCleaner()
+    app = LinuxPackageCleaner()
     app.main()
 
 # vi:set ts=4 sw=4 expandtab: