Ubuntu Pastebin

Paste from smoser at Fri, 1 Dec 2017 17:39:55 +0000

Download as text
 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
#!/bin/sh

set -e
version=$(dpkg-parsechangelog --show-field Version)
tag=$(echo "ubuntu/$version" | tr '~' '_')
dtag="debian/${tag#*/}"
if git tag -l | grep -q "^$dtag$"; then
    git tag --delete "$dtag"
fi
if git tag -l | grep -q "^$tag$"; then
    curhash=$(git rev-parse HEAD)
    taghash=$(git rev-parse $tag)
    if [ "$curhash" != "$tag" ]; then
        echo "$tag already exists and is different than HEAD"
        exit 1
    fi
fi
dsc="../out/cloud-init_${version}.dsc"
changes="${dsc%.dsc}_source.changes"

build-package
sbuild-it "$changes"
git tag "$tag"
dput ubuntu "$changes" ||
    { r=$?; git tag --delete "$tag"; exit $r; }
git push upstream HEAD "$tag"
Download as text