summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2008-05-29 13:14:34 +0200
committerGuillaume Seguin <guillaume@segu.in>2008-05-29 13:14:34 +0200
commit5c5c3c09b3838a523eb6aff4a9be16bf67583794 (patch)
tree07295e40d305ab3e118da0e42acd23f039ea1b6f
parent3278a7434591864349a7e2d7d5514d1c5597b787 (diff)
downloadfusion-releasekit-5c5c3c09b3838a523eb6aff4a9be16bf67583794.tar.gz
fusion-releasekit-5c5c3c09b3838a523eb6aff4a9be16bf67583794.tar.bz2
* More updates, improve testing system and such
-rwxr-xr-xrelease.py55
1 files changed, 36 insertions, 19 deletions
diff --git a/release.py b/release.py
index 4cf338a..84664b0 100755
--- a/release.py
+++ b/release.py
@@ -1,5 +1,7 @@
#!/usr/bin/python
+# TODO: Add compiz fetcher for fully automatic test environment setup
+
import sys
import os
import glob
@@ -77,29 +79,37 @@ def run_error2 (command, return_stdout = False):
run_error (command, "%s failed" % command, return_stdout)
def add_suffix (filename, suffix):
- if not suffix:
- return filename
- else:
+ if suffix:
known_exts = [".tar.gz", ".tar.bz2"]
for ext in known_exts:
if filename[-len (ext):] == ext:
return filename[:-len (ext)] + suffix + ext
+ return filename
+
+def remove_suffix (filename, suffix):
+ if suffix:
+ known_exts = [".tar.gz", ".tar.bz2"]
+ for ext in known_exts:
+ if filename[-len (ext):] == ext:
+ return filename[:-len (ext) - len (suffix)] + ext
+ return filename
def has_suffix (filename, suffix):
- if not suffix:
- return True
- else:
+ if suffix:
known_exts = [".tar.gz", ".tar.bz2"]
for ext in known_exts:
if filename[-len (ext):] == ext:
return filename[:-len (ext)][-len (suffix):] == suffix
+ return True
def is_bz2 (filename):
- return filename[-4] == ".bz2"
+ return filename[-4:] == ".bz2"
def fix_env ():
TESTS_PREFIX = os.path.abspath ("tests-%s/root" % TODAY)
- os.environ["PKG_CONFIG_PATH"] = "%s:%s" % (TESTS_PREFIX,
+ tests_paths = "%s/lib/pkgconfig:%s/share/pkgconfig" % (TESTS_PREFIX,
+ TESTS_PREFIX)
+ os.environ["PKG_CONFIG_PATH"] = "%s:%s" % (tests_paths,
config.pkgconfigpath)
def make_tarballs_dir ():
@@ -179,6 +189,13 @@ def tarballize (path):
else:
tarballs = []
for suffix in tarballizer:
+ base_string = "Release %s with suffix \"%s\" ? (y or n) "
+ if not ALL_MODE:
+ print >>sys.stderr, bold (base_string % (name,
+ suffix)),
+ if raw_input () in NOES:
+ print info ("Skipping \"%s\" suffix" % suffix)
+ continue
tarballs += tarballizer[suffix] (path, suffix)
return tarballs
else:
@@ -230,12 +247,12 @@ def tarballize_cmake (path, suffix = None):
os.chdir ("build")
run_error2 ("cmake ../")
run_error2 ("make package_source")
- tarballs = glob.glob ("dist/*.tar.gz")
+ tarballs = glob.glob ("*.tar.gz")
ret_tarballs = []
for file in tarballs:
run_error2 ("cp %s %s.bak" % (file, file))
run_error2 ("gunzip %s" % file)
- run_error2 ("bzip2 %s" % file)
+ run_error2 ("bzip2 %s" % file[:-3])
run_error2 ("mv %s.bak %s" % (file, file))
filename = os.path.basename (file)
suffixed = add_suffix (filename, suffix)
@@ -284,8 +301,8 @@ def unpack (file):
run_error ("tar %s %s" % (flags, path), "failed to unpack tarball")
-def test_default (file):
- name = file.rsplit (".", 2)[0]
+def test_default (file, suffix = None):
+ name = remove_suffix (file, suffix).rsplit (".", 2)[0]
os.chdir (TESTS_PATH)
unpack (file)
@@ -297,8 +314,8 @@ def test_default (file):
os.chdir (CURDIR)
-def test_distutils (file):
- name = file.rsplit (".", 2)[0]
+def test_distutils (file, suffix = None):
+ name = remove_suffix (file, suffix).rsplit (".", 2)[0]
os.chdir (TESTS_PATH)
unpack (file)
@@ -309,8 +326,8 @@ def test_distutils (file):
os.chdir (CURDIR)
-def test_cmake (file):
- name = file.rsplit (".", 2)[0]
+def test_cmake (file, suffix = None):
+ name = remove_suffix (file, suffix).rsplit (".", 2)[0]
os.chdir (TESTS_PATH)
unpack (file)
@@ -373,12 +390,12 @@ def release (component):
continue
if has_suffix (tarball, suffix):
found = True
- tester[suffix] (tarball)
+ tester[suffix] (tarball, suffix)
break
if not found and "" in tester:
- tester[""] (tarball)
+ tester[""] (tarball, "")
else:
- test_default (tarballs)
+ test_default (tarball, "")
print success ("Successfully tested %s" % tarball)
def sum_and_sign ():