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.
16 lines
521 B
16 lines
521 B
#!/bin/bash
|
|
# compose: no-hooks
|
|
|
|
upstream_version="$1"
|
|
version="${upstream_version/./}"
|
|
read -r year_month major minor patch <<< ${version//./ }
|
|
if ! [ "${#patch}" == 1 ]; then
|
|
echo "Error: build number is not a single digit: '${patch}' (upstream: '${upstream_version}')" >&2
|
|
exit 1
|
|
fi
|
|
if [ "${#major}" -gt 2 ]; then
|
|
echo "Error: major number is more than 2 digits: '${major}' (upstream: '${upstream_version}')" >&2
|
|
exit 1
|
|
fi
|
|
major=$(printf "%02d" ${major})
|
|
echo "${year_month}${major}.${minor}.${patch}"
|