Commit Graph

1911 Commits

Author SHA1 Message Date
Allen Wild fc79776fff scripts/lnr: update for python3
Change shebang line to python3 and add parentheses to print

(From OE-Core rev: 85b6a53386382c0d92b5bea545c2db5e0204e629)

Signed-off-by: Allen Wild <allenwild93@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-01 12:47:10 +01:00
Ed Bartosh 2e388048b6 scripts: python3: Use print function
Used print function instead of print statement to make
the code work in python 3.

(From OE-Core rev: 80fecc44761fa38ccf2e4dc6897b9f1f0c9c1ed0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-01 12:47:10 +01:00
Paul Eggleton 49557a5e9d recipetool / devtool: set a fixed SRCREV by default when fetching from git
If fetching source from a git repository, typically within OpenEmbedded
we encourage setting SRCREV to a fixed revision, so change to do that by
default and add a  -a/--autorev option to use "${AUTOREV}" instead.

(From OE-Core rev: 000480c42797dd2f03ebc3bc6d1dabfc6a7b75f5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-01 12:38:41 +01:00
Paul Eggleton 0a7c699b33 recipetool: create: use ${BP} for subdir for binary packages
If we use ${BP} for the subdirectory, the default value of S will work
rather than having to have an ugly value derived from the package
file name in both places. This does mean that we have to assume the
default though (we can't just let the normal logic work because the
value of BP is the default until later on, so the replacement doesn't
work).

(From OE-Core rev: 13bc2438d61c345a8f229b9d83bf36a14d08916f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-01 12:38:41 +01:00
Paul Eggleton eb09735737 recipetool: create: extract variable values from .deb/.ipk/.rpm
Extract the metadata from package files and use it to set variable
values in the recipe (including recipe name and version, LICENSE,
SUMMARY, DESCRIPTION, SECTION and HOMEPAGE). For LICENSE we take care
not to step on any value determined by our license file scan; if there
is one we simply add a comment above the LICENSE setting so the user can
resolve it.

(From OE-Core rev: 19e6b661d38c5ae9b19d6340762c289830baba59)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-01 12:38:41 +01:00
Paul Eggleton 2b510f5e01 recipetool: create: support extracting SUMMARY and HOMEPAGE
Allow plugins to set any variable value through the extravalues dict,
and use this to support extracting SUMMARY and HOMEPAGE values from spec
files included with the source; additionally translate "License:" to a
comment next to the LICENSE field (we have our own logic for setting
LICENSE, but it will often be useful to see what the spec file says if
one is present).

Also use the same mechanism for setting the same variables for node.js
modules; this was already supported but wasn't inserting the settings in
the appropriate place in the file which this will now do.

(From OE-Core rev: 91fc35ff5e89aa6d4c4ad945e45406fb4f71018e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-01 12:38:41 +01:00
Christopher Larson 91488e9630 wic: bootimg-efi: include startup.nsh if it's available
We want the system to boot on its own, rather than the user having to manually
input the correct file at the EFI prompt.

[YOCTO #9556]

(From OE-Core rev: aa215c12d729c001ad3b8b98a7e203a9ad192211)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-30 15:58:12 +01:00
Paul Eggleton 2d0a5c8361 devtool: upgrade: clarify help text for --srcrev option
The -S / --srcrev option must be specified if fetching from a git
repository, so spell that out in the help text.

(From OE-Core rev: 1465f205c235a1688a85844ebf5259e8971038ae)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-25 07:50:16 +01:00
Paul Eggleton 93a1c01666 devtool: upgrade: tweak conflict handling
Make a couple of changes to the rebase operation:

1) Only wrap the actual rebase command in try...except since a failure
   in any of the other commands should be an error, not a warning
2) If it's a conflict (which unfortunately we can only tell by checking
   for the keyword "conflict" since git doesn't return error codes based
   on the type of error) then print a message clarifying that the user
   needs to resolve the issue themselves to finish the upgrade.

(From OE-Core rev: 2a76be958432a35a0de30e9a5433089a54a06cad)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-25 07:50:16 +01:00
Paul Eggleton ab227452c7 devtool: upgrade: handle upgrading recipes with a versioned inc file
The gdb recipe in OE-Core has an inc file with the version in it;
since the inc file is pulled in with a "require ${PV}.inc", when
upgrading the recipe we need to also rename the inc file it will fail to
parse and the upgrade itself will fail.

Fixes [YOCTO #9574].

(From OE-Core rev: 3c623aac9333d20a62475279c72b6b6ec3d7dd6b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-25 07:50:16 +01:00
Humberto Ibarra 21af6c60b0 scripts/bitbake-whatchanged: migrate from optparse to argparse
The script bitbake-whatchanged uses optparse library, which is
deprecated since python 2.7. This migrates to argparse library.

[Yocto #9634]

(From OE-Core rev: b6c71616e66708bb1c456b83f98913b198f49a4a)

Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-22 16:11:14 +01:00
Ross Burton 456b222e0c wipe-sysroot: fix wrong glob when removing manifests
(From OE-Core rev: 5a0b857edfd6b21ec9a88eb6e246d8c602ab84d4)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-22 16:11:12 +01:00
Richard Purdie f9b0781534 scripts/oe-selftest: Remove inadvertant python3 specific change
(From OE-Core rev: 1bfe160fa1050c189364e2dec5d018f3ac91a670)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-22 16:11:12 +01:00
Richard Purdie 88972114a6 meta/scripts: python3: rename file -> open
file() API doesn't exist in python 3, convert to open(). Also handle
some cases where files aren't closed. Compatible with python 2.7.

[Contributions from Ed and Richard]

(From OE-Core rev: 0f4ec13e11bb8abe21aba2a28547dfb9372bc377)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-21 22:26:33 +01:00
Richard Purdie ffe9604be2 meta/selftest/scripts: Use print function for python3 compatibility
Used print function instead of print statement to make
the code work in python 3.

[Changes from both Ed and Richard]

(From OE-Core rev: ced1995694c394d92cb82fb9c25a33dc027a3b69)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-21 22:26:32 +01:00
Paul Eggleton 02986886fc devtool: sdk-update: drop support for local updates
Having two code paths here makes maintenance difficult, and it doesn't
seem likely that you would use the local case in real usage anyway, so
drop the local support entirely.

This should allow us to resolve [YOCTO #9301].

(From OE-Core rev: 7a4c9c96fee4fb514c2b69b52e811c4f896a16f1)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-21 22:24:57 +01:00
George McCollister 70b0e62af9 wic: fix path parsing, use last occurrence
If the path contains 'scripts' more than once the first occurrence will be
incorrectly used. Use rfind instead of find to find the last occurrence.

(From OE-Core rev: f30c486c17060d2f21618612804a692512ad6a57)

Signed-off-by: George McCollister <george.mccollister@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-20 10:20:55 +01:00
Humberto Ibarra ce2dd24ced scripts/oe-selftest: Improve listing by reducing unneeded spacing
The --list-tests option assumes a terminal of 150 characters wide,
which is clearly wrong. The output for this command is messy and
hard to understand for lower widths. Every command should look
good in a 80 characters terminal.

Unfortunately, this can't be done at the moment. The bad naming of
testcases have made the test names incredibly long.

This patch reduces spacing between columns and shows the tests
names in a concise and understandable way. The format is even the
same one required for running a testcase. Once the testcase naming
improves, this output will look even better.

[Yocto #9534]

(From OE-Core rev: 53da74155942febd520836cabf3aa727c53ce5ca)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19 09:05:19 +01:00
Ed Bartosh 471a816224 wic: add help for --bmap commandline option
Included description of -m/--bmap option to the help page
produced by 'wic help create'.

[YOCTO #9413]

(From OE-Core rev: 7c749d4cfe1642d70a6b3643422ef69dec1775fe)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19 09:05:19 +01:00
Ed Bartosh b5804498d6 wic: implement --bmap option
This option enables generation of <image>.bmap file for the
result image using native bmaptool.

[YOCTO #9413]

(From OE-Core rev: d64c7b37c40b052510419b4d6629b83319c833e4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19 09:05:19 +01:00
Ed Bartosh a49d279b50 wic: add bmaptool to the list of utilities
Added bmaptool -> bmap-tools pair to the dictionary
executable -> recipe as bmaptool is going to be used by wic
to generate .bmap file.

[YOCTO #9413]

(From OE-Core rev: 4684ac5f4d823a6afedc57aad0aa417bb17ba950)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19 09:05:19 +01:00
Raymond Tan 37abaa362c mkefidisk.sh: mount images as read-only
Mount the hddimg and rootfs.img as read-only when creating the bootable
image on the medium. Otherwise, the md5 checksum values of the hddimg will
be altered. As this changed checksum value might cause issue for users
whom would reuse the hddimg.

(From OE-Core rev: a1391c8a603f0ed972ee0bcc8c74999f5f43be43)

Signed-off-by: Raymond Tan <raymond.tan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19 09:05:18 +01:00
Robert Yang da53c7db9e oe-buildenv-internal: add BBPATH_EXTRA to BB_ENV_EXTRAWHITE_OE
So that user can easily make their own conf files such as conf/site.conf
work. For example, poky's default BBPATH in bblayers.conf is:
BBPATH = "${TOPDIR}"
Will change it to:
BBPATH_EXTRA ??= ""
BBPATH = "${BBPATH_EXTRA}${TOPDIR}"

When user sets BBPATH_EXTRA in env to their own dir which contains
conf/site.conf, it will work.

Note, BBPATH_EXTRA must end with ":", we can't set BBPATH as
"${BBPATH_EXTRA}:${TOPDIR}" since the sanity would fail when
BBPATH_EXTRA is null.

[YOCTO #7837]

(From OE-Core rev: a3d223284854a21c84e8f6d075d23b32789afa01)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17 14:43:29 +01:00
Ed Bartosh c589aff080 wic: use next builtin instead of .next method
Generators in Python 3 don't have .next method. It's recommended
to use 'next' builtin instead. As it also present in Python >= 2.6
it should make wic code compatible with both Python 2 and Python 3.

[YOCTO #9412]

(From OE-Core rev: 9b7ab632e47d786dd979262015dbfb1254103f83)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:14 +01:00
Ed Bartosh dd732eeedd wic: don't encode unicode strings
Removed check for unicode type as it doesn't work in Python 3.
This check is not needed for wic as all its output seem to be
strings. This allows to run code under both pythons.

[YOCTO #9412]

(From OE-Core rev: a56924b4a0102e401b5e37d857a08bab15da974e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:14 +01:00
Ed Bartosh a173885ccf wic: decode output of subprocess.communicate
stdeout and stderr content returned by communicate API has different
types in Python 3(bytes) and Python 2(string). Decoding it to 'utf-8'
makes it unicode on both pythons.

Decoded stdout and stderr output to utf-8 to make the code
working under both Python 2 and Python 3.

(From OE-Core rev: 5b556f58a171e3d45107bb56a1f780e5c1abba37)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:14 +01:00
Ed Bartosh 5f06463c6c wic: use // operator instead of /
Division operator works differently in Python 3. It results in
float unlike in Python 2, where it results in int.
Explicitly used "floor division" operator instead of 'division'
operator. This should make the code to result in integer under
both pythons.

[YOCTO #9412]

(From OE-Core rev: 997ff239bd753a7957cc14c6829b2f093d9bcef6)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:14 +01:00
Ed Bartosh bc89dc4225 wic: use find_executable in favor of bb.utils.which
As bitbake is not ported to Python 3 yet it's better to
avoid using its APIs as much as possible to be able to
test wic under Python 3 at least partially.

Used distutils.spawn.find_executable API in favor of
bb.utils.which to get path of the command to run.

(From OE-Core rev: 9658956bf8a5da779e06f71941de9b3e89415cdc)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:14 +01:00
Ed Bartosh b6b5b5e295 wic: don't use L suffix for integers
This suffix is not supported by Python 3. Wic code works
without it on Python 2 too, so it's safe to remove it.

[YOCTO #9412]

(From OE-Core rev: 296db7e33bd71585cac63dc78c2c95bc619b4a86)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:13 +01:00
Ed Bartosh 5fedb5d3cc wic: refactor pluginbase
Wic plugin machinery implemented using metaclasses.

Reimplemented plugin machinery using this advice from
https://wiki.python.org/moin/PortingToPy3k/BilingualQuickRef
Syntax for creating instances with different metaclasses is very
different between Python 2 and 3. Use the ability to call type instances
as a way to portably create such instances.

Now it should work under both Python 2 and Python 3.

[YOCTO #9412]

(From OE-Core rev: e62fe5a41bdcdd72b9b257fecff7ccdc59c76d33)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:13 +01:00
Ed Bartosh d4ded7fcb1 wic: remove unused functions
Removed 'raw', 'ask', 'choice' and 'pause' functions from
msger.py as they're not used in wic code and some of them
use raw_input, which is not present in Python 3.

[YOCTO #9412]

(From OE-Core rev: eb87d591ef67f1953b2689430ef6c5a6a27a5b6e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:13 +01:00
Ed Bartosh e301be3cd0 wic: use new syntax of 'except' statement
New syntax 'except Exception as err' is supported by Python >= 2.7.
Old syntax 'except Exception, err' is not supported by Python 3.

Used new syntax to be able to run wic on Python 3.

[YOCTO #9412]

(From OE-Core rev: 15e88714d6b0a93f72e8a19b083fcc1f2006e128)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:13 +01:00
Ed Bartosh ed10a80c2c wic: remove with_statement imports
'with' statement is not used in baseimager.py
It's supported by Python 2.7, which is included into all target
distros. Other wic modules use this statement.

Removed useless 'from __future__ import with_statement' from
wic code.

(From OE-Core rev: 528a1f20939589949831efbb4de6336776efe7d5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:13 +01:00
Ed Bartosh dac0e809b7 wic: don't inherit classes from object
All classes in Python3 are new style classes and don't need
to be inherited from object. Wic code works fine without
this inheritance even with Python2, so it's harmless to
remove it.

[YOCTO #9412]

(From OE-Core rev: a146b03ee7d0aa5bc1722da5977a5952782b69bf)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:13 +01:00
Ed Bartosh 52ce79dcba wic: don't use dict.keys and dict.has_key
Replaced calls of dict.keys and dict.has_key methods with the
'key in dict' statement. 'key in dict' is more pythonic, faster
and readable. dict.has_key doesn't exist in Python 3.

[YOCTO #9412]

(From OE-Core rev: 003df7dfb932c551953fbf1bd769b3c31bd16fb4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:13 +01:00
Ed Bartosh e36d04abb7 wic: use items instead of iteritems
Dictionary method 'iteritems' doesn't exist in Python 3.
Replaced 'iteritems' with 'items' to be able to run the
code under both Python 3 and Python 2.

[YOCTO #9412]

(From OE-Core rev: 5b14eb8d68aaca82de4f8f6bcb28ad6f4a5125d0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:13 +01:00
Ed Bartosh 0c57dd96c8 wic: replace print statements with print function
Print statements have been replaced with print function in
Python 3. Replaced them in wic code to be able to run it
under both Python 2 and Python 3.

[YOCTO #9412]

(From OE-Core rev: ee6979a19c77931c3cf6368e695e370d46192fef)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:13 +01:00
Patrick Ohly 4dadbbdd46 combo-layer: avoid too long command lines in update with history
As suspected, invoking "git archive" with all intended files as
parameters can run into command line length limitations. Splitting up
the parameters into multiple invocations (xargs-style) works and was
tested after encountering the situation in practice.

(From OE-Core rev: 1cb484ab99eabb5c24792757ab09d7f170f2e614)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:13 +01:00
Patrick Ohly 659ed8718b combo-layer: fix default "update" mode
When the "history" option is not set in the combo-layer.conf, the
intended default was to use the traditional method. Passing "True" as
default when querying the config was unintentional.

Also remove some left-over debugging code.

(From OE-Core rev: d0304acb05b926b08805d8652e12eaf19bf53ad6)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:12 +01:00
Randy Witt 832029356f devtool: Fix build-sdk when pn doesn't match filename
If an image with the filename foo.bb could be built using the name "bar"
instead, then build-sdk would fail to create the derivative sdk.

This was because the code assumed that the file name matched the target,
which is not necessarily the case.

(From OE-Core rev: d58a326b6960be14b8a049253559aec9582b7d0d)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 10:33:43 +01:00
Patrick Ohly d53ed05390 combo-layer: implement "update with history"
The core idea is that all commits get imported, including merge
commits, and joined into one big merge commit that imports the changes
from the individual components into the main branch of the combined
repository.

This is done by copying the files in each commit and removing deleted
ones, instead of trying to patch the combined repository.

The advantages of doing updates in this mode are:
- works for arbitrary upstream repos, not just those which
  support conversion into a linear set of patches
- listing history shows that commits where developed
  independently in the different components, instead of
  artificially showing them as if they had been developed
  one after the after (component "aaaa" before "bbbb", then "ccc", ...)
- bisecting becomes easier: when upstream repos only ensure consistency
  when merging into their "master" branches, then those merge
  commits are good candidates for test builds also in the combined
  repo
- more data mining can be done, for example showing who merged a commit
  and when

Selecting a subset of the files is supported, albeit with a slight
different semantic for wild card matching compared to other code paths
(/ is matched by * and ?). Empty commits get skipped because typically
they are a result of filtering (but that is not checked, so
intentionally empty commits also get skipped).

Other code paths are intentionally left unchanged, to avoid
regressions. However, the downside is that some opportunities for
refactoring (in particular regarding file filtering) were ignored.

(From OE-Core rev: 660f76b6fb0fb95738a2c8f50e0a99ffa5831c64)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 10:33:41 +01:00
Patrick Ohly 107c35e87e combo-layer: runcmd() enhancements
Allow setting the environment. Due to a subprocess quirk, it must
always be set explicitly (reuses the one from the previous call if not
set, instead of falling back to os.environ).

Embedding nul characters will be useful for parsing git output more
reliably; support dumping such output a bit better.

(From OE-Core rev: 0af4fadafce690fc8357196cf7247bd222c08d10)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 10:33:41 +01:00
Patrick Ohly aa4de3c8c5 combo-layer: dummy "update with history"
When setting "history = True" in combo-layer.conf consistently for the
components involved in an update or using "update" together with the
"--history" command line flag, a new mode for updating will be used
that does not rely on exporting/importing patches.

A config setting is used because it should be used consistently by
everyone using the same config, without having to remember to use an
additional command line parameter.

There are no real global settings, so the setting is checked
separately for each component although the setting has to be set
consistently. This restriction could be removed later.

In practice, putting "history" into the "[DEFAULT]" section is the
easiest approach for configuring it.

The actual code changes split up action_update and the
combo-layer.conf handling in preparation for this new mode, without
implementing the mode itself.

(From OE-Core rev: c9dab31f5f6dc225f5c2c2ca3ec9aeab2ff655d5)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 10:33:41 +01:00
Leonardo Sandoval 912e372bd3 scripts/lib/bsp/kernel.py: force patching when branch is machine branch is re-use
When a branch is re-used, the kernel tools turns off any patch pushing unless
'mark patching' is explicitly set.

[YOCTO #9120]

(From meta-yocto rev: 427f5473722e15e288cbce251a9ce18989c23548)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:32:24 +01:00
Christopher Larson 6e4b817776 ddimage: if 'pv' is installed, use it
This gives us a progress bar for the image write, which is quite helpful. See
https://www.ivarch.com/programs/pv.shtml.

(From OE-Core rev: 5b20cb2db929daaf0bf81c05368174e9c364ffab)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:31:15 +01:00
Paul Eggleton 8f275ff0d8 recipetool: create: fix falling back to declared license for npm packages
Fix two problems falling back to the "license" field from package.json
when no license file is present:
1) The function that was supposed to return the license field value was
   always explicitly returning None, and this was never noticed (because
   the test cases never exercised the fallback as they provided license
   files for each module).
2) Fix the main package not falling back because it had a default of an
   empty list, which evaluates to '' instead of 'Unknown'.

(From OE-Core rev: 59381a9450949ce6b4b03adb717e950b999830f3)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:31:14 +01:00
Christopher Larson a78e4ade1f scripts/lib/argparse_oe: also change 'positional arguments' to 'arguments'
This aligns with our existing 'optional arguments' to 'options' change, and
seems more intuitive for users.

(From OE-Core rev: 8a1cd471210e5fb77952f28172084bf6a4fb73e8)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:31:13 +01:00
Christopher Larson 09cbec8947 scripts/lib/argparse_oe: simplify options title change
There's no need to iterate over the action groups here, as self._optionals and
self._positionals are available.

(From OE-Core rev: 408694f4320f3cb52a391e5b927fb8c8ba16c1d2)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:31:13 +01:00
Christopher Larson 3e79d54523 scripts/lib/argparse_oe: show subparser help for unrecognized args
As an example, `recipetool create foo bar baz` shows `recipetool: error:
unrecognized arguments: bar baz` and then displays the main help, not the help
for the create command. Fix by saving the subparser name and using it in
parse_args() to look up the subparser.

(From OE-Core rev: 7fdaaedf4c63c8d019f03f84e22f9b838ef19aa6)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:31:13 +01:00
Christopher Larson 55c760bda3 scripts/lib/argparse_oe: show self.prog in the error message
This aligns our subclassed error() with that in the original class, using
_print_message and self.prog. Also add a docstring based on the original.

(From OE-Core rev: cf0c5175136966eefde8c0d9aa0679e85779f713)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:31:13 +01:00