Add version output (#1335456)
Add -V to livemedia-creator, and log the running version when lorax or lmc is started.
This commit is contained in:
parent
8154b3f7a3
commit
e3dcb1e329
@ -49,6 +49,15 @@ from pylorax.treeinfo import TreeInfo
|
|||||||
from pylorax.discinfo import DiscInfo
|
from pylorax.discinfo import DiscInfo
|
||||||
from pylorax.executils import runcmd, runcmd_output
|
from pylorax.executils import runcmd, runcmd_output
|
||||||
|
|
||||||
|
|
||||||
|
# get lorax version
|
||||||
|
try:
|
||||||
|
import pylorax.version
|
||||||
|
except ImportError:
|
||||||
|
vernum = "devel"
|
||||||
|
else:
|
||||||
|
vernum = pylorax.version.num
|
||||||
|
|
||||||
# List of drivers to remove on ppc64 arch to keep initrd < 32MiB
|
# List of drivers to remove on ppc64 arch to keep initrd < 32MiB
|
||||||
REMOVE_PPC64_DRIVERS = "floppy scsi_debug nouveau radeon cirrus mgag200"
|
REMOVE_PPC64_DRIVERS = "floppy scsi_debug nouveau radeon cirrus mgag200"
|
||||||
REMOVE_PPC64_MODULES = "drm plymouth"
|
REMOVE_PPC64_MODULES = "drm plymouth"
|
||||||
@ -178,14 +187,6 @@ class Lorax(BaseLoraxClass):
|
|||||||
installpkgs = installpkgs or []
|
installpkgs = installpkgs or []
|
||||||
excludepkgs = excludepkgs or []
|
excludepkgs = excludepkgs or []
|
||||||
|
|
||||||
# get lorax version
|
|
||||||
try:
|
|
||||||
import pylorax.version
|
|
||||||
except ImportError:
|
|
||||||
vernum = "devel"
|
|
||||||
else:
|
|
||||||
vernum = pylorax.version.num
|
|
||||||
|
|
||||||
if domacboot:
|
if domacboot:
|
||||||
try:
|
try:
|
||||||
runcmd(["rpm", "-q", "hfsplus-tools"])
|
runcmd(["rpm", "-q", "hfsplus-tools"])
|
||||||
|
@ -22,18 +22,13 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
def lorax_parser():
|
from pylorax import vernum
|
||||||
""" Return the ArgumentParser for lorax"""
|
|
||||||
|
|
||||||
# get lorax version
|
|
||||||
try:
|
|
||||||
from pylorax import version
|
|
||||||
vernum = version.num
|
|
||||||
except ImportError:
|
|
||||||
vernum = "devel"
|
|
||||||
|
|
||||||
version = "{0}-{1}".format(os.path.basename(sys.argv[0]), vernum)
|
version = "{0}-{1}".format(os.path.basename(sys.argv[0]), vernum)
|
||||||
|
|
||||||
|
def lorax_parser():
|
||||||
|
""" Return the ArgumentParser for lorax"""
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description="Create the Anaconda boot.iso")
|
parser = argparse.ArgumentParser(description="Create the Anaconda boot.iso")
|
||||||
|
|
||||||
# required arguments for image creation
|
# required arguments for image creation
|
||||||
@ -290,4 +285,8 @@ def lmc_parser(dracut_default=""):
|
|||||||
parser.add_argument("--timeout", default=None, type=int,
|
parser.add_argument("--timeout", default=None, type=int,
|
||||||
help="Cancel installer after X minutes")
|
help="Cancel installer after X minutes")
|
||||||
|
|
||||||
|
# add the show version option
|
||||||
|
parser.add_argument("-V", help="show program's version number and exit",
|
||||||
|
action="version", version=version)
|
||||||
|
|
||||||
return parser
|
return parser
|
||||||
|
@ -44,7 +44,7 @@ from mako.template import Template
|
|||||||
from mako.exceptions import text_error_template
|
from mako.exceptions import text_error_template
|
||||||
|
|
||||||
# Use the Lorax treebuilder branch for iso creation
|
# Use the Lorax treebuilder branch for iso creation
|
||||||
from pylorax import ArchData, setup_logging, find_templates
|
from pylorax import ArchData, setup_logging, find_templates, vernum
|
||||||
from pylorax.base import DataHolder
|
from pylorax.base import DataHolder
|
||||||
from pylorax.treebuilder import TreeBuilder, RuntimeBuilder, udev_escape
|
from pylorax.treebuilder import TreeBuilder, RuntimeBuilder, udev_escape
|
||||||
from pylorax.treebuilder import findkernels
|
from pylorax.treebuilder import findkernels
|
||||||
@ -1199,6 +1199,8 @@ def main():
|
|||||||
|
|
||||||
log.debug( opts )
|
log.debug( opts )
|
||||||
|
|
||||||
|
log.info("livemedia-creator v%s", vernum)
|
||||||
|
|
||||||
# Find the lorax templates
|
# Find the lorax templates
|
||||||
opts.lorax_templates = find_templates(opts.lorax_templates or "/usr/share/lorax")
|
opts.lorax_templates = find_templates(opts.lorax_templates or "/usr/share/lorax")
|
||||||
|
|
||||||
|
@ -54,6 +54,8 @@ def main():
|
|||||||
parser = lorax_parser()
|
parser = lorax_parser()
|
||||||
opts = parser.parse_args()
|
opts = parser.parse_args()
|
||||||
|
|
||||||
|
log.info("Lorax v%s", pylorax.vernum)
|
||||||
|
|
||||||
if not opts.source and not opts.repos:
|
if not opts.source and not opts.repos:
|
||||||
parser.error("--source, --repo, or both are required.")
|
parser.error("--source, --repo, or both are required.")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user