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