From: Michael Tremer Date: Fri, 18 Nov 2011 22:09:18 +0000 (+0100) Subject: Compress all man pages with the xz algorithm. X-Git-Tag: 0.9.18~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1b51609b93227835fdfdad339ac0b27ee389ca6a;p=pakfire.git Compress all man pages with the xz algorithm. --- diff --git a/python/pakfire/builder.py b/python/pakfire/builder.py index 5769cd863..49cd19aba 100644 --- a/python/pakfire/builder.py +++ b/python/pakfire/builder.py @@ -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) diff --git a/scripts/Makefile b/scripts/Makefile index 665a3b7da..4a4d79fd8 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -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 index 000000000..1b250d7a7 --- /dev/null +++ b/scripts/compress-man-pages @@ -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 diff --git a/scripts/functions-files b/scripts/functions-files index 66fd56745..3df66f7d0 100644 --- a/scripts/functions-files +++ b/scripts/functions-files @@ -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 index 0720d100e..000000000 --- a/scripts/quality-agent.d/090-man-pages +++ /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 -