diff options
author | Jeremy Katz <katzj@redhat.com> | 2002-08-08 18:37:07 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2002-08-08 18:37:07 +0000 |
commit | b8ea6a0297339177bb81434016ae8182c5ac130e (patch) | |
tree | 3fcf64db66dc225e0e8b97a1ebf5a3dd66ff39d7 /scripts/makestamp.py | |
parent | d31bcb4845331c375f84516cee4bb1a311a0d665 (diff) | |
download | anaconda-b8ea6a0297339177bb81434016ae8182c5ac130e.tar.gz anaconda-b8ea6a0297339177bb81434016ae8182c5ac130e.tar.xz anaconda-b8ea6a0297339177bb81434016ae8182c5ac130e.zip |
creation of stamp in buildinstall for main tree which becomes the dvd
Diffstat (limited to 'scripts/makestamp.py')
-rwxr-xr-x | scripts/makestamp.py | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/scripts/makestamp.py b/scripts/makestamp.py new file mode 100755 index 000000000..156d5975e --- /dev/null +++ b/scripts/makestamp.py @@ -0,0 +1,96 @@ +#!/usr/bin/python2.2 +# +# makes a .discinfo file. if information isn't provided, prompts for it +# +# Copyright 2002 Red Hat, Inc. +# +# License: GPL +# + +import os,sys,string +import getopt +import time + + +def usage(): + args = "" + for key in data: + args = "%s [--%s=%s]" %(args, key, key) + print "%s: %s" % (sys.argv[0], args) + sys.exit(1) + +data = {"timestamp": None, + "releasestr": None, + "arch": None, + "discNum": None, + "baseDir": None, + "packagesDir": None, + "pixmapsDir": None, + "outfile": None} +allDiscs = None + +opts = [] +for key in data.keys(): + opts.append("%s=" % (key,)) +opts.append("allDiscs") + +(args, extra) = getopt.getopt(sys.argv[1:], '', opts) +if len(extra) > 0: + print "had extra args: %s" % extra + usage() + +for (str, arg) in args: + if str[2:] in data.keys(): + data[str[2:]] = arg + elif str == "--allDiscs": + allDiscs = 1 + else: + print "unknown str of ", str + usage() + +if data["timestamp"] is None: + print >> sys.stderr, "timestamp not specified; using the current time" + data["timestamp"] = time.time() + +if data["releasestr"] is None: + print "What should be the release name associated with this disc?" + data["releasestr"] = sys.stdin.readline()[:-1] + +if data["arch"] is None: + print "What arch is this disc for?" + data["arch"] = sys.stdin.readline()[:-1] + +if data["discNum"] is None and allDiscs is None: + print >> sys.stderr, "No disc number specified; assuming disc 1" + data["discNum"] = "1" + +if data["baseDir"] is None: + print "Where is the comps file located?" + data["baseDir"] = sys.stdin.readline()[:-1] + +if data["packagesDir"] is None: + print "Where are the packages located?" + data["packagesDir"] = sys.stdin.readline()[:-1] + +if data["pixmapsDir"] is None: + print "Where are the images located?" + data["pixmapsDir"] = sys.stdin.readline()[:-1] + + +if data["outfile"] is None: + f = sys.stdout +else: + f = open(data["outfile"], "w") + +f.write("%f\n" % data["timestamp"]) +f.write("%s\n" % data["releasestr"]) +f.write("%s\n" % data["arch"]) +if allDiscs is None: + f.write("%s\n" % data["discNum"]) +else: + f.write("ALL\n") +f.write("%s\n" % data["baseDir"]) +f.write("%s\n" % data["packagesDir"]) +f.write("%s\n" % data["pixmapsDir"]) + + |