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

libdpkg: Add new modstatdb_note_ifwrite function

Ian Jackson лет назад: 18
Родитель
Сommit
63a1385960
3 измененных файлов с 13 добавлено и 0 удалено
  1. 5 0
      ChangeLog
  2. 7 0
      lib/dbmodify.c
  3. 1 0
      lib/dpkg-db.h

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2008-03-25  Ian Jackson  <ian@davenant.greenend.org.uk>
+
+	* lib/dpkg-db.h (modstatdb_note_ifwrite): New prototype.
+	* ib/dbmodify.c (modstatdb_note_ifwrite): New function.
+
 2008-03-25  Ian Jackson  <ian@davenant.greenend.org.uk>
 
 	* src/archives.c (archivefiles): Call log_message.

+ 7 - 0
lib/dbmodify.c

@@ -272,6 +272,13 @@ void modstatdb_note(struct pkginfo *pkg) {
   onerr_abort--;
 }
 
+void
+modstatdb_note_ifwrite(struct pkginfo *pkg)
+{
+  if (cstatus >= msdbrw_write)
+    modstatdb_note(pkg);
+}
+
 const char *pkgadminfile(struct pkginfo *pkg, const char *whichfile) {
   static struct varbuf vb;
   varbufreset(&vb);

+ 1 - 0
lib/dpkg-db.h

@@ -168,6 +168,7 @@ enum modstatdb_rw {
 
 enum modstatdb_rw modstatdb_init(const char *admindir, enum modstatdb_rw reqrwflags);
 void modstatdb_note(struct pkginfo *pkg);
+void modstatdb_note_ifwrite(struct pkginfo *pkg);
 void modstatdb_checkpoint(void);
 void modstatdb_shutdown(void);