File: amalgamation_version.sh

package info (click to toggle)
xerial-sqlite-jdbc 3.50.3.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,284 kB
  • sloc: java: 18,781; sh: 2,890; ansic: 2,830; xml: 463; makefile: 199
file content (23 lines) | stat: -rwxr-xr-x 595 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash
# Used to generate the version for the amalgamation download zip.
# https://www.sqlite.org/download.html#encoding
# The version is encoded so that filenames sort in order of increasing version number when viewed using "ls".
# For version 3.X.Y the filename encoding is 3XXYY00. For branch version 3.X.Y.Z, the encoding is 3XXYYZZ.
version=""
i=0
export IFS="."
for num in $1; do
	if [ $i -gt 0 ]; then
		if [ $num -le 9 ]; then
			eval num=0$num
		fi
	fi
	eval version=$version$num
	let i+=1
done
unset IFS
if [ $i -gt 3 ]; then
  echo "$version"
else
  echo "$version"00
fi