Quellcode durchsuchen

dpkg: Get rid of post_postinst_tasks_core()

Fold post_postinst_tasks_core() into post_postinst_tasks(), and replace
open-coded implementation in trigproc().
Guillem Jover vor 12 Jahren
Ursprung
Commit
09bde8ca46
3 geänderte Dateien mit 4 neuen und 20 gelöschten Zeilen
  1. 0 2
      src/main.h
  2. 1 7
      src/script.c
  3. 3 11
      src/trigproc.c

+ 0 - 2
src/main.h

@@ -242,8 +242,6 @@ int maintscript_fallback(struct pkginfo *pkg,
  * trigger incorporation until after updating the package status. The effect
  * is that a package can trigger itself. */
 int maintscript_postinst(struct pkginfo *pkg, ...) DPKG_ATTR_SENTINEL;
-void post_postinst_tasks_core(struct pkginfo *pkg);
-
 void post_postinst_tasks(struct pkginfo *pkg, enum pkgstatus new_status);
 
 void clear_istobes(void);

+ 1 - 7
src/script.c

@@ -62,13 +62,7 @@ post_postinst_tasks(struct pkginfo *pkg, enum pkgstatus new_status)
 		pkg_set_status(pkg, stat_installed);
 	modstatdb_note(pkg);
 
-	post_postinst_tasks_core(pkg);
-}
-
-void
-post_postinst_tasks_core(struct pkginfo *pkg)
-{
-	debug(dbg_triggersdetail, "post_postinst_tasks_core - trig_incorporate");
+	debug(dbg_triggersdetail, "post_postinst_tasks - trig_incorporate");
 	trig_incorporate(modstatdb_get_status());
 }
 

+ 3 - 11
src/trigproc.c

@@ -356,18 +356,10 @@ trigproc(struct pkginfo *pkg)
 			                     namesarg.buf + 1, NULL);
 		}
 
-		/* This is to cope if the package triggers itself: */
-		if (pkg->trigaw.head)
-			pkg_set_status(pkg, stat_triggersawaited);
-		else if (pkg->trigpend_head)
-			pkg_set_status(pkg, stat_triggerspending);
-		else
-			pkg_set_status(pkg, stat_installed);
-		modstatdb_note(pkg);
-
-		post_postinst_tasks_core(pkg);
+		post_postinst_tasks(pkg, stat_installed);
 	} else {
-		/* In other branch is done by modstatdb_note. */
+		/* In other branch is done by modstatdb_note(), from inside
+		 * post_postinst_tasks(). */
 		trig_clear_awaiters(pkg);
 	}
 }