Batch-cancel pending builds in PPA

Asked by Jasem Mutlaq on 2018-01-21

Even since the problems with the Launchpad build farm started, many packages are queued to be built. There are over 1000+ now and they're already obsoleted. It is quite inpractical to go and cancel each individually, therefore, I'd like all of them to be cancelled here:

Question information

English Edit question
Launchpad itself Edit question
No assignee Edit question
Solved by:
Colin Watson
Last query:
Last reply:
Best Colin Watson (cjwatson) said : #1

You can use the Launchpad API for that:

If you install the lptools package, it should be something like this:

  for build in lp.load('/~mutlaqja/+archive/ubuntu/ppa').getBuildRecords(build_state='Needs building'):
      if build.can_be_cancelled:

Colin Watson (cjwatson) said : #2

Oops, sorry, forgot a bit in those instructions. That code can be entered in the interactive shell you get from "lp-tools production devel".

Colin Watson (cjwatson) said : #3

lp-shell production devel

Apparently I'm not entirely with it today!

Jasem Mutlaq (mutlaqja) said : #4

Thanks Colin Watson, that solved my question.

Jasem Mutlaq (mutlaqja) said : #5

I had to run the same command several times to get all the queue to clear up, but it's finally cleared thanks!!