cookutils view modules/compressor @ rev 954

cook: remove package in taz/ is package not needed; modules/compressor: recompress *.zip files (for LibreOffice).
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Aug 02 18:44:51 2017 +0300 (2017-08-02)
parents 49ff02f8d304
children ba9972ca7cae
line source
1 #!/bin/sh
2 #
3 # compressor - module of the SliTaz Cook
4 # Copyright (C) SliTaz GNU/Linux - GNU GPL v3
5 #
7 . /usr/lib/slitaz/libcook.sh
9 # Compressor cache stuff
11 comp_cache_root='/home/slitaz/cache/cook'
12 mkdir -p "$comp_cache_root"
13 cache_stat=$(mktemp)
15 # Cache notes.
16 # Do not do the same job twice. Getting the file from the cache is much faster
17 # than compressing the file one more time. In addition, this cache is trying not
18 # to take extra space, using the hardlinks. Although the files from the cache
19 # without reference to itself should be removed periodically.
24 #
25 # Functions
26 #
29 # tazpkg install command
31 tpi() {
32 tazpkg -gi --quiet --local --cookmode $1
33 }
36 # Working with time (with hundredths precision)
38 get_time() {
39 cut -d" " -f2 /proc/uptime
40 }
42 calc_time() {
43 # L10n: 's' is for seconds, 'm' is for minutes
44 awk -va="$1" -vb="$(get_time)" -vs="$(_ 's')" -vm="$(_ 'm')" '
45 BEGIN{
46 time = b - a;
47 if (time < 30)
48 printf("%.2f%s\n", time, s);
49 else
50 printf("%.2f%s ~ %.0f%s\n", time, s, time / 60, m);
51 }'
52 }
55 # Compressor mini summary
57 comp_summary() {
58 # "$time0" "$size0" "$size1"
59 status
60 [ "$2" -eq 0 ] && return
61 saving=$(awk -va="$2" -vb="$3" 'BEGIN{ printf("%.0f\n", (a - b) / 1024) }')
62 cache_msg=''
63 if [ -s "$cache_stat" ]; then
64 cache_msg=$(_n ' Cache hit: %d/%d.' "$(fgrep '+' $cache_stat | wc -l)" "$(wc -l < $cache_stat)")
65 echo -n > $cache_stat
66 fi
67 _ ' Time: %s. Size: %s B -> %s B. Save: %s KB.%s' \
68 "$(calc_time $1)" "$2" "$3" "$saving" "$cache_msg"
69 }
72 # Calculating different sizes
74 sizes() {
75 case $1 in
76 man) find $install/usr/share/man -type f -exec ls -l \{\} \; ;;
77 png) find $install -type f -name '*.png' -exec ls -l \{\} \; ;;
78 svg) find $install -type f -name '*.svg' -exec ls -l \{\} \; ;;
79 xml) find $install -type f \( -name '*.ui' -o -name '*.glade' \) -exec ls -l \{\} \; ;;
80 des) find $install -type f -name '*.desktop' -exec ls -l \{\} \; ;;
81 mo1) find $install -type f -name '*.mo' -exec ls -l \{\} \; ;;
82 loc) find $install/usr/share/i18n/locales -type f -exec ls -l \{\} \; ;;
83 mo2) find $fs/usr/share/locale -type f -name '*.mo' -exec ls -l \{\} \; ;;
84 gz) find $install -type f -name '*.gz' ! -path '*/share/man/*' -exec ls -l \{\} \; ;;
85 zip) find $install -type f -name '*.zip' -exec ls -l \{\} \; ;;
86 str) find $fs -type f \( -name '*.so*' -o -name '*.a' -o -name '*.pyc' -o -name '*.pyo' \
87 -o -name '.packlist' -o -name '*.pm' -o -name '*.pl' -o -name '*.pod' \) -exec ls -l \{\} \; ;;
88 esac | awk '{s+=$5}END{print s}'
89 }
92 # Query cache for already existing compressed file; substitute original file with the cached
93 # compressed one if so.
94 # $1: cache section (gz, mangz, png, etc.); $2: path to original file
96 query_cache() {
97 md5=$(md5sum "$2")
98 cachefile="$comp_cache_root/$1/${md5%% *}"
99 echo "$cachefile"
100 if [ -f "$cachefile" ]; then
101 ln -f "$cachefile" "$2"
102 echo '+' >> "$cache_stat"
103 else
104 echo '-' >> "$cache_stat"
105 false
106 fi
107 }
110 # Store compressed file to the cache
111 # $1: path to cache entry to be stored; $2: path to compressed file to be stored
113 store_cache() {
114 mkdir -p "${1%/*}"
115 mv "$2" "$1"
116 ln "$1" "$2"
117 }
120 # Function to compress all man pages
121 # Compressing can be disabled with COOKOPTS="!manz"
123 compress_manpages() {
124 time0=$(get_time)
125 [ "${COOKOPTS/!manz/}" != "$COOKOPTS" ] && return
126 manpath="$install/usr/share/man"
127 [ -d "$manpath" ] || return
128 size0=$(sizes man); [ -z "$size0" ] && return
130 tpi advancecomp-static
132 action 'Compressing man pages...'
134 # We'll use only Gzip compression, so decompress other formats first
135 find $manpath -type f -name '*.bz2' -exec bunzip2 \{\} \;
136 find $manpath -type f -name '*.xz' -exec unxz \{\} \;
138 # Fast compress with gzip
139 find $manpath -type f ! -name '*.gz' -exec gzip \{\} \;
141 # Fix symlinks
142 for i in $(find $manpath -type l); do
143 dest=$(readlink $i | sed 's|\.[gbx]z2*$||')
144 link=$(echo $i | sed 's|\.[gbx]z2*$||')
145 rm $i; ln -s $dest.gz $link.gz
146 done
148 # Recompress with advdef (it can't compress, only recompress)
149 IFS=$'\n'
150 for i in $(find $manpath -type f); do
151 if ! cached_path=$(query_cache mangz "$i"); then
152 advdef -z4q "$i"
153 store_cache "$cached_path" "$i"
154 fi
155 done
157 comp_summary "$time0" "$size0" "$(sizes man)"
158 }
161 # Function to recompress all gzip archives
162 # Recompressing can be disabled with COOKOPTS="!gz"
164 recompress_gz() {
165 time0=$(get_time)
166 [ "${COOKOPTS/!gz/}" != "$COOKOPTS" ] && return
167 size0=$(sizes gz); [ -z "$size0" ] && return
169 tpi advancecomp-static
171 action 'Recompressing gzip files...'
173 # Recompress with advdef
174 IFS=$'\n'
175 for i in $(find $install -type f -name '*.gz' ! -path '*/share/man/*'); do
176 if ! cached_path=$(query_cache gz "$i"); then
177 advdef -z4q "$i"
178 store_cache "$cached_path" "$i"
179 fi
180 done
182 comp_summary "$time0" "$size0" "$(sizes gz)"
183 }
186 # Function to recompress all zip archives
187 # Recompressing can be disabled with COOKOPTS="!zip"
189 recompress_zip() {
190 time0=$(get_time)
191 [ "${COOKOPTS/!zip/}" != "$COOKOPTS" ] && return
192 size0=$(sizes zip); [ -z "$size0" ] && return
194 tpi advancecomp-static
196 action 'Recompressing zip files...'
198 # Recompress with advzip
199 IFS=$'\n'
200 for i in $(find $install -type f -name '*.zip'); do
201 if ! cached_path=$(query_cache zip "$i"); then
202 advzip -z3qk "$i" # -4 is more than 2 orders slower
203 store_cache "$cached_path" "$i"
204 fi
205 done
207 comp_summary "$time0" "$size0" "$(sizes zip)"
208 }
211 # Function used after compile_rules() to compress all png images
212 # Compressing can be disabled with COOKOPTS="!pngz"
214 compress_png() {
215 time0=$(get_time)
216 [ "${COOKOPTS/!pngz/}" != "$COOKOPTS" ] && return
217 size0=$(sizes png); [ -z "$size0" ] && return
219 use_pq=true
220 use_op=true
221 [ "${COOKOPTS/!pngquant/}" != "$COOKOPTS" ] && use_pq=false
222 [ "${COOKOPTS/!optipng/}" != "$COOKOPTS" ] && use_op=false
223 $use_pq && tpi pngquant-static
224 $use_op && tpi optipng-static
226 action 'Compressing png images...'
228 oplevel=$(echo $COOKOPTS | grep 'op[0-8]' | sed 's|.*op\([0-8]\).*|\1|')
229 [ -z "$oplevel" ] && oplevel='2'
231 cache_section="png$oplevel"
232 $use_pq && cache_section="${cache_section}p"
233 $use_op && cache_section="${cache_section}o"
235 [ "$oplevel" == '8' ] && oplevel='7 -zm1-9'
237 IFS=$'\n'
238 for i in $(find $install -type f -name '*.png'); do
239 if ! cached_path=$(query_cache $cache_section "$i"); then
240 $use_pq && pngquant -f --skip-if-larger --ext .png --speed 1 "$i"
241 $use_op && optipng -quiet -strip all -o$oplevel "$i"
242 store_cache "$cached_path" "$i"
243 fi
244 done
246 comp_summary "$time0" "$size0" "$(sizes png)"
247 }
250 # Function used after compile_rules() to compress all svg images
251 # Compressing can be disabled with COOKOPTS="!svgz"
253 compress_svg() {
254 time0=$(get_time)
255 [ "${COOKOPTS/!svgz/}" != "$COOKOPTS" ] && return
256 size0=$(sizes svg); [ -z "$size0" ] && return
258 tpi svgcleaner
260 action 'Compressing svg images...'
262 cleaner_log="$(mktemp)"
263 IFS=$'\n'
264 for i in $(find $install -type f -name '*.svg'); do
265 echo -n "$i: " >> "$cleaner_log"
266 svgcleaner "$i" "$i" --remove-unresolved-classes false --quiet >> "$cleaner_log"
267 done
269 comp_summary "$time0" "$size0" "$(sizes svg)"
271 sed -i '/: $/d' "$cleaner_log"
272 if [ -s "$cleaner_log" ]; then
273 _ 'Cleaner warnings and errors:'
274 awk '{printf " %s\n", $0;}' "$cleaner_log"
275 echo
276 fi
277 rm "$cleaner_log"
278 }
281 # Function used after compile_rules() to shrink all *.ui and *.glade files:
282 # remove insignificant spaces and comments
283 # Compressing can be disabled with COOKOPTS="!uiz"
285 compress_ui() {
286 [ "${COOKOPTS/!uiz/}" != "$COOKOPTS" ] && return
287 [ -z "$(find $install -type f \( -name '*.ui' -o -name '*.glade' \) )" ] && return
289 tpi xmlstarlet
291 action 'Compressing ui files...'
293 size0=$(sizes xml)
294 time0=$(get_time)
295 temp_ui="$(mktemp)"
296 IFS=$'\n'
297 for ui in $(find $install -type f \( -name '*.ui' -o -name '*.glade' \) ); do
298 xmlstarlet c14n --without-comments "$ui" | xmlstarlet sel -B -t -c '*' > "$temp_ui"
299 cat "$temp_ui" > "$ui"
300 done
302 comp_summary "$time0" "$size0" "$(sizes xml)"
303 rm "$temp_ui"
304 }
307 # Get list of supported locales...
309 get_supported_locales() {
310 lpc='/slitaz-i18n/stuff/locale-pack.conf'
311 if [ -e "$WOK$lpc" ]; then
312 # ... from package in the local wok
313 . "$WOK$lpc"
314 else
315 # ... from Hg
316 temp_conf=$(mktemp)
317 wget -q -O $temp_conf -T 10 "http://hg.slitaz.org/wok/raw-file/tip$lpc"
318 if [ -s $temp_conf ]; then
319 . $temp_conf
320 else
321 # Give up and use hardcoded list
322 LOCALE_PACK="ar ca cs da de el en es fi fr hr hu id is it ja nb nl nn pl pt \
323 pt_BR ro ru sl sv tr uk zh_CN zh_TW"
324 fi
325 rm $temp_conf
326 fi
327 echo $LOCALE_PACK
328 }
331 # Fix common errors and warnings in the .desktop files
332 # Fixing can be disabled with COOKOPTS="!fixdesktops"
334 fix_desktop_files() {
335 [ "${COOKOPTS/!fixdesktops/}" != "$COOKOPTS" ] && return
336 deskpath="$install/usr/share/applications"
337 [ -d "$deskpath" ] || return
338 [ -z "$(find $deskpath -type f -name '*.desktop')" ] && return
340 size0=$(sizes des)
341 time0=$(get_time)
343 if [ -n "$QA" -a -z "$(which desktop-file-validate)" ]; then
344 tpi desktop-file-validate-static
345 fi
347 # The variable $LOCALE is set in cook.conf and may be overridden in the receipt.
348 # Default value is "" (empty). That means for us that we'll use the full
349 # list of supported locales here.
350 [ -z "$LOCALE" ] && LOCALE=$(get_supported_locales)
352 IFS=$'\n'
353 for desktop in $(find $deskpath -type f -name '*.desktop'); do
354 cp "$desktop" "$desktop.orig"
356 # Sort out .desktop file (is prerequisite to correct working of `fix-desktop-file`)
357 sdft "$desktop" -i
359 # Fix common errors in .desktop file
360 fix-desktop-file "$desktop"
362 # Strip unsupported locales from .desktop file
363 [ "${COOKOPTS/!i18nz/}" == "$COOKOPTS" ] &&
364 sdft "$desktop" -i -k "$LOCALE"
366 # Extra-strip
367 [ "${COOKOPTS/!extradesktops/}" == "$COOKOPTS" ] &&
368 sdft "$desktop" -i -g -x -tf -r 'Keywords*' -o
370 if [ -n "$QA" ]; then
371 # Check the rest of errors, warnings and tips
372 _ 'QA: Checking %s...' "$(basename $desktop)"
373 busybox diff "$desktop.orig" "$desktop"
374 desktop-file-validate "$desktop" | busybox fold -s
375 echo
376 fi
378 rm "$desktop.orig"
379 done
381 comp_summary "$time0" "$size0" "$(sizes des)"
382 }
385 # Normalize all *.mo files: unconditionally convert to UTF-8; remove strings that are not really necessary
386 # to the translation (msgid = msgstr)
387 # Normalization can be disabled with COOKOPTS="!monorm"
389 normalize_mo() {
390 [ "${COOKOPTS/!monorm/}" != "$COOKOPTS" ] && return
391 [ -z "$(find $install -type f -name '*.mo')" ] && return
393 # Gettext functions: msgunfmt, msguniq, msgconv, msgfmt
394 tpi gettext
395 # Gconv modules (convert to UTF-8)
396 tpi glibc-locale
398 action 'Normalizing mo files...'
400 size0=$(sizes mo1)
401 time0=$(get_time)
403 # Process all existing *.mo files
404 IFS=$'\n'
405 for mo in $(find "$install" -type f -name '*.mo'); do
406 tmpfile="$(mktemp)"
408 msgunfmt "$mo" | msguniq | msgconv -o "$tmpfile" -t 'UTF-8'
409 # add newline
410 echo >> "$tmpfile"
412 # get Plural-Forms
413 awk '
414 BEGIN { skip = ""; }
415 {
416 if (! skip) {
417 s = $0;
418 gsub(/^[^\"]*\"/, "", s);
419 gsub(/\"$/, "", s);
420 printf("%s", s);
421 }
422 if (! $0) skip = "yes";
423 }
424 ' "$tmpfile" | sed 's|\\n|\n|g' | grep "^Plural-Forms:" > "$tmpfile.pf"
426 if ! grep -q 'msgid_plural' "$tmpfile"; then
427 echo > "$tmpfile.pf"
428 fi
430 # main
431 awk -v pf="$(cat "$tmpfile.pf")" '
432 function clean() {
433 mode = msgctxt = msgid = msgid_plural = msgstr = msgstr0 = msgstr1 = msgstr2 = msgstr3 = msgstr4 = msgstr5 = "";
434 }
436 function getstring() {
437 # Skip unquoted words at the beginning (msgid, msgstr...) and get string from inside quotes
438 s = $0;
439 gsub(/^[^\"]*\"/, "", s);
440 gsub(/\"$/, "", s);
441 return s;
442 }
444 BEGIN {
445 printf("msgid \"\"\nmsgstr \"\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n");
446 if (pf)
447 printf("\"%s\\n\"\n", pf);
448 printf("\n");
449 skip = 1;
450 clean();
451 }
453 {
454 # Skip the entire header
455 if (!skip) {
456 if ($1 == "msgctxt" || $1 == "msgid" || $1 == "msgstr" || $1 == "msgid_plural")
457 mode = $1;
458 if ($1 == "msgstr[0]") mode = "msgstr0";
459 if ($1 == "msgstr[1]") mode = "msgstr1";
460 if ($1 == "msgstr[2]") mode = "msgstr2";
461 if ($1 == "msgstr[3]") mode = "msgstr3";
462 if ($1 == "msgstr[4]") mode = "msgstr4";
463 if ($1 == "msgstr[5]") mode = "msgstr5";
465 if (mode == "msgctxt") msgctxt = msgctxt getstring();
466 if (mode == "msgid") msgid = msgid getstring();
467 if (mode == "msgstr") msgstr = msgstr getstring();
468 if (mode == "msgid_plural") msgid_plural = msgid_plural getstring();
469 if (mode == "msgstr0") msgstr0 = msgstr0 getstring();
470 if (mode == "msgstr1") msgstr1 = msgstr1 getstring();
471 if (mode == "msgstr2") msgstr2 = msgstr2 getstring();
472 if (mode == "msgstr3") msgstr3 = msgstr3 getstring();
473 if (mode == "msgstr4") msgstr4 = msgstr4 getstring();
474 if (mode == "msgstr5") msgstr5 = msgstr5 getstring();
476 if (! $0) {
477 if (msgid != msgstr) {
478 if (msgctxt) printf("msgctxt \"%s\"\n", msgctxt);
479 printf("msgid \"%s\"\n", msgid);
480 if (msgid_plural) printf("msgid_plural \"%s\"\n", msgid_plural);
481 if (msgstr) printf("msgstr \"%s\"\n", msgstr);
482 if (msgstr0) printf("msgstr[0] \"%s\"\n", msgstr0);
483 if (msgstr1) printf("msgstr[1] \"%s\"\n", msgstr1);
484 if (msgstr2) printf("msgstr[2] \"%s\"\n", msgstr2);
485 if (msgstr3) printf("msgstr[3] \"%s\"\n", msgstr3);
486 if (msgstr4) printf("msgstr[4] \"%s\"\n", msgstr4);
487 if (msgstr5) printf("msgstr[5] \"%s\"\n", msgstr5);
488 printf("\n");
489 }
490 clean();
491 }
492 }
493 if ($0 == "") skip = "";
494 }
495 ' "$tmpfile" > "$tmpfile.awk"
497 msgfmt "$tmpfile.awk" -o "$tmpfile.mo"
499 if [ -s "$tmpfile.mo" ]; then
500 rm "$mo"; mv "$tmpfile.mo" "$mo"
501 else
502 _ 'Error processing %s' "$mo"
503 [ -e "$tmpfile.mo" ] && rm "$tmpfile.mo"
504 fi
506 # Clean
507 rm "$tmpfile" "$tmpfile.pf" "$tmpfile.awk"
508 done
510 comp_summary "$time0" "$size0" "$(sizes mo1)"
511 }
514 # Strip locale definitions: normalize whitespace and remove comments
515 # Stripping can be disabled with COOKOPTS="!locdef"
517 strip_locale_def() {
518 [ "${COOKOPTS/!locdef/}" != "$COOKOPTS" ] && return
519 [ ! -d "$install/usr/share/i18n/locales" ] && return
520 [ -z "$(find $install/usr/share/i18n/locales -type f)" ] && return
522 action 'Stripping locale definitions...'
523 size0=$(sizes loc)
524 time0=$(get_time)
526 for i in $(find $install/usr/share/i18n/locales -type f); do
527 sed -i 's| | |g; s| *| |g; s|^ ||; /^%/d' $i
528 done
530 comp_summary "$time0" "$size0" "$(sizes loc)"
531 }
534 # Find and strip: --strip-all (-s) or --strip-debug on static libs as well
535 # as removing unneeded files like in Python packages. Cross compiled binaries
536 # must be stripped with cross-tools aka $ARCH-slitaz-*-strip
537 # Stripping can be disabled with COOKOPTS="!strip"
539 strip_package() {
540 [ "${COOKOPTS/!strip/}" != "$COOKOPTS" ] && return
542 case "$ARCH" in
543 arm*|x86_64) export STRIP="$HOST_SYSTEM-strip" ;;
544 *) export STRIP='strip' ;;
545 esac
546 action 'Executing strip on all files...'
547 size0=0
548 size1=0
549 time0=$(get_time)
551 # Strip executable files
552 for dir in $fs/bin $fs/sbin $fs/usr/bin $fs/usr/sbin $fs/usr/games; do
553 if [ -d "$dir" ]; then
554 oldsize=$(find $dir -type f -exec ls -l '{}' \; | awk '{s+=$5}END{print s}')
555 find $dir -type f -exec $STRIP -s '{}' 2>/dev/null \;
556 newsize=$(find $dir -type f -exec ls -l '{}' \; | awk '{s+=$5}END{print s}')
557 size0=$((size0 + oldsize)); size1=$((size1 + newsize))
558 fi
559 done
561 oldsize=$(sizes str)
563 # Strip shared and static libraries
564 find $fs -name '*.so*' -exec $STRIP -s '{}' 2>/dev/null \;
565 find $fs -name '*.a' -exec $STRIP --strip-debug '{}' 2>/dev/null \;
567 # Remove Python *.pyc and *.pyo
568 find $fs -type f \( -name '*.pyc' -o -name '*.pyo' \) -delete 2>/dev/null
570 # Remove both with the empty subfolders:
571 # 1. Perl perllocal.pod and .packlist (unconditionally)
572 local perlfiles="$(find $fs -type f \( -name 'perllocal.pod' -o -name '.packlist' \))"
573 # 2. Perl *.pod (if not disabled)
574 [ "${COOKOPTS/!rmpod/}" == "$COOKOPTS" ] &&
575 perlfiles="$perlfiles $(find $fs -type f -name '*.pod')"
576 echo "$perlfiles" | xargs rm -f 2>/dev/null
577 echo "$perlfiles" | awk 'BEGIN{FS=OFS="/"}{$NF="";print}' | xargs rmdir -p 2>/dev/null
579 # Strip Perl files (*.pm and *.pl) from documentation inside (if not disabled)
580 [ "${COOKOPTS/!perlz/}" == "$COOKOPTS" ] &&
581 find $fs -type f \( -name '*.pm' -o -name '*.pl' \) -exec sed -i '/^=/,/^=cut/d' '{}' \;
583 newsize=$(sizes str)
585 comp_summary "$time0" "$((size0 + oldsize))" "$((size1 + newsize))"
586 }
589 # Strip unsupported locales (.mo files)
591 strip_mo_i18n() {
592 [ "${COOKOPTS/!i18nz/}" != "$COOKOPTS" ] && return
594 [ ! -d "$fs/usr/share/locale" ] && return
595 [ -z "$(find $fs/usr/share/locale -type f -name '*.mo')" ] && return
597 action 'Thin out translation files...'
598 size0=$(sizes mo2)
599 time0=$(get_time)
601 # The variable $LOCALE is set in cook.conf and may be overridden in the receipt.
602 # Default value is "" (empty). That means for us that we'll use the full
603 # list of supported locales here.
604 [ -z "$LOCALE" ] && LOCALE=$(get_supported_locales)
606 # Existing locales
607 elocales=" $(ls -1 "$fs/usr/share/locale" | tr '\n' ' ') "
609 # Thin out the list of existing locales. At the end there will be only locales that need
610 # deleting (and the garbage like '_AU', _US', '_BR' leaving from 'en_AU', 'en_US', 'pt_BR'...)
611 for keep_locale in $LOCALE; do
612 elocales=${elocales//$keep_locale}
613 done
615 # Remove the unsupported locales
616 for rem_locale in $elocales; do
617 [ -d "$fs/usr/share/locale/$rem_locale" ] &&
618 rm -r "$fs/usr/share/locale/$rem_locale"
619 done
621 comp_summary "$time0" "$size0" "$(sizes mo2)"
622 }
627 case $1 in
628 install)
629 # Compressors working in the $install
630 case "$ARCH" in
631 arm*) ;;
632 *)
633 recompress_gz
634 recompress_zip
635 compress_manpages
636 compress_png
637 compress_svg
638 compress_ui
639 ;;
640 esac
642 fix_desktop_files
643 normalize_mo
644 strip_locale_def
645 ;;
646 fs)
647 # Compressors working in the $fs
648 strip_package
649 strip_mo_i18n
650 ;;
651 esac
653 # Clean
654 rm "$cache_stat"
655 find $comp_cache_root -type f -links -2 -delete