summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2019-03-02 18:13:14 +0100
committerGuillem Jover <guillem@debian.org>2019-10-12 16:37:12 +0200
commit463ed9a7becbe509948620d9c1138e40c711c45c (patch)
tree99eefa600a103ae7b907b875c791ee09642412de
parent9ad2462fc61aa2b7ba1c2dc8b0810c33abc9ee09 (diff)
downloaddpkg-463ed9a7becbe509948620d9c1138e40c711c45c.tar.gz
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
-rw-r--r--debian/changelog4
-rw-r--r--lib/dpkg/dump.c6
2 files changed, 9 insertions, 1 deletions
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);