diff options
author | Ryan S. Arnold <ryan.arnold@linaro.org> | 2016-08-19 13:49:30 -0500 |
---|---|---|
committer | Ryan S. Arnold <ryan.arnold@linaro.org> | 2016-08-19 13:49:30 -0500 |
commit | 9dac4d48397f5f805e78523f2ee2214b1f09facf (patch) | |
tree | 3ebe681bf97e7e14266e07883095bff02ad94638 | |
parent | 0efe81a12881c31cae6a1cec7121517f954993fd (diff) |
Add --nopersist to rn.py.
-rw-r--r-- | rn.py | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -32,12 +32,13 @@ def rncleanup(): else: rnProj[0].cleanup() -def generate(track, todate, toseries, gccsource): +def generate(track, todate, toseries, gccsource, persist): # Delay creating the Proj directory until now so that the parser (and # parser validation functions) can be tested in the unittests without # invoking the internals of this driver. - rnProj.append(Proj(prefix='rn', persist=True)) - print "proj dir is: " + rnProj[0].projdir + rnProj.append(Proj(prefix='rn', persist=persist)) + print "proj dir is: %s with persist=%s" % (rnProj[0].projdir, str(persist)) + # This will raise an exception if gccsource is not a git repository. gccclone=GCCClone(rnProj[0], clonedir=gccsource) @@ -116,6 +117,8 @@ def create_parser(): parser.add_argument('-d', '--date', dest='todate', required=True, help='the next series date in "YYYY.MM" form.', type=str_to_datetime) + parser.add_argument('-n', '--nopersist', dest='persist', default=True, action='store_false', help='The proj dir will not persist once this program has executed.') + # At least one of the following arguments are required. group = parser.add_mutually_exclusive_group(required=True) group.add_argument('-c', '--candidate', dest='toseries', action='store_const', const=LinaroSeries.series.index("candidate")) @@ -127,7 +130,7 @@ def create_parser(): def main(): parser=create_parser() args = parser.parse_args() - generate(args.track, args.todate, args.toseries, args.gccsource) + generate(args.track, args.todate, args.toseries, args.gccsource, args.persist) if __name__ == '__main__': # logging.basicConfig(level="INFO") |