#!/bin/sh
# $Id: Debian.sh 6716 2018-01-07 02:04:22Z flaterco $
# Build TCD file from SQL "source."
# (Deleted nonfree because no nonfree data are distributed anymore.)
if [ "$1" = "" ]; then
  echo "Build TCD file from SQL \"source.\""
  echo "Usage: Debian file-prefix"
  echo "(Do not include the .sql suffix)"
  echo "You'll get file-prefix-free.tcd."
  echo "PostgreSQL programs dropdb, createdb, and pgsql must be in PATH."
  exit 1
fi
dropdb harmbase2
createdb harmbase2
psql harmbase2 < "$1.sql"
"/pbulk/work/math/harmbase2/work/.destdir/usr/pkg/bin/hbexport" --optimize --free    "$1-free.tcd"
# "/pbulk/work/math/harmbase2/work/.destdir/usr/pkg/bin/hbexport" --optimize --nonfree "$1-nonfree.tcd"
