aboutsummaryrefslogtreecommitdiffstats
path: root/sb_builder/packages.py
diff options
context:
space:
mode:
Diffstat (limited to 'sb_builder/packages.py')
-rw-r--r--sb_builder/packages.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/sb_builder/packages.py b/sb_builder/packages.py
index dbbbd30..c057c35 100644
--- a/sb_builder/packages.py
+++ b/sb_builder/packages.py
@@ -320,12 +320,14 @@ class PackagesTab(QWidget):
self.act_build = {
a: action(self, a.capitalize(), icon, fb, lambda a=a: self.act(a))
for a, icon, fb in (("build", "run-build", SP.SP_MediaPlay),
- ("update", "system-software-update", SP.SP_BrowserReload),
("rebuild", "view-refresh", SP.SP_BrowserReload),
("remove", "edit-delete", SP.SP_TrashIcon))}
+ self.act_prune = action(self, "Prune", "edit-clear", SP.SP_TrashIcon, self.prune)
+ self.set_prunable(None)
self.act_new_hint = action(self, "New hint", "document-new", SP.SP_FileIcon, self.new_hint)
self.actions = [*self.act_build.values(),
action(self, "Update all", "system-upgrade", SP.SP_ArrowUp, self.update_all),
+ self.act_prune,
self.act_new_hint,
action(self, "Publish", "document-send", SP.SP_DialogSaveButton, self.publish)]
self.view_actions = [
@@ -418,6 +420,13 @@ class PackagesTab(QWidget):
def update_all(self):
self.start_requested.emit(["slackrepo", "update", "--preview"])
+ def set_prunable(self, n):
+ """How many built packages lost their SlackBuild (stats), None if unknown."""
+ enable(self.act_prune, None if n else "no built package lost its SlackBuild")
+
+ def prune(self):
+ self.start_requested.emit(["slackrepo", "prune", "--preview"])
+
def publish(self):
if QMessageBox.question(self, "Publish", "Push the package repository to the mirror now?") \
== QMessageBox.StandardButton.Yes: