diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2020-03-30 19:20:07 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2020-03-30 19:20:07 +0200 |
commit | 84a74943effd070d81bcb8551583baa572786bc4 (patch) | |
tree | 733b5b5338430643494e25b09aef745edd1db5a5 | |
parent | 651104d7058ee5908a446379745c266a5e71d09c (diff) |
bugs: update-bug-database!: Refresh all existing bugs.
This includes bugs that have been moved to other packages.
-rw-r--r-- | mumi/bugs.scm | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/mumi/bugs.scm b/mumi/bugs.scm index 6e1e367..69911fc 100644 --- a/mumi/bugs.scm +++ b/mumi/bugs.scm @@ -203,6 +203,13 @@ tags=excluded.tags;") "SELECT id FROM bugs WHERE tags LIKE " (string-append "%|" tag "|%") ";"))))) +(define (bug-ids) + "Return all bug ids." + (map (cut vector-ref <> 0) + (with-db + (lambda (db) + (sqlite-exec db "SELECT id FROM bugs;"))))) + (define (update-bug-database!) (define chunk-size 400) (define (safe-split lst n) @@ -211,11 +218,13 @@ tags=excluded.tags;") (split-at lst n)) (lambda _ (values lst '())))) - (let* ((bug-nums (append-map (lambda (package) - (soap-invoke (%config 'debbugs) - get-bugs - `((package . ,package)))) - (%config 'packages))) + (let* ((bug-nums (apply lset-adjoin = + (append-map (lambda (package) + (soap-invoke (%config 'debbugs) + get-bugs + `((package . ,package)))) + (%config 'packages)) + (bug-ids))) (total (length bug-nums))) (display "updating bug database...") ;; Process bugs in chunks |