Add new tarball generation script.

The old script depended on svn. An earlier version of this script has already
been used in the 3.11. branch.

Change-Id: Id03abb8f7bd005ede343243194c4453f0b2e8943
This commit is contained in:
Dominik Riebeling 2012-04-12 21:14:11 +02:00
parent e9d5f6cb61
commit 2aae745458
2 changed files with 30 additions and 34 deletions

View file

@ -1,34 +0,0 @@
#!/bin/sh
version="3.0"
srcdir=.
tempdir=rockbox-temp
outfile=rockbox-$version.7z
# remove previous leftovers
rm -rf $tempdir
cd $srcdir
# create the dir name based on revision number
rbdir=$tempdir/rockbox-$version
# create new temp dir
mkdir -p $rbdir
# copy everything to the temp dir
svn ls -R | xargs -Imoo cp --parents moo $rbdir 2>/dev/null
cd $tempdir
rm -f $outfile
# 7zip the entire directory
7zr a $outfile rockbox*
# world readable please
chmod a+r $outfile
# remove temporary files
rm -rf $tempdir

30
utils/common/tarball.py Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/python
import gitscraper
import os
import sys
if len(sys.argv) < 2:
print "Usage: %s <version|hash>" % sys.argv[0]
sys.exit()
repository = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + "/../..")
if '.' in sys.argv[1]:
version = sys.argv[1]
basename = "rockbox-" + version
ref = "refs/tags/v" + version + "-final"
refs = gitscraper.get_refs(repository)
if ref in refs:
tree = refs[ref]
else:
print "Could not find hash for version!"
sys.exit()
else:
tree = sys.argv[1]
basename = "rockbox-" + tree
gitscraper.archive_files(repository, tree, [], basename, archive="7z")
print "done."