[Fedora-livecd-list] [PATCH] check for valid script path before editing livecd image and update usage options confusion

Joey Boggs jboggs at redhat.com
Tue Feb 14 02:40:56 UTC 2012


---
 tools/edit-livecd |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/tools/edit-livecd b/tools/edit-livecd
index 72ec059..0df2fa8 100755
--- a/tools/edit-livecd
+++ b/tools/edit-livecd
@@ -543,17 +543,17 @@ class LiveImageEditor(LiveImageCreator):
 def parse_options(args):
     parser = optparse.OptionParser(usage = """
        %prog [-n=<name>]
-                      [-o=<output>]
-                      [-k=<kickstart-file>]
-                      [-s=<script.sh>]
-                      [-t=<tmpdir>]
-                      [-e=<excludes>]
-                      [-f=<exclude-file>]
-                      [-i=<includes>]
-                      [-r=<releasefile>]
-                      [-b=<builder>]
+                      [-o <output>]
+                      [-k <kickstart-file>]
+                      [-s <script.sh>]
+                      [-t <tmpdir>]
+                      [-e <excludes>]
+                      [-f <exclude-file>]
+                      [-i <includes>]
+                      [-r <releasefile>]
+                      [-b <builder>]
                       [--clone]
-                      [-c=<compress_type>]
+                      [-c <compress_type>]
                       [--skip-compression]
                       [--skip-minimize]
                       <LIVEIMG.src>""")
@@ -690,6 +690,10 @@ def main():
             editor.ks = read_kickstart(options.kscfg)
             # part / --size <new rootfs size to be resized to>
             editor._LoopImageCreator__image_size = kickstart.get_image_size(editor.ks)
+        if options.script:
+            if not os.path.exists(options.script):
+                print "Invalid Script Path '%s'" % options.script
+                return 1
         editor.mount(LiveOS, cachedir = None)
         editor._configure_bootloader(editor._LiveImageCreatorBase__isodir)
         if editor.ks:
-- 
1.7.7.6



More information about the livecd mailing list