#!/bin/sh
#

wok=/home/slitaz/wok
pkgs=/home/slitaz/packages

case "$1" in
	-e)
		# Extract all pkgs.
		mkdir -p tmp && cd tmp
		for pkg in $pkgs/*.tazpkg
		do
			pkg=$(basename ${pkg%.tazpkg})
			tazpkg extract $pkgs/$pkg.tazpkg
			. $pkg/receipt
			if [ ! -d "$wok/$PACKAGE/taz" ]; then
				mkdir -p $wok/$PACKAGE/taz
				mv $pkg $wok/$PACKAGE/taz
			fi
		done ;;
	-c)
		for pkg in $(ls $wok)
		do
			[ -d "$wok/$pkg/taz" ] || \
				echo "Missing: $pkg taz"
		done ;;
esac
exit 0
