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. | expand |
On 05/08/18 20:03, Joseph Salisbury wrote: > 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%) > > 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: > Looks good to me. Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
On 08.05.2018 11:03, Joseph Salisbury wrote: > 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> > --- I think it looks ok, but would be even more appreciative if the description text at the top of the file would be made into something more usable than the default tutorial description... -Stefan > ...nux-meta-cleaner => linux-package-cleaner} | 35 +++++++++++-------- > 1 file changed, 20 insertions(+), 15 deletions(-) > rename bugs/{linux-meta-cleaner => linux-package-cleaner} (67%) > > 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: >
On 06/05/2018 02:27 PM, Stefan Bader wrote: > On 08.05.2018 11:03, Joseph Salisbury wrote: >> 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> >> --- > I think it looks ok, but would be even more appreciative if the description text > at the top of the file would be made into something more usable than the default > tutorial description... > > -Stefan Yeah that would be good, wouldn't it :-) I'll fix that up and send a v2. > >> ...nux-meta-cleaner => linux-package-cleaner} | 35 +++++++++++-------- >> 1 file changed, 20 insertions(+), 15 deletions(-) >> rename bugs/{linux-meta-cleaner => linux-package-cleaner} (67%) >> >> 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: >> >
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:
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%)