summaryrefslogtreecommitdiffstats
path: root/scripts/lib/recipetool/create.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/recipetool/create.py')
-rw-r--r--scripts/lib/recipetool/create.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 1899a0dcd8..4a59363eea 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -563,6 +563,10 @@ def create_recipe(args):
563 lines_before.append('') 563 lines_before.append('')
564 lines_before.append('# Modify these as desired') 564 lines_before.append('# Modify these as desired')
565 lines_before.append('PV = "%s+git${SRCPV}"' % (realpv or '1.0')) 565 lines_before.append('PV = "%s+git${SRCPV}"' % (realpv or '1.0'))
566 if not args.autorev and srcrev == '${AUTOREV}':
567 if os.path.exists(os.path.join(srctree, '.git')):
568 (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree)
569 srcrev = stdout.rstrip()
566 lines_before.append('SRCREV = "%s"' % srcrev) 570 lines_before.append('SRCREV = "%s"' % srcrev)
567 lines_before.append('') 571 lines_before.append('')
568 572
@@ -1049,5 +1053,6 @@ def register_commands(subparsers):
1049 parser_create.add_argument('-b', '--binary', help='Treat the source tree as something that should be installed verbatim (no compilation, same directory structure)', action='store_true') 1053 parser_create.add_argument('-b', '--binary', help='Treat the source tree as something that should be installed verbatim (no compilation, same directory structure)', action='store_true')
1050 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') 1054 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')
1051 parser_create.add_argument('--src-subdir', help='Specify subdirectory within source tree to use', metavar='SUBDIR') 1055 parser_create.add_argument('--src-subdir', help='Specify subdirectory within source tree to use', metavar='SUBDIR')
1056 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")
1052 parser_create.set_defaults(func=create_recipe) 1057 parser_create.set_defaults(func=create_recipe)
1053 1058