git.py: Remove -l option, its not necessary

If -l is specified and the source and destination are not on a common
filesystem an error occurs. The -l option is however the default for
git for local paths which the fetcher already now ensures in the
file:// case.

We can therefore safely drop the -l option.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
utils.py: Add function to set nonblocking operation on a file descriptor

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
taskdata.py: Add support for rdepends task flag

Currently its not possible to add arbitrary RDEPENDS to a specific task.
This can be useful and this patch adds functionality equivalent to the
'depends' task flag.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
process: Improve _logged_communicate buffering

There are two problems with the _logged_communicate that are both
caused as a result of buffering I/O issues:

1) log truncation when python fails

2) While a bitbake task is running it is impossible to see what is
   going on if it is only writing a small incremental log that is
   smaller than the buffer, or you get only a partial log, up until
   the task exists.  It is worse in the case that stderr and stdout
   are separate file handles, because previous code blocks on the read
   of stdout and then stderr, serially.

The right approach is simply to use select() to determine if there is
data available and also flush the log before exiting.

This is based on a patch from Jason Wessel <jason.wessel@windriver.com>
with some changes to flush upon exit, abstract the non blocking file
descriptor setup and drop the buffer size parameter.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
fetch2: Handle errors orruring when building mirror urls

When we build the mirror urls, its possible an error will occur. If it
does, it should just mean we don't attempt this mirror url. The current
code actually aborts *all* the mirrors, not just the failed url.

This patch catches and logs the exception allowing things to continue.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
fetch2: Add new mirror syntax to simplify mirror specifications

When writing mirror specifications, the current regexp syntax can be awkward
and hard to get it to do what you want. For example, extracting the 'basename'
of a repository:

PREMIRRORS = "git://.*/([^/]+/)*([^/]*) git://somewhere.org/somedir/\\2;protocol=file"

can now become:

PREMIRRORS = "git://.*/.* git://somewhere.org/somedir/BASENAME;protocol=file"

which is much clearer. A MIRRORNAME substitution is also added which contains
an encoded form of both host and path. One of the problems with the existing
regexp syntax is you couldn't access HOST information from PATH and vice-versa
which is an issue this patch also addresses.

Tests for the new syntax are also added.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/utils.py: remove unnecessary preserved variables

_ and LANG no longer need to be preserved from the external environment.
The value of _ changes between non-pseudo-wrapped and pseudo-wrapped
invocations (e.g. between "bitbake -p" and "bitbake target") and this
will currently trigger a full reparse in the absence of a whitelist
entry in BB_HASHCONFIG_WHITELIST, which is not ideal.

LANG used to be preserved in order to ensure the C locale was being
used for tools invoked by bitbake, however we now set LC_ALL in
bitbake.conf to take care of this.

Second part of the fix for [YOCTO #2600].

Acked-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
fetch2: Ensure star character doesn't end up in mirror tarball names

If '*' does end up in mirror urls accidently, some strange things
can break since supports_checksum() looks for this, ud.localpath can
then get ignored and this can lead to empty directories being downloaded
"successfully". '*' is a special case for file urls only at this point
so remove any entries that accidentlly make it in through url mapping.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hig.py: use module tempfile to create temp file

I am sorry that use os.tmpname which casue a security warning.
Follow Darren's suggestion to use tempfile.NamedTemporaryFile instead.

Signed-off-by: Kang Kai <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Fix for Hob bug #2323

Removed unnecessary button from Recipes screen and
replaced the button that diplayed packages size and total image size
from Packages screen with a label.

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>