#!/bin/sh

# Copyright (C) 2000  James Troup <james@nocrew.org>

# This program 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 2 of the License, or
# (at your option) any later version.

# This program 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 this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

set -e

TMPDIR=$HOME/xx_keyring_tmp_dir
ARCHIVE=/org/ftp.debian.org/ftp/
KEYRING_LOC=$ARCHIVE/doc/

test -f /org/keyring.debian.org/keyrings/debian-keyring.pgp || exit 1

rm -fr $TMPDIR
mkdir $TMPDIR
cp -ia /org/keyring.debian.org $TMPDIR/debian-keyring
pushd $TMPDIR/debian-keyring >/dev/null
# compat to placify the freaking queueds
mv -i keyrings/* .
rmdir keyrings
rm -fr keyrings-new keyserver apache.conf keyserver.conf
pushd .. > /dev/null
tar czf debian-keyring.tar.gz debian-keyring
rm -fr debian-keyring
install -m 664 -o troup -g debadmin debian-keyring.tar.gz $KEYRING_LOC/
for i in 1 2; do popd .. > /dev/null; done
rm -fr $TMPDIR
echo "Keyring tarball in doc/ update complete."
