Bladeren bron

dpkg: Move modstatdb_note() calls from post_postinst_tasks_core() to call sites

This moves the calls near where the package status is being changed,
and makes it obvious that we are creating an update log entry.
Guillem Jover 13 jaren geleden
bovenliggende
commit
5f1ba89ae9
2 gewijzigde bestanden met toevoegingen van 4 en 4 verwijderingen
  1. 2 3
      src/script.c
  2. 2 1
      src/trigproc.c

+ 2 - 3
src/script.c

@@ -3,7 +3,7 @@
  * script.c - maintainer script routines
  * script.c - maintainer script routines
  *
  *
  * Copyright © 1995 Ian Jackson <ian@chiark.greenend.org.uk>
  * Copyright © 1995 Ian Jackson <ian@chiark.greenend.org.uk>
- * Copyright © 2007-2012 Guillem Jover <guillem@debian.org>
+ * Copyright © 2007-2013 Guillem Jover <guillem@debian.org>
  *
  *
  * This is free software; you can redistribute it and/or modify
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * it under the terms of the GNU General Public License as published by
@@ -60,6 +60,7 @@ post_postinst_tasks(struct pkginfo *pkg, enum pkgstatus new_status)
 		pkg_set_status(pkg, stat_triggerspending);
 		pkg_set_status(pkg, stat_triggerspending);
 	else
 	else
 		pkg_set_status(pkg, stat_installed);
 		pkg_set_status(pkg, stat_installed);
+	modstatdb_note(pkg);
 
 
 	post_postinst_tasks_core(pkg);
 	post_postinst_tasks_core(pkg);
 }
 }
@@ -67,8 +68,6 @@ post_postinst_tasks(struct pkginfo *pkg, enum pkgstatus new_status)
 void
 void
 post_postinst_tasks_core(struct pkginfo *pkg)
 post_postinst_tasks_core(struct pkginfo *pkg)
 {
 {
-	modstatdb_note(pkg);
-
 	if (!f_noact) {
 	if (!f_noact) {
 		debug(dbg_triggersdetail,
 		debug(dbg_triggersdetail,
 		      "post_postinst_tasks_core - trig_incorporate");
 		      "post_postinst_tasks_core - trig_incorporate");

+ 2 - 1
src/trigproc.c

@@ -4,7 +4,7 @@
  *
  *
  * Copyright © 2007 Canonical Ltd
  * Copyright © 2007 Canonical Ltd
  * written by Ian Jackson <ian@chiark.greenend.org.uk>
  * written by Ian Jackson <ian@chiark.greenend.org.uk>
- * Copyright © 2008-2012 Guillem Jover <guillem@debian.org>
+ * Copyright © 2008-2013 Guillem Jover <guillem@debian.org>
  *
  *
  * This is free software; you can redistribute it and/or modify
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * it under the terms of the GNU General Public License as published by
@@ -353,6 +353,7 @@ trigproc(struct pkginfo *pkg)
 			pkg_set_status(pkg, stat_triggerspending);
 			pkg_set_status(pkg, stat_triggerspending);
 		else
 		else
 			pkg_set_status(pkg, stat_installed);
 			pkg_set_status(pkg, stat_installed);
+		modstatdb_note(pkg);
 
 
 		post_postinst_tasks_core(pkg);
 		post_postinst_tasks_core(pkg);
 	} else {
 	} else {