[SCM] live-studio branch, master, updated. be51da814fb12d25dce46a7f078a46f5c89bd777
Chris Lamb
lamby at debian.org
Fri Jul 30 02:52:37 UTC 2010
The following commit has been merged in the master branch:
commit 516a34b3d9f33959ba0382588773673009a679bf
Author: Chris Lamb <lamby at debian.org>
Date: Thu Jul 29 19:08:42 2010 -0400
Inline for the time being.
Signed-off-by: Chris Lamb <lamby at debian.org>
diff --git a/live_studio/build/management/commands/queue_runner.py b/live_studio/build/management/commands/queue_runner.py
index 8605543..4eaff8c 100644
--- a/live_studio/build/management/commands/queue_runner.py
+++ b/live_studio/build/management/commands/queue_runner.py
@@ -45,7 +45,26 @@ class Command(NoArgsCommand):
self.log.info("Building #%d in %s", build.pk, tempdir)
try:
- filename = self.handle_build(build, tempdir, target_dir, logfile)
+ os.chdir(tempdir)
+
+ call(logfile, ('lh', 'config') + build.config.options())
+ open('binary.iso', 'w').write('iso here') #call(logfile, ('lh', 'build'))
+
+ # Find file that was created
+ filename = None
+ for extension in ('iso', 'img'):
+ if not os.path.exists('binary.%s' % extension):
+ continue
+
+ filename = '%s.%s' % (build.ident, extension)
+ os.rename(
+ 'binary.%s' % extension,
+ os.path.join(target_dir, filename),
+ )
+
+ break
+
+ assert filename, "Did not create any image"
update(
finished=datetime.datetime.utcnow(),
@@ -58,7 +77,10 @@ class Command(NoArgsCommand):
self.log.exception("#%d failed", build.pk)
continue
finally:
- self.clean(tempdir, logfile)
+ os.chdir(tempdir)
+ call(logfile, ('lh', 'clean', '--purge'))
+ shutil.rmtree(tempdir)
+
self.log.info("Finished processing #%d", build.pk)
except IndexError:
@@ -67,28 +89,3 @@ class Command(NoArgsCommand):
time.sleep(2)
except KeyboardInterrupt:
sys.exit(1)
-
- def handle_build(self, build, tempdir, target_dir, logfile):
- os.chdir(tempdir)
-
- call(logfile, ('lh', 'config') + build.config.options())
- open('binary.iso', 'w').write('iso here') #call(logfile, ('lh', 'build'))
-
- for extension in ('iso', 'img'):
- if not os.path.exists('binary.%s' % extension):
- continue
-
- filename = '%s.%s' % (build.ident, extension)
- os.rename(
- 'binary.%s' % extension,
- os.path.join(target_dir, filename),
- )
-
- return filename
-
- assert False, "Did not create any image"
-
- def clean(self, tempdir, logfile):
- os.chdir(tempdir)
- call(logfile, ('lh', 'clean', '--purge'))
- shutil.rmtree(tempdir)
--
live-studio
More information about the debian-live-changes
mailing list