[PATCH] new pungi command line options

Paul B Schroeder paul.schroeder at bluecoat.com
Thu Oct 16 19:08:52 UTC 2008


In my kickstart config, the %include files are all generated in %pre and don't exist at compose time, thus "--ignore-missing-includes".  And I have no repo lines defined in my ks.cfg either, so the --repo-* options allow you to specify or add repo info from the command line.

 --repo-baseurl=REPO BASEURL
                       repository name and base URL to use
 --repo-mirrorlist=REPO MIRRORLIST
                       repository name and mirrorlist URL to use
 --ignore-missing-includes
                       ignore missing %include files in the kickstart config

So you can do something like this:
pungi --name=fedora --ver=10 --flavor=beta --nodebuginfo --nosplitmedia --nosource -c ks.cfg --ignore-missing-includes --repo-mirrorlist=rawhide "http://mirrors.fedoraproject.org/mirrorlist?repo=rawhide&arch=x86_64"

Cheers...Paul...


diff --git a/src/bin/pungi.py b/src/bin/pungi.py
index fbec6fd..703fc0a 100755
--- a/src/bin/pungi.py
+++ b/src/bin/pungi.py
@@ -43,7 +43,7 @@ def main():
             pass
 
     # Set up the kickstart parser and pass in the kickstart file we were handed
-    ksparser = pykickstart.parser.KickstartParser(pykickstart.version.makeVersion())
+    ksparser = pykickstart.parser.KickstartParser(pykickstart.version.makeVersion(), missingIncludeIsFatal=opts.ignore_missing_includes)
     ksparser.readKickstart(opts.config)
 
     if opts.sourceisos:
@@ -78,6 +78,15 @@ def main():
     if opts.nodebuginfo:
         config.set('default', 'debuginfo', "False")
 
+    if opts.repo_baseurl:
+        for repo in opts.repo_baseurl:
+            rd = ksparser.handler.RepoData(name=repo[0], baseurl=repo[1])
+            ksparser.handler.repo.add(rd)
+    if opts.repo_mirrorlist:
+        for repo in opts.repo_mirrorlist:
+            rd = ksparser.handler.RepoData(name=repo[0], mirrorlist=repo[1])
+            ksparser.handler.repo.add(rd)
+
     # Actually do work.
     mypungi = pypungi.Pungi(config, ksparser)
 
@@ -166,6 +175,12 @@ if __name__ == '__main__':
 
         parser.add_option("-c", "--config", dest="config",
           help='Path to kickstart config file')
+        parser.add_option("--repo-baseurl", action="append", dest="repo_baseurl", type="string", nargs=2,
+          metavar="REPO BASEURL", help='repository name and base URL to use')
+        parser.add_option("--repo-mirrorlist", action="append", dest="repo_mirrorlist", type="string", nargs=2,
+          metavar="REPO MIRRORLIST", help='repository name and mirrorlist URL to use')
+        parser.add_option("--ignore-missing-includes", action="store_false", default=True, dest="ignore_missing_includes",
+          help="ignore missing %include files in the kickstart config")
         parser.add_option("--all-stages", action="store_true", default=True, dest="do_all",
           help="Enable ALL stages")
         parser.add_option("-G", action="store_true", default=False, dest="do_gather",




More information about the Fedora-buildsys-list mailing list