File: make-source-tarball

package info (click to toggle)
android-platform-frameworks-base 21-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,836 kB
  • ctags: 9,265
  • sloc: cpp: 51,953; java: 19,224; ansic: 612; python: 571; yacc: 300; sh: 246; lex: 212; xml: 146; makefile: 70
file content (39 lines) | stat: -rwxr-xr-x 1,201 bytes parent folder | download
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
#!/bin/bash
# bash is needed for the timestamp feature in printf

if [ $# -ne 1 ]; then
    echo "Usage: $0 [branch-name]"
    exit 1
fi

set -e
set -x

version=`echo $1 | sed 's,^tools_r\([0-9][0-9.]*\),\1,'`
tardir=android-platform-frameworks-base_${version}
rsyncdir=../../android-platform-frameworks-base.upstream

cd $rsyncdir
git checkout $1
# standardize timezone to reduce build differences
export TZ=UTC
# get the timestamp from the current git commit
TIMESTAMP=`printf '%(%Y-%m-%d %H:%M:%S)T' $(git log -n1 --format=format:%at)`

cd ../android-platform-frameworks-base/debian
test -d $tardir || mkdir $tardir
rsync -axv --delete --delete-excluded \
    --cvs-exclude --exclude 'tools/preload/[0-9]*.compiled' \
    $rsyncdir/include \
    $rsyncdir/libs \
    $rsyncdir/tools \
    $tardir/

# do some tricks to make the process deterministic and reproducible
rm -f $tardir.orig.tar.gz
find $tardir -type f -print0 -o -type l -print0 \
	| sort --zero-terminated \
	| faketime -f "$TIMESTAMP" tar -z --no-recursion --null --files-from - \
	--owner=1000 --group=1000 --numeric-owner --format=gnu \
	--create --file ../../$tardir.orig.tar.gz
touch --date="$TIMESTAMP" ../../$tardir.orig.tar.gz