website view scripts/get-latest.sh @ rev 681

en: add review from Linux Journal
author Christophe Lincoln <pankso@slitaz.org>
date Sun Nov 07 16:40:24 2010 +0100 (2010-11-07)
parents c55af5fe90ab
children a25d8f788c09
line source
1 #!/bin/sh
2 #
3 # Get latest commits and packages to display on the website main page.
4 # On Tank, this script is executed by cron each hour.
5 #
7 REPO="/home/slitaz/repos/wok"
8 URL="http://hg.slitaz.org/wok"
9 PKGS="/home/slitaz/cooking/packages"
10 OUTPUT="/var/cache/slitaz/website/latest.html"
12 mkdir -p /var/cache/slitaz/website
14 # Latest Hg commits
15 echo -n "Getting latest commits... "
16 echo '<h2><font color="#DF8F06">Latest commits</font></h2>' > $OUTPUT
17 echo "<ul>" >> $OUTPUT
18 hg log --repository $REPO --limit 5 --no-merges \
19 --template " <li><strong>{date|shortdate}</strong> \
20 - <a href=\"$URL/rev/{rev}\">{desc}</a></li>\n" >> $OUTPUT 2> /dev/null
21 echo "</ul>" >> $OUTPUT
22 echo "Done"
24 # Latest cooked packages by the build bot.
25 echo -n "Getting latest cooked packages... "
26 echo '<h2><font color="#DF8F06">Latest cooked packages</font></h2>' >> $OUTPUT
27 echo "<ul>" >> $OUTPUT
28 cd $PKGS && ls -1t *.tazpkg | head -5 | \
29 while read file
30 do
31 echo -n ' <li><strong>'$(stat -c '%y' $PKGS/$file | \
32 cut -d '.' -f 1); echo "</strong> - $file</li>"
33 done >> $OUTPUT
34 echo "</ul>" >> $OUTPUT
35 echo "Done"