#!/bin/sh
#
# This simple script wrapper proceses an upload with reprepro with the right
# configuration location and with GnuPG pointed at the appropriate keyring.
#
# Written by Russ Allbery <eagle@eyrie.org>
#
# The authors hereby relinquish any claim to any copyright that they may have
# in this work, whether granted under contract or by operation of law or
# international treaty, and hereby commit to the public, at large, that they
# shall not, at any time in the future, seek to enforce any copyright in this
# work against any person or entity, or prevent any person or entity from
# copying, publishing, distributing or creating derivative works of this
# work.

set -e
GNUPGHOME=/srv/debian/keyring; export GNUPGHOME
reprepro -b /srv/debian processincoming default
reprepro -b /srv/debian pull
exit 0

# Documentation.  Use a hack to hide this from the shell.  Because of the
# above exit line, this should never be executed.
DOCS=<<__END_OF_DOCS__

=for stopwords
Allbery dput keyring reprepro

=head1 NAME

reprepro-upload - Process an upload to a reprepro repository

=head1 SYNOPSIS

B<reprepro-upload>

=head1 DESCRIPTION

Small wrapper around B<reprepro> that processes a new upload, using
B</srv/debian> as the base directory and configures an appropriate GnuPG
keyring.  Calls C<processincoming default> followed by C<pull>.

This is meant to be run as a B<dput> C<post_upload_command> setting via B<ssh>
after uploading files.

=head1 SEE ALSO

dput(1), reprepro(1), ssh(1)

=head1 AUTHOR

Russ Allbery <eagle@eyrie.org>

=cut

__END_OF_DOCS__
