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

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
Родитель
Сommit
5f1ba89ae9
2 измененных файлов с 4 добавлено и 4 удалено
  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
  *
  * 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
  * 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);
 	else
 		pkg_set_status(pkg, stat_installed);
+	modstatdb_note(pkg);
 
 	post_postinst_tasks_core(pkg);
 }
@@ -67,8 +68,6 @@ post_postinst_tasks(struct pkginfo *pkg, enum pkgstatus new_status)
 void
 post_postinst_tasks_core(struct pkginfo *pkg)
 {
-	modstatdb_note(pkg);
-
 	if (!f_noact) {
 		debug(dbg_triggersdetail,
 		      "post_postinst_tasks_core - trig_incorporate");

+ 2 - 1
src/trigproc.c

@@ -4,7 +4,7 @@
  *
  * Copyright © 2007 Canonical Ltd
  * 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
  * 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);
 		else
 			pkg_set_status(pkg, stat_installed);
+		modstatdb_note(pkg);
 
 		post_postinst_tasks_core(pkg);
 	} else {