# HG changeset patch # User Aleksej Bobylev # Date 1544022250 -7200 # Node ID 41c25139be4d8f3b2bded383ef73797103a286a9 # Parent 21a779d6f2387ca0c1870cde4949b9386ef4835d modules/postcheck: fix displaying the problems diff -r 21a779d6f238 -r 41c25139be4d lighttpd/cooker.css --- a/lighttpd/cooker.css Mon Dec 03 13:15:17 2018 +0200 +++ b/lighttpd/cooker.css Wed Dec 05 17:04:10 2018 +0200 @@ -394,6 +394,18 @@ padding: 0 0.8rem 0 0; vertical-align: middle; } + +.badge::before { + height: 16px; + display: inline-block; + padding: 0; +} +.button.badge { + height: 16px; + padding: 1px; + margin: unset; +} + .badge.bdbroken::before { content: url("data:image/svg+xml,"); } diff -r 21a779d6f238 -r 41c25139be4d lighttpd/index.cgi --- a/lighttpd/index.cgi Mon Dec 03 13:15:17 2018 +0200 +++ b/lighttpd/index.cgi Wed Dec 05 17:04:10 2018 +0200 @@ -1060,7 +1060,7 @@ list) p=$(echo $p | sed 's|]*>\([^<]*\)|\1|g') s=$(echo $s | sed 's|]*>\([^<]*\)|\1|g|') - echo "$p" + echo "$p" ;; *) echo -n "" @@ -1357,9 +1357,9 @@ $(toolchain_version glibc) -

Toolchain documentation: http://doc.slitaz.org/en:cookbook:toolchain -

+ diff -r 21a779d6f238 -r 41c25139be4d modules/postcheck --- a/modules/postcheck Mon Dec 03 13:15:17 2018 +0200 +++ b/modules/postcheck Wed Dec 05 17:04:10 2018 +0200 @@ -163,6 +163,7 @@ IFS=$'\n' bad_own="$(find $install -type f \( ! -user 0 -a ! -group 0 \))" + list=$(mktemp) if [ -n "$bad_own" ]; then if [ -e $overrides_exp ]; then # There may be mix of overridden and not-overridden ownership @@ -175,25 +176,33 @@ add 'ownover' else add 'own' - list="$list$(printf "\n %s:%s %s" "$(stat -c %u:%g "$i")" "${i#$install}")" + printf " %s:%s %s\n" "$(stat -c %u:%g "$i")" "${i#$install}" >>$list result='bad' fi done [ "$result" == '' ] # OK, all was overridden else + for i in $bad_own; do + printf " %s:%s %s\n" "$(stat -c %u:%g "$i")" "${i#$install}" >>$list + done add 'own' fi fi status unset IFS - [ -n "$list" ] && echo -e " Problems found:$list" + if [ -s "$list" ]; then + echo " Problems found:" + sort -k2 $list + fi + rm $list action "Checking permissions in ${install#$WOK/$1/}..." + IFS=$'\n' bad_files="$(find $install -type f \( ! -perm 644 -a ! -perm 755 \))" bad_dirs="$(find $install -type d ! -perm 755)" - list='' + list=$(mktemp) if [ -n "$bad_files$bad_dirs" ]; then if [ -e $overrides_exp ]; then # There may be mix of overridden and not-overridden permissions @@ -205,7 +214,7 @@ add 'permover' else add 'perm' - list="$list$(printf "\n %04d %s" "$(stat -c %a "$i")" "${i#$install}")" + printf " %04d %s\n" "$(stat -c %a "$i")" "${i#$install}" >>$list result='bad' fi done @@ -214,24 +223,47 @@ add 'permover' else add 'perm' - list="$list$(printf "\n %04d %s" "$(stat -c %a "$i")" "${i#$install}/")" + printf " %04d %s\n" "$(stat -c %a "$i")" "${i#$install}/" >>$list result='bad' fi done [ "$result" == '' ] # OK, all was overridden else + for i in $bad_files; do + printf " %04d %s\n" "$(stat -c %a "$i")" "${i#$install}" >>$list + done + for i in $bad_dirs; do + printf " %04d %s\n" "$(stat -c %a "$i")" "${i#$install}/" >>$list + done add 'perm' fi fi status - [ -n "$list" ] && echo -e " Problems found:$list" + unset IFS + if [ -s "$list" ]; then + echo " Problems found:" + sort -k2 $list + fi + rm $list action "Checking broken symlinks in ${install#$WOK/$1/}..." - bad_sl=$(find $install -type l ! -exec test -e '{}' \; -print) + + IFS=$'\n' + bad_sl="$(find $install -type l ! -exec test -e '{}' \; -print)" + result='' if [ -n "$bad_sl" ]; then add 'symlink' + result='bad' fi - status + [ "$result" == '' ]; status + + if [ "$result" == 'bad' ]; then + echo " Problems found:" + for i in $bad_sl; do + stat -c ' %N' + done + fi + unset IFS done if [ "$REPOLOGY" != '-' ]; then