]> git.ipfire.org Git - pakfire.git/commitdiff
Compress all man pages with the xz algorithm.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Nov 2011 22:09:18 +0000 (23:09 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Nov 2011 22:42:05 +0000 (23:42 +0100)
python/pakfire/builder.py
scripts/Makefile
scripts/compress-man-pages [new file with mode: 0755]
scripts/functions-files
scripts/quality-agent.d/090-man-pages [deleted file]

index 5769cd86371a7bc44f8ee2cb3e865171212b1a6d..49cd19aba63e44f2749aed8d076bd2c93071a8c8 100644 (file)
@@ -686,6 +686,7 @@ class Builder(object):
                        self.build_stage(stage)
 
                # Run post-build stuff.
+               self.post_compress_man_pages()
                self.post_remove_static_libs()
 
                # Package the result.
@@ -730,6 +731,12 @@ class Builder(object):
                except Error, e:
                        logging.warning(_("Could not remove static libraries: %s") % e)
 
+       def post_compress_man_pages(self):
+               try:
+                       self.do("%s/compress-man-pages %s" % (SCRIPT_DIR, self.buildroot))
+               except Error, e:
+                       logging.warning(_("Compressing man pages did not complete successfully."))
+
        def cleanup(self):
                if os.path.exists(self.buildroot):
                        util.rm(self.buildroot)
index 665a3b7da5e672f62ffa37f0bd283f9a0e785b66..4a4d79fd83c24351230af6b44375081004152a68 100644 (file)
@@ -6,6 +6,7 @@ SCRIPTS_BIN   =
 SCRIPTS_SHELL = \
        chroot-shell \
        cleanup \
+       compress-man-pages \
        dependency-tracker \
        pakfire-multicall.py \
        py-compile \
diff --git a/scripts/compress-man-pages b/scripts/compress-man-pages
new file mode 100755 (executable)
index 0000000..1b250d7
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+echo "Compressing man pages..."
+
+BUILDROOT=${1}
+shift
+
+for file in $(find ${BUILDROOT}/usr/share/man -type f); do
+       case "${file}" in
+               *.gz)
+                       gzip -d ${file}
+                       file=${file%*.gz}
+                       ;;
+               *.bz2)
+                       bzip2 -d ${file}
+                       file=${file%*.bz2}
+                       ;;
+       esac
+
+       echo "  Compressing man page ${file//${BUILDROOT}/}..."
+       xz ${file}
+done
+
+exit 0
index 66fd56745f670623d7ff2bcd30cdf0c9719bd0ee..3df66f7d023d2fd69ed7ccf3cba2f9f5ad8f975b 100644 (file)
@@ -179,6 +179,13 @@ function find_elf_files() {
        for dir in ${dirs}; do
                dir="${prefix}${dir}"
                for file in $(find ${dir} -type f -not -name "*.ko" 2>/dev/null); do
+                       case "${file}" in
+                               # Skip kernel modules.
+                               */lib/modules/*)
+                                       continue
+                                       ;;
+                       esac
+
                        if file_is_elf ${file} && ! file_is_static ${file}; then
                                files="${files} ${file}"
                        fi
diff --git a/scripts/quality-agent.d/090-man-pages b/scripts/quality-agent.d/090-man-pages
deleted file mode 100755 (executable)
index 0720d10..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/bash
-
-. $(dirname ${0})/qa-include
-
-DESC="Decompressing man-pages..."
-
-function check() {
-       for file in $(find ${BUILDROOT}/usr/share/man -type f 2>/dev/null); do
-               log DEBUG "  Processing: ${file}"
-               if [[ ${file} =~ \.gz$ ]]; then
-                       gzip -d ${file}
-               fi
-       done
-}
-
-run
-