cookutils rev 938
Tiny edits.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue Jun 20 03:52:01 2017 +0300 (2017-06-20) |
parents | 60126d568f3d |
children | 9c470f60d0d0 |
files | cook lighttpd/cooker.css lighttpd/index.cgi modules/deps |
line diff
1.1 --- a/cook Mon Jun 19 19:00:28 2017 +0100 1.2 +++ b/cook Tue Jun 20 03:52:01 2017 +0300 1.3 @@ -543,14 +543,18 @@ 1.4 patchit() { 1.5 [ -f "$stuff/patches/series" ] || return 1.6 1.7 + IFS=$'\n' 1.8 while read i; do 1.9 - [ -f "$src/done.$i" ] && continue 1.10 + patchname=$(echo $i | cut -d' ' -f1) # allow comments (anything after the space) 1.11 + [ -n "$patchname" ] || continue # allow empty lines 1.12 + [ -f "$src/done.$patchname" ] && continue # already applied (useful with `cook --continue`) 1.13 newline 1.14 - _ 'Applying patch %s' "$i" 1.15 - patch -p1 -i $stuff/patches/$i | sed 's|^| |' 1.16 - touch $src/done.$i 1.17 + _ 'Applying patch %s' "$patchname" 1.18 + patch -Np1 -i $stuff/patches/$patchname | sed 's|^| |' 1.19 + touch $src/done.$patchname 1.20 done < $stuff/patches/series 1.21 newline 1.22 + unset IFS 1.23 } 1.24 1.25
2.1 --- a/lighttpd/cooker.css Mon Jun 19 19:00:28 2017 +0100 2.2 +++ b/lighttpd/cooker.css Tue Jun 20 03:52:01 2017 +0300 2.3 @@ -337,8 +337,8 @@ 2.4 .summary th, .summary td { white-space: nowrap; width: 1rem; text-align: center; } 2.5 .summary th:last-child, .summary td:last-child { width: unset; } 2.6 2.7 -.webstat td { text-align: center; } 2.8 -.webstat td:first-child { text-align: unset; } 2.9 +.webstat td { text-align: center; width: 16%; } 2.10 +.webstat td:first-child { text-align: unset; width: unset; } 2.11 2.12 div.list td, div.list th { padding: 5px 2px; } 2.13
3.1 --- a/lighttpd/index.cgi Mon Jun 19 19:00:28 2017 +0100 3.2 +++ b/lighttpd/index.cgi Tue Jun 20 03:52:01 2017 +0300 3.3 @@ -487,7 +487,7 @@ 3.4 -e 's#^.*[Nn]o such file.*#<b>\0</b>#' \ 3.5 -e 's#^.*No package .* found.*#<b>\0</b>#' \ 3.6 -e 's#^.*Unable to find.*#<b>\0</b>#' \ 3.7 - -e 's#^.*[Ii]nvalid.*#<b>\0</b>#' \ 3.8 + -e 's#[^a-zA-Z-][Ii]nvalid.*#<b>\0</b>#' \ 3.9 -e 's#\([Nn][Oo][Tt] found\.*\)$#<b>\1</b>#' \ 3.10 -e 's#\(found\.*\)$#<i>\1</i>#' \ 3.11 \ 3.12 @@ -591,8 +591,11 @@ 3.13 } 3.14 function row2(line, rowNum) { 3.15 split(line, s, " : "); 3.16 - if (rowNum == 1) 3.17 + if (rowNum == 1) { 3.18 + print "<thead>"; 3.19 printf("\t<tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>\n", s[1], s[2], s[3], s[4], s[5]); 3.20 + print "</thead><tbody>"; 3.21 + } 3.22 else 3.23 printf("\t<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", s[1], s[2], s[3], s[4], s[5]); 3.24 } 3.25 @@ -601,12 +604,12 @@ 3.26 if ($0 ~ "===") { seen++; if (seen == 1) next; else exit; } 3.27 if ($0 ~ "---") { 3.28 seen2++; 3.29 - if (seen2 == 1) printf("</table>\n<table class=\"pkgslist\">\n") 3.30 + if (seen2 == 1) print "</table>\n\n<table class=\"pkgslist\">" 3.31 next 3.32 } 3.33 if (seen2) row2($0, seen2); else row($0); 3.34 } 3.35 - END { print "</table></section>" } 3.36 + END { print "</tbody></table></section>" } 3.37 ' 3.38 elif fgrep -q "Debug information" $log; then 3.39 echo -e '<section>\n<h3>Debug information</h3>' 3.40 @@ -739,6 +742,10 @@ 3.41 # There is no need to recalculate the statistics every time the page is displayed. 3.42 3.43 update_webstat() { 3.44 + echo '<div id="waitme">' 3.45 + show_note i 'Please wait while statistics are being collected.' 3.46 + echo "</div>" 3.47 + 3.48 # for receipts: 3.49 rtotal=$(ls $WOK/*/arch.$ARCH | wc -l) 3.50 rcooked=$(ls -d $WOK/*/taz | wc -l) 3.51 @@ -763,6 +770,8 @@ 3.52 rtotal="$rtotal"; rcooked="$rcooked"; runbuilt="$runbuilt"; rblocked="$rblocked"; rbroken="$rbroken" 3.53 ptotal="$ptotal"; pcooked="$pcooked"; punbuilt="$punbuilt"; pblocked="$pblocked"; pbroken="$pbroken" 3.54 EOT 3.55 + 3.56 + echo '<script>document.getElementById("waitme").remove();</script>' 3.57 } 3.58 3.59 3.60 @@ -790,10 +799,10 @@ 3.61 done 3.62 3.63 if [ -n "$(GET broken)" ]; then 3.64 - echo '<div id="content2">' 3.65 + echo '<section id="content2">' 3.66 echo "<h2>DB: broken - Packages: $(wc -l < $broken)</h2>" 3.67 sort $CACHE/broken | sed "s|^[^']*|<a href='$base/\0'>\0</a>|g" | mktable 3.68 - echo '</div>' 3.69 + echo '</section>' 3.70 fi 3.71 3.72 case "$QUERY_STRING" in
4.1 --- a/modules/deps Mon Jun 19 19:00:28 2017 +0100 4.2 +++ b/modules/deps Tue Jun 20 03:52:01 2017 +0300 4.3 @@ -23,23 +23,33 @@ 4.4 # * mirror files list has been updated 4.5 # * local files list has been updated 4.6 4.7 -if [ ! -s $fl -o $fl_mirrorz -nt $fl -o $fl_local -nt $fl ]; then 4.8 - # unpack mirror files list 4.9 - fl_mirror="$(mktemp)" 4.10 - lzcat $fl_mirrorz > $fl_mirror 4.11 +case $(hostname) in 4.12 + # Do we need to use mirror files list? 4.13 + # It useful on casual development on local host, but useless on cooker server 4.14 + # (and slow down list creation a lot). 4.15 + tank) 4.16 + if [ ! -s $fl -o $fl_mirrorz -nt $fl -o $fl_local -nt $fl ]; then 4.17 + # unpack mirror files list 4.18 + fl_mirror="$(mktemp)" 4.19 + lzcat $fl_mirrorz > $fl_mirror 4.20 4.21 - # remove packages that exist in local list 4.22 - cut -d: -f1 $fl_local | uniq | \ 4.23 - while read package; do 4.24 - sed -i "/^$package: /d" $fl_mirror 4.25 - done 4.26 + # remove packages that exist in local list 4.27 + cut -d: -f1 $fl_local | uniq | \ 4.28 + while read package; do 4.29 + sed -i "/^$package: /d" $fl_mirror 4.30 + done 4.31 4.32 - # combine lists 4.33 - cat $fl_mirror $fl_local > $fl 4.34 + # combine lists 4.35 + cat $fl_mirror $fl_local > $fl 4.36 4.37 - # clean 4.38 - rm $fl_mirror 4.39 -fi 4.40 + # clean 4.41 + rm $fl_mirror 4.42 + fi 4.43 + ;; 4.44 + *) 4.45 + [ ! -s $fl -o $fl_local -nt $fl ] && cp $fl_local $fl 4.46 + ;; 4.47 +esac 4.48 4.49 # recreate "database with *.so files" in the cases: 4.50 # * if absent 4.51 @@ -171,8 +181,12 @@ 4.52 # Requires: glib-2.0 gobject-2.0 4.53 # Requires.private: gmodule-no-export-2.0 4.54 # Requires: gobject-2.0,gio-2.0 4.55 + # Requires.private: nspr >= 4.9.2 4.56 pcs=$(grep '^Requires' $1 | cut -d: -f2 | tr ',' ' ' | tr '\n' ' ') 4.57 for i in $pcs; do 4.58 + isitlib=$(echo $i | tr -d '<=>0-9.') 4.59 + # if it contains only comparisons, numbers, dot - it is not lib, skip 4.60 + [ -n "$isitlib" ] || continue 4.61 indb "$i.pc" $db_pc 4.62 done 4.63 # Syntax examples: