]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sysupdate: Allow partial+pending flags in a few more places for UpdateSets
authorPhilip Withnall <pwithnall@gnome.org>
Wed, 22 Apr 2026 16:23:49 +0000 (17:23 +0100)
committerPhilip Withnall <pwithnall@gnome.org>
Fri, 24 Apr 2026 14:28:40 +0000 (15:28 +0100)
While a resource Instance can either be partial or pending, but not
both; an UpdateSet (which potentially comprises several Instances) can
be both partial *and* pending if it contains Instances in both those
states.

Amend a few bits of internal code to allow that in situations which were
previously overlooked.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
src/sysupdate/sysupdate-update-set-flags.c
src/sysupdate/sysupdate.c

index 36801938f65f128be950fad04d51ef931e5d7633..7b684576b0614d2313e1ed746ea00574b19db9d6 100644 (file)
@@ -70,6 +70,11 @@ const char* update_set_flags_to_string(UpdateSetFlags flags) {
         case UPDATE_INSTALLED|UPDATE_PARTIAL|UPDATE_NEWEST|UPDATE_PROTECTED:
         case UPDATE_INSTALLED|UPDATE_AVAILABLE|UPDATE_PARTIAL|UPDATE_NEWEST:
         case UPDATE_INSTALLED|UPDATE_AVAILABLE|UPDATE_PARTIAL|UPDATE_NEWEST|UPDATE_PROTECTED:
+        /* can also contain pending instances: */
+        case UPDATE_INSTALLED|UPDATE_PARTIAL|UPDATE_PENDING|UPDATE_NEWEST:
+        case UPDATE_INSTALLED|UPDATE_PARTIAL|UPDATE_PENDING|UPDATE_NEWEST|UPDATE_PROTECTED:
+        case UPDATE_INSTALLED|UPDATE_AVAILABLE|UPDATE_PARTIAL|UPDATE_PENDING|UPDATE_NEWEST:
+        case UPDATE_INSTALLED|UPDATE_AVAILABLE|UPDATE_PARTIAL|UPDATE_PENDING|UPDATE_NEWEST|UPDATE_PROTECTED:
                 return "current+partial";
 
         case UPDATE_AVAILABLE|UPDATE_NEWEST:
index 2dd1bfdaac38ed42785127b23a3d82260b1a4dcd..89efe36c857f044b2b9376a0ec925c9cc4bb5b01 100644 (file)
@@ -669,7 +669,7 @@ static int context_show_version(Context *c, const char *version) {
                 Instance *i = *inst;
 
                 if (!i) {
-                        assert(FLAGS_SET(us->flags, UPDATE_INCOMPLETE));
+                        assert(us->flags & (UPDATE_INCOMPLETE|UPDATE_PARTIAL|UPDATE_PENDING));
                         continue;
                 }