diff options
author | Tom Zanussi <tom.zanussi@intel.com> | 2013-01-15 16:59:57 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-01-16 12:08:01 +0000 |
commit | a746719a46e9277a118fd7d4a6342bb667034132 (patch) | |
tree | c43113311d641844e5affefde108a61f5d163fb3 /scripts/yocto-bsp | |
parent | e02b31623dac54f82509fcb5588bb58daaaa75e0 (diff) | |
download | poky-a746719a46e9277a118fd7d4a6342bb667034132.tar.gz |
yocto-bsp: add basic git connectivity check
yocto-bsp create does a 'git ls-remote
git://git.yoctoproject.org/linux-yocto-3.4.git *heads*' to get the set
of existing branches from the kernel repo.
If the user isn't connected to the network, or if git isn't configured
sanely, yocto-bsp fails with an ugly Python backtrace.
We should try to avoid this by doing a basic sanity check for those
things before actually running the command.
The sanity check can be avoided by specifying -s on the yocto-bsp
command-line:
$ yocto-bsp create -s test qemu
Fixes [YOCTO #3279]
(From meta-yocto rev: 496e76f9bed2ed5a04ef757724d2e63d05c7a601)
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/yocto-bsp')
-rwxr-xr-x | scripts/yocto-bsp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/yocto-bsp b/scripts/yocto-bsp index 126fc8dc0d..d269861769 100755 --- a/scripts/yocto-bsp +++ b/scripts/yocto-bsp | |||
@@ -58,6 +58,8 @@ def yocto_bsp_create_subcommand(args, usage_str): | |||
58 | help = "name of file containing the values for BSP properties as a JSON file") | 58 | help = "name of file containing the values for BSP properties as a JSON file") |
59 | parser.add_option("-c", "--codedump", dest = "codedump", action = "store_true", | 59 | parser.add_option("-c", "--codedump", dest = "codedump", action = "store_true", |
60 | default = False, help = "dump the generated code to bspgen.out") | 60 | default = False, help = "dump the generated code to bspgen.out") |
61 | parser.add_option("-s", "--skip-git-check", dest = "git_check", action = "store_false", | ||
62 | default = True, help = "skip the git connectivity check") | ||
61 | (options, args) = parser.parse_args(args) | 63 | (options, args) = parser.parse_args(args) |
62 | 64 | ||
63 | if len(args) != 2: | 65 | if len(args) != 2: |
@@ -73,6 +75,17 @@ def yocto_bsp_create_subcommand(args, usage_str): | |||
73 | else: | 75 | else: |
74 | bsp_output_dir = "meta-" + machine | 76 | bsp_output_dir = "meta-" + machine |
75 | 77 | ||
78 | if options.git_check and not options.properties_file: | ||
79 | print "Checking basic git connectivity..." | ||
80 | if not verify_git_repo(GIT_CHECK_URI): | ||
81 | print "Couldn't verify git connectivity, exiting\n" | ||
82 | print "Details: couldn't access %s" % GIT_CHECK_URI | ||
83 | print " (this most likely indicates a network connectivity problem or" | ||
84 | print " a misconfigured git intallation)" | ||
85 | sys.exit(1) | ||
86 | else: | ||
87 | print "Done.\n" | ||
88 | |||
76 | yocto_bsp_create(machine, karch, scripts_path, bsp_output_dir, options.codedump, options.properties_file) | 89 | yocto_bsp_create(machine, karch, scripts_path, bsp_output_dir, options.codedump, options.properties_file) |
77 | 90 | ||
78 | 91 | ||