tazpanel diff stripall.sh @ rev 565
hardware: show usb device name (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Jan 24 17:37:57 2016 +0100 (2016-01-24) |
parents | 694b20d6963c |
children |
line diff
1.1 --- a/stripall.sh Mon Dec 07 02:36:31 2015 +0200 1.2 +++ b/stripall.sh Sun Jan 24 17:37:57 2016 +0100 1.3 @@ -5,8 +5,6 @@ 1.4 1.5 1.6 substitute_icons() { 1.7 - grep -q 'data-icon="\|data-img"' $1 || return 1.8 - 1.9 # Customize sed script 1.10 cp "$sed_script" "$sed_script.do" 1.11 sed -i "s|@@@|$1|" "$sed_script.do" 1.12 @@ -44,8 +42,7 @@ 1.13 msg \n msgerr \n msgwarn \n msgup 1.14 msgtip \n vpn \n floppy \n folder " | \ 1.15 while read icon symbol; do 1.16 - echo -n "s|data-icon=\"$icon\"|data-icon=\"$symbol\"|g; " >> "$sed_script" 1.17 - echo -n "s|data-img=\"$icon\"|data-img=\"$symbol\"|g; " >> "$sed_script" 1.18 + echo -n "s|@$icon@|$symbol|g; " >> "$sed_script" 1.19 done 1.20 echo "' @@@" >> "$sed_script" 1.21 1.22 @@ -56,20 +53,33 @@ 1.23 for CGI in *.cgi tazpanel libtazpanel bootloader *.html; do 1.24 echo "Processing $CGI" 1.25 1.26 - mv $CGI $CGI.old 1.27 - # Copy initial comment (down to empty line) 1.28 - sed '1,/^$/!d' $CGI.old > $CGI 1.29 - # Remove initial tabs, other comments and empty lines 1.30 - sed 's|^[\t ]*||;/^#/d;/^$/d' $CGI.old >> $CGI 1.31 - rm $CGI.old 1.32 + case $CGI in 1.33 + tazpanel.*.html) 1.34 + # doc/tazpanel.*.html 1.35 + substitute_icons $CGI 1.36 + if [ -n "$(which tidy)" ]; then 1.37 + tidy -m -q -w 0 -utf8 --show-body-only y --quote-nbsp n $CGI 1.38 + else 1.39 + sed -i 's|[ ][ ]*| |g; s|^ ||' $CGI 1.40 + fi 1.41 + ;; 1.42 + *) 1.43 + mv $CGI $CGI.old 1.44 + # Copy initial comment (down to empty line) 1.45 + sed '1,/^$/!d' $CGI.old > $CGI 1.46 + # Remove initial tabs, other comments and empty lines 1.47 + sed 's|^[\t ]*||;/^#/d;/^$/d' $CGI.old >> $CGI 1.48 + rm $CGI.old 1.49 1.50 - substitute_icons $CGI 1.51 + substitute_icons $CGI 1.52 1.53 - sed -i 's|" *>|">|g' $CGI 1.54 - sed -i "s|' *)|')|g" $CGI 1.55 - sed -i 's| *;;|;;|g' $CGI 1.56 + sed -i 's|" *>|">|g' $CGI 1.57 + sed -i "s|' *)|')|g" $CGI 1.58 + sed -i 's| *;;|;;|g' $CGI 1.59 1.60 - chmod a+x $CGI 1.61 + chmod a+x $CGI 1.62 + ;; 1.63 + esac 1.64 1.65 done 1.66 1.67 @@ -96,6 +106,7 @@ 1.68 for JS in *.js; do 1.69 echo -en "\nProcessing $JS" 1.70 1.71 + substitute_icons $JS 1.72 sed -i 's|^[\t ]*||; /^$/d; /^\/\//d; /console\./d' $JS 1.73 1.74 # Try "jsmin"