You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jenkins-debian-glue/scripts/jdg-increase-version-number

37 lines
1.3 KiB

#!/bin/bash
if [ "$#" -lt 1 ] ; then
echo "Usage: $0 <version_number>" >&2
exit 1
fi
# This script nowadays (that's why it exists as such simple and
# short script at all) just appends "+0" to the specified
# <version_number> on the command line.
#
# This turned out to be the most reliable way to get:
#
# $existing_old_version < $snapshot_version < $new_version
#
# where $existing_old_version is the provided <version_number>,
# $snapshot_version is a version number based on the output of
# the script (as used inside scripts like
# jdg-generate-{git,svn}-snapshot) and $new_version is a version
# number that might show up in the future.
#
# NOTE: The author of jenkins-debian-glue is aware of only one
# exception where this isn't true with +0 appended for $snapshot.
# This would be the case when e.g. version 1.2.3 would be changed
# to 1.2.3-1. But this would mean a change in Debian packaging as
# well (from Debian package source being identical to the
# pristine source (AKA native package) vs. upstream software
# packaged within Debian (AKA non-native package)). In such a
# situation the $existing_old_version should be raised from e.g.
# 1.2.3 to at least 1.2.3.1-1, otherwise the generated
# $snapshot_version will be older than $existing_old_version
# until it's 1.2.4, 1.3, etc.
echo "${1}+0"
# vim:foldmethod=marker ts=2 ft=sh ai expandtab sw=2