slitaz-dev-tools rev 140
rolling.sh: htmlize logs
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Jan 09 13:33:32 2012 +0100 (2012-01-09) |
parents | 63cee71bb097 |
children | dd373f91a950 |
files | mirror-tools/rootfs/usr/bin/rolling.sh |
line diff
1.1 --- a/mirror-tools/rootfs/usr/bin/rolling.sh Mon Jan 09 13:16:22 2012 +0100 1.2 +++ b/mirror-tools/rootfs/usr/bin/rolling.sh Mon Jan 09 13:33:32 2012 +0100 1.3 @@ -9,9 +9,20 @@ 1.4 # We use the last build as build environment 1.5 system=$rolling/slitaz-core.iso 1.6 1.7 +htmlize() 1.8 +{ 1.9 +echo -e "<html>\n<body>\n<pre>" 1.10 +dos2unix | sed -e 's|\(Filesystem size:\).*G\([0-9\.]*M\) *$|\1 \2|' \ 1.11 + -e 's|.\[1m|<b>|' -e 's|.\[0m|</b>|' -e 's|.\[[0-9Gm;]*||g' \ 1.12 + -e ':a;s/^\(.\{1,68\}\)\(\[ [A-Za-z]* \]\)/\1 \2/;ta' \ 1.13 + -e 's#\[ OK \]#[ <span style="color: green">OK</span> ]#' \ 1.14 + -e 's#\[ Failed \]#[ <span style="color: red">Failed</span> ]#' 1.15 +echo -e "</pre>\n</body>\n</html>" 1.16 +} 1.17 + 1.18 # Build the rolling release if something is new on mirror 1.19 for flavor in $flavors ; do 1.20 - if [ ! -s $rolling/slitaz-$flavor.iso \ 1.21 + if [ ! -s $rolling/slitaz-$flavor.iso -o \ 1.22 $packages/$flavor.flavor -nt $rolling/slitaz-$flavor.iso -o \ 1.23 $packages/packages.list -nt $rolling/slitaz-$flavor.iso ]; then 1.24 [ -d $rolling ] || mkdir -p $rolling 1.25 @@ -34,9 +45,13 @@ 1.26 cat > $TMP/fs/root/build.sh <<EOT 1.27 #!/bin/sh 1.28 1.29 +echo "# date" 1.30 date 1.31 +echo "# tazlito get-flavor $flavor" 1.32 tazlito get-flavor $flavor 1.33 +echo "# yes '' | tazlito gen-distro" 1.34 yes '' | tazlito gen-distro 1.35 +echo "# date" 1.36 date 1.37 EOT 1.38 cat > $TMP/fs/BUILD <<EOT 1.39 @@ -51,7 +66,7 @@ 1.40 done 1.41 mount --bind /tmp \$DIR/tmp || mount -t tmpfs tmpfs \$DIR/tmp 1.42 fi 1.43 -script -c "SHELL=/bin/sh chroot \$DIR /bin/sh -x /root/build.sh" $TMP/slitaz-$flavor.log 1.44 +script -c "SHELL=/bin/sh chroot \$DIR /bin/sh /root/build.sh" $TMP/slitaz-$flavor.log 1.45 umount \$DIR/tmp 1.46 for i in \$MOUNTS; do 1.47 umount \$DIR/\$i 1.48 @@ -64,9 +79,11 @@ 1.49 umount $TMP/fs/var/cache/tazpkg/cooking/packages 1.50 mv -f $TMP/fs/home/slitaz/cooking/distro/slitaz-$flavor.* $rolling/ 1.51 mv -f $TMP/slitaz-$flavor.log $rolling/ 1.52 + htmlize < $rolling/slitaz-$flavor.log > $rolling/slitaz-$flavor.log.html 1.53 rm -rf $TMP 1.54 fi 1.55 - rsync --bwlimit=40 -vtP -e 'ssh -i /home/bellard/.ssh/id_rsa' \ 1.56 - $rolling/slitaz-$flavor.* \ 1.57 + export DROPBEAR_PASSWORD=none 1.58 + SSH="dbclient -p 222 -i /home/bellard/.ssh/id_rsa.dropbear" 1.59 + rsync --bwlimit=40 -vtP -e "$SSH" $rolling/slitaz-$flavor.* \ 1.60 bellard@mirror.slitaz.org:/var/www/slitaz/mirror/iso/rolling 1.61 done