# v-prep                                    -*- shell-script -*-
#
# Copyright (C) 2013 Thien-Thi Nguyen
#
# This file is part of xdgdirs.
#
# xdgdirs is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# xgdirs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with xdgdirs.  If not, see <http://www.gnu.org/licenses/>.

barf ()
{
    echo >&2 "$1"
    exit 1
}

basename=`basename $0`

die ()
{
    barf "${basename}: $1"
}

exp=$basename.expected
got=$basename.actually
doubt=$basename.diff

chkseq ()
{
    ./xdgdirs --sequence PKG "$@" > $got 2>&1 \
        || die "xdgdirs failed"
    diff -u $exp $got > $doubt 2>&1
    test -s $doubt \
        && die "chkseq: discrepency (see $doubt)"
    rm -f $exp $got $doubt
}

# v-prep ends here
