#!/bin/sh

# Author: Ross Gammon <rossgammon@mail.dk>
#
# autopkgtest check: Tests that gramps can import the sample gedcom file and
# export it in the .gpkg format, and then import the example gramps database
# and export it in gedcom format.

set -e

echo "Retrieving sample gedcom"
cp /usr/share/doc/gramps/example/gedcom/sample.ged.gz .
echo "Unzipping sample gedcom"
gunzip sample.ged.gz
echo "Importing gedcom into gramps and exporting a gramps .gpkg file"
gramps -i sample.ged -e sample.gpkg

echo "Retrieving example gramps file"
cp /usr/share/doc/gramps/example/gramps/example.gramps.gz .
echo "Unzipping example gramps file"
gunzip example.gramps.gz
echo "Importing gramps file into gramps and exporting a gedcom"
gramps -i example.gramps -e example.ged

echo "gramps-import-export: OK"
