File: create_release_archives.sh

package info (click to toggle)
allegro5 2%3A5.2.10.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 10,820 kB
  • sloc: ansic: 109,795; cpp: 12,976; objc: 4,592; java: 2,845; python: 2,595; javascript: 1,238; sh: 1,008; makefile: 40; xml: 27; pascal: 24
file content (50 lines) | stat: -rwxr-xr-x 891 bytes parent folder | download | duplicates (7)
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
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
set -e

ver=$1

if [ -z "$ver" ]
then
    echo "Please pass a version."
    exit 1
fi

if git show $ver -- 2>&1 | grep -q 'fatal'
then
    echo "$ver is not a valid revision."
    exit 1
fi

export LC_ALL=en_US

repo=$PWD
tmpdir=$( mktemp -d )

git archive --format=tar --prefix=allegro/ ${ver} | ( cd $tmpdir && tar xf - )

( cd "$tmpdir/allegro"
    for file in $( find -type f -printf '%P\n' )
    do
        echo $file
        commit=$( cd $repo && git rev-list ${ver} "$file" | head -n 1 )
        mtime=$( cd $repo && git show --pretty=format:%ai $commit | head -n 1)
        touch -d "$mtime" "$file"
    done
)

( cd "$tmpdir/allegro"
    ./misc/zipup.sh allegro-$ver.zip
    mv .dist/*.* ..
)

(cd "$tmpdir"
    rm -rf allegro
    unzip allegro-$ver.zip
    ./allegro/misc/mkunixdists.sh allegro-$ver.zip
)

mv "$tmpdir"/*.* ./

rm -rf -- "$tmpdir"

echo "Done and done!"