This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=463ed9a7becbe509948620d9c1138e40c711c45c

commit 463ed9a7becbe509948620d9c1138e40c711c45c
Author: Guillem Jover <[email protected]>
AuthorDate: Sat Mar 2 18:13:14 2019 +0100

    libdpkg: Do not generate a backup file for the available database
    
    This file contains information only valid as long as the downloaded
    sources are also available. So it is closer to a cache than a database,
    and as such, there is no need for an uncompressed backup, which can
    take quite some space.
    
    Closes: #343578
---
 debian/changelog | 4 ++++
 lib/dpkg/dump.c  | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 240d07d32..9f7105a7d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,9 @@
 dpkg (1.20.0) UNRELEASED; urgency=medium
 
+  [ Guillem Jover ]
+  * libdpkg: Do not generate a backup file for the available database.
+    Closes: #343578
+
   [ Updated man pages translations ]
   * German (Helge Kreutzmann). Closes: #931135
 
diff --git a/lib/dpkg/dump.c b/lib/dpkg/dump.c
index c58a4d59a..48f0beb03 100644
--- a/lib/dpkg/dump.c
+++ b/lib/dpkg/dump.c
@@ -538,8 +538,12 @@ void
 writedb(const char *filename, enum writedb_flags flags)
 {
   struct atomic_file *file;
+  enum atomic_file_flags atomic_flags = ATOMIC_FILE_BACKUP;
 
-  file = atomic_file_new(filename, ATOMIC_FILE_BACKUP);
+  if (flags & wdb_dump_available)
+    atomic_flags = 0;
+
+  file = atomic_file_new(filename, atomic_flags);
   atomic_file_open(file);
 
   writedb_records(file->fp, filename, flags);

-- 
Dpkg.Org's dpkg

Reply via email to