From 786138b4bd7a47ef3f7570c872d3f8e7ac02abda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ozan=20=C3=87a=C4=9Flayan?= Date: Sat, 6 Jun 2009 13:21:54 +0000 Subject: [PATCH] Sort the files according to their path names before adding them to the tarfile. This helps lzma to compress the install.tar better. Thanks Onur for noticing this and giving the idea. install.tar.lzma for the kernel-source package dropped from 54MB to 47MB after applying this patch. --- ChangeLog | 5 +++++ pisi/operations/build.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index abf98eca..fcd7837d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-06 Ozan Çağlayan + * (operations/build.py): Sort the files according to their path names + before adding them to the tarfile. This helps lzma to compress the + install.tar better. Thanks Onur for noticing this and giving the idea. + 2009-05-07 Bahadır Kandemir * Set DBus timeout for setupPackage calls. diff --git a/pisi/operations/build.py b/pisi/operations/build.py index 572280b9..4c8106f3 100644 --- a/pisi/operations/build.py +++ b/pisi/operations/build.py @@ -965,6 +965,11 @@ class Builder: files = pisi.files.Files() files.read(ctx.const.files_xml) + # Sort the files in-place according to their path for an ordered + # tarfile layout which dramatically improves the compression performance + # of lzma. + files.list.sort(key=lambda x: x.path) + if ctx.get_option('package_format') == "1.0": for finfo in files.list: orgname = arcname = pisi.util.join_path("install", finfo.path)