scripts/brp-compress.in: extend the range of autocompressed file types

Autocompress "[^:]*ASCII.* text.*" file types in addition to
"[^:]*troff or preprocessor input text.*".
This commit is contained in:
Дмитрий Левин 2020-09-11 08:00:00 +00:00
parent 1357563e49
commit 4f5394b5a1

View File

@ -82,14 +82,14 @@ for d in `find "$RPM_BUILD_ROOT$RPM_COMPRESS_TOPDIR" -type d -name man`; do
find "$d" -type f \( -name \*.gz -o -name \*.Z \) -print0 |xargs -r0 gunzip
find "$d" -type f -name \*.bz2 -print0 |xargs -r0 bunzip2
# First, compress normal files.
for f in `find "$d" -type f -a \! -name whatis -print0 |xargs -r0 file |sed -rn 's/^([^[:space:]]+):[^:]*troff or preprocessor input text.*/\1/p'`; do
for f in `find "$d" -type f -a \! -name whatis -print0 |xargs -r0 file |sed -rn 's/^([^[:space:]]+):[^:]*(troff or preprocessor input|ASCII.*) text.*/\1/p'`; do
[ -f "$f" ] || continue
if ! head -1 "$f" |grep -q '^.so '; then
@RPMCONFIGDIR@/compress_files "$f"
fi
done
# Second, convert .so links into symlinks.
for f in `find "$d" -type f -a \! -name whatis -print0 |xargs -r0 file |sed -rn 's/^([^[:space:]]+):[^:]*troff or preprocessor input text.*/\1/p'`; do
for f in `find "$d" -type f -a \! -name whatis -print0 |xargs -r0 file |sed -rn 's/^([^[:space:]]+):[^:]*(troff or preprocessor input|ASCII.*) text.*/\1/p'`; do
[ -f "$f" ] || continue
if head -1 "$f" |grep -q '^.so '; then
f_dir="${f%/*}"