1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
#!/bin/sh
# copyright, licensing and documentation at the end
set -e
set -u
usage() {
perl -MPod::Usage=pod2usage -e"pod2usage(-input => '$0', -verbose=>99, -sections=>[qw(SYNOPSIS DESCRIPTION COMMANDS)])"
exit 1
}
[ -n "${1:-}" ] || usage
[ -z "${2:-}" ] || usage
if [ -z "${DPT_PACKAGES}" ]; then
echo "Required configuration variable DPT_PACKAGES is not set" >&2
echo "See dpt-config(5)" >&2
exit 1
fi
if [ -d ${DPT_PACKAGES}/"$1" ]; then
echo "Package '$1' is in ${DPT_PACKAGES}/$1"
else
echo "Package '$1' not found in ${DPT_PACKAGES}" >&2
exit 1
fi
exit 0
POD=<<'EOF'
=head1 NAME
dpt-cd - change to package's working directory
=head1 SYNOPSIS
B<dpt cd> I<package-name>
=head1 DESCRIPTION
B<dpt cd> puts you in the working copy for the packaging of a given package.
It does not try to update the checkout, nor create it if it does not exist. Use
L<dpt-checkout(1)> for that.
It is a shortcut for when you know that the given checkout is up to date or
when you are offline.
=head1 CAVEATS
Programs cannot change the working directory of the shell. In order to achieve
this you should integrate B<dpt> with your shell. See L<dpt-shell-lib(1)> for
instructions.
=head1 CONFIGURATION
B<dpt checkout> requires the C<DPT_PACKAGES> environment variable.
See L<dpt-config(5)> for details.
=head1 COPYRIGHT & LICENSE
Copyright 2013 Damyan Ivanov L<dmn@debian.org>
This program is free software, licensed under the same terms as perl.
=cut
EOF
|