cookutils rev 964
lighttpd/index.cgi: display unpackaged empty folders under "files" sub-section.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Sep 01 14:14:53 2017 +0300 (2017-09-01) |
parents | 96304f0412ca |
children | 3d56fc04b0e1 |
files | lighttpd/index.cgi |
line diff
1.1 --- a/lighttpd/index.cgi Fri Sep 01 01:34:10 2017 +0300 1.2 +++ b/lighttpd/index.cgi Fri Sep 01 14:14:53 2017 +0300 1.3 @@ -1153,6 +1153,7 @@ 1.4 echo "<section><h3>Quick jump:</h3><ul>" 1.5 echo "$split" | sed 'p' | xargs printf "<li><a href='#%s'>%s</a></li>\n" 1.6 echo "<li id='li-repeats' style='display:none'><a href='#repeats'>repeatedly packaged files</a></li>" 1.7 + echo "<li id='li-empty' style='display:none'><a href='#empty'>unpackaged empty folders</a></li>" 1.8 echo "<li id='li-orphans' style='display:none'><a href='#orphans'>unpackaged files</a>" 1.9 echo "<span id='orphansTypes'></span></li>" 1.10 echo "</ul></section>" 1.11 @@ -1195,6 +1196,33 @@ 1.12 echo "</pre></section>" 1.13 fi 1.14 1.15 + # find unpackaged empty folders 1.16 + emptydirs="$( 1.17 + cd $wok/$main/install 1.18 + find -type d | sed 's|\.||' | \ 1.19 + while read d; do 1.20 + [ -z "$(ls "$wok/$main/install$d")" ] || continue 1.21 + echo $d 1.22 + done | \ 1.23 + while read d; do 1.24 + notfound='yes' 1.25 + for p in $(cd $wok/$main/taz; ls); do 1.26 + if [ -d "$wok/$main/taz/$p/fs$d" ]; then 1.27 + notfound='' 1.28 + break 1.29 + fi 1.30 + done 1.31 + [ -n "$notfound" ] && 1.32 + ls -ldp --color=always .$d | syntax_highlighter files | sed 's|>\./|>/|' 1.33 + done 1.34 + )" 1.35 + if [ -n "$emptydirs" ]; then 1.36 + echo '<script>document.getElementById("li-empty").style.display = "list-item"</script>' 1.37 + echo -n '<section><h3 id="empty">Unpackaged empty folders:</h3><pre class="files">' 1.38 + echo "$emptydirs" 1.39 + echo "</pre></section>" 1.40 + fi 1.41 + 1.42 # find unpackaged files 1.43 all_files=$(mktemp) 1.44 cd $wok/$main/install; find ! -type d | sed 's|\.||' > $all_files