script fixups

This commit is contained in:
TomasM
2017-11-04 05:36:01 -04:00
parent 3f92d8d653
commit ed7524050d
2 changed files with 28 additions and 7 deletions
+17 -5
View File
@@ -39,11 +39,23 @@ rm -Rf /usr/share/man/*_*
rm -f /root/.fehbg
rm -f /root/.fluxbox/lastwallpaper
# Unzip gzipped files (man pages), so LZMA can compress 2times better.
# First we fix symlinks, then uncompress files
# $1 = search directory
uncompress_files()
{
local LINK LINE
# Unzip gzipped man pages, so LZMA can compress 2times better.
# First we gunzip symlinks, which will be overwritten by the content of targets
# this doesn't matter as mksquashfs will handle duplicate files correctly
find /usr/share/man -type l -name "*.gz" | xargs gunzip -f
find /usr/share/man -name "*.gz" | xargs gunzip
find "$1" -type l -name "*.gz" | while read LINE; do
LINK="$(readlink "$LINE" | sed -r 's/.gz$//')"
FILE="$(echo "$LINE" | sed -r 's/.gz$//')"
ln -sfn "$LINK" "$FILE"
rm -f "$LINE"
done
find "$1" -type f -name "*.gz" | xargs gunzip
}
uncompress_files /etc/alternatives
uncompress_files /usr/share/man
rm -Rf /usr/share/icons/elementaryXubuntu-dark