Просмотр исходного кода

dpkg: Use modstatdb_get_status() instead of hardcoding msdbrw_write

Pass the modstatdb status value used when opening the database, instead
of hardcoding msdbrw_write to trig_incorporate() calls, and avoiding
calling them on --no-act.
Guillem Jover лет назад: 12
Родитель
Сommit
9772f1f276
1 измененных файлов с 3 добавлено и 6 удалено
  1. 3 6
      src/script.c

+ 3 - 6
src/script.c

@@ -68,11 +68,8 @@ post_postinst_tasks(struct pkginfo *pkg, enum pkgstatus new_status)
 void
 post_postinst_tasks_core(struct pkginfo *pkg)
 {
-	if (!f_noact) {
-		debug(dbg_triggersdetail,
-		      "post_postinst_tasks_core - trig_incorporate");
-		trig_incorporate(msdbrw_write);
-	}
+	debug(dbg_triggersdetail, "post_postinst_tasks_core - trig_incorporate");
+	trig_incorporate(modstatdb_get_status());
 }
 
 static void
@@ -82,7 +79,7 @@ post_script_tasks(void)
 
 	debug(dbg_triggersdetail,
 	      "post_script_tasks - ensure_diversions; trig_incorporate");
-	trig_incorporate(msdbrw_write);
+	trig_incorporate(modstatdb_get_status());
 }
 
 static void