Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@marcopg.org>2008-11-28 14:47:57 (GMT)
committer Marco Pesenti Gritti <marco@marcopg.org>2008-11-28 14:47:57 (GMT)
commitc6c285b09530669719576064446e68d7b63e9bb9 (patch)
treed26545ccb9c5f3730ad5812096911098edb86d86 /build
Initial commit
Diffstat (limited to 'build')
-rwxr-xr-xbuild44
1 files changed, 44 insertions, 0 deletions
diff --git a/build b/build
new file mode 100755
index 0000000..aec1b9c
--- /dev/null
+++ b/build
@@ -0,0 +1,44 @@
+#!/usr/bin/python
+
+import logging
+import os
+import sys
+
+import imgcreate
+
+base_dir = os.path.dirname(__file__)
+images_dir = os.path.join(base_dir, 'images')
+cache_dir = os.path.join(base_dir, 'cache')
+last_file = os.path.join(images_dir, 'last')
+
+def main():
+ if not os.path.exists(images_dir):
+ os.mkdir(images_dir)
+
+ try:
+ last = open(last_file).read()
+ version = int(last) + 1
+ except IOError:
+ version = 1
+
+ ks = imgcreate.read_kickstart(os.path.join(base_dir, 'soas.ks'))
+ creator = imgcreate.LiveImageCreator(ks, 'soas-1', 'Sugar')
+
+ try:
+ creator.mount(cachedir=cache_dir)
+ creator.install()
+ creator.configure()
+ creator.unmount()
+ creator.package(destdir=images_dir)
+ except imgcreate.CreatorError, e:
+ logging.error("Error creating Live CD : %s" % e)
+ return 1
+ finally:
+ creator.cleanup()
+
+ open(last_file, 'w').write(str(version))
+
+ return 0
+
+if __name__ == "__main__":
+ sys.exit(main())