#!/bin/bash

# This program is part of the tbackup package,
# (c) 1993,1994,1995,1998 Koen Holtman.
#
# The tbackup package is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free Software Foundation.
# No warranty. See the GNU General Public License for more details.


export bupbin=/usr/lib/tbackup/bin
export bupdir=/usr/lib/tbackup
export PATH=$bupbin\:$PATH
export ttytitle=list

source tinit

#get method names and parameters

source getlistpars

source makelogtty

source handlepars

echo
echo "List in progress..."
echo

# make named pipe

mkfifo -m 700 archive

# execute list.

# readmethod is supposed to interact with the user.

# listmethod should start a background task that deletes the pipe
# `archive' when finished.
# This method should do no i/o on the user tty.

cd /tmp/tbup
source $listmethod\.lx
cd /tmp/tbup
source $readmethod\.rx

# wait for `archive' to disappear.
while [ -e archive ]; do sleep 1; done

#finalise methods
#what such methods would want to do is beyond me, we put it in for symmetry.

if [ -f $bupbin/$readmethod\.rf ]; then
 cd /tmp/tbup
 source $readmethod\.rf
fi
if [ -f $bupbin/$listmethod\.lf ]; then
 cd /tmp/tbup
 source $listmethod\.lf
fi

source texit
