Set buildarch and other fixes.
Set buildarch to the value of pylorax.getBuildArch(). Other minor cleanups.
This commit is contained in:
parent
7c6562f972
commit
bc76ca2070
39
lorax
39
lorax
@ -28,20 +28,20 @@ import sys
|
|||||||
import pylorax
|
import pylorax
|
||||||
|
|
||||||
def usage(prog):
|
def usage(prog):
|
||||||
print "Usage: %s required_arguments... [optional_arguments...] repo\n" % (prog,)
|
print("Usage: %s -v VERSION -p PRODUCT -r RELEASE -o PATH REPO\n" % (prog,))
|
||||||
print "Required arguments:"
|
print("Required arguments:")
|
||||||
print " -v, --version STRING Version identifier."
|
print(" -v, --version=STRING Version identifier.")
|
||||||
print " -p, --product STRING Product name."
|
print(" -p, --product=STRING Product name.")
|
||||||
print " -r, --release STRING Release information or comment.\n"
|
print(" -r, --release=STRING Release information or comment.\n")
|
||||||
print " -o, --output PATHSPEC Where to write output files."
|
print(" -o, --output=PATHSPEC Where to write output files.")
|
||||||
print "Optional arguments:"
|
print("Optional arguments:")
|
||||||
print " -d, --debug Enable debugging messages."
|
print(" -d, --debug Enable debugging messages.")
|
||||||
print " -t, --variant STRING Variant name."
|
print(" -t, --variant=STRING Variant name.")
|
||||||
print " -b, --bugurl URL Bug reporting URL for the product."
|
print(" -b, --bugurl=URL Bug reporting URL for the product.")
|
||||||
print " -u, --updates PATHSPEC Path to find updated RPMS."
|
print(" -u, --updates=PATHSPEC Path to find updated RPMS.")
|
||||||
print " -m, --mirrorlist REPO Mirror list repo.\n"
|
print(" -m, --mirrorlist=REPO Mirror list repo, may be listed multiple times.\n")
|
||||||
print "A 'repo' specification is a valid yum repository path.\n"
|
print("A 'REPO' specification is a valid yum repository path.\n")
|
||||||
print "See the man page lorax(8) for more information."
|
print("See the man page lorax(8) for more information.")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
prog = os.path.basename(sys.argv[0])
|
prog = os.path.basename(sys.argv[0])
|
||||||
@ -84,11 +84,11 @@ if __name__ == "__main__":
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
if version is None or product is None or release is None or output is None:
|
if version is None or product is None or release is None or output is None:
|
||||||
print "ERROR: Missing a required argument."
|
sys.stderr.write("ERROR: Missing a required argument.\n")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if len(args) == 0:
|
if len(args) == 0:
|
||||||
print "ERROR: Missing repo to use for image generation."
|
sys.stderr.write("ERROR: Missing repo to use for image generation.\n")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# collect all repos specified on the command line. the first repo is
|
# collect all repos specified on the command line. the first repo is
|
||||||
@ -104,18 +104,17 @@ if __name__ == "__main__":
|
|||||||
sys.stderr.write("Error generating temporary yum.conf file.\n")
|
sys.stderr.write("Error generating temporary yum.conf file.\n")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
print "I am the Lorax. I speak for the trees..."
|
buildarch = pylorax.getBuildArch()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# upd-instroot
|
# upd-instroot
|
||||||
|
# XXX
|
||||||
|
|
||||||
# write .treeinfo file
|
# write .treeinfo file
|
||||||
if not pylorax.treeinfo.write(family=product, variant=variant, version=version, arch=buildarch, outdir=output):
|
if not pylorax.treeinfo.write(family=product, variant=variant, version=version, arch=buildarch, outdir=output):
|
||||||
sys.stderr.write("Error writing %s/.treeinfo file.\n" % (output,))
|
sys.stderr.write("Error writing %s/.treeinfo file.\n" % (output,))
|
||||||
|
|
||||||
# mk-images
|
# mk-images
|
||||||
|
# XXX
|
||||||
|
|
||||||
# write .discinfo file
|
# write .discinfo file
|
||||||
if not pylorax.discinfo.write(release=release, arch=buildarch, outdir=output):
|
if not pylorax.discinfo.write(release=release, arch=buildarch, outdir=output):
|
||||||
|
Loading…
Reference in New Issue
Block a user