# HG changeset patch # User Aleksej Bobylev # Date 1484186692 -7200 # Node ID 5f6be706ab4f3a096cec76b3b44f31ac0eba926f # Parent fd06b19f712bdccb95cbbbb899991e307bfdcd9a cook, modules/compressor: implement tazpkg --cookmode; cooker.cgi: info2html(): pagination, syntax_highlighter(): distinguish local/cached installed packages (vital for the system update). diff -r fd06b19f712b -r 5f6be706ab4f cook --- a/cook Wed Jan 11 11:58:53 2017 +0200 +++ b/cook Thu Jan 12 04:04:52 2017 +0200 @@ -677,15 +677,15 @@ # Install local packages: package-version$arch cd $PKGS for i in $(uniq $CACHE/installed.local); do - _ 'Installing dep (pkg/local): %s' "$i" - tazpkg install $i --root=$root --local --quiet + # _ 'Installing dep (pkg/local): %s' "$i" + tazpkg install $i --root=$root --local --quiet --cookmode done # Install web or cached packages (if mirror is set to $PKGS we only # use local packages). for i in $(uniq $CACHE/installed.web); do - _ 'Installing dep (web/cache): %s' "$i" - tazpkg get-install $i --root=$root --quiet + # _ 'Installing dep (web/cache): %s' "$i" + tazpkg get-install $i --root=$root --quiet --cookmode done update_installed_cook_diff diff -r fd06b19f712b -r 5f6be706ab4f modules/compressor --- a/modules/compressor Wed Jan 11 11:58:53 2017 +0200 +++ b/modules/compressor Thu Jan 12 04:04:52 2017 +0200 @@ -66,6 +66,8 @@ [ -d "$manpath" ] || return size0=$(sizes man); [ -z "$size0" ] && return + tazpkg -gi advancecomp --quiet --cookmode + action 'Compressing man pages...' # We'll use only Gzip compression, so decompress other formats first @@ -83,7 +85,6 @@ done # Recompress with advdef (it can't compress, only recompress) - tazpkg -gi advancecomp --quiet for i in $(find $install/usr/share/man -type f); do advdef -z4q $i done @@ -100,15 +101,14 @@ [ "${COOKOPTS/!pngz/}" != "$COOKOPTS" ] && return size0=$(sizes png); [ -z "$size0" ] && return - action 'Compressing png images...' - use_pq=true use_op=true [ "${COOKOPTS/!pngquant/}" != "$COOKOPTS" ] && use_pq=false [ "${COOKOPTS/!optipng/}" != "$COOKOPTS" ] && use_op=false + $use_pq && tazpkg -gi pngquant --quiet --cookmode + $use_op && tazpkg -gi optipng --quiet --cookmode - $use_pq && tazpkg -gi pngquant --quiet - $use_op && tazpkg -gi optipng --quiet + action 'Compressing png images...' oplevel=$(echo $COOKOPTS | grep 'op[0-8]' | sed 's|.*op\([0-8]\).*|\1|') [ -z "$oplevel" ] && oplevel='2' @@ -131,9 +131,10 @@ [ "${COOKOPTS/!svgz/}" != "$COOKOPTS" ] && return size0=$(sizes svg); [ -z "$size0" ] && return + tazpkg -gi svgcleaner --quiet --cookmode + action 'Compressing svg images...' - tazpkg -gi svgcleaner --quiet cleaner_log="$(mktemp)" for i in $(find $install -type f -name '*.svg'); do echo -n "$i: " >> "$cleaner_log" @@ -160,10 +161,12 @@ [ "${COOKOPTS/!uiz/}" != "$COOKOPTS" ] && return [ -z "$(find $install -type f \( -name '*.ui' -o -name '*.glade' \) )" ] && return + tazpkg -gi xmlstarlet --quiet --cookmode + action 'Compressing ui files...' + size0=$(sizes xml) time0=$(date +%s) - tazpkg -gi xmlstarlet --quiet temp_ui="$(mktemp)" for ui in $(find $install -type f \( -name '*.ui' -o -name '*.glade' \) ); do xmlstarlet c14n --without-comments "$ui" | xmlstarlet sel -B -t -c '*' > "$temp_ui" @@ -210,7 +213,7 @@ time0=$(date +%s) if [ -n "$QA" -a -z "$(which desktop-file-validate)" ]; then - tazpkg -gi desktop-file-utils-extra --quiet + tazpkg -gi desktop-file-utils-extra --quiet --cookmode fi # The variable $LOCALE is set in cook.conf and may be overridden in the receipt. @@ -258,15 +261,16 @@ [ "${COOKOPTS/!monorm/}" != "$COOKOPTS" ] && return [ -z "$(find $install -type f -name '*.mo')" ] && return + # Gettext functions: msgunfmt, msguniq, msgconv, msgfmt + tazpkg -gi gettext --quiet --cookmode + # Gconv modules (convert to UTF-8) + tazpkg -gi glibc-locale --quiet --cookmode + action 'Normalizing mo files...' + size0=$(sizes mo1) time0=$(date +%s) - # Gettext functions: msgunfmt, msguniq, msgconv, msgfmt - tazpkg -gi gettext --quiet - # Gconv modules (convert to UTF-8) - tazpkg -gi glibc-locale --quiet - # Process all existing *.mo files for mo in $(find "$install" -type f -name '*.mo'); do tmpfile="$(mktemp)" diff -r fd06b19f712b -r 5f6be706ab4f web/cooker.cgi --- a/web/cooker.cgi Wed Jan 11 11:58:53 2017 +0200 +++ b/web/cooker.cgi Thu Jan 12 04:04:52 2017 +0200 @@ -138,7 +138,8 @@ -e '/^Tag Table:$/,/^End Tag Table$/d' \ -e '/INFO-DIR/,/^END-INFO-DIR/d' \ -e "s|https*://[^>),'\"\` ]*|&|g" \ - -e "s|ftp://[^>),\"\` ]*|&|g" + -e "s|ftp://[^>),\"\` ]*|&|g" \ + -e "s|^|
|"
 }
 
 
@@ -164,6 +165,9 @@
 				-e 's#\( \[N[ym/]\?\] y\)$# \1#g' \
 				-e 's#(NEW) $#(NEW) #g' \
 				\
+				-e 's#.*(pkg/local).*#\0#g' \
+				-e 's#.*(web/cache).*#\0#g' \
+				\
 				-e 's#error$#error#g' \
 				-e 's#ERROR:#ERROR:#g' \
 				-e 's#Error#Error#g' \