-
Notifications
You must be signed in to change notification settings - Fork 17
oelite: add show-provided subcommand #149
base: master
Are you sure you want to change the base?
Conversation
d0e510a to
df17ee5
Compare
lib/oelite/cmd/check_provided.py
Outdated
| data["unzip"] = dict(args = "-v") | ||
| data["util-linux"] = dict(cmd = "getopt") | ||
|
|
||
| data["git"] = dict(min = "1.8.4") |
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.
it doesn't seem like a good idea to add version information here, since I don't think everybody would know they need to update a sub-command if the touch provided.conf :)
Would it be a problem to add this information to the .conf file instead?
|
nice addition, but think a command should not contain any data, since this is confusing from a user perspective |
f135f39 to
c280a98
Compare
| return None | ||
|
|
||
| args = [param["cmd"]] + param["args"] | ||
| cmdstring = " ".join(args) |
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.
Why are you flattening args? subprocess.Popen() is capable of taken args as a sequence, and in case you have args with whitespace, you effectively split the arguments this way.
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.
Please look at the Popen call - I do pass args as a list. cmdstring is only used in warning messages. Of course that could end up being slightly confusing if there are arguments with whitespace, but I really don't want to complicate this with trying to get shell quoting right.
ffbe190 to
cf77ee0
Compare
It can be frustrating trying to help track down problems which end up being caused by the other guy using a different autotools version. So "oe show-provided" does a semi-automatic extraction of the version of all ASSUME_PROVIDED utils. In many cases, we can just do "$util --version" and extract the first substring matching "\b([0-9][0-9.a-zA-Z_-]+)\b" - when necessary, this heuristic can be overridden, and I've included a few examples. We can now also attach minimum and maximum versions to the assume_provided utilities. We're not going to check or enforce these during normal "oe bake", but it's nice to be able to do "oe show-provided -c". A previous version had these minimum and maximum versions hardcoded in show_provided.py, but it's better to keep the version requirements together with the ASSUME_PROVIDED variable. The syntax is rather oelitish, e.g. ASSUME_PROVIDED_MIN += "native:git_1.8.4 native:tar_1.2.3"
This is partly to introduce an example of ASSUME_PROVIDED_MIN. But this is not just some random git version - I've had a difficult-to-debug problem which wouldn't have happened with a new enough host git. The problem was a SRC_URI specifying a git repository accessed via a non-standard ssh port, causing the ingredients subdir to contain a colon. Subsequent cloning from that dir (during do_unpack) was, pre-1.8.4, interpreted as an scp-style url rather than a local path, which obviously breaks. Commit 60003340cda05f5ecd79ee8522b21eda038b994b in git.git handles this case much more sanely.
cf77ee0 to
b2fb6f7
Compare
This is a quick'n'dirty proof-of-concept, but I think it might already be useful in its current form, and it shouldn't really affect normal operation of the oe command, hence the PR.
Update 2016-10-21: changed the primary mode to "show" rather than "check"; until we actually have some version requirements defined, "show" is the only thing this can really be used for. Also make sure that the version requirements get defined together with ASSUME_PROVIDED - but keep the per-util version extraction tweaks inside the subcommand file.