File: upload-source-only-rebuild

package info (click to toggle)
pkg-perl-tools 0.82
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 796 kB
  • sloc: sh: 3,255; perl: 3,239; makefile: 142; python: 18
file content (56 lines) | stat: -rwxr-xr-x 1,476 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
# Copyright (©) 2021, Damyan Ivanov <dmn@debian.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of either:
#
# a) the GNU General Public License as published by the Free Software
#    Foundation; either version 1, or (at your option) any later
#    version, or
#
# b) the "Artistic License" which comes with Perl.


set -e -u

die() {
    echo "$@" >&2
    exit 1
}

`dpt shell-lib`

[ -n "${DEBEMAIL:-}" ] || die "DEBEMAIL not set. Who are you?"

while [ -n "${1:-}" ]; do
    dpt co "$1"
    LATEST_VER=$(dpkg-parsechangelog -SVersion)
    echo "$LATEST_VER" | grep -q -- '-1$' || die "Latest version '$LATEST_VER' is not a -1 version"
    FIRST_VER=$(dpkg-parsechangelog --reverse -SVersion)
    [ "$FIRST_VER" = "$LATEST_VER" ] || die "Package is uploaded more than once"

    UPLOADERS=$(perl -ne'if (/^Uploaders:/) {print; while(<>) { print, next if /^\s/; exit 0}}' debian/control)
    [ -n "$UPLOADERS" ] || die "Unable to determine Uploaders"
    if echo "$UPLOADERS" | grep -q "$DEBEMAIL"; then
        dch -i "No-changes source-only upload to enable testing migration"
    else
        dch -i "Team upload"
        dch -a "No-changes source-only upload to enable testing migration"
    fi

    dch -r ''

    # build the package
    sb

    dpkg-parsechangelog

    # upload to the archive. uses the result of the build command above
    upload-debian

    debcommit -a -r

    dpt push

    shift
done