File: pristine-orig

package info (click to toggle)
pkg-perl-tools 0.85
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 796 kB
  • sloc: perl: 3,254; sh: 3,244; makefile: 144; python: 18
file content (68 lines) | stat: -rwxr-xr-x 1,574 bytes parent folder | download | duplicates (5)
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
#!/bin/sh
# documentation at the end
set -e
set -u

PKG=`dpkg-parsechangelog --show-field Source`
VER=`dpkg-parsechangelog --show-field Version | sed 's,^[0-9]\+:,,; s,-[^-]\+$,,'`

if [ -f /etc/devscripts.conf ]; then
    . /etc/devscripts.conf
fi

if [ -f ~/.devscripts ]; then
    . ~/.devscripts
fi

ORIG_DIR=${USCAN_DESTDIR:-..}

GOT_ONE=
for c in gz bz2 xz; do
    if pristine-tar checkout ${ORIG_DIR}/${PKG}_${VER}.orig.tar.$c 2>/dev/null; then
        GOT_ONE=$c
        break
    fi
done

if [ -z "$GOT_ONE" ]; then
    # repeat, with error reporting enabled
    for c in gz bz2 xz; do
        pristine-tar checkout ${ORIG_DIR}/${PKG}_${VER}.orig.tar.$c
    done
else
    echo ${ORIG_DIR}/${PKG}_${VER}.orig.tar.$GOT_ONE ready
fi

exit 0

POD=<<EOF
=head1 NAME

pristine-orig -- acquire upstream source of the current package version

=head1 SYNOPSIS

 pristine-orig

=head1 DESCRIPTION

B<pristine-orig> checks the current package name via F<debian/control>
and the current package version from F<debian/changelog> and calls
L<pristine-tar(1)> with the right file name so that you get a pristine
upstream source tarball ready.

It tries gzip, bzip2 and xz compression suffices.

The tarball is placed in the C<USCAN_DESTDIR> directory (configured via
L<devscripts.conf(5)>, see L<uscan(1)>), or in the parent directory if no
C<USCAN_DESTDIR> is configured.

=head1 COPYRIGHT AND LICENSE

Copyright (c) 2011, 2017 Damyan Ivanov <dmn@debian.org>

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=cut
EOF