cookutils view lib/libcook.sh @ rev 707

cookall.sh: skip broken packages
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Mar 04 10:58:57 2015 +0100 (2015-03-04)
parents 3ff0467577c7
children da66e6be1add
line source
1 #!/bin/sh
2 #
3 # Cook library - Shared configs and functions between cook, the cooker and
4 # cookiso. Read the README before adding or modifying any code in libcook.sh!
5 #
6 # Copyright (C) SliTaz GNU/Linux - GNU gpl v3
7 # Author: Christophe Lincoln <pankso@slitaz.org>
8 #
9 . /lib/libtaz.sh
10 . /usr/lib/slitaz/libpkg.sh
11 . /etc/slitaz/slitaz.conf
13 # System wide config can be overwritten by a cook.conf in current path.
14 [ -f "/etc/slitaz/cook.conf" ] && . /etc/slitaz/cook.conf
15 [ -f "cook.conf" ] && . ./cook.conf
17 # Shared DB between Cook, the Cooker and Cookiso.
18 # In cookiso: repo= --> flavors
19 if [ "$(basename $0)" = "cookiso" ]; then
20 cache="$CACHE/cookiso"
21 #cookiso variables
22 repo="$SLITAZ/flavors"
23 iso="$SLITAZ/iso"
24 rollog="$cache/rolling.log"
25 synclog="$cache/rsync.log"
26 else
27 cache="$CACHE"
28 fi
30 flavors="$SLITAZ/flavors"
31 activity="$cache/activity"
32 commits="$cache/commits"
33 cooklist="$cache/cooklist"
34 cookorder="$cache/cookorder"
35 command="$cache/command"
36 blocked="$cache/blocked"
37 broken="$cache/broken"
38 wokrev="$cache/wokrev"
39 cooknotes="$cache/cooknotes"
40 crontabs="/var/spool/cron/crontabs/root"
42 # Lograte activity.
43 [ -s "$activity" ] && tail -n 60 $activity > /tmp/tail-$$ && \
44 mv -f /tmp/tail-$$ $activity
46 # Log activities, we want first letter capitalized.
47 # TODO: use /lib/libtaz.sh log() but need to change all:
48 # echo "Message" | log --> log "Message"
49 log() {
50 grep ^[A-Z] | \
51 sed s"#^[A-Z]\([^']*\)#$(date '+%Y-%m-%d %H:%M') : \0#" >> $activity
52 }
54 # Log broken packages.
55 broken() {
56 if ! grep -q "^$pkg$" $broken; then
57 echo "$pkg" >> $broken
58 fi
59 }