#!/bin/sh
# Automate common management tasks.

# Update repositories
if [ ! -d /var/lib/tazpkg/installed/mercurial ]; then
	tazpkg get-install mercurial
fi
tazwok update-wok
. /etc/slitaz/slitaz.conf
. /etc/slitaz/tazwok.conf
LOCAL_REPOSITORY="$SLITAZ_DIR/${undigest:-$SLITAZ_VERSION}"
cd $LOCAL_REPOSITORY/flavors
if [ ! -d .hg ]; then
	[ "$SLITAZ_VERSION" == "cooking" ] && hg clone http://hg.slitaz.org/flavors .
	[ "$SLITAZ_VERSION" == "stable" ] && hg clone http://hg.slitaz.org/flavors-stable .
else
	hg pull -u
fi
clean-chroot

tazwok cook-commit --missing
tazwok check-incoming
