Skip to content

Commit f89a172

Browse files
authored
more robust version calculation in Debian snapshot builds (#1343)
1 parent 4b9da57 commit f89a172

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

debian/build_snapshot.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ if [ ! -x /usr/bin/gbp ]; then
5757
exit 1
5858
fi
5959

60-
changelog_package=$(dpkg-parsechangelog | sed -n 's/^Source: //p')
60+
changelog_package=$(dpkg-parsechangelog -SSource)
6161
if [ "${package}" != "${changelog_package}" ]; then
6262
echo "This script is configured to create snapshots for ${package} but you are trying to create a snapshot for ${changelog_package}"
6363
exit 1
6464
fi
6565

66-
bare_upstream_version=$(sed -E 's/([^-]+).*/\1/' VERSION_CURRENT)
66+
bare_upstream_version=$(dpkg-parsechangelog -SVersion | sed -r 's/-[^-]+$//')
6767
echo "Found bare upstream version: ${bare_upstream_version}"
6868
snapshot_version="${bare_upstream_version}-0+$(date +%Y%m%d)+git$(git rev-parse --short HEAD)"
6969
echo "Upstream snapshot version: ${snapshot_version}"

0 commit comments

Comments
 (0)