]> code.ossystems Code Review - openembedded-core.git/commitdiff
recipetool: create: add --keep-temp command line option
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Sun, 4 Sep 2016 22:26:20 +0000 (10:26 +1200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 7 Sep 2016 23:36:43 +0000 (00:36 +0100)
For debugging it's useful to be able to tell recipetool to keep the
temporary directory.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
scripts/lib/recipetool/create.py

index 431a09dd606f140b94d0d1dd382e81df2f0d4600..bc5b22b3615d24742c89522549f29843934fd669 100644 (file)
@@ -764,7 +764,10 @@ def create_recipe(args):
         logger.info('Recipe %s has been created; further editing may be required to make it fully functional' % outfile)
 
     if tempsrc:
-        shutil.rmtree(tempsrc)
+        if args.keep_temp:
+            logger.info('Preserving temporary directory %s' % tempsrc)
+        else:
+            shutil.rmtree(tempsrc)
 
     return 0
 
@@ -1047,5 +1050,6 @@ def register_commands(subparsers):
     parser_create.add_argument('--also-native', help='Also add native variant (i.e. support building recipe for the build host as well as the target machine)', action='store_true')
     parser_create.add_argument('--src-subdir', help='Specify subdirectory within source tree to use', metavar='SUBDIR')
     parser_create.add_argument('-a', '--autorev', help='When fetching from a git repository, set SRCREV in the recipe to a floating revision instead of fixed', action="store_true")
+    parser_create.add_argument('--keep-temp', action="store_true", help='Keep temporary directory (for debugging)')
     parser_create.set_defaults(func=create_recipe)