-
Notifications
You must be signed in to change notification settings - Fork 0
/
printversions.sh
executable file
·38 lines (32 loc) · 1011 Bytes
/
printversions.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# This script extracts the meta-information from all the packages.
# It is intended to be run manually when the packages are updated.
# Compute the untared size of a tarball
function UntaredSize
{
tar tvf $1 | (
let total=0
while read a b filesize remainder
do
let total+=$filesize
done
# Convert the size to the upper kilobyte
let total+=1023
let total/=1024
echo $total
)
}
# Main program
echo "# The following defines are generated by $0"
echo "# They must be manually copied/pasted into the NSIS source file."
echo "!define THIS_YEAR `date +%Y`"
echo "!define PRODUCT_VERSION `date +%Y%m%d`"
echo "!define PRODUCT_VERSION_DOTS 0.`date +%Y.%-m.%-d`"
for f in packages/*-bin-cygwin-*
do
set $(echo $f |sed -e 's:^[^/]*/\([^-]*\)-\(.*\)-bin-.*:\1 \2:')
package=$(echo $1 |tr '[:lower:]' '[:upper:]')
echo "!define ${package}_ARCHIVE $(basename $f)"
echo "!define ${package}_VERSION $2"
echo "!define ${package}_SIZE $(UntaredSize $f)"
done