-
Notifications
You must be signed in to change notification settings - Fork 17
bake.py: add warning if building on unsupported os #161
base: master
Are you sure you want to change the base?
bake.py: add warning if building on unsupported os #161
Conversation
lib/oelite/cmd/bake.py
Outdated
| break | ||
|
|
||
| if response == 'n': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this break when stdin is not tty? Maybe just initialize response to 'n' in an else clause to the tty if.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better :)
|
Any progress on this? |
58ea237 to
2044739
Compare
|
Setting initial value of response to 'n' thus failing per default. Use -s to force continue. |
|
Before merging this, we really need to have a setup file for Ubuntu 16.04 (and probably 15.10 as well). |
|
Im on it |
|
setup files has been vaguely tested in official ubuntu containers |
|
Oh, if you add a debian_8 setup file, build should hopefully go green. |
0cd4f30 to
1418756
Compare
Print a warning if building on unsupported os. The warning triggers a prompt asking to continue or abort build. Use '-s' (--skip-os-check) option to automatically continue build. To add a supported OS see core/setup directory. Files can also be added in a setup folder in local meta layer. To unsupport an OS add a setup file with only the distro-release line (keep only the first line). It would be handy to have a feature to disable all other setup folders but the one in local layer. But so far this has not been implemented.
1418756 to
651154f
Compare
|
Still need to detect debian distro in setup.get_host_distro() |
kimrhh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't feel like addressing my comments for this, then I don't mind taking over the change :)
| if distro and release: | ||
| print('WARNING: Host distribution (%s %s) has not been validated'%(distro, release)) | ||
| else: | ||
| print("WARNING: Cannot determine host distribution") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this stuff does not really belong in bake. Let us make good use of OO and keep the responsibility for the logic about support host OS in the setup code.
What is needed is a refactor of the setup code, so you can simply ask it from bake "are we running on a supported host OS", probably something like a "is_supported()" method or the like. The rest of the setup code should of cause use that as well
| if response == 'n': | ||
| print "Maybe another time" | ||
| return False | ||
| return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this a duplication of the other place where we interactively ask if we should continue?
Let us not do that, we already have a mess of duplication and responsibility in the code. Please refactor this out to a place where it can be used by commands that need it.
| def run(options, args, config): | ||
|
|
||
| if not options.skip_os_check: | ||
| if not os_check(config): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line is basically what I would imagine should be needed in bake, but by calling into the setup code.
If lsb-release is not present on system try to get host distro from distro specific release or version files. Add check for: * Ubuntu 16.04 * Ubuntu 15.10 * Ubuntu 15.04 * Debian 8 * Debian 7
|
@vmbracvlvm @kimrhh Who is going to follow up on this? |
|
I will look at it some time, but don't know when |
|
Ok, it will have to be delayed to 7.0 then. |
Print a warning if building on unsupported os. The warning triggers a
prompt asking to continue or abort build. Use '-s' (--skip-os-check) option to
automatically continue build.
To add a supported OS see core/setup directory. Files can also be added in
a setup folder in local meta layer. To unsupport an OS add a
setup file with only the distro-release line (keep only the first line).
It would be handy to have a feature to disable all other setup folders
but the one in local layer. But so far this has not been implemented.