Commit Graph

967 Commits

Author SHA1 Message Date
Richard Purdie 20afb21a37 bitbake/fetch2: Ensure network access status is reset for each loop iteration in download()
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-11 16:15:36 +00:00
Richard Purdie 05d8b6422d bitbake/fetch2/wget: Fix missing string parameter reference
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-11 12:16:44 +00:00
Richard Purdie ea70c4362f bitbake/fetch2: Ensure failed fetch attempts are logged in the debug logs
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-11 12:14:20 +00:00
Richard Purdie 7f30131faa bitbake/fetch2: Correctly handle git mirror tarball fetching
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-11 12:06:44 +00:00
Richard Purdie 20ab1cb0ca bitbake/fetch2: Pass over malformatted (empty) mirror url lines
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-11 12:04:59 +00:00
Richard Purdie b42ba2f95c bitbake: Remove bad commit hunk from old cvs fetcher
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 23:53:17 +00:00
Saul Wold 14dea89521 fetch2: Correct the clean() mechanism for the fetcher2 code
This create a clean() method in each of the fetcher modules
and correctly cleans the .done stamp file and lock files

Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-02-10 23:49:25 +00:00
Javier Martin f1bbea4ab0 Export KRB5CCNAME variable
This allows fetching git repositories using Kerberos authentication.

(Bitbake rev: d761cf98284b02eb3d3a1f879782c501c284b698)

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 22:35:44 +00:00
Javier Martin aacbe3f35e Fix comparison with SRCREVINACTION constant
Use '==' instead of 'is', otherwise it will always return
true since 'rev' and "SRCREVINACTION" are not the same object.

(Bitbake rev: f30b3af975a071d1584817054a2996f08a3aba4f)

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 22:35:28 +00:00
Chris Larson c68c5f6e31 persist_data: kill unreachable break line
(Bitbake rev: 7486b38603f2766adaf976a9f95e9276c83abe31)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 22:35:12 +00:00
Chris Larson afdbb02693 bitbake-layers: fix bug with env vars leaking in
I forgot that bin/bitbake is what does the environment filtering based upon
BB_ENV_WHITELIST, etc.

(Bitbake rev: 2cc6b6951bd17832866ec710029d119d2df31ba4)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 22:34:24 +00:00
Chris Larson 882ac1afea cache: fix docstring usage
Use comments instead of docstrings where appropriate in CacheData.

(Bitbake rev: 088d516e02bb2b4ce8a50bbaa967e944c46e620b)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 22:34:10 +00:00
Chris Larson 68bd406962 Add initial bitbake-layers script
This script has subcommands which operate against your bitbake layers, either
displaying useful information, or acting against them.  Currently, it only
provides a show_appends command, which shows you what bbappends are in effect,
and warns you if you have appends which are not being utilized.

Currently, a bug exists when using this due to the DataContext stuff, but I'm
not certain as to the root cause, it appears to be the bb package relying
implicitly on the way the bitbake script does things.  A fix for that issue
will be forthcoming, as will further subcommands.

(Bitbake rev: 78b6d4cb26cec3321f8eec9889205a6b93b2ee18)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 22:33:43 +00:00
Chris Larson 1385162cd2 persist_data: loop on database lock for table creation
(Bitbake rev: d93fcbd64ab5d806288424170f55323b4297e7d6)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 22:32:12 +00:00
Richard Purdie 59a08262ab bitbake/fetch2/git: Write mirror tarballs if enabled and they don't exist, also set a default value for mirror tarball generation
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 15:24:31 +00:00
Richard Purdie 296866c38e image-swab: Convert to attach strace to the process to obtain the required swabber data
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 11:51:48 +00:00
Richard Purdie 29ed2c6e9a bitbake/fetch2: Fix negated if check for BB_FETCH_PREMIRRORONLY
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-09 01:23:56 +00:00
Mark Hatle 906285ff00 fetch2: Add SRPM knowledge
Enable the fetcher to be able to unpack and SRPM.  By default the system will
unpack the contents of the SRPM into the WORKDIR.

A new syntax "unpack=file" was developed for the SRC_URI, to allow for a
recipe to extract a specific file within an SRPM.  An unpack operation will
then be executed on the extracted file.

In order to apply extracted patches (or unpack files not specified with
unpack), you must specify the path using WORKDIR, i.e.:

