mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-28 18:46:18 +00:00
d/extra/prepare-commit-package.sh: Improve verbosity, specificity.
This commit is contained in:
parent
c0c3f22518
commit
757267a7a2
11
debian/extra/prepare-commit-package.sh
vendored
11
debian/extra/prepare-commit-package.sh
vendored
|
@ -1,5 +1,5 @@
|
|||
#!/bin/sh
|
||||
# Copyright 2020-2021, Ryan Pavlik <ryan@ryanpavlik.com>
|
||||
# Copyright 2020-2022, Ryan Pavlik <ryan@ryanpavlik.com>
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
# Packages produced this way are for automated use only and shouldn't be uploaded to the Debian archive.
|
||||
|
@ -12,21 +12,26 @@ set -e
|
|||
|
||||
if [ x"$1" != x ]; then
|
||||
COMMIT_TO_PACKAGE=$1
|
||||
echo "Package version will describe commit specified on command line: ${COMMIT_TO_PACKAGE}"
|
||||
export COMMIT_TO_PACKAGE
|
||||
else
|
||||
COMMIT_TO_PACKAGE=master
|
||||
COMMIT_TO_PACKAGE=main
|
||||
echo "Package version will describe default commit: ${COMMIT_TO_PACKAGE}"
|
||||
export COMMIT_TO_PACKAGE
|
||||
fi
|
||||
|
||||
if [ x"$2" != x ]; then
|
||||
PKG_REVISION=$2
|
||||
echo "Appending custom revision suffix specified on command line: ${PKG_REVISION}"
|
||||
export PKG_REVISION
|
||||
else
|
||||
PKG_REVISION=1~bpo11~ci$(date --utc "+%Y%m%d")
|
||||
echo "Appending auto-generated revision suffix: ${PKG_REVISION}"
|
||||
export PKG_REVISION
|
||||
fi
|
||||
|
||||
UPSTREAM_VER=$(git describe $COMMIT_TO_PACKAGE | sed -E -e 's/^v//' -e 's/-([0-9]+)-g([0-9a-f])/+git\1.\2/')
|
||||
UPSTREAM_VER=$(git describe --exclude "v0*" "$COMMIT_TO_PACKAGE" | sed -E -e 's/^v//' -e 's/-([0-9]+)-g([0-9a-f])/+git\1.\2/')
|
||||
echo "Computed package version ${UPSTREAM_VER}"
|
||||
git archive -o "../monado_${UPSTREAM_VER}.orig.tar.gz" ${COMMIT_TO_PACKAGE}
|
||||
dch --newversion "${UPSTREAM_VER}-${PKG_REVISION}" --preserve "Automated CI build of commit ${COMMIT_TO_PACKAGE}"
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue