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"
# Set up the kickstart parser and pass in the kickstart file we were handed
- ksparser = pykickstart.parser.KickstartParser(pykickstart.ver sion.makeVersion())
+ ksparser = pykickstart.parser.KickstartParser(pykickstart.ver sion.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",
--
Fedora-buildsys-list mailing list
Fedora-buildsys-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list
10-16-2008, 07:15 PM
Jesse Keating
new pungi command line options
On Thu, 2008-10-16 at 14:08 -0500, Paul B Schroeder wrote:
> 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
Rather than throw more command line options at the problems, I wonder if
it would make more sense to make the kickstart parsing gracefully handle
and warn about missing includes. I also really don't like doing repo
declaration via the command line arguments, but I'll think on this one a
bit more.
--
Jesse Keating
Fedora -- Freedom˛ is a feature!
identi.ca: http://identi.ca/jkeating
--
Fedora-buildsys-list mailing list
Fedora-buildsys-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list