Source: tzdata
Version: 2022a-1
Severity: wishlist
Tags: patch

tzdata is not a huge package, but when considering it for use in an
embedded system, the size is noticeable. Depending on the file system in
use, the size consumption may even be bigger due to the many small
files.

It turns out that a number of those files are duplicated. You can see a
report at https://dedup.debian.net/compare/tzdata/tzdata. If replacing
them with hardlinks, we can easily save 20% of reported Installed-Size.
I expect that the practical savings are bigger.

Please consider applying the attached patch. If you dislike hard links
for some reason, the same effect can be achieved using symlinks in a
similarly mechanical way.

Helmut
diff --minimal -Nru tzdata-2022a/debian/changelog tzdata-2022a/debian/changelog
--- tzdata-2022a/debian/changelog       2022-03-22 20:49:04.000000000 +0100
+++ tzdata-2022a/debian/changelog       2022-05-02 12:00:33.000000000 +0200
@@ -1,3 +1,10 @@
+tzdata (2022a-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Deduplicate files in timezone database using hard links.  Closes: #-1.
+
+ -- Helmut Grohne <helmut.gro...@intenta.de>  Mon, 02 May 2022 12:00:33 +0200
+
 tzdata (2022a-1) unstable; urgency=high
 
   [ Aurelien Jarno ]
diff --minimal -Nru tzdata-2022a/debian/control tzdata-2022a/debian/control
--- tzdata-2022a/debian/control 2022-03-22 20:47:25.000000000 +0100
+++ tzdata-2022a/debian/control 2022-05-02 12:00:33.000000000 +0200
@@ -2,7 +2,7 @@
 Section: localization
 Priority: required
 Build-Depends: debhelper-compat (= 13)
-Build-Depends-Indep: gawk, po-debconf, symlinks
+Build-Depends-Indep: gawk, po-debconf, symlinks, rdfind
 Rules-Requires-Root: no
 Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
 Uploaders: Clint Adams <cl...@debian.org>, Aurelien Jarno <aure...@debian.org>
diff --minimal -Nru tzdata-2022a/debian/rules tzdata-2022a/debian/rules
--- tzdata-2022a/debian/rules   2022-03-22 20:47:25.000000000 +0100
+++ tzdata-2022a/debian/rules   2022-05-02 12:00:32.000000000 +0200
@@ -76,6 +76,7 @@
            echo ; \
        done ) > $(TEMPLATES_FILE)
        debconf-updatepo
+       rdfind -outputname /dev/null -makehardlinks true $(TZGEN)
 
 override_dh_auto_test:
        # The upstream tests are related to the sources. Just skip it.
diff --minimal -Nru tzdata-2022a/debian/tzdata.lintian-overrides 
tzdata-2022a/debian/tzdata.lintian-overrides
--- tzdata-2022a/debian/tzdata.lintian-overrides        1970-01-01 
01:00:00.000000000 +0100
+++ tzdata-2022a/debian/tzdata.lintian-overrides        2022-05-02 
12:00:33.000000000 +0200
@@ -0,0 +1,2 @@
+# lintian bug #1010476
+tzdata: package-contains-hardlink *

Reply via email to