#!/bin/bash

if [ ! -f $1 ]  ; then
	echo "no such file $1 ..."
	exit -1
fi

pri=`grep scripts/packages $1 | cut -d ' ' -f 3`
stages=`egrep "^[x,o,z] " $1 | cut -f 1`
ver=`grep "^[xoz] " $1 | tr -s '\t' | cut -f3`
dfiles=`egrep -v '^[x,o,z] ' $1 | grep -v "\-\-\-\-"`

print_dfiles ()
{
	while [ "$1" ]; do
                y=$1
                shift 
                echo "[D] 0 $y $1"
		shift
        done
}

echo 
echo "[V] $ver"
echo "[P] $stages $pri"
if [ "$dfiles" ] ; then
	print_dfiles $dfiles
fi