file://${WORKDIR}/mypatch.patch

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2011-02-08 18:01:35 +00:00
Saul Wold 07088f7711 bitbake/utils.py: add glob name matching to remove
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-02-08 17:35:49 +00:00
Richard Purdie aa45760702 bitbake/fetch2: Ignore UnboundLocalError in exception handler in try_mirror
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-08 17:30:45 +00:00
Richard Purdie ee1a9c0476 bitbake/fetch2: Move symlink handling into try_mirror where is belongs instead of the main download function
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-08 14:02:16 +00:00
Richard Purdie c4e66a7fe0 bitbake/fetch2: When using BB_FETCH_PREMIRRORONLY, set BB_NO_NETWORK after premirrors as there could be data processing needed by the real fetcher
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-08 14:02:16 +00:00
Richard Purdie 91eeb9b0d3 bitbake/fetch2: Ensure we only remove files, not directories when fetch failures occur
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-08 14:02:16 +00:00
Richard Purdie 0713fb6b99 bitbake/fetch2: Ensure original ud is preserved in try_mirror
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-08 14:02:16 +00:00
Richard Purdie a235c67479 bitbake/fetch2/git: Fix broken variable reference
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-08 12:05:35 +00:00
Richard Purdie 5920e85c56 bitbake/fetch2/git: Ensure unresolved branches are translated into revisions
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-08 12:05:35 +00:00
Saul Wold 1544aa8ab4 fetch2: add try/finally to ensure lockfile is unlocked on failure
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-02-07 17:29:46 -08:00
Saul Wold 232b6f3c92 fetch2: add runfetchcmd to import for fetchers
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-02-07 16:28:35 -08:00
Richard Purdie 500c66337c bitbake/fetch2:Fetch Make using the fn based cache optional
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 21:13:13 +00:00
Richard Purdie d4b4b48add bitbake/fetch2: Fix pickling issues with fetcher exceptions
See the problems in http://bugs.python.org/issue1692335, need to set self.args
correctly.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 21:13:13 +00:00
Richard Purdie 94faffdaf6 bitbake/fetch2: Update mirror processing to ensure we look for mirror tarballs
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 19:48:21 +00:00
Richard Purdie 37624b9745 bitbake/fetch2: Update forcefetch and mirror handling to clean up, simplfy and bug fix the code
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 16:52:42 +00:00
Richard Purdie 7586adb360 bitbake/msg: Ensure lower level debug messages have DEBUG prefix and reuse log level values from formatter
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 14:50:27 +00:00
Richard Purdie ded83ffc3b bitbake/fetch2: Match Fetcher log domain to that in bb.msg
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 14:50:27 +00:00
Richard Purdie d7eebbe9db bitbake:__init__.py: Fix debug log level handling to correct debug output
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 14:50:27 +00:00
Richard Purdie fb9c5a196e bitbake: event/build: Drop stdout specific handling for python messages as this is no longer needed with newer log handling
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 14:50:27 +00:00
Richard Purdie 681bcf4e6b bitbake/fetch2/git: use clonedir as ud.localfile too since the mirror tarball may not exist
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 10:13:29 +00:00
Richard Purdie 3308868267 bitbake/fetch2/git.py: Ensure that forcefetch operates in the correct directory for calling _contains_ref()
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:34:24 +00:00
Richard Purdie 917d3e9697 bitbake/fetch2/git: Fix localpath to point at the clone repo since we no longer always generate a mirror tarball and it isn't a good guide to fetcher success
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:13:44 +00:00
Richard Purdie 7202a77134 bitbake/fetch2: Use True instead of integer values
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:37 +00:00
Richard Purdie 8f2abf4a9f bitbake/fetch2: Drop name/override ordering backwards compatibility code
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:37 +00:00
Richard Purdie ee6f34483a bitbake/fetch2/svn: The concept of using dates with svn is totally insane, drop support
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:37 +00:00
Richard Purdie ca7adf7529 bitbake/fetch2: Define a new interface to the fetcher code though the 'Fetch' class
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:37 +00:00
Richard Purdie 08a9fef4fa bitbake/fetch2: Fix typo
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:37 +00:00
Richard Purdie 806d1c25f8 bitbake/fetch2: Drop legacy CVSDATE support
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:36 +00:00
Richard Purdie f60d9d6bd4 bitbake/fetch2: Move getSRCDate to FetchData class where is more appropriate
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:36 +00:00
Richard Purdie 831c6c1d3c bitbake/fetch2: Make srcrev_internal_helper a normal function, doesn't belong in the FetchMethod class
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:36 +00:00
Richard Purdie ab0dd13974 bitbake/fetch2: Rename Fetch class to FetchMethod
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:36 +00:00
Richard Purdie 74b71864fe bitbake/fetch2: Drop old md5 handling code
Drop some old md5 functions since we have improved functionality now which includes
sha256 checksum support. This stops each download being md5 checksumed twice.

Also change ".md5" stamp extentions to ".done" to better describe its use as a
download complete marker file and no longer write the md5 sum to the files.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:36 +00:00
Richard Purdie d08397ba4d bitbake/fetch2: Rewrite and improve exception handling, reusing core functions for common operations where possible
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:36 +00:00
Richard Purdie f6eefb3ca3 bitbake/fetch2: Have all fetcher exceptions derived from a common BBFetchException class
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:35 +00:00
Richard Purdie 8daab5b951 bitbake/fetch2: Drop unused parameter for localpath() and update comments
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:35 +00:00
Richard Purdie 7e4fbfc1c1 bitbake/fetch2: Simplfy setup_srcrevs
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:35 +00:00
Richard Purdie 49a022d25d bitbake/fetch2: Simplify localpath variable handling FetchData init
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:35 +00:00
Richard Purdie 5a52cb80d6 bitbake/fetch2: Define a sane localpath function and remove code duplication
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:35 +00:00
Richard Purdie 972eb5faba bitbake/fetch2: Move ud.localfile setup into urldata_init
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:35 +00:00
Richard Purdie 0e5404ceda bitbake/fetch2: Drop horrible SRCREV hack which is no longer needed
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:34 +00:00
Richard Purdie e4c1e99f23 bitbake/fetch2/git: Switch to completely use bare clones
We no longer need index/workdir support in the mirror tree and it causes all
kind of reference naming problems.Simplifying the code to remove this and use
just bare clones addresses this problem.

We increase the "version" number on the mirror tarballs to reflect the change
and ensure older mirror tarballs are not used as they would break.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-06 11:44:12 +00:00
Saul Wold 192f631129 fetch2/git.py: Fix problem when fetching with no origin
When updating a git repo, its possible to not have an origin,
so fail gracefully with a debug message.

Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-02-05 14:14:21 -08:00
Richard Purdie 96810cade0 bitbake/fetch2/git: Ensure we prune origin to remove stale branches
Thanks to Bruce Ashfield for the tip.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-05 15:43:36 +00:00
Richard Purdie dfc5faf717 bitbake/fetch2/git: Ensure deleted branches upstream are removed, all branch tags are forced to the upstream revisions and all revisions and tags are always fetched
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-03 20:18:52 +00:00
Richard Purdie 282a828f3d bitbake/fetch2: Remove old local file acceleration code
Since local mirror fetches are always symlinked from the download directory
directly, there is no need for this premirrors hack which doesn't cover
mirrors and also abuses the localpath variable with inconsistent results.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-03 18:24:25 +00:00
Richard Purdie fa9fda05e1 bitbake/fetch2: Ensure that mirror fetches are symlinked from the download directory
When files are fetched from a mirror source that happens to be local,
ensure links are created for the file since subsequent fetch calls
can then follow the links to find files.

Any other approach such as the existing manipulations of localpath
internally to the fetcher are prone to errors, races and other issues.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-03 18:22:06 +00:00
Richard Purdie 7f99605562 bitbake/fetch2: When encoding a file:// url, drop user and host information
When processing a cvs SRC_URI to a file:// mirror, the user and host information
will break the mirror processing. This patch addresses it by only constructing
valid urls.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-03 18:19:23 +00:00
Richard Purdie a55d86b405 bitbake/lib/bb/fetch2: Assign a default name in the names array as empty strings as names cause problems for python
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-03 00:16:23 +00:00
Richard Purdie 08cd6c1cb9 bitbake/fetch2: Add missing parameter to localcount_internal_helper
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-02 18:48:13 +00:00
Richard Purdie adfa6c40da bitbake/fetch2/git: Ensure target directory exists when copying files
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-02 17:46:37 +00:00
Yu Ke 0e837e6844 fetch2: Allow multiple src rev to be used in one src_uri
* SRC_URI format:
the SRC_URI are extended to allow multiple src rev:
name=<name1>,<name2>,...<name-n>
branch=<branch1>,<branch2>,...,<branch-n>
also SRCREV can be defined with
SRCREV_<name1> = xxxxx
SRCREV_<name2> = xxxxx

* FetchData extention
to support multiple src rev, several FetchData data are added:
- FetchData.names: list of name in SRC_URI,  one name per srcrev. name is the index of revision and branch
- FetchData.revisions: dictionary of name->revision.
- FetchData.branches: dictionary of name->branch.

For example, linux-yocto recipes becomes:
SRC_URI = "git://git.pokylinux.org/linux-yocto-2.6.37;protocol=git;branch=${KBRANCH},meta;name=machine,meta"

FetchData.names = ['machine', 'meta']
FetchData.revisions = { 'machine':xxxxx, 'meta':xxxxxx }
FetchData.branches = { 'machine':${KBRANCH}, 'meta':'meta'}

* generic revision handling extension
the related revision handling code in fetch2.__init__.py are changed accordingly. the major change is add name parameter to indicate which src rev to handling. originally there is one src rev per FetchData, so FetchData parameter is enough. now since one FetchData has multiple src rev, it is necessary to use FetchData + name to specifiy src rev.

* git extension
git fetcher are also revised to take advantage of the multiple src rev in FetchData. especially the download() method are enhanced to fetch multiple src rev.

* other fetcher (svn, hg, ...) does not support multiple src rev. they just sync the API to add name, and then simply ignore the name. no actually functional change

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-02-02 17:19:18 +00:00
Yu Ke affcfe468a git.py: Remove the source tree tarball archives
Since we're now always providing the git source control files it becomes
pointless to handle the tarballs of specific git revisions so drop this
part of the fetcher.

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-02-02 17:13:30 +00:00
Richard Purdie 05048e0f91 bitbake/fetch2/git: Add nocheckout option to disable checkouts and always add scm data to checkouts
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-02 17:11:41 +00:00
Yu Ke 3a3fc6b071 bb.fetch2: Add git unpack
The git download method clones the git repository to the local machine. The unpack process
can be optimised to be a local to local machine clone or a direct readtree operation to the
destination using git.will clone git repo to local, so git unpack can be simplified
to only checkouting the code to the work dir. For fullclone case, we also
need to manually copy all the ref info, which is needed by the later do_kernel_checkout().
Rather than use hardlinks, we reference the repository using alternatives since the
download directory may be on a different filesystem.

[Change to use -s by Richard Purdie]

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-02-02 17:05:48 +00:00
Richard Purdie 05954ef4d7 bitbake/fetch2: Ensure the local revision counter takes a default value of 0, not None
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-01 23:33:19 +00:00
Richard Purdie 06c6db7929 bitbake/runqueue.py: Avoid starvation of events to the server
The server UI was reading 1024 bytes, then sleeping for 0.25 seconds. Since
most new LogRecord events are larger than this it leads to a build up of data
which is only processed slowly, leading to a bottleneck and a slow down of
all bitbake processes.

Thanks to Dongxiao Xu <dongxiao.xu@intel.com> for the great work in debugging
this. A large value has been left in for the read() command just to ensure some
fairness amongst process handling if a task tries to log truly huge amounts of
data to the server, or goes crazy and ensures the main loop doesn't stall.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-28 10:21:41 +00:00
Richard Purdie c34913ea5a bitbake/build.py: When looking up extra stamp info for setscene tasks, use the real taskname
(Fixed based on a bug reported by Dongxiao Xu <dongxiao.xu@intel.com>)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-27 11:20:58 +00:00
Richard Purdie 5f866ac84f bitbake/unlockfile: Fix exception handling
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-26 12:20:14 +00:00
Yu Ke 029f8584d5 bitbake/fetch2: Instrument fetchers when making network access
Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-25 12:32:50 +00:00
Yu Ke 098e8ded33 bb.fetch2: add "BB_NO_NETWORK" option
Sometime user want a purely local fetching, i.e. using local mirror without
any remote netowrk access. BB_NO_NETWORK option is introduced for this purpose

check_network_access() is the guard for BB_NO_NETWOKR option. it should be
put in any place that fetcher use network access

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-25 12:32:49 +00:00
Yu Ke 733de7596c bb.fetch2: remove the obsolate Fetch.try_mirrors referrence
Fetch.try_mirrors is no longer exists, so the code is obsolate

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-25 12:25:47 +00:00
Yu Ke ef918a72de git.py: split download to download() and build_mirror_data()
the download is to fetch the source from URL, the build_mirror_data is
to create the mirror tar ball. the original go() method mix them together,
it is more clean to split them.

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-25 12:25:47 +00:00
Yu Ke e05918937c bb.fetch2: rename "go" with "download" to better reflect its functionality
no functional change

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-25 12:25:47 +00:00
Yu Ke f12e714845 bb.fetch: add fetch version to distinguish bb.fetch and bb.fetch2
there is case that we need to distingush bb.fetch and bb.fetch2,
and use different API for bb.fetch and bb.fetch2. so it is necessary
to add version info for distinguish purpose

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-25 12:25:46 +00:00
Yu Ke 84ff79413a bb.fetch2: revise the Fetch.unpack API
change the unpack to use the urldata and rootdir parameter
- urldata is the FetchData instance
- rootdir is the dir to put the extracted source. the original unpack
  use current dir (os.getcwd) as destination dir, which is not flexible
  and error-prone (error will occur if caller not chdir to dest dir)

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-25 12:25:46 +00:00
Yu Ke d8698b92ff bb.fetch2: add unpack method in fetcher
copy exactly the base.bbclass:oe_unpack_file() to bb.fetch2 as the code base

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-25 12:25:46 +00:00
Richard Purdie 74783fec56 bitbake/utils: Ignore OSError in unlockfile
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-24 14:26:50 +00:00
Kevin Tian bcb1873836 siggen.py: better print for task hash comparison
current bitbake-diffsigs simply print out the whole 'runtaskdeps' when there's mismatch, which
is not very readable. On the other hand, 'runtaskhashes' comparison is broken which assumes
same key existing in two sides. This commit provides better output by figuring out differences
from addition, removal or hash change.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
2011-01-21 01:36:17 -08:00
Dongxiao Xu 5da9423217 bitbake: fix parameter order for flaglist()
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
2011-01-20 23:29:25 +00:00
Richard Purdie d4f537965b bitbake/providers.py: Fix runtime providers problems
Take a real world testcase where you have two recipes, each of which
contains PACKAGES_DYNAMIC = "gdk-pixbuf-loaders-*" and recipes which
RDEPEND on some gdk-pixbuf-loaders-xxx package. To select between these
you need to set a PREFERRED_PROVIDER.

These are specified in the PN namespace so the locgical conclusion is
that setting PREFERRED_PROVIDER_gdk-pixbuf = "gtk+" should work. It
doesn't and instead checks crazy things.

The code was correctly finding the two possible providers, gtk+ and
gdk-pixbuf. It was however only accepting PREFERRED_PROVIDER_gtk+
= "gdk-pixbuf" to resolve this problem which reads as the exact
opposite to what was wanted.

This patch changes the code to do something that makes sense. I suspect
that before these changes it was pretty much a null operation rubber
stamping the single provider case. For Poky at least it exposes a few
cases where -nativesdk recipes were providing the same things as their
normal counterparts but these are genuine bugs in the metadata.

I've also attempted to make the multiple provider error message human
readable as I counldn't understand it and I doubt anyone else could
either.

Signed-off-by: Richard  Purdie <richard.purdie@linuxfoundation.org>
2011-01-20 22:44:33 +00:00
Richard Purdie fd88588df0 bitbake/utils.py: Teach unlockfile about shared mode lockfiles
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-19 13:30:14 +00:00
Richard Purdie 7857834691 bitbake/utils.py: Add option of holding shared lockfiles
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-19 11:01:54 +00:00
Dongxiao Xu 80cf3e405c bitbake: Introduce stamp-extra-info task flag into stamp filenames
For certain tasks, we need additional information in build stamp file
other than the task name and file name. stamp-extra-info is introduced as
a task flag which is appended to the stamp file name.

[Code simplifcations/tweaks from Richard]

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-18 12:50:04 +00:00
Richard Purdie 72b452ecf2 bitbake/build.py: Allow FuncFailed error to have an optional message
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-17 23:54:28 +00:00
Richard Purdie 0388f0758f bitbake/build.py: Rename message field to avoid DeprecationWarning: BaseException.message warning
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-17 15:52:06 +00:00
Richard Purdie 25b3d39612 bitbake/siggen.py: Fix whitelisted variable handling
Even when a variable was whitelisted, any dependencies of that variable
could still creep into the task hash due to the way the whitelisting
code worked. This patch changes thing to ensure that when whitelisted,
that whitelisting applies to the variable and any dependencies it has.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-12 15:58:48 +00:00
Bernhard Reutner-Fischer bff1d2ba06 build: remove duplicate import of utils
(Bitbake rev: 86c6434f093ce5e55d1febfb424a8e595ffc2d17)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-12 13:47:18 +00:00
Bernhard Reutner-Fischer 2ef204dcdd *: use utils.remove() some more
(Bitbake rev: d3489b141cac1197324661680fe38b8a88bc49b4)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-12 13:47:14 +00:00
Bernhard Reutner-Fischer c405a3a13e codeparser: fix spacing in diagnostic messages
(Bitbake rev: 8c5555f5ed6d61db57de80d2820c8cec64a27239)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-12 13:47:08 +00:00
Richard Purdie 3f08b7f1ea bitbake/knotty.py: Ensure task note messages are only surpressed at default log levels
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-12 13:45:39 +00:00
Joshua Lock ac5c28a462 bitbake/goggle: don't drop events
We had a logic inversion that meant we where dropping quite a
significant number of events on the floor.... Fixed!

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-01-12 11:43:50 +00:00
Joshua Lock e21150f2b1 bitbake/depexp: closing progress dialog kills gui
It seems safe to assume a user hitting the close button
on the dialog wants to kill the whole UI.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-01-12 11:43:50 +00:00
Joshua Lock c9bb30b232 bitbake/goggle: closing the progress dialog kills the UI
It's unlikely that someone wants to close the progress dialog
yet leave the UI (and BitBake process) running, so hook up
the progress dialogs delete-event to exit gtk.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-01-12 11:43:50 +00:00
Joshua Lock 749ca68709 bitbake/uievent: fix queueing of events for xmlrpc before UI has loaded
The recent change to Queue up events before the UI is spawned (in
26eda93337) broke the xmlrpc server because the
uievent implementation of BBUIEventQueue expects pickled strings for its
queue_event() method.

This is because the RPC exposed event.send() method must accept pickled
strings, but for xmlrpc event.send() is just mapped to queue_event().

Work around this by adding a send_event method which unpickles strings and
hands them off to queue_event() which can then be used for the remapping.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-01-12 11:43:50 +00:00
Richard Purdie 4b055ed937 runqueue.py: Renable check_stamp_fn() for now since we still fork for task execution (as per bitbake-upstream)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 22:36:23 +00:00
Richard Purdie 0b3d443fc1 bitbake/runqueue.py: Simplify hashdata storage since we're not using an external script for tasks anymore, in line with bitbake-upstream
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 22:32:46 +00:00
Chris Larson 4428aabc92 msg: no need to hardcode the logging levels
(Bitbake rev: 8385bfb7da3a3b71f340a787d7f1502ba61c5b81)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 22:10:53 +00:00
Chris Larson d967f3b731 vim: properly highlight python inside of ${@}
(Bitbake rev: 4210eb0b783bf9bbdf80b6c6806f66f3e6ec1e77)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 22:10:41 +00:00
Chris Larson cbcd8e5296 vim: handle highlighting exports without assignment
(Bitbake rev: f36354a1bfd3f92979c5ad61a1e5d796f8246f60)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 22:10:30 +00:00
Chris Larson 55606ce78d vim: add an ftplugin for indentation settings
(Bitbake rev: 29ce70ac857a155b27f1909286bc3a0f7429bea0)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 22:10:12 +00:00
Chris Larson 810e139fd3 Inject taskpid into log records via our log handler
It turns out that while log filters added with addFilter are only associated
with that logger, and not its children, handlers are inherited, and handlers
can be filters.   So, let's add filtering to our existing LogHandler class
which dispatches our log records as bitbake events.

(Bitbake rev: 0153ace246e7c88366f45c8f035a2b4505a1c115)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 22:09:11 +00:00
Richard Purdie 48e567bb47 bitbake/runqueue.py: Fix del_stamp calls and -f option to bitbake with the BasicHash siggen code
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 21:59:34 +00:00
Yu Ke 2b2dbf7612 Fetcher: only set __BB_DONT_CACHE when SRCREV = "${AUTOREV}"
we should cache SRCREV whenever possible, the only exception is
when SREREV is auto rev. so change the logic to only set __BB_DONT_CACHE
at SRCREV = "${AUTOREV}" case

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-10 20:37:37 +00:00
Yu Ke 1589a1172f Fetcher: break the "SRCREVINACTION" deadlock
Current fetcher has annoying "SRCREVINACTION" deadlock,
which occurs when SRCREV=${AUTOREV}=@bb.fetch.get_srcrev():
get_srcrev()->setup_localpath()->srcrev_internal_helper()
->evaluate SRCREV->get_srcrev()

current fetcher resolve the deadlock by introducing a
"SRCREVINACTION" condition check. Althoguh it works, it is
indeed not clean.

This patch use antoehr idea to break the deadlock: break
the dependency among SRCREV and get_srcrev(), i.e. assign
a specific keyword "AUTOINC" to AUTOREV. when Fetcher meet
this keyword, it will check and set the latest revision to
urldata.revision. get_srcrev later can use the urldata.revision
for value evaluation(SRCPV etc). In this case, SRCREV no longer
depends on get_srcrev, and there is not deadlock anymore.

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-10 20:24:33 +00:00
Yu Ke 550c3bd821 bb.fetch2.bzr: add bzr urldata_init
move the bzr specific urldata init from localpath to urldata_init
so that it can be called early

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-10 20:22:12 +00:00
Yu Ke f684ff18a2 bb.fetch2.hg: add hg urldata_init
move the hg specific urldata init from localpath to urldata_init
so that it can be called early

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-10 20:21:59 +00:00
Yu Ke 7420e70f4f bb.fetch2.svn.py: add urldata_init
move the svn specific urldata init from localpath to urldata_init
so that it can be called early

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-10 20:21:48 +00:00
Yu Ke 54e34f6e25 bb.fetch2.git.py: add git urldata_init
move the git specific urldata init from localpath to urldata_init
so that it can be called early

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-10 20:21:35 +00:00
Yu Ke 2892cbfb11 bb.fetch2: add urldata_init call for Fetch class
FetchData has some fetch method specific data, and only fetch method knows how
to initialize it. originally it is mostly initialized in Fetch.localpath().
But now there is requirement to call Fetch.latest_revision() before
Fetch.localpath(), thus require another earlier place for initialization. so
urldata_init is introduced for this purpose. it will be called in FetchData:__init__
and make all the Fetch functions useable after that.

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-10 20:21:15 +00:00
Yu Ke 9e3a92c04a BBHandler: remove bb.fetch referrence
BBHandler.py no longer use bb.fetch, so remove its import statement

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-10 20:20:24 +00:00
Richard Purdie c02f89fe24 bitbake: For poky only, force the use of fetch2 codebase
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 18:13:53 +00:00
Richard Purdie af06e4a8ef bitbake: Switch to fetch2 fetcher code based on the environment variable BBFETCH2
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 18:12:53 +00:00
Yu Ke c64b445f38 bb.fetch2: replace bb.fetch with bb.fetch2 in the bb.fetch
bb.fetch2 is copied from bb.fetch, and has many bb.fetch referrence.
Fix these referrence with bb.fetch2 referrence

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 18:05:07 +00:00
Richard Purdie 6b212ad3c3 bitbake/fetch/git: Add backwards compatibility code for branch name handling
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 14:27:30 +00:00
Yu Ke 4dccd92439 bitbake: copy bb.fetch to bb.fetch2 as initial code base for fetcher overhaul
Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 14:23:36 +00:00
Richard Purdie c036d1a5a0 bitbake/codeparser: Fix import to match upstream bitbake
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:05 +00:00
Chris Larson a17d271db2 utils: show the actual exception in better_exec
(Bitbake rev: a148e6a63c842ac586ac1dddbd9008f93cdea297)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:04 +00:00
Richard Purdie cd382f9546 runqueue.py: Drop unneeded import and improve quieterrors handling as per upstream bitbake
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:04 +00:00
Richard Purdie 2c2d160c88 bitbake: Update event queue handling to match upstream bitbake
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:04 +00:00
Richard Purdie 9336ba1fd2 bitbake/runqueue.py: Sync with changes in upstream bitbake
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:04 +00:00
Richard Purdie 5cc720aac2 bitbake/fetch: Sync up logger/whitespace improvements
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:04 +00:00
Richard Purdie 8d6800bc8e bitbake/utils.py: Drop unused function extend_deps()
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:04 +00:00
Richard Purdie c186419173 bitbake: Sync environment handling function names and comments with upstream alterations
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:03 +00:00
Chris Larson b127874ee6 parse: pass filename, lineno into the ast
We will be needing this information to improve the tracebacks of python code
from the metadata, as well as to give the user information about where
variables were defined, so they know how it ended up the way it is.

(Bitbake rev: 9615c538b894f71a2d1a0ba6b3f260db91e75786)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:03 +00:00
Chris Larson f305e95840 cache: don't expand variables for skipped recipes
Errors can result from these expansions, but for skipped recipes, we
shouldn't care about those failures.  This fixes the same issue which
Richard Purdie fixed in poky, commit 847b717.

(Bitbake rev: 96ee6840010c1ae1080e6bf7ff0f4eb2d361e84b)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:03 +00:00
Richard Purdie b22e345e05 bitbake/knotty.py: Don't show log messages of NOTE and below for task processes
This cleans up the knotty console messages to be a lot quieter and cleaning,
in keeping with the expectations of most users.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-08 00:02:00 +00:00
Richard Purdie f8e7215f6c bitbake/__init__.py: Add taskpid to all LogRecords (subclassed to be BBLogRecords)
This allows us to identify which task messages are from.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-08 00:02:00 +00:00
Richard Purdie a13352cfaf bitbake/msg.py: Add named definitions for all logging levels
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-08 00:01:59 +00:00
Richard Purdie 5c69fab405 bitbake/runqueue.py: Remove duplicate TaskStarted event fire()
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-07 16:23:29 +00:00
Richard Purdie 5da9747024 bitbake/build.py: Fix del_stamp work correctly after recent stamp function changes
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-07 14:03:27 +00:00
Richard Purdie 0e26f53f9e bitbake/cooker.py: Fix merge conflict with upstream which was preventing clean bitbake shutdown
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-07 13:54:50 +00:00
Richard Purdie 847b717862 bitbake/cache.py: Expansion of variables in skipped recipes should not be attempted as they can trigger errors
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-07 12:56:06 +00:00
Lianhao Lu 6f454c10bc bitbake/data.py: corrected the output for shell syntax.
[BUGID# 645], modify the emit_var()
1. Added "#" to the beginning of each line if the comment contains
multiple lines.

2. Added "\" to the end of each line if the shell variable value
contains multiple lines.

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
2011-01-07 11:14:22 +00:00
Richard Purdie 97789a160a bitbake/siggen.py: Add a signature generator which adds the hash to the stamp files
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-07 11:04:38 +00:00
Richard Purdie df8569b4d8 bitbake/runqueue.py: Fix a bug where do_setscene dependencies would be ignored
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 19:48:47 +00:00
Richard Purdie 66c6200ff3 bitbake build/siggen/runqueue: Fix stampfile parameters
The current parameters are not useful to the stampfile generator function
as they can't uniquely define a task. This updated things so the
parameters can identify unique tasks.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 19:47:03 +00:00
Richard Purdie ec6e4793dc bitbake build.py: Stamp handling improvements
* Move stamp file deletion out of the internal stamp helper function
* Add a new function to return the path to a stamp for a given task

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 19:43:56 +00:00
Richard Purdie 4a10a5b438 bitbake build.py: Use localdata for stamp handling, not d
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 19:40:41 +00:00
Richard Purdie 51a2e8712a bitbake/build.py: Ditch the extract_stamp function as its just going to complicate improving the stamp handling functions
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 15:41:39 +00:00
Chris Larson 37391f667f parse.ast: drop __word__ regular expression
We can use the string split method for this instead.

(Bitbake rev: aa9646717b3ee1006628246a7c495f601e62391c)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 10:49:29 +00:00
Chris Larson 1204ed79fc parse.ast: avoid code duplication for inherit
(Bitbake rev: 0b11a3d4eab84b372fd45b9537cf0327008daf8d)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 10:49:01 +00:00
Chris Larson 74653168c0 event: use BBLogFormatter in print_ui_queue
This ensures that when a failure occurs very early on in bitbake startup, the
message formatting ematches that used by the UIs.

(Bitbake rev: c8ff0fd3e9f050a668f1a069cf37ee37db3664fa)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 10:47:08 +00:00
Chris Larson e7febaa343 build: use logger.isEnabledFor, not getEffectiveLevel
I think this is less confusing, and avoids needing to know about the *range*
of logging levels, instead simply asking what we really want to know.

(Bitbake rev: dc2264387617586b5c0a61e126c75edde5e7abcd)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 10:46:54 +00:00