Bug#793559: udpkg: Update status keywords to match dpkg
Package: udpkg
Version: 1.17
Severity: wishlist
Tags: patch
Hi!
Here's a patch I had laying around, updating the status field values to
match the ones in dpkg. It does the following:
Remove obsolete keyword aliases, as dpkg autoupgraded these keywords
to their modern counterparts at run-time long time ago. And they are
no longer supported by dpkg itself. Moreover one of the keywords was
mispelled here ("post-inst-failed" should have been "postinst-failed"),
presumably from a typo carried over from apt.
Add triggers-awaited and triggers-pending keywords.
Sort status keywords in their normal transition sequence order.
Beware, only build-tested.
Thanks,
Guillem
From f5e8222c2211a8f6f85c2320201dd91d34a87424 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@debian.org>
Date: Sun, 3 Aug 2014 12:40:33 +0200
Subject: [PATCH] Update status keywords
Remove obsolete keyword aliases, as dpkg autoupgraded these keywords
to their modern counterparts at run-time long time ago. And they are
no longer supported by dpkg itself. Moreover one of the keywords was
mispelled here ("post-inst-failed" should have been "postinst-failed"),
presumably from a typo carried over from apt.
Add triggers-awaited and triggers-pending keywords.
Sort status keywords in their normal transition sequence order.
---
status.c | 10 ++++------
udpkg.h | 20 +++++++++-----------
2 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/status.c b/status.c
index 305e234..d1c20ad 100644
--- a/status.c
+++ b/status.c
@@ -24,12 +24,10 @@
static const char *statuswords[][10] = {
{ (char *)STATUS_WANTSTART, "unknown", "install", "hold",
"deinstall", "purge", 0 },
- { (char *)STATUS_FLAGSTART, "ok", "reinstreq", "hold",
- "hold-reinstreq", 0 },
- { (char *)STATUS_STATUSSTART, "not-installed", "unpacked", "half-configured",
- "installed", "half-installed",
- "config-files", "post-inst-failed",
- "removal-failed", 0 }
+ { (char *)STATUS_FLAGSTART, "ok", "reinstreq", 0 },
+ { (char *)STATUS_STATUSSTART, "not-installed", "config-files",
+ "half-installed", "unpacked", "half-configured",
+ "triggers-awaited", "triggers-pending", "installed", 0 }
};
int package_compare(const void *p1, const void *p2)
diff --git a/udpkg.h b/udpkg.h
index 30fc8c2..48bc877 100644
--- a/udpkg.h
+++ b/udpkg.h
@@ -35,20 +35,18 @@
#define STATUS_FLAGSTART (5)
#define STATUS_FLAGOK (1 << 5)
#define STATUS_FLAGREINSTREQ (1 << 6)
-#define STATUS_FLAGHOLD (1 << 7)
-#define STATUS_FLAGHOLDREINSTREQ (1 << 8)
-#define STATUS_FLAGMASK ~(STATUS_FLAGOK | STATUS_FLAGREINSTREQ | STATUS_FLAGHOLD | STATUS_FLAGHOLDREINSTREQ)
+#define STATUS_FLAGMASK ~(STATUS_FLAGOK | STATUS_FLAGREINSTREQ)
#define STATUS_STATUSSTART (9)
#define STATUS_STATUSNOTINSTALLED (1 << 9)
-#define STATUS_STATUSUNPACKED (1 << 10)
-#define STATUS_STATUSHALFCONFIGURED (1 << 11)
-#define STATUS_STATUSINSTALLED (1 << 12)
-#define STATUS_STATUSHALFINSTALLED (1 << 13)
-#define STATUS_STATUSCONFIGFILES (1 << 14)
-#define STATUS_STATUSPOSTINSTFAILED (1 << 15)
-#define STATUS_STATUSREMOVALFAILED (1 << 16)
-#define STATUS_STATUSMASK ~(STATUS_STATUSNOTINSTALLED | STATUS_STATUSUNPACKED | STATUS_STATUSHALFCONFIGURED | STATUS_STATUSINSTALLED | STATUS_STATUSCONFIGFILES | STATUS_STATUSPOSTINSTFAILED | STATUS_STATUSREMOVALFAILED | STATUS_STATUSHALFINSTALLED)
+#define STATUS_STATUSCONFIGFILES (1 << 10)
+#define STATUS_STATUSHALFINSTALLED (1 << 11)
+#define STATUS_STATUSUNPACKED (1 << 12)
+#define STATUS_STATUSHALFCONFIGURED (1 << 13)
+#define STATUS_STATUSTRIGGERSAWAITED (1 << 14)
+#define STATUS_STATUSTRIGGERSPENDING (1 << 15)
+#define STATUS_STATUSINSTALLED (1 << 16)
+#define STATUS_STATUSMASK ~(STATUS_STATUSNOTINSTALLED | STATUS_STATUSCONFIGFILES | STATUS_STATUSHALFINSTALLED | STATUS_STATUSUNPACKED | STATUS_STATUSHALFCONFIGURED | STATUS_STATUSTRIGGERSAWAITED | STATUS_STATUSTRIGGERSPENDING | STATUS_STATUSINSTALLED)
#define COLOR_WHITE 0
#define COLOR_GRAY 1
--
2.5.0.rc2.392.g76e840b
Reply to: