Compare commits

...

1053 Commits

Author SHA1 Message Date
Joshua Lock
afd0958d27 Green 3.3.1 Release
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-07-08 12:14:07 +01:00
Richard Purdie
2b9dbe57a4 package_*.bbclass: Only set pkg in overrides. These are the only values we're interested in expanding and this makes sure we obtain the expected data
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-07 12:56:25 +01:00
Richard Purdie
d538d8e171 Revert "classes/package_ipk|_deb|_rpm.bbclass: Fix setting of OVERRIDES when packaging"
This reverts commit 3abe7a0624 which was incorrect
in some assumptions about OVERRIDE handling order.
2010-07-07 12:24:49 +01:00
Joshua Lock
d42f0b9153 classes/package_ipk|_deb|_rpm.bbclass: Fix setting of OVERRIDES when packaging
The OVERRIDES variable was being incorrectly set with the end result of the
runtime dependencies of the package not being encoded in it's package metadata.

This broke opkg-native in meta-toolchain.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-07-03 13:35:22 +01:00
Richard Purdie
f5003084d5 encodings: Specify encodingsdir as the default was being detected incorrectly resulting in an empty package
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-30 15:08:42 +01:00
Enric Balletbo i Serra
763b11d0fd busybox: fix unexpected "done" in /etc/udhcpc.d/50default script.
Run udhcpc results in

 udhcpc (v1.15.3) started
 /etc/udhcpc.d/50default: line 37: syntax error: unexpected "done" (expecting "fi")
 run-parts: /etc/udhcpc.d/50default exited with code 2

Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-29 13:36:16 +01:00
Kevin Tian
7d292468e7 qemux86/xorg.conf: no DefaultDepth for VMware SVGA driver
VMware SVGA driver needs to have same depth between the host and the guest. Or put in
other word, the depth read by the guest is the value read from host. The guest is not
allowed to change virtual depth to other value. With DefaultDepth option xorg.conf,
vmware driver rejects to work with suggestion "Please do not specify a depth on the
command line or via the config file".

Signed-off-by Kevin Tian <kevin.tian@intel.com>
2010-06-29 13:36:07 +01:00
Kevin Tian
f51bb81248 qemu: fix VMware VGA depth calculation error
VMware SVGA presents to the guest with the depth of the host surface it renders
to, and rejects to work if the two sides are mismatched. One problem is that
current VMware VGA may calculate a wrong host depth, and then memcpy from virtual
framebuffer to host surface may trigger segmentation fault. For example, when
launching Qemu in a VNC connection, VMware SVGA thinks depth as '32', however the
actual depth of VNC is '16'. The fault also happens when the host depth is not
32 bit.

Qemu <4b5db3749c5fdba93e1ac0e8748c9a9a1064319f> tempts to fix a similar issue, by
changing from hard-coded 24bit depth to instead query the surface allocator
(e.g. sdl). However it doesn't really work, because the point where query
is invoked is earlier than the point where sdl is initialized. At query time,
qemu uses a default surface allocator which, again, provides another hard-coded
depth value - 32bit. So it happens to make VMware SVGA working on some hosts,
but still fails in others.

To solve this issue, this commit introduces a postcall interface to display
surface, which is walked after surface allocators are actually initialized.
At that point it's then safe to query host depth and present to the guest.

Signed-off-by Kevin Tian <kevin.tian@intel.com>
2010-06-29 13:35:59 +01:00
Richard Purdie
d3b8687ea6 gcc: Add patch to allow disabling of libstdc++ linkage and hence fix gcc-runtime which was having broken configure tests due to the linker failures and assuming maths primitives were not in libm
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-29 13:35:50 +01:00
Richard Purdie
93f7d74492 qemu: Enable ppc system emulation and fix ppc build
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-29 13:35:30 +01:00
Joshua Lock
e2c567f51e pkgconfig: add patch to disable legacy scripts such as glib-config
On an F13 host with glib-config installed pkgconfig-native can get into a
horrible state with recursive calls between pkg-config and glib-config.
The patch adds a configure time option to disable legacy script support in
pkgconfig and makes use of the option for Poky.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-25 14:58:43 +01:00
Joshua Lock
7646f333e1 cross-canadian: ensure package dependencies are generated correctly
cross-canadian packages need to look for their SOLIBS in the nativesdk
sysroot so that dependencies are correctly picked up and meta-toolchains are
correctly built.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-25 14:58:34 +01:00
Joshua Lock
b318d8f87b gdb-cross-canadian: build with the host-triplet prefix
Our cross-canadian tools our built with the host-triplet prefix, gdb should do
similar.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-23 18:44:59 +01:00
Scott Garman
0128976cb0 kernel.bbclass: Remove additional binaries from staging
* Remove additonal binaries known to cause "strip command failed"
  errors during do_package on cross platforms.

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
2010-06-23 18:44:59 +01:00
Joshua Lock
5a4342cb2e qemu: fix sloppy merge
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-23 18:02:45 +01:00
Jeff Dike
6e4579b32b qemu: Work around the crash seen on Ubuntu.
Due to different stack contents in sdl_display_init on Ubuntu vs other distros,
an uninitialized structure is causing a crash.  Zeroing the structure makes the
behavior uniform across distros, avoiding the Ubuntu crash, but doesn't fix the
underlying bugs, notably:
the return value of SDL_GetWMInfo needs to be checked, as it's currently
failing silently
the underlying reason for the failure of SDL_GetWMInfo needs to be found -
there is a GetWMINfo method in the internal SDL structure which is NULL, and
the reason for this needs to be found.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
2010-06-23 17:32:47 +01:00
Dexuan Cui
bd11abb22c linux-omap: fix build failure with gcc-4.3.3
Pull time.h patch from upstream Linux kernel
(commit 38332cb98772f5ea757e6486bed7ed0381cb5f98)

The patch fixes the following build failure:
  LD      .tmp_vmlinux1
kernel/built-in.o: In function `timespec_add_ns':
    undefined reference to `__aeabi_uldivmod'
kernel/built-in.o: In function `do_gettimeofday':
    undefined reference to `__aeabi_uldivmod'
    undefined reference to `__aeabi_uldivmod'
kernel/built-in.o: In function `timespec_add_ns':
    undefined reference to `__aeabi_uldivmod'
    undefined reference to `__aeabi_uldivmod'
kernel/built-in.o: more undefined references to `__aeabi_uldivmod'

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2010-06-23 13:24:52 +01:00
Joshua Lock
e1798f5e39 linux-libc-headers: delete include/scsi/scsi.h, it's not for userspace
include/scsi/scsi.h is not userland parsable and research indicates this is
because the header should not be exposed to userspace. Therefore remove it
in the install.

Research done by Tom Rini <tom_rini@mentor.com> in OE commit
91d3d92a626da89dfe13d63e68a90dbafdbaef1d

This has been the case since kernel 2.6.31

Bump glibc and uclibc PR's so that users have sane <scsi/scsi.h>

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-18 10:34:06 +01:00
Dike, Jeffrey G
b43a425119 linux-libc-headers: Remove ioctls for deleted driver
2.6.33 removed the Hayes ESP driver.  The presence of these ioctls
makes setserial believe that ESP support should be built in, breaking its
build.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
2010-06-17 15:08:53 +01:00
Joshua Lock
01a5883616 qemu: Fix linking of the native package on Fedora 13
Fedora 13 switched the default behaviour of the linker to no longer
indirectly link to required libraries (i.e. dependencies of a library
already linked to). Therefore we need to explicitly pass the depended on
libraries into the linker for building to work on Fedora 13.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-17 15:08:49 +01:00
Joshua Lock
ed145bbdfe handbook: Fix stylesheet
Some sizes where defined without units (in our case px) causing display of the
header of the handbook to be broken.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-14 14:33:51 +01:00
Joshua Lock
dc123ba831 sanity.bbclass: Fix test for i686 SDKMACHINE
The 'is' keyword tests for object identity, returning True if the variables are
both referencing the same object. Changed the test to use the equality
operator, which compares the values of the objects.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-14 12:51:34 +01:00
Joshua Lock
887a7768cf handbook: Fix typo in last commit
Managed to mangle the command...

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-14 12:12:09 +01:00
Joshua Lock
aba90fdf2f handbook: fix extraction command
We ship bzipped tarballs now so we need to pass j to tar, not z

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-14 12:08:12 +01:00
Joshua Lock
27cff3f045 handbook: Note that this is the documentation for Green
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-14 12:03:21 +01:00
Joshua Lock
506386d148 handbook: Fix references to the stable release
The handbook was still talking about the purple release, we're green now

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-14 11:45:30 +01:00
Joshua Lock
f5d24f0574 handbook: Fix generation of HTML handbook
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-14 11:44:56 +01:00
Joshua Lock
d36f183ade Green 3.3 Release 2010-06-11 14:43:33 +01:00
Joshua Lock
6129f9fc44 packaged-staging.bbclass: fix typo in scan_cmd
it's PSTAGE_TMPDIR_STAGE, not PSTAGE_TMDPDIR_STAGE spotted by Chris Larson
<chris_larson@mentor.com>

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-11 14:43:33 +01:00
Richard Purdie
836bddc71e xserver-kdrive: Disable dolt to fix build failures
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-11 11:37:33 +01:00
Joshua Lock
ee13bb0b1a linux-moblin-2.6.33.2: Enable trackpads for netbooks
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-11 11:28:39 +01:00
Richard Purdie
11d8097053 site/powerpc: Add popt site options
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-11 11:10:21 +01:00
Richard Purdie
2e62c640e7 gnome-keyring: Add missing DEPENDS on gconf
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-11 11:09:58 +01:00
Richard Purdie
d6bda454f8 qemuppc: Add ppc603e to PACKAGE_EXTRA_ARCHS, fixing image builds
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-11 10:27:02 +01:00
Scott Garman
b5fc6abac9 poky.bbclass: Add second fall-back sources mirror
* Green and newer releases can now use http://autobuilder.pokylinux.org/sources/

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
2010-06-11 10:19:03 +01:00
Richard Purdie
155770a597 task-poky-tools: Disable kexec for powerpc
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-11 09:31:37 +01:00
Scott Garman
482b3ef78c gypsy: Fix broken SRC_URI
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-11 09:18:41 +01:00
Kevin Tian
c32daf4554 icu-native: LD_LIBRARY_PATH is required
Back to commit ea45876d7b, LD_LIBRARY_PATH
is disable for cross-build, however it's required for native version. So
force noldlibpath.patch for non-native case only

Signed-off-by Kevin Tian <kevin.tian@intel.com>
2010-06-11 11:57:22 +08:00
Nitin A Kamble
fd4924087c Add an entry for ${BPN} in the handbook
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-06-10 17:34:57 -07:00
Richard Purdie
57c7dda03e js: Fix mips build and other architecture inconsistency
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-10 22:12:55 +01:00
Richard Purdie
ea45876d7b icu: Fix LD_LIBRARY_PATH corruption causing build failures
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-10 22:04:20 +01:00
Richard Purdie
beef002bb4 lib/oe/patch.py: Fix patch application failure interaction handling
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-10 20:22:41 +01:00
Joshua Lock
453ee8d573 poky-env-internal: fix a typo
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-10 15:59:11 +01:00
Richard Purdie
d92a12f761 poky-evn-internal: Add some documentation about the config file and commonly used build targets
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-10 15:51:36 +01:00
Joshua Lock
b5a370970f opkg: ensure the data directory is created
We need to ensure the data directory (/usr/lib/opkg) is created and shipped in
the package as it's used by opkg to create a lock file.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-10 15:04:38 +01:00
Joshua Lock
eb3c93f401 rootfs_ipk.bbclass: ensure the package manager can create lock files
The opkg package manager uses /usr/lib/opkg to store lock files in, modify the
remove_package_data_files() function to create an empty directory once the data
files are removed so that the lock can be created.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-10 14:49:50 +01:00
Richard Purdie
12a9dea241 qemu-nativesdk: Make sure the compiler prefix is set fixing cross sdk builds
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-10 12:05:38 +01:00
Joshua Lock
6a7549ff00 packaged-staging.bbclass: Use a differnet opkg.conf for each TARGET_ARCH
Assembling an appropriate opkg.conf in the pstage_helper is difficult when
building for multiple target architectures in one Poky directory, work around
this by generating an appropriate opkg.conf for the TARGET_ARCH and using an
${TARGET_ARCH}-opkg.conf for packaged staging.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-10 11:36:23 +01:00
Richard Purdie
8273262ae6 qemu-helper-nativesdk: Fix after file:// url handling changes
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-10 10:55:43 +01:00
Richard Purdie
07b4e14734 m4: Set further site entries
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-10 10:42:21 +01:00
Richard Purdie
80878dae5b LICENSE: Clarify the license recipe source code is under
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-10 10:13:18 +01:00
Joshua Lock
24ace6b45d linux-2.6.33.2: Ensure enable QEMU network drivers for qemux86
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-10 09:59:43 +01:00
Joshua Lock
2e0e24e849 scripts: Fix setting up links to cc and gcc in runqemu
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-09 17:32:01 +01:00
Richard Purdie
61a730184b kernel.bbclass: Drop code which is duplicated later in the function, fixing older kernel builds
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-09 14:27:13 +01:00
Richard Purdie
f38160b367 bootcdx86: This is dropped in favour of netbook iso images
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-09 12:58:46 +01:00
Richard Purdie
9b60f0d0b7 poky-image-sato-cd: This has been replaced by the -live image
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-09 12:58:06 +01:00
Richard Purdie
8eea156e9f xserver-kdrive-xomap: Bandaid for configure issues and modern autotools
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-09 12:56:21 +01:00
Richard Purdie
3ff78923ba gcc-4.3.3: Drop unused patches
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-09 12:50:17 +01:00
Joshua Lock
c2569a7405 udev: bump PR after cache fixes
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-09 12:07:59 +01:00
Yu Ke
1c803f3ffb Fix the boot process udev warning
Phenomena: there is udev warning in boot process
        tar: can't open '/etc/dev.tar': Read-only file system

The reason is that the init script /etc/rcS.d/S04udev will try to tar the /dev as cache to speed up udev at next boot time. Unfortunately, S04udev is too early and the filesystem is not writable yet.

To fix it, this patch split the cache action to another init script, and register it as /etc/rcS.d/S36, which is after the S35mountall, and the filesystem is already writable.

Signed-off-by: Yu Ke <ke.yu@intel.com>
2010-06-09 12:04:51 +01:00
Richard Purdie
efc47a8999 pciutils: Stop build breakage if HOST is set in the environment
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-09 11:29:30 +01:00
Richard Purdie
26a6079237 curl: Fix configure issue on mips
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-09 11:12:49 +01:00
Joshua Lock
99954dae46 linux: bump PR of linux-2.6.3243.2 after the fix for RTC
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-09 10:22:58 +01:00
Joshua Lock
52de67497f busybox: bump the PR after the syslog fix
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-09 10:22:24 +01:00
Zhai Edwin
aa913534e4 Fix the syslog starting failure
Should use "-Cxx" instead of "-C xx" as command line for syslog in busybox

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
2010-06-09 10:20:44 +01:00
Zhai Edwin
2e54470a0b Fix the issue of /dev/misc/rtc missing from hwclock.sh
Build RTC driver into kernel by default on qemux86 to avoid missing of /dev/misc/rtc

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
2010-06-09 10:20:43 +01:00
Richard Purdie
6f28a05ccc m4: Drop broken custom do_configure which stops site cache taking effect (amongst other issues) and drop duplicate PR setting
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-09 10:12:40 +01:00
Richard Purdie
247da0351e site/common-glibc: Add entries for m4
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-09 10:11:52 +01:00
Richard Purdie
fa64e20621 linux-moblin: Drop old versions (2.6.31.5 and 2.6.29.1)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-08 21:04:38 +01:00
Richard Purdie
3a8ee5864d gcc: Drop 4.2.3 as its unused
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-08 21:03:12 +01:00
Joe Sauer
47e5d86aad metadata_scm.bbclass: Make errors quiet if we're not in a git based scm
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-08 20:54:26 +01:00
Richard Purdie
f47eeddbd6 gcc-runtime: Various bug fixes
* Use the -nostdinc++ to CXX fixing libstdc++
* Generate libgcc in gcc-cross, save the result and use in gcc-runtime
* Fix the layout of the crt*.o files so the SDK compiler can find them

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-08 20:33:16 +01:00
Richard Purdie
d579b7c746 gcc-configure-sdk.inc: local-prefix should be in SDKPATH, not a build patch
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-08 20:32:44 +01:00
Richard Purdie
e77506b171 gcc-configure-cross.inc: local-prefix should be the target exec_prefix
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-08 20:32:01 +01:00
Richard Purdie
a06a85ab9b cross/cross-canadian.bbclass: Save target_exec_prefix variable
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-08 20:30:26 +01:00
Joshua Lock
fcd220b4fd handbook: document the LAYERDIR variable
LAYERDIR is one of the few variables which requires immediate expansion and is
worth documenting explicitly.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-08 17:53:25 +01:00
Joshua Lock
49df0b84fa .gitignore: Ignore the built bsp-guide
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-08 17:29:56 +01:00
Joshua Lock
79f330c6c9 handbook: point out required Python version
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-08 17:29:56 +01:00
Joshua Lock
3a6948a2af handbook: add documentation for layers
Collections and overlays are deprecated in favour of layers, a much cleaner and
non-intrusive way of extending Poky with custom recipes, classes and
configuration.

This patch updates the Extending Poky section of the handbook to show how to
use layers to tailor Poky while dropping  the existing section on using
collections.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-08 17:29:56 +01:00
Joshua Lock
6a9312cccc sanity.bbclass: Check for Python 2.6 or newer
In relocatable.bbclass and utility-tasks.bbclass we depend on functionality
that was only introduced with Pytrhon 2.6, so we now check that the build
system has it in the sanity class.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-08 17:29:46 +01:00
Joshua Lock
8f34dcfdbc handbook: Use new style patch application syntax
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-08 17:07:03 +01:00
Richard Purdie
40b0d41fd1 task-poky-standalone-sdk-target: Add libgcc-dev and libstdc++-dev to allow compiling in meta-toolchain to work
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-08 13:13:18 +01:00
Dongxiao Xu
f8c0b93562 gcc-cross: Fix install path typo.
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
2010-06-08 17:09:33 +08:00
Richard Purdie
1a53b52071 linux-moblin: Fix defconfig-netbook
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-07 23:29:58 +01:00
Richard Purdie
2f7b3e3f31 gcc-runtime: Make sure multiple target builds work correctly
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-07 23:09:00 +01:00
Richard Purdie
6118da2a7f syslinux: Fix native install to use the correct paths
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-07 21:58:21 +01:00
Richard Purdie
2160dddcc1 base.bbclass: Fix after bb.decodeurl was fixed
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-07 21:16:16 +01:00
Joshua Lock
c4a0b5463d sanity.bbclass: version each of the files in the build/conf/ directory
We already have versioning of the local.conf file but it's entirely plausible
for the bblayers.conf and site.conf to change incompatibly so we should version
those too.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-07 16:16:35 +01:00
Saul Wold
cab1009b08 Fixes for Qemu to use VGA and Touch Screen
Added usb tablet options to poky-qemu-internal script, and adjusted the
xorg.conf script for x86 to use VGA screen and tablet input device

Signed-off-by: Saul Wold <saul.wold@intel.com>
2010-06-07 16:13:00 +01:00
Jeff Dike
bf59d217a8 qemu: Update to 0.12.4
Renamed the recipe to 0.12.4.

Moved the patches directory to qemu-0.12.4 - when it was named
qemu-0.12, bitbake silently ignored the patches, and only failed when
it came time to apply them.

Added a FILESDIR to the git recipe and changed its PV to 0.12.4 so it
can use the same patches as the normal recipe for now.

Removed the series file - it wasn't needed.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
2010-06-07 16:10:19 +01:00
Nitin A Kamble
fc81ca7d2d insane.bbclass: Throw better error if path is bad
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-06-07 16:05:12 +01:00
Nitin A Kamble
c3682bf89b bitbake decodeurl: fix the file:// url handling
Without this patch decoding a url of this kind file://dir/filename gives
path=/filename host=dir.
With the patch it decodes as path=/dir/filename host=""

Probably nobody stumbled on this issue yet because nobody used
file:// urls with directory names in the path.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-06-07 16:05:00 +01:00
Jeff Dike
807e983632 e2fsprogs: Remove all mention of anything associated with uuids
--disable-libuuid is added to the configure command line.  This has
the effect of disabling the compilation of uuidgen and libuuid.so.

These two are specified as making up their own packages, which turn
out to be empty, and thus aren't created in the first place.  The
error which manifests itself is at the final creation of the rootfs
when the global package depends on the e2fsprogs-uuidgen and libuuid,
which turn out not to exist, because they weren't created.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
2010-06-07 16:04:00 +01:00
Jeff Dike
42e7e4f3e2 wpa-supplicant: Don't run populate-volatile.sh on the build system
Move the populate-volatile.sh call to below the offline check.
Otherwise, it will try to run during the build, on a system which
likely doesn't have populate-volatile.sh.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
2010-06-07 16:03:45 +01:00
Joshua Lock
8f367b6930 packaged-staging: Add the correct architectures to the opkg conf
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-04 20:02:09 +01:00
Joshua Lock
1ccbc1549e handbook: use XML catalogues to make building work on all(?) distros
Thanks to Damien's pointers we should now be able to generate the handbook
regardless of host distro

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-04 20:02:06 +01:00
Joshua Lock
f5d0471541 busybox: Fix redirection of fd 0 in ash interactive
Backported change from the 1.16.1 ash patches.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-04 20:02:01 +01:00
Jeff Dike
fe4e6fc997 module-init-tools: Don't cross-build static binaries
When building the native version, I get errors from ld complaining
about not being able to find a static libc.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
2010-06-03 12:28:10 +01:00
Kevin Tian
3161c9b15a utility-tasks.bbclass: automatic upstream version check
Automatic upstream version check can be triggered by "bitbake xxx -c checkpkg".
The rationale behind is to find a automatic way for version comparison between
current in-use one and upstream progress. The tricky thing is how to find out
useful version string from mass diverse information. Fortunately now it mostly
work for wget based protocol, except some sites (e.g. sourceforge) not providing
a directory service. Repo (git/svn/cvs) based protocols are handled in a very
simple manner, by always tagging as update required. This will be further
improved later. Use 'world' target to retrieve a full version check for all
active recipes.

Along with version check, other package information is also collected from
existing fields in .bb file

Signed-off-by Kevin Tian <kevin.tian@intel.com>
2010-06-03 12:23:22 +01:00
Richard Purdie
50224b5afa libtool-cross: Allow the compile to run else we can generate invalid (unpatched) libtool files
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-03 09:05:03 +01:00
Joshua Lock
9d9b64aaf0 bitbake.conf: Remove util-linux from ASSUME_PROVIDED
We need to build our own util-linux now

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-02 16:15:15 +01:00
Joshua Lock
17f3c548ca util-linux: bump to 2.17 based on OE recipe
Needed to increase version to one which includes libuuid and change do_install
for building a native version.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-02 16:14:54 +01:00
Joshua Lock
c4476f7914 e2fsprogs: add util-linux to depends
e2fsprogs requires libuuid to build and we have disabled its built in version
in favour of the one in util-linux, therefore we need util-linux in the DEPENDS

Drop old configure option --enable-dynamic-e2fsck

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-02 15:25:23 +01:00
Joshua Lock
7ada79de07 sanity.bbclass: check for invalid characters in OEROOT
Some characters in the path for OEROOT are known to cause issues, so check for
them in the sanity checker.
Currerently we warn on +'s and spaces.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-02 15:25:00 +01:00
Richard Purdie
9ea69b17f7 utility-tasks: Remove unneeded addtask parameter
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-02 14:07:59 +01:00
Nitin A Kamble
6b82b70c93 Handbook: Documentation for DISTRO_PN_ALIAS
Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com
2010-06-02 14:06:03 +01:00
Nitin A Kamble
682983b548 xset: Defining DISTRO_PN_ALIAS for distro_check
This recipe has different names in the different distros. So defining
these aliases for the distro_check task use.

Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-06-02 14:06:03 +01:00
Nitin A Kamble
2ccd2e67c5 Handbook: Documentation for LIC_FILES_CHKSUM
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-06-02 14:06:02 +01:00
Nitin A Kamble
5ae3f65531 do_distro_check: Recipe exists in other distros?
This adds a new task (distro_check) for each recipe.
The task generates the source package list for Fedora OpenSuSE
Ubuntu Debian & Mandriva Linux distros.

As one recipe or source package can generate multiple target packages
the recipe name is compared with the source package name list of LInux
distributions.

Thread locking is used to avoid multiple threads racing for the
package list update.

Then the recipe name (PN) is checked if it exists in the package
list of distros. And if the DISTRO_PN_ALIAS then it is used to copmare
pacakge_name instead of the PN variable. Just for example the
DISTRO_PN_ALIAS can be defined in the recipe (.bb) files like this

In the file xset_1.0.4.bb:

DISTRO_PN_ALIAS = "Fedora=xorg-x11-server-utils;\
   Ubuntu=x11-xserver-utils; Debian=x11-xserver-utils;Opensuse=xorg-x11"

The final results are stored in the tmp/log/distro_check-${DATETIME}.result
file.

FYI this command will generate the results for all recipies:
bitbake world -f -c distro_check

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-06-02 14:06:02 +01:00
Nitin A Kamble
8514bcf5f8 iproute2: fix an issues with DATETIME
The DATE variable in this bb files was distrubing the DATETIME variable
used by the distro_check task.
Renamed the DATE variable to SRCDATE

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-06-02 14:06:02 +01:00
Nitin A Kamble
2ddc6c4b03 bitbake.conf: add the LOG_DIR variable
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-06-02 14:06:02 +01:00
Richard Purdie
648290d5bf libtool: Make sure ltmain.sh is always regenerated. We can't just remove it since it has to be present to run configure 2010-06-02 11:57:49 +01:00
Richard Purdie
420b1d8488 initscripts: Tweak checkroot to work with recent versions of busybox
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-02 11:45:59 +01:00
Richard Purdie
5b1c702566 e2fsprogs: Upgrade 1.41.5 -> 1.45.12
* The no-hardlinks patch is no longer required
* There was an autoconf macro issue which required a new patch (details in patch)
* libuuid was disabled, this should be provided by util-linux on modern systems
* Not providing libuuid is useful for the -native tools as it stops library symbol
  confusion with those from the host system.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-01 22:13:35 +01:00
Richard Purdie
fe37d679e0 gcc-configure-runtime: Make sure the sysroot is configured
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-01 17:52:53 +01:00
Richard Purdie
7dcf1e47b7 sanity.bbclass: Check for SDKMACHINE=i686 and error if found
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-01 17:25:05 +01:00
Joshua Lock
7f0181202a dropbear: don't apply no-password patch
The patch.bbclass changes default to applying listed patches without an
apply/patch parameter. Set the apply parameter to no.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-01 15:17:12 +01:00
Joshua Lock
e2598fefaa busybox: disable mdev, we use udev
The import from OE had included some mdev configuration, whereas Poky switched
to udev and a static (tarred) dev some time ago.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-01 15:17:12 +01:00
Joshua Lock
09536a7592 patch.bbclass: Merge patch enhancements from OE by Chris Larson
Chris made some interesting changes to the patch handling in OE. Firstly the
patch and pnum parameters have been renamed, to better reflect their function,
to apply and striplevel. The apply parameter now takes either yes or no as its
value.

Therefore a patch line would be changed from:
file://some.patch;patch=1;pnum=2
to:
file://some.patch;apply=yes;striplevel=2

Secondly the apply parameter is inferred if not defined. Entries in SRC_URI
with diff or patch filename extensions will be automatically applied as patches
if the apply parameter is not set to no (or an unknown value).

Note: We have disabled the warnings when using the old style parameters for now

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-01 15:17:12 +01:00
Richard Purdie
1f2646981f pm-utils: Upgrade to 1.3.0 and fix SRC_URI not to point at SCM generated tarballs
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-01 15:14:26 +01:00
Richard Purdie
3cbbd0b002 eds-dbus: Disable parallel make
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-01 12:45:07 +01:00
Joshua Lock
2700a620d0 qemu: add some extra ldflags to make it link succesfully
qemu-native was failing to link on my 64bit Fedora 13 machine with this error:

| /usr/bin/ld: libqemu.a(helper_opengl.o): undefined reference to symbol 'dlsym@@GLIBC_2.2.5'
| /usr/bin/ld: note: 'dlsym@@GLIBC_2.2.5' is defined in DSO /lib64/libdl.so.2 so try adding it to the linker command line
| /lib64/libdl.so.2: could not read symbols: Invalid operation

So I did as the linker told me and added -ldl to the linker flags

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-28 15:32:42 +01:00
Joshua Lock
138df217ef Drop vm_mmap_min_addr checks from scripts and sanity class
QEMU 0.12.x is relocatable so we no longer need these tests, which is good
because it doesn't work reliably with modern kernels.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-28 15:32:41 +01:00
Joshua Lock
32a85c1570 qemu: reduce duplication, use an inc file and share common patches
There's no need to carry around two copies of the same patches for qemu-git and
qemu-0.12 so drop the qemu-git directory and update the git recipe to use the
qemu-0.12 directory for patches.

Move common code from the two recipes to an inc file.

Signed-off-by: Joshua Lock <josh@linux.intel.com>

fweh
2010-05-28 15:31:54 +01:00
Jeff Dike
3d6e7e7d0c qemu: Update the static recipe to 0.12.0
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
2010-05-27 15:22:50 -04:00
Jeff Dike
4de4707213 qemu: updated the glflags patch, which is needed by qemusdk.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
2010-05-27 13:16:59 -04:00
Richard Purdie
1de1ac2eb2 lib/oe/patch.py: Fix datastore references in error paths
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-05-27 15:58:00 +01:00
Richard Purdie
d630317b6b handbook: Add alpha verison of a BSP specification
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-05-26 15:26:09 +01:00
Jeff Dike
a49e605a52 qemu: Updated to 0.12.0
Updated the metadata in the recipe, changed the git revision in
poky-default-revisions.inc, and pulled the qemu patches forward.
2010-05-26 14:14:48 +01:00
Joshua Lock
eb69ecdfcc poky-default.inc: Bump linux-libc-headers to 2.6.33
Now that we have a Busybox (and strace) which we can build we can use the same
kernel-headers version as our default kernel version.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-25 15:38:28 +01:00
Joshua Lock
f24f8360bc strace: bump from 4.15.18 to 4.15.20
The old version didn't build with the older linux-libc-headers

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-25 15:37:33 +01:00
Joshua Lock
615a98ed9a busybox: bump to 1.15.3 from OE
Import the 1.15.3 recipe from OpenEmbedded and tweak to match Poky style

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-25 15:36:14 +01:00
Joshua Lock
cd62d697e1 relocatable.bbclass: reduce the amount of output
Disable the last bb.note call, it's a bit spurious. Only really useful for
debug.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-24 17:25:28 +01:00
Joshua Lock
9210ae6f1a poky-default.inc: roll-back preferred linux-libc-headers to 2.6.30
Our current Busybox version doesn't support 2.6.33 headers.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-24 17:25:02 +01:00
Joshua Lock
9f23e3e491 Update directdisk images to use common inc files
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-24 12:05:25 +01:00
Richard Purdie
6bf1f8c76e kernel.bbclass: Simplify the current external module code
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-05-24 11:14:56 +01:00
Scott Garman
78988bb014 eggdbus: Disable PARALLEL_MAKE
* Fixes eggdbusenumtypes.h gen/use errors

Signed-off-by: Scott Garman <sgarman@zenlinux.com>
2010-05-24 10:35:01 +01:00
Scott Garman
4bcf9c7220 xserver-kdrive-glamo: Fix broken SRC_URI
Signed-off-by: Scott Garman <sgarman@zenlinux.com>
2010-05-24 10:34:49 +01:00
Scott Garman
ae9174ef53 kernel.bbclass: Stop staging binaries within scripts/
* Preserves scripts/ directory but excludes binaries known to cause
  "strip command failed" errors during do_package on cross platforms

Signed-off-by: Scott Garman <sgarman@zenlinux.com>
2010-05-24 10:34:40 +01:00
Joshua Lock
5bec733fb1 kernel.bbclass: tidy up staging of headers
The changes merged from upstream used the ASMDIR variable even when it might
not have been set. These changes may be incorrect but at the very least I can
now build a QEMU image (including v86d) with the 2.6.33 kernel now.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-20 16:09:39 +01:00
Joshua Lock
d887296baa linux-libc-headers: add 2.6.33 headers
Add kernel headers to match our preferred/default kernel version and set them
as the preferred version for the Poky and Moblin distributions.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-20 15:50:16 +01:00
Joshua Lock
2c3437d0ae kernel-arch.bbclass: merge improved arch detection from OE.dev
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-20 15:15:55 +01:00
Joshua Lock
769cf0b6b0 kernel.bbclass: Package Kernel firmware
Merged change from OE.dev to create packages of the kernel firmware

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-20 14:16:26 +01:00
Joshua Lock
3da120a872 linux-kernel-base.bbclass: merge version detection updates from upstream
Kernels after 2.6.33 store the utrelease.h file, used to detect the kernels
version, in a different location.

Merged from oe.dev

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-20 14:14:22 +01:00
Joshua Lock
e30c5a29d2 kernel.bbclass: match x86 header installation to other architectures
The header installation for x86 was slightly different as to that employed
for other architectures, change them to match for consistency.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-20 12:58:25 +01:00
Joshua Lock
7a4f1adcbc linux: Bump to 2.6.33.2
Use the same kernel version as the moblin distro so that we provide a similar
kernel for all QEMU machines and the netbook machine.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-19 12:20:17 +01:00
Joshua Lock
5e8c7c54a9 linux-moblin: add 2.6.33.2 kernel from MeeGo 1.0
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-19 12:20:16 +01:00
Joshua Lock
5e07bc9128 kernel.bbclass: fix installing of kernels 2.6.34 and above
Changes merged from upstream to cope with changes to directory structures in
recent kernels when building for x86

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-19 12:20:08 +01:00
Joshua Lock
53d98d76fd Move all QEMU machines to use a common kernel recipe set and version
The different kernel recipes encapsulate functionality groups for machines,
therefore it makes sense to have all the QEMU machines using the same kernel
recipe.

Switch the QEMU machines to default to the "linux" recipes for their kernel
and bump the latest recipe from linux-2.6.32 to 2.6.33.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-18 14:22:27 +01:00
Nitin A Kamble
bad2fe6498 add a new scripts create-pull-request
This is the 1st version of create-pull-request script.
Using specified local commit-id or branch-name it
generates a short description of the changes;
and using poky-contrib branch-name it generates the
URL where these changes are already pushed
and are available for review and git-pull.

I prepared this script as per the input from Richard Purdie.

Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-05-17 13:47:40 -07:00
Nitin A Kamble
ebed56190e Add recipe for X vesa driver package
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-05-17 10:51:57 -07:00
Nitin A Kamble
c74035a2ad Add recipe for moblin-image-netbook.directdisk
Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-05-17 10:47:20 -07:00
Nitin A Kamble
b2c4aee283 poky-qemu-internal Add -show-cursor to qemux86
Without this option the need to do the blind guesswork about the
position of the pointer.

Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-05-14 11:57:27 -07:00
Richard Purdie
f71a4b9be8 handbook: Add section to Poky manual about contributions and certificate of origin
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-05-14 11:17:54 +08:00
Richard Purdie
a722741e32 Merge branch 'tk/head' of ssh://git.pokylinux.org/poky-contrib 2010-05-14 06:36:56 +08:00
Richard Purdie
dfd1472eda Merge branch 'nitin/lic1' of ssh://git.pokylinux.org/poky-contrib 2010-05-14 04:12:35 +08:00
Joshua Lock
505c26951b linux: Ensure we have buildable kernel recipes for each machine
Fix various kernels to build with our toolchain, this includes well known fixes
for:
* sumversion.c: compilation failing with a 'PATH_MAX' undeclared (fixed by
    adding limits.h to sumversions includes
* a patch taken from oe.dev to stop GCC >= 4.3 from optimizing a loop which
    causes compilation to fail
* Fixing the KERNEL_OUTPUT for mx31 and nokia800 kernel recipes

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-13 16:55:26 +01:00
Richard Purdie
ad136ddeef Revert "poky-env-internal: Disable automatic adding of meta environments to BBPATH"
This reverts commit ba804d1729 which is a valid
change but isn't working for some reason which needs further investigation.
2010-05-13 17:07:17 +08:00
Kevin Tian
5a3f17ee6b poky-env-internal: unset variables to avoid disturbing new GIT clone
Signed-off-by Kevin Tian <kevin.tian@intel.com>
2010-05-13 16:27:01 +08:00
Nitin A Kamble
8825d4d455 License Checking: convert an error into warning
If license file md5 information (LIC_FILES_CHKSUMS variable) is
missing in the recipe then just throw a warning instead of the build
failure.
  Once enough recipes' LIC_FILES_CHKSUMS are filled then this warning
will be reverted back to the the fetal error.
  If LIC_FILES_CHKSUMS field is present but invalid then the it still
causes a fetal build error.

Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-05-12 10:54:05 -07:00
Richard Purdie
b6c6913212 mtd-utils: Fix mtd-utils-native do_install task to install binaries into the correct place rather than using hardcoded paths
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-05-12 19:30:58 +08:00
Richard Purdie
ba804d1729 poky-env-internal: Disable automatic adding of meta environments to BBPATH
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-05-12 15:28:54 +08:00
Nitin A Kamble
2ca1f78a95 License Change checking:
Added a new variable in recipe : LIC_FILES_CHKSUM

It is a required field for every recipe.

It describes license text location in the source files. And also stores
md5sum of that license text. Any change in this license text triggers build
error. Which enables developer to review any changes in the license and
update the license fields in the recipe accordingly.

For Example: contents of zlib_1.2.3.bb
LICENSE = "zlib"
LIC_FILES_CHKSUM = "file://README;md5=ae764cfda68da96df20af9fbf9fe49bd \
  file://zlib.h;beginline=1;endline=30;md5=6ab03f03a5ee92d06b809797d4d5586d "

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-05-11 16:25:39 -07:00
Joshua Lock
c89362c767 openssl: Fix build of openssl-native on x86_64 with recent binutils
Apply a patch from upstream that fixes the build, patch should be able to be
dropped when we update openssl version.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-07 00:45:38 +01:00
Joshua Lock
229c80ad19 xf86-input-vmmouse: bump version to 12.6.6
There was a bug in 12.6.5 whereby it was depending on symbols no longer
available in the X server.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-06 17:07:53 +01:00
Joshua Lock
cd8de7b443 moblin: drop moblin.conf and inherit poky for mirror configuration
Doesn't make any sense to duplicate the mirror configuration, and all that the
moblin class contained was minimal mirror config. So let's drop it.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-06 15:54:55 +01:00
Richard Purdie
3b9ac3f017 pax-utils: Sync with OE.dev fixing native version
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-05-06 15:10:46 +01:00
Gary Thomas
28ca131ebe Fix build problem with GCC-4.3.3 on PowerPC
Signed-off-by: Gary Thomas <gary@mlbassoc.com>
2010-05-06 14:52:08 +01:00
Gary Thomas
e150e90f0a Latest versions of GCC are safe on PowerPC
Signed-off-by: Gary Thomas <gary@mlbassoc.com>
2010-05-06 14:52:04 +01:00
Joshua Lock
e7fa3529f3 Update classes to use lib/oe
Adapt modifications from upstream to make Poky classes use lib/oe for the
common Python functionality.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-06 12:53:16 +01:00
Joshua Lock
ac023d775b lib/oe: Import oe lib from OE.dev
This library moves the common Python methods into modules of an 'oe' Python
package.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-06 12:48:05 +01:00
Richard Purdie
14196cb031 base.bbclass: Sync minor layout changes with OE.dev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-05-06 12:22:44 +01:00
Richard Purdie
89497d8057 xfce.bbclass: Fix SRC_URI (from OE.dev)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-05-06 12:03:31 +01:00
Richard Purdie
753b4a3187 poky-default-revisions.inc: Add linux-omap3-pm revision to ensure offline builds at least parse even if the revision is invalid
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-05-06 10:29:14 +01:00
Richard Purdie
37858f5fac handbook: Add new FAQs
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-05-06 10:29:14 +01:00
Richard Purdie
d37f26525b unifdef-native: Fix staging reference in do_install (noticed from OE.dev)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-05-06 10:29:14 +01:00
Richard Purdie
d0f555cb5c unifdef-native: Fix staging reference in do_install (noticed from OE.dev)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-05-06 10:16:57 +01:00
Joshua Lock
d425fac6d1 sanity.bbclass: fix typo in earlier commit
Commit fbe3d41eb0 left a trailing bracket which
cause an interpretation error

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-30 20:15:56 +01:00
Joshua Lock
70a930f30e Remove meta-cross-linkage recipe, we no longer have a cross directory
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-30 16:25:48 +01:00
Joshua Lock
fbe3d41eb0 Version the build configuration directory
The addition of BBLAYERS changes the build/conf directory to be incompatible
with the "old way" in the Purple release.

As such things are likely to occur in future we should bersion the build/conf
directory through local.conf

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-30 16:25:41 +01:00
Joshua Lock
69d788ad5e Fix sanity check for new abi
current_abi is the abi of the tmp directory, not the current abi specified in
the abi file...

Now the sanity check should work sanely.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-29 10:25:39 +01:00
Joshua Lock
19a81653b7 Bump the ABI to alert people that cross has gone
Since we've change the tmpdir layout quite a bit we're going to bump ABI and
force a rebuild.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-28 17:48:08 +01:00
Joshua Lock
6458da896f Fix references to CROSS_DIR now that it has been removed
CROSS_DIR is no longer removed so fix up classes, packages and documentation
which refer to it.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-28 16:47:14 +01:00
Joshua Lock
29813a43b5 cross.bbclass: inherit relocatable to post-process cross binaries
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-27 18:29:57 +01:00
Joshua Lock
c22ab5fc9f Install cross-packages into the native sysroot
Cross is no longer required so can go away, we now install cross packages into
the native sysroot and use them from there.

This patch includes updates to classes and some recipes which reference
CROSS_DIR. Others still need fixing an image can be built and run with this
patch applied.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-27 18:29:57 +01:00
Joshua Lock
00c5c97442 gcc: Fix packaging of cross for PPC
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-27 18:26:29 +01:00
Joshua Lock
4d1f39af75 autotools: deprecate autotools_stage class
Move the functionality into autotools and ensure all our Poky recipes are no
longer using it.
Keep the autools_stage class around for OE compatability but just have it
inherit autools.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-27 17:11:28 +01:00
Joshua Lock
95f2dd7dc8 poky-default.inc: set PPC preferred version for gcc-runtime
We use an older toolchain for PPC so we need to set the PREFERRED_VERSION for
gcc-runtime too.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-27 17:11:28 +01:00
Joshua Lock
5fb1069e47 conf/poky-default.inc: Fix PPC preferred binutils
At some stage the PPC preferred binutils seems to have been changed, we still
need 2.19 for now.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-27 16:58:43 +01:00
Joshua Lock
d2c6f3ef36 scripts/pstage-scanner: new script to sanity test the contents of pstage
Currently the script will scan all packages in the pstage directory and log
packages which contain destinations outside of the native sysroot.
The script currently ignores pkgdata, stamps and deploy but does trigger the
work dir for packages with a package-split file, this may well be a false
positive.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-27 16:58:43 +01:00
Joshua Lock
23ff2e0819 relocatable.bbclass: Normalise the generated path
The generated path we create for the binaries RPATH can have a lot of directory
separators in. Use os.path.normpath() to tidy it up and only include the
required directory separators.

This patch is purely to appease my personal sense of niceness...

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-27 16:58:42 +01:00
Joshua Lock
d1f413ff30 sanity.bbclass: handle lack of permission to read /proc/sys/vm/mmap_min_addr
Patch from OE.dev by Martin Jansa to workaround that we on modern Linux we can
no longer read this file.

We need a better fix but best option will be to update to a newer, relocatable,
QEMU release.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-27 16:58:42 +01:00
Joshua Lock
6763d7506f polkit: fix DEPENDS, requires intltool
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-27 16:58:42 +01:00
Joshua Lock
7f019514d8 Move STAGING_BINDIR_CROSS into target sysroot, instead of native
Cross scripts now live in sysroot/$arch-distro-os/crossscripts, this conveys
that they are no longer native system dependant and emphasises their purpose.

Bump the staging ABI and implement a simple migration from ABI 3 to ABI 4.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-27 16:58:42 +01:00
Joshua Lock
e866ea68c7 packaged-staging.bbclass: Fix architecture field
The packages architecture field is incorrect, this patch changes it to:
native - build machine architecture
cross - build and target machine architectures
target - target machine architecture

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-27 16:58:42 +01:00
Joshua Lock
6727d5ad6c poky-image-sato-directdisk: directdisk variant of Sato image
New recipe to create a directdisk Sato disk image.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-27 16:58:42 +01:00
Joshua Lock
4c00f55f7a pixman: explicitly disable Gtk+ tests
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-27 11:29:09 +01:00
Joshua Lock
36652f51ab qemu_git: Ensure we have the required dependencies for a native build
qemu-native requires a libGL and the SDL development headers to build with our
GL "emulation". This patch adds a check before configure for the native package
to ensure that the sdl.pc file and GL so files exist and bombs out otherwise.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-15 17:49:49 +01:00
Joshua Lock
d3fbb56c2f relocatable.bbclass: Actually skip symlinks
The previous patch to do so was badly merged and didn't actually skip all
symlinks, only ones which where not an absolute path...

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-12 15:56:45 +01:00
Richard Purdie
4f1ec3194d gpgme: STAGING_DIR_HOST != STAGING_DIR/HOST_SYS and this causes subtle cross contamination between certain machines. Fix.
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-04-12 12:11:54 +01:00
Joshua Lock
1ac0a1aebe relocatable.bbclass: ignore symlinks
If this links to a file created by the package install we already handle it
when we process the sysroot. By ignoring symlinks here we don't cause a build
to fail when the symlink is to somewhere in the host OS.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-08 16:41:24 +01:00
Joshua Lock
10b6d14062 relocatable.bbclass: Handle files which don't have read/write permissions
It's possible to have files in our sysroot which don't have the write (or in
some cases even the read) bit set. Test for these and if they are not set
temporarily set them so that we can chrpath the binaries.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-08 16:41:24 +01:00
Joshua Lock
572f86ce5b packaged-staging.bbclass: Remove hardcoded paths in binfiles for target packages
Amend the default PSTAGE_SCAN_CMD, as used when scanning target packages, to
include binconfig scripts in the results and remove their hardcoded paths.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-08 16:41:24 +01:00
Enric Balletbo i Serra
aa1931498b igep0020: Rename files for IGEP v2 boards, prepare for support Hw rev. B and rev. C
Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
2010-04-07 10:20:53 +01:00
Enric Balletbo i Serra
c45c86003c linux-igep2: update to latest stable version 2.6.28-3
Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
2010-04-07 10:20:53 +01:00
Richard Purdie
eb8be4555b psuedo: We don't use lib64
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-04-06 15:27:46 +01:00
Richard Purdie
43b5d13c63 psuedo: Add missing install function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-04-01 15:57:21 +01:00
Joshua Lock
b43b80c760 relocatable: Handle directories having subdirectories of binaries
Make the processing of directories less naive so that it can handle a directory
with children that are directories. We now scan for and process binaries in all
directories below the scanned paths rather than only the top-level directory.

This patch moves the meat of the post-processing into a separate function which
is fed paths, process_dir (). Then when the function finds a subdirectory of
the passed path which is itself a directory it recursively calls itself.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-01 11:53:29 +01:00
Richard Purdie
cf929499aa gcc-cross-initial/gcc-cross-intermediate: Add missing EXTRA_OECONF variables
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 17:28:08 +01:00
Richard Purdie
18bdffa955 python-pycurl: Set NATIVE_INSTALL_WORKS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 15:36:12 +01:00
Richard Purdie
bcdfa2a468 encdev-updater: Set NATIVE_INSTALL_WORKS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 15:33:21 +01:00
Richard Purdie
369f4dc1a9 liblbxutil: Fix cross compile issues
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 15:30:10 +01:00
Joshua Lock
9b6287c7b1 python-pycurl: Fix building
Add python to DEPENDS and ensure the required environment variables are
available at build time.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-31 14:50:50 +01:00
Richard Purdie
0f4202fa20 gcc: Don't create links in base-libdir
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 14:28:27 +01:00
Richard Purdie
715b0a859f gcc-crosssdk: Remove bogus require
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 14:14:50 +01:00
Richard Purdie
50022b12ef poky-moblin.inc: Set provider for virtual/TARGETcompilerlibs
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 14:12:23 +01:00
Richard Purdie
2fc8da52f7 gcc-runtime: Add 4.2.3 version
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 14:06:33 +01:00
Richard Purdie
eca7e8c9bf gcc-crosssdk: Create common include files
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 13:53:07 +01:00
Richard Purdie
c155b71ba4 gcc-cross.inc: Move do_compile
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 13:46:20 +01:00
Richard Purdie
70abb2e3e8 gcc-cross: Use NATIVEDEPS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 13:43:09 +01:00
Richard Purdie
fb5b562837 gcc: Move -native dependencies into the base gcc version configuration file and create and use EXTRA_OECONF_INITIAL and EXTRA_OECONF_INTERMEDIATE variables
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 12:09:14 +01:00
Richard Purdie
5b5a069e16 gcc-cross-kernel: Remove unneeded requires
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 11:22:25 +01:00
Richard Purdie
95fd994366 gcc-runtime: Move core code to the main include file
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 11:19:54 +01:00
Richard Purdie
ccebaa67df gcc-cross: Simplify require statements
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 11:19:24 +01:00
Richard Purdie
e9522df693 gcc: Drop 4.1.2 as its unused
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 10:32:57 +01:00
Richard Purdie
cc0bd4bed2 gcc: Drop 3.4.4/3.4.6 and gcc-native as all are now unused
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-31 10:32:08 +01:00
Richard Purdie
4821286d0a gcc-csl: Drop old version
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-30 14:23:15 +01:00
Richard Purdie
9c77464538 gcc-runtime: Handle libgcc headers correctly and set c++ include patch for packages correctly
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-30 14:14:34 +01:00
Richard Purdie
c75c0d68c2 gcc-runtime: Fix c++ include path
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-30 12:26:20 +01:00
Richard Purdie
0cf4a98244 gcc-package-cross.inc: Only stage gcc-runtime headers for gcc-cross
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-30 10:43:15 +01:00
Richard Purdie
847324b79b classes/conf: Update to handle gcc-runtime
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-29 22:28:49 +01:00
Richard Purdie
cdaf6c804b gcc-runtime: Add initial recipe
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-29 22:27:13 +01:00
Richard Purdie
7a7c2341c7 gcc-4.3.3: Add patch for issue PR35942 to fix libstdc++ build issues with certain host cross compile combinations
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-29 22:24:50 +01:00
Richard Purdie
fcfbc7b1e7 autotools.bbclass: Allow extraction of the configure arguments for use in strange testcases
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-29 17:04:13 +01:00
Joshua Lock
93f357d657 relocatable.bbclass: we need to process library files too
The .so files we ship also have a RPATH encoded so should be post-processed for
a relocatable RPATH too.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-26 14:24:58 +00:00
Joshua Lock
1ee88638a2 rootfs_rpm: Explicitly add runtime dependencies to depends
Python RDEPENDS are tricksy beasts and the runtime dependencies of Yum aren't
being pulled in for the RPM rootfs so explicitly add them to depends.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-26 12:23:11 +00:00
Joshua Lock
34a24c2d9d createrepo: Fix dependencies, yum at runtime and libxml2 at build
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-26 10:29:18 +00:00
Joshua Lock
ad07d796fe .gitignore: Add packaged staging directory to ignore list
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-26 10:29:18 +00:00
Joshua Lock
5eb169bb6a python-urlgrabber: Update to 3.9.1 with extra patches from Fedora
Add a couple of extra patches from Fedora to make the latest createrepo package
work.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-26 10:29:18 +00:00
Joshua Lock
811497111b python-native: Fix DEPENDS by adding sqlite3
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-26 10:29:18 +00:00
Joshua Lock
678537c684 pyton-pycurl: Add new recipe from OE.dev
Add python-pycurl_7.19.0 from OE.dev with some tweaks to enable a native
version. This package is a dependancy of newer Yum

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-26 10:29:18 +00:00
Joshua Lock
a2d5806f5d curl: Bump to 7.20
Newer libcurl is needed by newer pycurl which is needed by newer yum

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-26 10:29:18 +00:00
Joshua Lock
555f60faa0 yum: Fix installation of python modules
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-26 10:29:18 +00:00
Joshua Lock
9b3a51fbd8 handbook: Update links to Anjuta plugin
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-26 10:29:18 +00:00
Joshua Lock
72af5b2f92 fakechroot: Fix patch application
We listed the Debian patch but never actually asked BitBake to apply it.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-26 10:29:18 +00:00
Richard Purdie
d3d36d9f44 bitbake/event.py: Run class eventhandlers in the task context but ensure UI handlers run in the server context
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:33:41 +00:00
Richard Purdie
871f731e57 bitbake/cooker.py: Finishing the command needs to happen after the BuildCompleted event else the cooker can shutdown first
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:31:23 +00:00
Richard Purdie
fb245be03d cache.py: Bump the cache version after the BBVERSIONS update
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:28:34 +00:00
Richard Purdie
881caec450 bb.manifest: Drop, its unused and obsolete. No point in having dead code around
(Bitbake rev: 69374497b557a5e99ffc7cbe5e075d63e2d9cfaa)

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:26:30 +00:00
Chris Larson
19d5f2b067 BBFILES: use a set to remove duplicates when collecting.
(Bitbake rev: b1b06133da4ca379a60775552d481f7fbf77e999)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:26:02 +00:00
Chris Larson
adbfce3958 bb/command was importing bb and accessing some of its own classes indirectly as bb.command.<class>
(Bitbake rev: 4b2a268ce8dad63d21619c1b9acc1de86d222d93)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:26:00 +00:00
Chris Larson
1e2f64abc7 Why is bb/__init__.py importing bb?
(Bitbake rev: 3eb01a20cbbb2e7a2f6278089bcc9bb70021738f)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:25:59 +00:00
Chris Larson
964085f701 data_smart: be explicit about what we make available to eval'd python code
(Bitbake rev: 6a73dda60f50e9b3e5513795d1ec7207d1446de2)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:25:58 +00:00
Chris Larson
6028daedcb Fix 7 references to undefined variables, as spotted by pyflakes
(Bitbake rev: e1e4ccf203e38070eeafd31a622671996cff61a1)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:25:56 +00:00
Chris Larson
c6940a9795 bb.utils: remove old portage remnants
The following utility functions were removed.  Note that in this particular
case we're bypassing a proper deprecation process, as these functions are
clearly not utilized, are obvious remnants of old ways of doing things, and
some of which do not even function properly.

- tokenize
- evaluate
- flatten
- relparse

- ververify
- isjustname
- isspecific
- catpkgsplit
- pkgsplit
- pkgcmp
- dep_parenreduce
- dep_opconvert

(Bitbake rev: 62983ad9b151ee8d51e8cf9a31c736c7813edf16)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:25:54 +00:00
Chris Larson
ec3f908948 bb.utils: utilize string.letters and string.digits
(Bitbake rev: 7af05cba87ec9f3ea5e53689b3d9f0a63784d1b5)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:25:51 +00:00
Chris Larson
80a52e7ad6 bb.which: fix broken direction/reverse argument
(Bitbake rev: 4725d83f532cad96168aa9affdedb33b6fc897b7)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:25:50 +00:00
Chris Larson
b5f8ce02b7 crumbs: fix hassattr typo
(Bitbake rev: 5593de13a18792e36d15dfd2a9579b36284e4d67)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:25:49 +00:00
Chris Larson
c244243274 Implement BBVERSIONS
This implements a feature similar to BBCLASSEXTEND, but for generating
multiple versions of a given recipe.  For example: BBVERSIONS = "1.0 2.0 git".

In addition to the above, one can utilize [a-b] style patterns, and can have a
:<basever> postfix, which allows you to essentially name the range of
versions.  Both the current version and the basever end up in OVERRIDES, and
the basever gets placed into the BPV variable.  The default BPV, if none is
specified, is the original PV of the recipe, before bbversions processing.

In this way, you can do things like:
BBVERSIONS = "1.0.[0-6]:1.0.0+
              1.0.[7-9]:1.0.7+"

SRC_URI_append_1.0.7+ = "file://some_extra_patch.patch;patch=1"

Or you can create a recipe per range, and name the recipe file as such: nano_1.0.7+.bb.

(Bitbake rev: 4ee9a56e16f1eb3c1649eaa3127b09ab0e93d1ec)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:25:45 +00:00
Richard Purdie
cefeeb1aa3 usermanual.xml: Add documentation on bblayers.conf
(Bitbake rev: 879229d12c2830dba9e0cb794e61e3c698b8dcc7)

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:25:30 +00:00
Enrico Scholz
5060280a7a Expand PREMIRRORS
When not expanding PREMIRRORS, the functions fails/does not work correctly
when PREMIRRORS is not a plain string (e.g. contains ${...} or a ${@...}
statements).

(Bitbake rev: d612d22b073f68b8cf1bb7344e0487820040d80d)

Signed-off-by: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:17:12 +00:00
Bernhard Reutner-Fischer
5d90d90358 utils: improve wording of error message
(Bitbake rev: b2486ec57c6a7adf09d0960fdf6727881b324d2f)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:15:28 +00:00
Richard Purdie
c328f161f8 bootimg.bbclass: Fix dependency name
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:09:15 +00:00
Richard Purdie
5cda1b7660 parted: Add BBCLASSEXTEND native
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 14:09:24 +00:00
Richard Purdie
f89cd3158a bootimg/boot-directdisk.bbclass: Update afer syslinux changes, fix mbr.bin location and fix dependencies
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 14:09:06 +00:00
Richard Purdie
91f093a2b2 syslinux: Convert to BBCLASSEXTEND, clean up recipe and staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 14:08:12 +00:00
Richard Purdie
7ccc046732 scm-revisions: Always use ??= operator
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 11:59:12 +00:00
Richard Purdie
679746595e meta-openmoko: Add layer configuration
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 11:56:08 +00:00
Richard Purdie
00d0202a75 meta-moblin/layer.conf: Fix layer location
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 11:52:31 +00:00
Richard Purdie
4e821de9e2 meta-extras: Add layer configuration
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 11:48:44 +00:00
Richard Purdie
e941ff652a poky-image-minimal-directdisk: Add directdisk image example
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 11:45:13 +00:00
Richard Purdie
027c167878 boot-directdisk.bbclass: Add direct disk image creation class
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 11:44:25 +00:00
Richard Purdie
f30bf93e14 bootimg.bbclass: Improve documentation
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 11:36:40 +00:00
Richard Purdie
589df80ca1 bitbake: Gross hack to fix packaged-staging with BBCLASSEXTEND packages
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-23 22:33:02 +00:00
Richard Purdie
0449c26e97 packaged-staging.bbclass: Revert accidental damage
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-23 21:59:06 +00:00
Richard Purdie
9ce619897c packaged-staging.bbclass: Fix mkdir to actually create the destination directory
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-23 21:56:21 +00:00
Richard Purdie
ae04c7f11d encdev-native: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-23 16:57:33 +00:00
Joshua Lock
ff5e6f4b4d yum: Update yum and createrepo to latest version
Also switch Yum to using BBCLASSEXTEND rather than having separate native and
host recipes.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-23 14:51:10 +00:00
Joshua Lock
1a1361040f .gitignore: ignore bblayers.conf
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-23 14:51:09 +00:00
Joshua Lock
d02c604d31 linux-nokia800_2.6.21: Remove legacy staging function
The recently added kernels for the N800 include legacy staging functions,
update them to follow the new world order.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-23 14:51:09 +00:00
Joshua Lock
e78c12d136 u-boot: remove legacy staging
A recent commit seems to have introduced a legacy staging function, remove it

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-23 14:51:09 +00:00
Joshua Lock
e3c4237fd7 fakechroot: Update to 2.9 and add a patch from Debian
This update includes a refresh of our existing readlink patch and a (trimmed)
copy of the patch Debian are shipping in their package which includes
unreleased fixes from SVN for building against more recent glibc.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-23 14:50:50 +00:00
Richard Purdie
1d05e3aa30 pseudo: Add recipe
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 23:54:41 +00:00
Richard Purdie
006510ceda layer.conf: Fix filename conflict
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 23:40:15 +00:00
Richard Purdie
d158569aa9 Move default SCM versions into separate meta directory specific files to improve maintainability
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 23:35:48 +00:00
Richard Purdie
90040ce7b5 Switch to bblayers configuration
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 18:11:41 +00:00
Richard Purdie
666c753d4b bitbake/cooker.py: Add support for a bblayers.conf file
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 17:48:31 +00:00
Richard Purdie
a4008b883c utility-tasks.bbclass: Remove unneeded base_ prefix since we don't EXPORT these functions any longer
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 17:12:38 +00:00
Richard Purdie
70141cbcc8 bitbake/providers: Fix merge error
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 15:09:07 +00:00
Bernhard Reutner-Fischer
04263dc426 cooker: bail out early if no files to build
This prevents a misleading backtrace:
ERROR: no files to build.
Command execution failed: Traceback (most recent call last):
  File ".../bitbake/build/lib/bb/command.py", line 83, in runAsyncCommand
    self.cooker.updateCache()
  File ".../bitbake/build/lib/bb/cooker.py", line 779, in updateCache
    if not self.parser.parse_next():
  File ".../bitbake/build/lib/bb/cooker.py", line 969, in parse_next
    cooker.bb_cache.sync()
UnboundLocalError: local variable 'cooker' referenced before assignment

(Bitbake rev: 060ef3d957615b7eb1209dc0d01ebeb53f8c4edc)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 15:03:46 +00:00
Chris Larson
2f9e15afbe Fix issues with BBCLASSEXTEND set by anonymous python, and rename some variables to improve code clarity
(Bitbake rev: 3062e96181fe845cfd286990b0216888ddd3d228)

Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 15:03:21 +00:00
Chris Larson
57044b9a62 Implement ??= operator
??= is a lazy, conditional assignment.  Whereas a ?= immediately assigns to
the variable if the variable has not yet been set, ??= does not apply the
default assignment until the end of the parse.  As a result, the final ??= for
a given variable is used, as opposed to the first as in ?=.

Note that the initial implementation relies upon finalise() to apply the
defaults, so a "bitbake -e" without specifying a recipe will not show the
defaults as set by ??=.  Moving application of the default into getVar adds
too large a performance hit.  We may want to revisit this later.

(Bitbake rev: 74f50fbca194c9c72bd2a540f4b9de458cb08e2d)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 15:02:59 +00:00
Chris Larson
ada2a8494a Avoid unnecessary calls to keys() when iterating over dictionaries.
dict objects provide an __iter__ method for the iteration which gives you the
keys, so calling keys directly is unnecessary, and isn't really a best
practice.  The only time you really need to call the keys is if there's a
danger of the dict changing out from underneith you, either due to external
forces or due to modification of the iterable in the loop.  Iterations over
os.environ are apparently subject to such changes, so they must continue to
use keys().

As an aside, also switches a couple spots to using sorted() rather than
creating a temporary list with keys() and sorting that.

(Bitbake rev: 5b6ccb16c6e71e23dac6920cd2df994d67c2587b)

Signed-off-by: Chris Larson <clarson@mvista.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 15:01:59 +00:00
Bernhard Reutner-Fischer
9d9b47bae4 knotty: tweak failure phrase
..to make copy and paste of the logfile easier.

(Bitbake rev: 446cc0cebd4daff7f849717f4cb89ac1b4c6b755)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:58:57 +00:00
Chris Larson
a7d5f73134 Fix ud.basecmd error introduced by the FETCHCMD_git commit
(Bitbake rev: 0bbcbe3548f39ca46c5aa3bf1a8681026e51cbf0)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:58:41 +00:00
Tom Rini
dea828c744 Add initial 'repo' fetcher
(Bitbake rev: f68406e864c9837feb56cbec993b620481445cc2)

Signed-off-by: Tom Rini <tom_rini@mentor.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:58:15 +00:00
Chris Larson
d8b12d4eea Re-getVar BBCLASSEXTEND after finalise()
This ensures that an anonymous python function is able to manipulate the
BBCLASSEXTEND contents, and, therefore, amend.inc files are able to add to it.

(Bitbake rev: c7d038d404afaf4ce3735af5134163759da6f6ef)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:56:16 +00:00
Chris Larson
73a12b9184 Error early if BBPATH is unset, rather than falling back to share/bitbake
Better to error as early as possible rather than experience strange behavior
resulting from the use of the largely useless stock bitbake.conf/base.bbclass.

(Bitbake rev: 641e6cf3ec3ab4d26929cf4d2a3704ff07eed4d6)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:56:00 +00:00
Chris Larson
9998b454bb Kill unused projectdir in bb package.
(Bitbake rev: 79b93e6929c5feeb1ad05bd17f589c69f00b77f6)

Signed-off-by: Chris Larson <clarson@mvista.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:55:18 +00:00
Chris Larson
8f83be3338 Fix msg usage in the moved utility functions.
(Bitbake rev: 686288444d22091dee66e20ec49b9c53f8c980b7)

Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:54:57 +00:00
Chris Larson
f8c6db95d7 Move most utility functions from bb into bb.utils.
(Bitbake rev: ff720ec59b30671c951dbf3b96df10ef56b8b505)

Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:54:42 +00:00
Chris Larson
b7d175a18a Move compat imports in the bb package to avoid circular dep issues.
(Bitbake rev: b66c129edc7d78fed9d41b0c634744ec81931b21)

Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:54:26 +00:00
Chris Larson
ac392b66a5 Move encodeurl, decodeurl into bb.fetch.
(Bitbake rev: 867d36f9afce2d298874ac7563e5b3852ef04659)

Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:54:10 +00:00
Chris Larson
a3012e1ca9 Move MalformedUrl, VarExpandError into appropriate modules.
(Bitbake rev: e616483b237dafff7f90ba1c09e9ee7c383a2e47)

Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:53:55 +00:00
Martyn Welch
9a0da388ce Add FETCHCMD parameter for git
The Git fetcher currently hardwires the git command to "git". Allow the
path and any additional wrappers to the Git command to be provided via
FETCHCMD functionality, as with some of the other fetchers.

If FETCHCMD_git is not define in bitbake.conf, the fetcher defaults to "git".

(Bitbake rev: f3afb79ecac30d973a3c62ff6baf28d8b7388a24)

Signed-off-by: Malcolm Crossley <malcolm.crossley@ge.com>
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:53:26 +00:00
Richard Purdie
e17a0bd6c0 sanity.bbclass: Add a note about using dpkg-reconfigure
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:33:56 +00:00
Richard Purdie
9c5386c1fd base.bbclass: Split up as per the patch in OE.dev by Chris Larson making code more readable and modularised
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-19 23:12:06 +00:00
Richard Purdie
185cb38f13 base.bbclass: Really drop siteinfo by default
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-19 22:53:21 +00:00
Richard Purdie
a30f6e968c base.bbclass: Don't inherit siteinfo in base.bbclass [based on an OE patch from Chris Larson] 2010-03-19 18:08:35 +00:00
Richard Purdie
8d5f122cbb .gitignore: Add handbook generated files to the ignore list
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-19 17:50:36 +00:00
Joshua Lock
6cd2b264ad xcmsdb: Add libxdmcp to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-19 15:26:53 +00:00
Joshua Lock
d296df4397 claws-mail: Fix building with new automake
Having the same file listed multiple times in Makefile.am breaks with new
Autotools

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-19 14:59:49 +00:00
Joshua Lock
34e1b3ef1c poky-fixed-revisions: Bump twitter-glib to a buildable version
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-19 13:01:57 +00:00
Joshua Lock
8659148e14 poky-fixed-revisions: Align Clutter revisions with Moblin distro
Primarily to pull in a newer Clutter, which works fixes a build error, but new
versions of software are nice anyway...

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-19 12:30:22 +00:00
Joshua Lock
6526d31492 clutter: Fix building version 0.8
Fix building of Clutter with new Automake

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-19 12:30:14 +00:00
Joshua Lock
98d29b86c8 syncevolution: Fix DEPENDS
Add eds-dbus and gnome-keyring

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-19 12:29:54 +00:00
Joshua Lock
2060121d7c libsynthesis: Fix DEPENDS
Add sqlite3 and zlib

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-19 12:29:45 +00:00
Joshua Lock
c00070d19f luit: add libxdmcp to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-19 12:29:30 +00:00
Joshua Lock
380346e4fc libxscrnsaver: bump version to 1.2.0
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-19 12:29:22 +00:00
Joshua Lock
b7783b335f liblbxutil: Bump version and fix dependencies
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-19 12:29:11 +00:00
Joshua Lock
62cd0ea1a5 handbook: remove OpenedHand contact information
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-19 10:23:23 +00:00
Richard Purdie
5b5f1ba099 handbook: Add a section on extending images using packages
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-18 23:47:48 +00:00
Richard Purdie
b3f5e554d0 handbook: Publishing tweaks
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-18 23:31:35 +00:00
Richard Purdie
d2805818aa handbook: Add missing tag
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-18 23:23:25 +00:00
Richard Purdie
de9c12bea2 handbook/faq: Add entry about building on NTFS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-18 21:40:11 +00:00
Richard Purdie
c21aed8add task-poky: No longer need to exclude pcmanfm on powerpc
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-18 21:33:02 +00:00
Gary Thomas
757fd87314 pcmanfm: Allow package to build on PowerPC
Signed-off-by: Gary Thomas <gary@mlbassoc.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-18 21:30:51 +00:00
Graeme Gregory
e844f9bef6 zoom2.conf : switch to using the TI integration tree for kernel
Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-18 20:59:14 +00:00
Graeme Gregory
af1488eaba linux-omap-zoomsync_2.6.32.bb : add kernel from TI zoom2 integration tree
This is the latest code from dev.omapzoom.org and is also what OE is using
for zoom2 machine.

Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-18 20:59:04 +00:00
Richard Purdie
61423e1a79 bison: 2.0 -> 2.3
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-18 20:58:34 +00:00
Joshua Lock
1eb093938b handbook: Correction, we're building QEMU x86 not QEMU Arm image
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-18 16:10:42 +00:00
Joshua Lock
208f6a9ec0 handbook: update references of stable version number
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-18 16:10:42 +00:00
Richard Purdie
ffb5db2c57 handbook: Clean up OpenedHand references
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-18 15:50:08 +00:00
Richard Purdie
05324ae0cd handbook: Various tweaks for recent fop/pdf generation
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-18 15:37:59 +00:00
Richard Purdie
4c07b33f14 poky-doc-tools: Update to work with fop >= 0.95
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-18 15:36:58 +00:00
Richard Purdie
701e5bd37a eds-dbus: Add parallel make fixes from Pango
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-16 11:36:00 +00:00
Richard Purdie
d59a1a1808 task-poky: Disable pcmanfm on powerpc (until confirmed it works)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-15 17:18:38 +00:00
Richard Purdie
8ddb3067e6 Add i686 SDK machine
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-15 13:00:46 +00:00
Richard Purdie
382a630e78 bitbake fetch/__init__.py: Failing urls should raise errors, not fatal exceptions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-15 12:55:47 +00:00
Joshua Lock
28f7dd3ca7 packaged-staging: tweak previous fix to accomodate possible changes to CROSS_DIR
This change, suggested by Chris Larson, ensures that the fix works even if the
definition of CROSS_DIR changes.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-05 08:35:46 +00:00
Joshua Lock
538087d203 packaged-staging: Fix packagaging of cross packages
packagedstaging_fastpath() was only copying the contents of CROSS_DIR to
PSTAGE_TMPDIR resulting in the folders contents being packaged and then
installed incorrectly at the top level of CROSS_DIR rather than in HOST_ARCH
specific sub directories.

This patch fixes that issue by copying the directory and its contents rather
than just the directory contents.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-04 16:53:00 +00:00
Joshua Lock
211f928e08 packaged-staging: Fix typo, grep not qrep ...
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-03 17:43:40 +00:00
Enric Balletbo i Serra
424375b94e xf86-video-omapfb: Bump revision.
Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-03 14:26:52 +00:00
Enric Balletbo i Serra
b8637a9ab1 xserver-xf86-config: Do not set default depth to 16 for IGEP v2.
Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-03 14:26:47 +00:00
Enric Balletbo i Serra
80f1baf525 xserver-xf86-lite: Fix compilation break for ARM architecture.
This patch syncs the patches used in xserver-xf86-dri-lite and adds
a new patch that fixes a compilation break for ARM architecture.

(http://www.mail-archive.com/xorg-devel@lists.x.org/msg04137.html)

Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-03 14:26:41 +00:00
Enric Balletbo i Serra
bda8282653 gcc: Fix fail to compile since they can't find limits.h include.
With gcc package on my build machine gcc can't find limits.h include.

$ cat x.c

$ gcc -M x.c
In file included from x.c:1:
/usr/include/limits.h:125:26: error: no include path in which to search for limits.h

This patch adds missing includes to gcc package.

Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-03 14:25:24 +00:00
Richard Purdie
07207b0ac5 liboil: 0.3.14 -> 0.3.17
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-03 13:00:37 +00:00
Richard Purdie
bb594646aa eds-dbus: Disable parallel make build problem
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-03 10:01:34 +00:00
Joshua Lock
c02ea00db1 tasks: Bump to version 0.15
The Owl patch has gone in upstream but requires a different configure switch so
soft assign in the .inc and set appropriately in the 0.15 recipe.

0.16 is out but doesn't build with Poky's Gtk+ version.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-03-01 17:23:10 +00:00
Gary Thomas
12eed15a31 gdb-cross: Allow to build after recent gettext changes
Signed off-by: Gary Thomas <gary@mlbassoc.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-26 17:13:23 +00:00
Joshua Lock
cb8ae04ebe packaged-staging: post-process non-binary files to fix paths in native packages
Extend the existing libtool hack so that native packages (native, cross, sdk)
have all non-binary files scanned and the STAGING_DIR fixed up.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-26 12:33:34 +00:00
Joshua Lock
fce742aac6 handbook: tmp/staging was renamed to tmp/sysroots - update references
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-26 12:31:31 +00:00
Joshua Lock
3e39dac1cc preferred-xorg-versions: Bump versions to match available recipes
The PREFERRED_VERSIONS for makedepend and xorg-cf-files where set for versions
which we no longer carry recipes for. Increase them to make BB happy.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-26 12:30:39 +00:00
Richard Purdie
28d90659b4 linux-omap: Build fix
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-23 22:42:59 +00:00
Richard Purdie
185819ad66 poky-moblin.inc: Move to meta-moblin
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-23 19:47:07 +00:00
Richard Purdie
d9d4540609 glibc: Allow 2.9 to work with binutils 2.20 (patch from OE.dev)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-23 19:18:06 +00:00
Richard Purdie
2bbf5cedf2 poky/moblin: Switch to binutils 2.20
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-23 17:30:58 +00:00
Richard Purdie
8d382809b3 binutils: Add 2.20 (patchset from OE.dev)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-23 17:30:19 +00:00
Richard Purdie
2baf8bbf8b libpcap: Update to 1.0.0 and sync with OE.dev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-23 15:19:41 +00:00
Richard Purdie
75fbd88ad5 portmap: Sync with OE.dev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-23 14:59:23 +00:00
Richard Purdie
32a44f4775 a52dec: Clean up CFLAGS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-23 14:57:44 +00:00
Richard Purdie
e3eb1286e1 perl: Update to work with native binary relative path locations
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-22 22:30:26 +00:00
Richard Purdie
7a60d379e8 relocatable.bbclass: Clean up indentation
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-22 14:23:26 +00:00
Richard Purdie
df76efbdee relocatable.bbclass: Handle symlinks correctly
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-22 14:20:26 +00:00
Joshua Lock
814c3efb5c cross.bbclass: Note that relocatable binaries disabled for a reason
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-18 10:57:08 +00:00
Joshua Lock
de2138b474 linux: Enable linux-2.6.32 for qemux86 and qemuppc
The qemux86 configuration is simply a copy of the qemux86-defconfig from
linux-rp with make oldconfig and mostly default answers.

Configuration for qemuppc already exists but DEFAULT_PREFERENCE was not set in
the recipe.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-18 10:38:40 +00:00
Joshua Lock
ef246b44b9 relocatable.bbclass: Enhancements to rpath replacement algorithm
This patch removes the hard coded number of parent directory operators ( /..)
placed into the rpath and instead fully dynamically generates the rpath entries
based on the current rpath.

Theoretically this patch means we can now make cross packages relocatable but
this is *not* enabled as chrpath can only set a new rpath of the same length
or shorter than the existing rpath. Due to the amount of parent directory
jumps we need to encode in the rpath this can easily fail when TMPDIR is in a
short namespace (e.g. /usr/poky).

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-18 10:38:29 +00:00
Richard Purdie
b694d3c3f9 bitbake: Revert "providers.py: sort eligible providers by DEFAULT_PREFERENCE"
This breaks preferred providers functionality

This reverts commit ee9afccf33b220a21b74fab279925eeb4771249b.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-16 15:40:12 +00:00
Richard Purdie
a88950c477 eggdbus: Add missing dbus-glib DEPENDS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:44:30 +00:00
Richard Purdie
ba60f7ba3b qmake-naitve: Fix do_install
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:32:19 +00:00
Holger Freyther
defa54dea0 bitbake: [cache] copy instead of deepcopy in sync
We only intend to modify the dict, no need to copy all
elements.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:58 +00:00
Chris Larson
f03769280c bitbake: [parse] In ast, make StatementGroup inherit list, and add a AstNode base class.
(Bitbake rev: 7ea31b2842b45ffe1ca688f55207f8676442a108)

Signed-off-by: Chris Larson <clarson@mvista.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:57 +00:00
Chris Larson
c675bfd5bf bitbake: [parse] Use bb.which in resolve_file
(Bitbake rev: 3cd06ed487ee0617892f154cff461379a323a1fb)

Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:56 +00:00
Holger Freyther
7b57ad901a bitbake: [parser] Make resolve_file only resolve the path
Do not attempt to open the file in the resolve_file method
(a lot like bb.which... maybe bb.which can be used). This way
we don't need to open/close a file which we have already parsed.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:55 +00:00
Holger Freyther
83ec5eaed4 bitbake: [parser] Cache parsed .inc and .bbclass files for a parse speedup
Have a growing dict with .inc and .bbclass'es. This avoids to reparse
files we have already seen.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:54 +00:00
Holger Freyther
c011d42eda bitbake: [parser] prepare to cache some .bbcclass and .inc files
Our parser is shit but instead to replace it now we will see
how long we can drive the wave by caching parsed files. This
will not go through the feeder again but we can just reevaluate
the StatementGroup.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:53 +00:00
Holger Freyther
793c88dd92 bitbake: [parser] Remove the "data" from feeder, evaluate after parsing a file
Evaluate the statements after having parsed one file. This is
referred to as "entwirren" and we can remove the direct evaluation
and postpone a bit, in the future we can use a cached copy instead
of parsing the original.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:51 +00:00
Chris Larson
3eb2e6cf02 bitbake: [parse] Move vars_from_file from bb.parse.BBHandler into bb.parse.
(Bitbake rev: fda0707d772e0964a0185d4ec4d016522f6972f3)

Signed-off-by: Chris Larson <clarson@mvista.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:50 +00:00
Chris Larson
6f52a1521e bitbake: [parse] Don't use relative import of parse_py.
(Bitbake rev: 0a2bb3dd790e3e40867195f14f4e174f98f8a47c)

Signed-off-by: Chris Larson <clarson@mvista.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:49 +00:00
Holger Freyther
3f1ca0a086 bitbake: [parse] Move the last method to the AST...
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:48 +00:00
Holger Freyther
baf2395900 bitbake: [parser] Move more methods to the ast scheme
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:48 +00:00
Holger Freyther
d84b7c5555 bitbake: [parser] Move one more item to the ast
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:47 +00:00
Holger Freyther
a5bb5d625e bitbake: [parser] Move methodflags over to the ast
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:46 +00:00
Richard Purdie
7cfe3a5e15 bitbake: [parser] Build fix
(Bitbake rev: 9c97696f37499b4d0ec5c034c51e4cf6bc425ba2)

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:45 +00:00
Holger Freyther
8eaaf663ba bitbake: [parser] Move more statements over the two phase AST
Create the data first, then evaluate on the data dict

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:44 +00:00
Holger Freyther
d2bf3f00ea bitbake: [parse] Change handling include through the AstNode
Disable the recursively evaluating the statement for now
as it is causing problems.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:43 +00:00
Holger Freyther
8072cf0846 bitbake: [parser] Call eval and remove non ast code
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:42 +00:00
Holger Freyther
118161f46b bitbake: [parser] Call eval immeditaley to test this code
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:41 +00:00
Holger Freyther
a20105868f bitbake: [parser] Prepare to cease out getFunc
getFunc is now a method of the data node, hopefully we can kill the other
version soon.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:40 +00:00
Richard Purdie
269d4d58a9 bitbake: [parser] Preserve include vs. require behaviour
(Bitbake rev: 6073a5b8e4ca8af8e1a8e0234fad7b08baf76c99)

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:20 +00:00
Holger Freyther
71a19386a3 bitbake: [parser] Firs set of AST nodes with construction and eval
First set of ConfHandling with AST nodes. The include can
use a speed up and things might need to be migrated... into
this class.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:07 +00:00
Holger Freyther
df8f7706a6 bitbake: [parser] Add documentation about usage of this code
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:06:59 +00:00
Holger Freyther
4320386deb bitbake: [parser] Move the finalise into the ast as well
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:06:55 +00:00
Holger Freyther
4b25b519ae bitbake: [parser] Cary a Statement Node through the parsing
When parsing we will collect a number of statements
that can be evaluated...The plan is to be evaluate
things twice (old+new) and then compare the result,
it should be the same.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:06:50 +00:00
Holger Freyther
5bac3403d7 bitbake: [parser] Move evaluating into the ast class...
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:06:36 +00:00
Bernhard Reutner-Fischer
e9d8dd2abf bitbake: providers.py: sort eligible providers by DEFAULT_PREFERENCE
(Bitbake rev: ee9afccf33b220a21b74fab279925eeb4771249b)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:03:50 +00:00
Bernhard Reutner-Fischer
de7c939a7f bitbake: runqueue.py: improve printing dependent tasks
Print names instead of Task-IDs (and not mentioning they're task ids).

Previously we printed e.g.:
Dependency loop #1 found:
  Task 89 (/there/src/oe/openembedded/recipes/busybox/busybox-native_1.15.2.bb, do_configure) (depends: Set([88, 282, 92, 87]))

Now we say
Dependency loop #1 found:
  Task 89 (/there/src/oe/openembedded/recipes/busybox/busybox-native_1.15.2.bb, do_configure) (dependent Task-IDs ['busybox-native, do_patch', 'update-rc.d, do_populate_staging', 'busybox-native, do_populate_staging', 'shasum-native.bb, do_populate_staging', 'busybox-native, do_unpack'])

(Bitbake rev: 00eaf76fdc32eb515995b47dfa69eb90ca904b37)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:03:47 +00:00
Bernhard Reutner-Fischer
e39d89e934 bitbake: taskdata.py: fix typo in debug message
(Bitbake rev: 457fb59f10ed59269b8bda3ee53bbeded5d33eb5)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:03:07 +00:00
Joshua Lock
da10a2af54 sanity.bbclass: Add chrpath to the required utilities
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-15 16:43:38 +00:00
Joshua Lock
7b4e80b98e relocatable.bbclass: Tidy up class
There was a hard coded path and a spurious variable left in before the last
commit. Whoops ...

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-12 17:39:08 +00:00
Joshua Lock
12325e3c56 chrpath: Only set the chrpath binary for the native package
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-12 15:00:44 +00:00
Joshua Lock
f1a87fadc7 relocatable.bbclass: Improve logic and style
The initial pass at this class was pretty lame and broke on a lot of native
packages. This rewrite makes the code a lot more dynamic, removing use of hard
coded paths and improving the logic.

The class now runs a chrpath -l over the binary to determine what rpaths are
currently set. It then munges the output and determines relative versions of
each component of the rpath and uses chrpath -r to set them.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-12 15:00:44 +00:00
Richard Purdie
62c103ce0e bitbake: utils.py: Don't error if an exported environment variable is unset (i.e. None)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-12 13:50:19 +00:00
Joshua Lock
6e1cc7ca10 relocatable.bbclass: remove hard-coded rpaths from native binaries
The relocatable path will pre-process built binaries in SYSROOT_DESTDIR and
replace any harcoded dynamic link rpaths with relative paths.

Add an inherit of class in native.bbclass to make our native packages
relocatable and tweak the chrpath recipe so that the native package can make
itself relocatable with the just built chrpath binary.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-11 16:21:09 +00:00
Richard Purdie
a0795895e3 xserver-nodm-init: Make sure kdrive servers have the console keyboard enabled
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-11 16:09:49 +00:00
Richard Purdie
e49fcdcc8b xserver-kdrive: Add keyboard fix (partially from OE.dev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-11 16:06:46 +00:00
Richard Purdie
6054d36e7a preferred-xorg-versions: Update xserver-kdrive version
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-11 12:18:55 +00:00
Richard Purdie
216f9f05b4 xserver-xf86: Drop old versions and update xserver-xf86-lite version
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-11 12:18:25 +00:00
Richard Purdie
25e0acc952 xserver-kdrive: Add 1.7.99.2
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-11 12:15:06 +00:00
Richard Purdie
2146902ae4 calibrateproto: Add missing length fields to X_Replies
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-11 12:10:39 +00:00
Richard Purdie
c33fa352b8 sharp-flash-header: Convert from leagacy staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-11 09:51:55 +00:00
Richard Purdie
633e0ff5e3 binutils: Apply cross compiling changes to libtool since we don't autoreconf
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-11 09:51:23 +00:00
Richard Purdie
6877acce5a keymaps: Use RDEPENDS_${PN}
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-11 09:50:34 +00:00
Joshua Lock
0307f8002e linux-libc-headers: extend nativesdk for 2.6.29
2.6.29 is the PREFERRED_VERSION of linux-libc-headers for ditro=poky but there
was no buildable recipe for that version. Fix this with a simple BBCLASSEXTEND

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-11 09:32:48 +00:00
Joshua Lock
bc1ae94d25 preferred-xorg-versions.inc: bump preferred util-macros
We no longer have a recipe for 1.5.0 so bump to 1.6.0

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-10 22:51:14 +00:00
Khem Raj
99b4b10dc1 bitbake: BBHandler: pass lineno and fn to handleMethod
* lineno and fn are needed in handleMethod
  to restore the functionality as it was before.

(Bitbake rev: ac6792045959cfee56279c1c4597521e990848e7)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:43:06 +00:00
Martin Jansa
d5519d4ad9 bitbake: parse_py/ConfHandler.py: missing colon after else
(Bitbake rev: d520ae0764016906ff61ec33b14eabc908aa8408)

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:38:33 +00:00
Richard Purdie
7a4579e7cb bitbake: ConfHandler: Fix require vs. include behaviour
(Bitbake rev: 824a032672c8673cae28e492aa916a4750b94efa)

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:38:00 +00:00
Holger Freyther
fb918a7582 bitbake: [parser] Move more stuff out the feeder
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:37:43 +00:00
Holger Freyther
b045ab3222 bitbake: [parse] Move inherit handling to method
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:32:28 +00:00
Holger Freyther
7477c0d89a bitbake: [parsers] Move out more functions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:32:14 +00:00
Holger Freyther
e3c9a340dc bitbake: [parser] Move more stuff out to separate methods...
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:32:00 +00:00
Holger Freyther
169e719456 bitbake: [parser] Move the handling of a method to a function
We want to convert this into a proper AST. So move all
such operations to methods... Later change them to generate
a node... and create that node from here.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:31:48 +00:00
Holger Freyther
913e78898e bitbake: [parse] Unify opening a file...
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:31:33 +00:00
Holger Freyther
242a03607d bitbake: [parser] Kill obtain/localpath from the parser
With obtain it was possible to use an existing fetcher to
download a bb or config file. In practive no one has used it
and it was likely broken in regard to depends_cache... Remove
it for now, simplfiy the code.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:31:19 +00:00
Theodore A. Roth
bf6a4fd658 bitbake: usermanual.xml: Add section for ?= var setting.
(Bitbake rev: df8309c11a43a9488ca25ec114a2dd3d49b041ff)

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:25:35 +00:00
Joshua Lock
6ae3907433 distros: set xserver-xf86 as default PREFERRED_PROVIDER for virtual/xserver
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-10 14:34:15 +00:00
Joshua Lock
bf422fcfff qemux86: fix setting of preferred provider for virtual/xserver
Change the virtual/xserver preferred provider in qemu.inc to a soft assign and
set preferred provider in qemux86 before the require so that the value is retained.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-10 14:34:15 +00:00
Joshua Lock
62ab7dac39 moblin-fixed-revisions: bump libdrm version
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-10 14:34:15 +00:00
Joshua Lock
0ff3de8ebf preferred-xorg-versions: increase various components to match Moblin distro
Switch to using xserver-xf86-dri-lite 1.7.99.2 and the updated dependencies it
requires by default.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-10 14:34:14 +00:00
Joshua Lock
2c2994718c libdrm: bump version to 2.4.17 as required by mesa 7.7
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-10 14:34:02 +00:00
Joshua Lock
391fda5150 poky-default: bump preferred glibc version to 2.9 for Poky distro
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-10 13:33:16 +00:00
Joshua Lock
8a8094a10b ofono: bump to 0.17
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-09 17:03:24 +00:00
Joshua Lock
f1ee04bd15 connman: bump to 0.48
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-09 17:03:24 +00:00
Joshua Lock
109f750d17 eds-dbus: Fix DEPENDS, add gnome-keyring and use libsoup-2.4 not libsoup
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-09 17:02:45 +00:00
Joshua Lock
e8241d7bba libpcap: Fix PR
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-09 16:14:20 +00:00
Joshua Lock
6895486d05 libpcap: fix configure with newer autofoo and fix inherit
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-09 15:56:44 +00:00
Richard Purdie
b81b391cd2 xorg-macros: 1.5.0 -> 1.6.0
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-09 14:10:26 +00:00
Richard Purdie
466043e096 moblin-panel-myzone: Add DEPENDS on libical
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-05 16:03:10 +00:00
Richard Purdie
6d2b2b2dbc libical: Add from OE.dev with cleanup
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-05 15:58:21 +00:00
Richard Purdie
e93ccce413 eds-dbus: Pull from git, not svn
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-05 15:57:59 +00:00
Richard Purdie
96cdddcdd7 moblin-bleeding: Don't enable a browser for now
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-05 15:56:45 +00:00
Richard Purdie
f19bbd5c8b task-moblin-x11-netbook: Allow browser choice to be overridden
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-05 15:55:16 +00:00
Richard Purdie
bb1427f0b9 moblin-floating-revisions: Use mx branch for moblin-web-browser
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-05 14:50:56 +00:00
Richard Purdie
851267d2af mesa-dri-git: Handle cross compiling of the glsl utils
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-05 14:08:37 +00:00
Richard Purdie
173f02f3e8 moblin-fixed-revisions.inc: Update libsocialweb revision
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-05 12:54:32 +00:00
Joshua Lock
52cbb07423 bitbake: fix invalid method and logic
The previous bitbake change included an invalid method call and inverted logic.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-05 12:41:08 +00:00
Joshua Lock
ec92133d6f bitbake: Test premirrors and mirrors in checkstatus()
checkstatus() is used to ensure we can fetch a copy of each file, so it makes
sense to also test PREMIRRORS and MIRRORS in the method.

This patch adds calls to try_mirrors() to the Fetch.checkstatus() method and
changes the try_mirrors() method to take a check argument, which is False by
default. When check is True try_mirrors() will call a fetchers checkstatus()
with the replaced uri.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-05 12:19:05 +00:00
Richard Purdie
b5965307e9 bognor-regis: Add missing bickley DEPENDS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-05 12:14:46 +00:00
Richard Purdie
e5be3728a3 mesa-dri: Use master branch for git versions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-05 12:14:21 +00:00
Richard Purdie
8886fa1145 xserver-xf86-dri-lite: Update git recipe for latest versions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-05 12:13:47 +00:00
Richard Purdie
03890f3fc0 makedepend/xorg-cf-files: Upgrade to new point releases
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-05 12:12:55 +00:00
Richard Purdie
ce6ae6753d util-macros: 1.4.1 -> 1.5.0
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-05 12:12:21 +00:00
Richard Purdie
219b89e556 python.inc: Disable parallel make
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 19:28:20 +00:00
Richard Purdie
3a15c0e1e0 dpkg: Make sure the -native version doesn't have strange RDEPENDS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 19:19:52 +00:00
Richard Purdie
f6f10668ca libjana: Use gnome git, not svn
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 17:31:58 +00:00
Richard Purdie
422c5f7c6a tracker: 0.6.95 -> 0.7.18
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 16:51:45 +00:00
Richard Purdie
4dd0575af7 moblin-panel-git: Update DEPENDS for libsocialweb
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 16:35:06 +00:00
Richard Purdie
def39679df Add libsocialweb
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 16:31:12 +00:00
Richard Purdie
780d2186dc clutter-gst: Update revision
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 14:24:43 +00:00
Joshua Lock
c9fd126f64 bitbake: Fix try_mirrors() logic, was only trying the first mirror.
The logic in try_mirrors() was buggy such that only the first entry in the
mirrors list was tried.

This patch fixes this. Thanks to Richard for the review.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-04 14:08:34 +00:00
Richard Purdie
72495b5f37 task-moblin-standalone-sdk-target: Update clutter-gst/-gtk dependencies
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 13:20:42 +00:00
Richard Purdie
32f61e544c hornsey: Update DEPENDS of recent git versions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 13:17:21 +00:00
Richard Purdie
5b3397a2a0 Tweak gettext usage
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 12:52:59 +00:00
Richard Purdie
5af4d6a607 gmime: Add from OE.dev with tweaks
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 12:52:35 +00:00
Richard Purdie
893bc3e8f2 gamin: Add from OE.dev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 12:46:10 +00:00
Richard Purdie
42d72759b4 tracker: Add from OE.dev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 12:44:16 +00:00
Richard Purdie
fa2470c846 clutter-gst/clutter-gtk: Add API versions to the package names and update to the latest code
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 12:41:16 +00:00
Richard Purdie
99e23d64fc pango-1.22.2: Fix autoconf/automake issue with double header reference
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 12:08:53 +00:00
Richard Purdie
1556e81158 poky-default: Upgrade binutils to 2.19
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 12:01:46 +00:00
Richard Purdie
71b1add233 moblin-floating-revisions: Fix missing quote
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-04 11:59:00 +00:00
Joshua Lock
afe12428a9 bitbake: if PREMIRRORS set test for local file in FetchData.setup_localpath
When we are using PREMIRRORS it's possible a mirror in the local namespace
(some filesystem path, i.e. an NFS share) provides read-only files.
This is a perfectly valid scenario so this patch fixes bitbake so that for
such a scenario locapath is set to the files path rather than some child
of DL_DIR.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-04 00:18:29 +00:00
Joshua Lock
b571168ac7 bitbake: Enhance the fetchers' support for local mirrors
Modify the try_mirrors() function to return the localpath of the fetched file
and update the data dictionary to reflect this.
Secondly the metadata files, lock and md5, should always be stored relative to
the ${DL_DIR} as it is possible that the localpath is a read-only directory,
for example in the scenario where there is a read-only file:// mirror.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-04 00:18:29 +00:00
Joshua Lock
095347fc69 poky.bbclass: Use pokylinux.org stashes as PREMIRRORS for vcs'
Check the tarball stash on pokylinux.org before hitting the upstream
version control systems. This is friendlier to the upstream repositories than
us hammering their bandwidth.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-04 00:18:29 +00:00
Joshua Lock
8235389fd1 conf: remove references to SRC_TARBALL_STASH
SRC_TARBALL_STASH is deprecated, the same functionality can be acheived
with PREMIRRORS, so remove references to it from configuration files.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-04 00:18:29 +00:00
Joshua Lock
0737552c1d bitbake: unify mirror support and make it independant of the fetcher
This patch serves two purposes. Firstly it unifies the concept of mirrors into
PREMIRRORS and MIRRORS. PREMIRRORS are tried before the SRC_URI defined in the
recipe whereas MIRRORS are tried only if that fails.
The tarball stash was conceptually inline with a PREMIRROR only with special
handling within the wget fetcher and therefore only worked with certain
fetch types.
Secondly the patch removes the need for individual fetch implementations to
worry about mirror handling.

With this patch, the base fetch implementation will first try to use a
PREMIRROR to fetch the desired object, if this fails the native fetch method
for the object will be tried and if this fails will try to fetch a copy from
one of the MIRRORS.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-04 00:18:29 +00:00
Richard Purdie
0b52537f5c twitter-glib: Drop merged patch and update revision
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-03 14:52:15 +00:00
Richard Purdie
d19b1145aa moblin-fixed-revisions: Update moblin-app-installer version
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-03 14:49:40 +00:00
Richard Purdie
ef670e0ea5 xorg-proto: Always depend on util-macros, update gettext dependencies to be inherits
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-03 09:23:55 +00:00
Richard Purdie
4cb58790da xorg: Bulk version upgrades
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-03 00:29:41 +00:00
Richard Purdie
5daaa63bdb hornsey: Add mixxing xtst DEPENDS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-02 22:38:10 +00:00
Richard Purdie
28a8d1503c mozilla-headless: Add missing autoconf patch hunk
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-02 19:54:56 +00:00
Richard Purdie
4d80441aae mx: Disable gesture support
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-02 17:56:14 +00:00
Richard Purdie
4f0499f6e0 autoconf: Add missing patch
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-02 17:50:55 +00:00
Richard Purdie
29d1df5b97 autoconf/automake: Switch to 2.65 and 1.11.1
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-02 17:36:55 +00:00
Richard Purdie
fa9f3991d5 libtool: Add missing patch
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-02 17:29:56 +00:00
Richard Purdie
3813e33c7f mozilla-headless: Add patch to enable builds with recent autoconf/automake
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-02 17:29:08 +00:00
Richard Purdie
11044cbd74 xserver-xf86-dri: Fix for recent autoconf+automake
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-02 16:22:41 +00:00
Richard Purdie
9d225568d3 kexec-tools: Fix synatx error with recent autoconf+automake
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-02 16:21:56 +00:00
Richard Purdie
18ba0bc495 libatomics-ops: Fix with recent autoconf/automake
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-02 16:21:05 +00:00
Richard Purdie
625ae518a3 libtool: Fix a bug where trailing slash characters could break path comparisions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-02 16:19:09 +00:00
Richard Purdie
80c7c52592 twitter-glib: Add fix for recent autoconf/automake
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-02 14:35:34 +00:00
Richard Purdie
99643e58b5 taglib: 1.5 -> 1.6.1 (and apply autoconf/automake fixes)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-02 14:32:39 +00:00
Richard Purdie
dd5269c329 parted: 1.88 -> 1.9.0 (works with recent autoconf/automake)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-02 14:31:30 +00:00
Richard Purdie
10b89e872c m4: 1.4.12 -> 1.4.13
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 15:02:03 +00:00
Richard Purdie
ca51dda506 libsndfile1: Add infinite recursion fix for recent autotools
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 15:01:18 +00:00
Richard Purdie
5cf94e1d1e libtelepathy: Fix double referenced file causing autoconf/automake issues
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 13:54:29 +00:00
Richard Purdie
769baa1143 autoconf-2.65: Ensure autoconf sees our site cache
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 12:47:29 +00:00
Richard Purdie
09ab7da4f9 autoconf-2.65: Drop unneeded patches
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 11:57:59 +00:00
Richard Purdie
daabf19115 e2fsprogs: Fix configure quoting to work with recent autoconf/automake
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 11:48:50 +00:00
Richard Purdie
89bee8abf2 Add *~ to .gitignore
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 11:03:45 +00:00
Richard Purdie
bb217b62b7 libxslt: Fix double defintion problem which breaks recent autoconf/automake
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 11:02:59 +00:00
Richard Purdie
da21a63d48 gettext: Apply upstream fix to work with recent autoconf/automake
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 11:02:26 +00:00
Richard Purdie
116e25e86d bzip2: Fix double defintion problem which breaks recent autoconf/automake
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 11:01:46 +00:00
Dennis.Yxun
be2a5dfc21 task-poky-tools: kexec-tools don't support mips|mipsel, so make it optional
Signed-off-by: lan.yi.xun <dennis.yxun@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 10:42:33 +00:00
Dennis.Yxun
2e84247aac pcmanfm: support mips|mipsel
Signed-off-by: lan.yi.xun <dennis.yxun@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 10:42:13 +00:00
Dennis.Yxun
301744df4d site/mipsel-linux: add eds-dbus variables
Signed-off-by: lan.yi.xun <dennis.yxun@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 10:39:00 +00:00
Dennis.Yxun
9999f0a9d3 site/mipsel-linux: add popt variables
Signed-off-by: lan.yi.xun <dennis.yxun@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 10:38:15 +00:00
Dennis.Yxun
0c4ead0ce9 site/mipsel-linux: add glib-2.0 variables
Signed-off-by: lan.yi.xun <dennis.yxun@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 10:36:26 +00:00
Richard Purdie
413f235827 udev: Add DEPENDS on glib-2.0 after recent changes
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 09:33:53 +00:00
Richard Purdie
b604fe9048 networkmanager: Fix polkit dependency
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-01 09:20:33 +00:00
Richard Purdie
dfcc15e7b6 autoconf: Don't use 2.65 yet
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-29 16:04:50 +00:00
Richard Purdie
08f4cc94d6 automake: Add 1.11.1 using BBCLASSEXTEND (not default)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-29 16:02:06 +00:00
Richard Purdie
50d9304068 autoconf: 2.63 -> 2.65 (not default)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-29 16:00:31 +00:00
Richard Purdie
4420ddc284 autoconf: 2.63 -> 2.65 (not default)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-29 15:54:18 +00:00
Richard Purdie
1c870f000b moblin-fixed-revisions.inc: Bump clutter-1.0 revision
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-29 15:53:12 +00:00
Richard Purdie
c6afdeb503 xf86-video-intel: 2.7.1 -> 2.10.0
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-29 15:52:34 +00:00
Richard Purdie
1e4ec6242e pkgconfig: Add SCM version for testing purposes (not default)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-29 15:51:05 +00:00
Richard Purdie
2f280c1681 packagekit: Use 0.5.6 and gnome-packagekit 2.28.2
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-29 15:22:36 +00:00
Richard Purdie
7e38b6f73b devicekit: Add 003 release and devicekit-power (from OE.dev with fixes/improvements)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-29 15:21:04 +00:00
Richard Purdie
c18b2b599b policykit: Rename to polkit to match upstream and upgrade
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-29 15:20:02 +00:00
Richard Purdie
ecc9880c9d udev: Enable gudev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-29 15:18:56 +00:00
Richard Purdie
e5c96dd507 eggdbus: Add from OE.dev with dependency fixes
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-29 15:18:27 +00:00
Richard Purdie
058b96d839 mutter-moblin-git: Add missing require
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-29 12:45:07 +00:00
Joshua Lock
50ffb99417 packaged-staging: basic support for pulling staging packages from a mirror
Add simple support for trying to fetch staging packages from a http, https  or
ftp mirror if they do not already exist in PSTAGE_DIR.

As documented in local.conf.sample
"Poky can try and fetch packaged-staging packages from a http, https or ftp
mirror. Set this variable to the root of a pstage directory on a server."

If the PSTAGE_MIRROR variable is not set, or the package cannot be found on
the mirror it will be built as usual.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-29 12:33:46 +00:00
Joshua Lock
0e4111c7d9 bitbake.conf: quieten wget fetches
Add the q switch to wget fetches and resumes to reduce stdout noise.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-29 12:33:46 +00:00
Joshua Lock
b2c8430898 packaged-staging: Move packaged staging directory outside of DEPLOY_DIR
Rename DEPLOY_DIR_PSTAGE to PSTAGE_DIR and move it outside of deploy.
Do soft assignment of a default variable inside bitbake.conf as
${OEROOT}/tmp/pstage.
Use a separate directory, PSTAGE_WORKDIR, to store transient packaged
staging files such as the stamp files and opkg.conf

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-29 12:33:45 +00:00
Joshua Lock
9ff304510e packaged-staging: fix up handling of crosssdk packages
The packaged-staging class already special cases native packages for ensuring
the package is only reused if the path doesn't change.

This patch ensures the special casing is also done for crosssdk packages.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-29 12:33:45 +00:00
Richard Purdie
9737011e5f opkg: We must always include a valid arch.conf file
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-29 12:21:32 +00:00
Richard Purdie
eb6d6f3dc1 opkg: Fix header problem
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-29 11:36:52 +00:00
Richard Purdie
6ca0e13033 packagekit: 0.4.9 -> 0.6.0 (with fixes for opkg)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-29 11:36:06 +00:00
Richard Purdie
db39d570e6 mesa: Add 7.7
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-28 22:44:50 +00:00
Richard Purdie
f020fe5baf libx11-trim: Update patch
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-28 22:30:22 +00:00
Richard Purdie
aa49e73ded poky-external-eabi: Rename to poky-external-default
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-28 22:14:41 +00:00
Richard Purdie
589a797e98 conf/distro/poky: Rename poky-eabi to poky-default to make more sense
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-28 22:12:58 +00:00
Richard Purdie
3ce2be9e77 conf/distro/include: Drop poky-eabiX files, they no longer serve a purpose
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-28 22:04:55 +00:00
Richard Purdie
e3090243c1 poky-eabi.inc: Massive cleanup
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-28 22:03:00 +00:00
Richard Purdie
3697f64c1e poky-moblin: Set gcc version correctly
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-28 21:49:44 +00:00
Richard Purdie
db99dabc66 gcc: Drop 4.3.1 and 4.3.2
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-28 21:49:10 +00:00
Richard Purdie
23d8841f28 gcc: Make sure target_* variables are set, fixing gcc search path issues
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-28 21:46:51 +00:00
Richard Purdie
6793dca934 opkg: Fix native and nativesdk configuration options
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-27 14:44:27 +00:00
Richard Purdie
fdf134abfb bitbake/build.py: No need for this gross hack now
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-27 12:40:02 +00:00
Richard Purdie
c6868ce84e libdrm: Create a common include file and att virtual/libx11 to DEPENDS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-27 12:11:11 +00:00
Richard Purdie
4340e3e974 qemu.inc: Set xserver preferred provider correctly
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-27 11:52:32 +00:00
Richard Purdie
19805550bd bitbake.conf: Add virtual/xserver to MUTLI_PROVIDER_WHITELIST
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-27 11:52:32 +00:00
Joshua Lock
39d8c0fc4a opkg: add openssl to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-27 10:58:00 +00:00
Richard Purdie
67fbc5c871 opkg: Update to latest svn and apply patch to enable readable logfiles
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-26 23:19:09 +00:00
Richard Purdie
6391725f94 libdrm: 2.4.7 -> 2.4.15
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-26 23:19:09 +00:00
Richard Purdie
91066e8c25 site/mips-linux: Add entry for eds-dbus
Signed-off-by: Richard Purdie <richard@rex.(none)>
2010-01-26 17:55:46 +00:00
Richard Purdie
fd34f26511 insane.bbclass: Since we have no legacy packaging, no need to repeatedly scan staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-26 16:00:13 +00:00
Richard Purdie
684d263e75 linux-moblin: Add 2.6.31.5
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-26 15:59:18 +00:00
Richard Purdie
3a32c2c6e9 yum: Fix DEPENDS (no python-shlex)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-26 13:46:50 +00:00
Richard Purdie
5790800fe3 yum: Fix DEPENDS (no python-bzip)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-26 13:30:58 +00:00
Richard Purdie
b623ced116 bitbake.conf: Add virtual/libintl-nativesdk to MULTI_PROVIDER_WHITELIST
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-25 17:26:44 +00:00
Richard Purdie
75f682d1f6 fakeroot: Stop setting LD_LIBRARY_PATH as it breaks things (see patch description)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-23 22:46:19 +00:00
Richard Purdie
b9d958c186 bitbake: Don't import xmlrpc server unless needed
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-22 16:15:50 +00:00
Richard Purdie
aedf7d3205 bin/bitbake: Add import server
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-22 09:00:49 +00:00
Richard Purdie
7e8025459e bitbake/cooker: Drop unneeded import
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-22 00:04:18 +00:00
Richard Purdie
37f8e24ce3 bitbake: Fix UI failure exception handling with python 2.6
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-21 23:49:50 +00:00
Richard Purdie
5ebad0d500 knotty: Improve task failure message handling using the uihelper code
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-21 23:49:17 +00:00
Richard Purdie
5c62833766 runqueue.py: Use fcntl to make the worker pipes non-blocking
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-21 23:46:20 +00:00
Richard Purdie
fd42ffa273 bitbake/event: If the server disappears, we just exit too
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-21 16:00:12 +00:00
Richard Purdie
d7c9b7d8b9 runqueue: When a task fails, make sure the server still processes events from other workers
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-21 15:58:56 +00:00
Richard Purdie
867b01c3ca bitbake/__init__.py: Fix bb.plain and bb.warn function, initial patch from Petri Lehtinen <petri.lehtinen+bitbake-dev@inoi.fi>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-21 10:44:34 +00:00
Martin Jansa
c69797d89c bitbake/git: remove repodir usage (from bitbake master)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-21 10:30:37 +00:00
Richard Purdie
573f6125e6 bitbake/runqueue: Fix typo
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-21 10:25:54 +00:00
Richard Purdie
22c29d8651 bitbake: Switch to bitbake-dev version (bitbake master upstream)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-20 18:46:02 +00:00
Richard Purdie
1bfd6edef9 bitbake-dev: Sync with bitbake upstream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-20 18:39:00 +00:00
Richard Purdie
d6c7a44b94 gcc-cross-canadian: Fix include paths and hence c++ compiler issues
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-20 15:56:35 +00:00
Richard Purdie
3139368254 bitbake.conf: Add virtual/libintl-native to MUTLI_PROVIDER_WHITELIST
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-20 15:24:22 +00:00
Richard Purdie
b65e8ec593 bitbake-dev: Sync again with upstream after fixes from Poky bitbake 1.8 were merged
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-19 15:34:01 +00:00
Joshua Lock
43788606bd linux-2.6.32: Add defconfig for qemuppc
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-19 15:09:38 +00:00
Joshua Lock
c94707a679 qemuppc: Add qemuppc machine
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-19 15:09:26 +00:00
Joshua Lock
92df15ec76 poky-eabi: Temporarily add non-standard PREFERRED_VERSIONS for PowerPC
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-19 15:09:18 +00:00
Joshua Lock
f97e68456f u-boot-mkimage: Update 2009.08 recipe
Remove legacy staging function and enable native install

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-19 15:09:10 +00:00
Esben Haabendal
b731a08ebf linux-2.6.32 (for mpc8313erdb) 2010-01-19 15:09:02 +00:00
Esben Haabendal
bd375075bd u-boot-mkimage-2009.08 (and BBCLASSEXTEND native nativesdk) 2010-01-19 15:08:45 +00:00
Esben Haabendal
3d3053e6cc Add crosssdk and cross-canadian gcc 4.2.3 recipes 2010-01-19 15:08:30 +00:00
Esben Haabendal
306756be65 glibc-2.6.1: add BBCLASSEXTEND nativesdk 2010-01-19 15:08:21 +00:00
Esben Haabendal
48007a047e linux-libc-headers-2.6.20 fixed headers_install path and extend as nativesdk 2010-01-19 15:08:11 +00:00
Esben Haabendal
8fa52fb8cd lzo: fix building for powerpc 2010-01-19 15:08:02 +00:00
Joshua Lock
0bddf1ce2c task-poky-tools: kexec-tools doesn't work on Mips so make it optional
Use a variable to soft-assign a value for kexec-tools and set it empty for
Mips as it's not supported on that architecture.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-19 14:54:30 +00:00
Richard Purdie
22a271aaa9 bitbake-dev: Sync with upstream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-19 14:48:19 +00:00
Joshua Lock
cefe87fc3c pcmanfm: Add COMPATIBLE_HOST line for arch's with inotify/fam
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-15 15:51:13 +00:00
Joshua Lock
fd165bb9c0 tasks/task-poky: make the file manager a conditional part of the task
mips doesn't support pcmanfm so make it a conditional part of the task by
creating a variable, FILEMANAGER, set to pcmanfm by default and empty for mips

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-15 15:44:20 +00:00
Joshua Lock
e77bc0b848 kexec-tools: Set COMPATIBLE_HOST as mips is unsupported
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-15 15:31:34 +00:00
Joshua Lock
ba66481c9d site/mips-linux: add readline
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-15 15:22:42 +00:00
Joshua Lock
b0bda60d77 qemu: build mips system support in qemu
Add mips to the target-list configuration option and add a dummygl for mips.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-15 15:11:56 +00:00
Joshua Lock
dfe72318ed distros: fix mistake in opkg-native PREFERRED_PROVIDER
PREFERRED_PROVIDER for opkg-native should be a native
package...

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-15 13:44:03 +00:00
Joshua Lock
b02a125cae preferred-xorg-versions: bump util-macros version
The util-macros version has been bumped, update
PREFERRED_VERSION accordingly.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-15 11:07:58 +00:00
Joshua Lock
e081a82966 distros: Fix some warnings by setting PREFERRED_PROVIDER's
opkg-native needs a PREFERRED_PROVIDER for moblin and poky

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-15 11:07:49 +00:00
Richard Purdie
22aadfc3b8 glib-2.0-native: Fix DEPENDS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-15 09:28:41 +00:00
Richard Purdie
60251ac9e1 pango: Disable PARALLEL_MAKE
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-15 09:11:46 +00:00
Richard Purdie
170e071460 dpkg: Add missing -native DEPENDS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-14 23:30:12 +00:00
Richard Purdie
f00e5cf964 bitbake-dev: Sync with upstream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-14 23:29:31 +00:00
Richard Purdie
a7740492af poky-eabi.inc: Use glibc 2.9 for mips
Signed-off-by: Richard Purdie <richard@rex.(none)>
2010-01-14 18:54:45 +00:00
Richard Purdie
feed2e22f4 cross.bbclass: Set BASEPKG_HOST_SYS to a sane value
Signed-off-by: Richard Purdie <richard@rex.(none)>
2010-01-14 17:19:02 +00:00
Richard Purdie
2debb77ab2 libx11-git: Disable dolt
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-14 17:05:32 +00:00
Richard Purdie
b07628bf26 util-macros: 1.3.0 -> 1.4.1
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-14 16:39:57 +00:00
Richard Purdie
50d9ca76b4 qemu: Add small fix to gl patch
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-14 16:37:56 +00:00
Joshua Lock
24c24ecf0d gnome-terminal: temporarily disable scrollkeeper
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-14 13:42:16 +00:00
Joshua Lock
6816e5a653 empathy: append to EXTRA_OECONF, don't override
Previous commit overrode EXTRA_OECONF rather than appending

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-14 13:42:16 +00:00
Joshua Lock
7b41d2b3d1 scripts/runqemu: Fix some typos
Fix typo in help message (we default to ext3 not ext2 now)
and a typo whereby moblin-image-sdk wouldn't be autofound.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-14 13:42:16 +00:00
Richard Purdie
ce687c223f package_ipk.bbclass: Tweak handling for all/any/noarch and nativesdk
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-14 13:16:13 +00:00
Richard Purdie
adede582cd package_ipk.bbclass: Add handling for all/any/noarch and nativesdk
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-14 12:36:37 +00:00
Joshua Lock
9bad53754d empathy: Remove stale package and fix build
Temporarily disable scrollkeeper to fix the build.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-14 12:23:47 +00:00
Richard Purdie
46a26dc357 poky-fixed-revisions: Update clutter gst/gtk/mozembed revisions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-14 12:14:06 +00:00
Richard Purdie
94006b88fa poky-fixed-revisions: Update moblin revisions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-14 12:03:36 +00:00
Richard Purdie
2634976634 gnome-terminal: Apply patch from upstream to fix doc build issues
Signed-off-by: Richard Purdie <richard@rex.(none)>
2010-01-14 11:56:19 +00:00
Richard Purdie
ed2be0f349 insane.bbclass: Fix typo
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-14 11:37:56 +00:00
Richard Purdie
9604ad0ddf cross-canadian: Fix gettext issues
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-14 11:25:42 +00:00
Richard Purdie
5afaf16714 gdb-cross-canadian: Add missing gettext-nativesdk DEPENDS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-14 10:50:53 +00:00
Richard Purdie
0b724f9083 gcc-cross-canadian: Add gettext-nativesdk DEPENDS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-14 10:48:56 +00:00
Richard Purdie
58ef914d0c binutils-cross-canadian: DEPEND on gettext-nativesdk
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-14 10:21:45 +00:00
Richard Purdie
523439fda4 gcc-crosssdk: Fix DEPENDS for gettext
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-14 09:19:06 +00:00
Richard Purdie
07046f300b dpkg: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-13 23:25:08 +00:00
Richard Purdie
5c0a06b85f openssl: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-13 23:19:27 +00:00
Richard Purdie
441006cc6f db: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-13 23:04:55 +00:00
Richard Purdie
705fe2f2f8 glib-2.0: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-13 22:59:46 +00:00
Richard Purdie
a717961f6e opkg: Convert to use BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-13 22:06:25 +00:00
Richard Purdie
357282e211 freetype: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-13 22:06:24 +00:00
Richard Purdie
88872c05b5 gcc-crosssdk-intermediate: Add missing gettext-native dependency
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-13 21:55:51 +00:00
Richard Purdie
f911c26cd3 xkeyboard-config: Merge recipes (and fix DEPENDS)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-13 21:52:49 +00:00
Richard Purdie
89ab1a22e3 meta-moblin:Tweak PVs
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-13 17:27:11 +00:00
Richard Purdie
6baeede3c6 meta-moblin: Update to Moblin 2.1 released versions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-13 17:07:59 +00:00
Richard Purdie
3fce6c2d7e libx11_git: Update PV
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-13 15:47:04 +00:00
Richard Purdie
9a66ae02cb mutter: Add 2.28.1 release
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-13 15:46:30 +00:00
Richard Purdie
813e135dee gupnp-av: 0.5 -> 0.5.2 and add 0.4
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-13 15:45:30 +00:00
Richard Purdie
3ef9c4c9a3 nbtk: Add 1.2.3 release
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-12 21:20:08 +00:00
Richard Purdie
4108af2ac7 carrick: Add 1.1.13 release version and prefer over the git version for moblin
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-12 20:32:43 +00:00
Richard Purdie
cf91cfaaa2 bitbake: Apply modified version of a patch from Martin Jansa <martin.jansa@gmail.com> to allow wildcards at the end of PREFERRED_VERSION strings
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-12 20:31:18 +00:00
Joshua Lock
5ab442890d gettext: extend nativesdk
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-08 12:41:01 +00:00
Richard Purdie
b8e0c83dda claws-plugins: Add missing gettext inherits
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-08 10:57:17 +00:00
Richard Purdie
2a30f28c88 gupnp-tools: Fix filename
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-08 10:55:29 +00:00
Richard Purdie
7ae983c9ee aspell: Add missing gettext inherit
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-07 18:13:39 +00:00
Richard Purdie
2491731121 claws-mail: Add missing gettext inherit
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-07 18:13:06 +00:00
Richard Purdie
fbf9d75d7c coreutils: Add missing gettext inherit
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-07 18:12:48 +00:00
Richard Purdie
a06263e7d5 make: Add missing gettext inherit
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-07 18:12:34 +00:00
Richard Purdie
1b20976cfc gcc: Use DEPENDS += to preseve gettext dependency
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-07 18:11:38 +00:00
Richard Purdie
2f78c4d28b xkeyboard-config: Add DEPENDS on glib-2.0 (for glib-gettext)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-07 17:10:38 +00:00
Richard Purdie
957863bf9e rpm-native: Add DEPENDS on gettext-native
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-07 17:09:51 +00:00
Richard Purdie
795e22ccf8 moblin-menus: Add DEPENDS on glib-2.0 (for glib-gettext)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-07 17:08:49 +00:00
Richard Purdie
d702e01051 blktool: Add missing DEPENDS on glib-2.0
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-07 17:06:39 +00:00
Richard Purdie
ace4de10e0 bognor-regis: Add missing gupnp and gupnp-av DPENDS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-07 17:04:11 +00:00
Richard Purdie
1f343e2130 gupnp: Update to latest releases
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-07 17:03:42 +00:00
Richard Purdie
4863664ca6 Merge branch 'master' of ssh://gitserver@git.pokylinux.org/poky 2010-01-07 17:01:35 +00:00
Richard Purdie
7111f8318b diffutils: Add missing gettext dependency
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-07 17:01:13 +00:00
Joshua Lock
d273811c5b site/mips-linux: add popt variables
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-06 15:52:16 +00:00
Joshua Lock
9f73ec3288 libxcb: add xcb-proto-native to DEPENDS
A code generation tool used during build is run using the
native Python and needs a module built by xcb-proto.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-06 15:52:16 +00:00
Joshua Lock
5504082a09 xcb-proto: support building native packages of each version
Move the BBCLASSEXTEND="native" to the inc file from the
git recipe.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-06 15:52:16 +00:00
Joshua Lock
fc20223097 qemumips: Use the linux-rp kernel by default
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-06 15:52:16 +00:00
Joshua Lock
e4f4259365 linux-rp: Support a 2.6.29 kernel for qemumips
Modify the linux-rp-2.6.29 to enable building a kernel for
qemumips with a defconfig taken form OE.dev's linux kernel

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-06 15:52:16 +00:00
Joshua Lock
955c7aaf51 qemumips: Add qemumips machine from OE.dev
Site and machine configuration for Mips architecture and
a qemumips target from Openembedded.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-06 15:52:16 +00:00
Joshua Lock
aef159c70c insane.bbclass: Fix multiline string
Earlier commit had created a multiline string without
updating the python string quotation (""" for multiline).

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-06 13:18:18 +00:00
Joshua Lock
aee835ba8f insane.bbclass: enhance gettext error message
Point the user at gettext.bbclass which handles adding the
correct gettext to DEPENDS.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-06 09:32:41 +00:00
Joshua Lock
4dac8ed6d7 pam: fix inherit, add gettext and change autotools
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-06 09:17:00 +00:00
Joshua Lock
b1b5194dc2 libidn: fix inherit, add gettext and change autotools
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-06 09:16:52 +00:00
Richard Purdie
1ce4a018b1 gst-plugins-ogg/bad/ugly: Add missing inherit gettext
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-06 00:54:40 +00:00
Richard Purdie
a1e9d39ef8 avahi: Add missing inherit gettext
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-06 00:54:08 +00:00
Richard Purdie
7cbbccffb3 parted: Add missing inherit gettext
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-06 00:53:53 +00:00
Richard Purdie
e83d48c67d gst-plugins-base: Inherit gettext
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-05 21:12:01 +00:00
Richard Purdie
c37037df65 gettext.bbclass: Set the gettext dependencies correctly for target, cross and native packages
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-05 21:10:47 +00:00
Richard Purdie
f3092747b4 tzcode/tzdata: Drop unneeded gettext DEPENDS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-05 20:27:23 +00:00
Joshua Lock
8a7fd14ad4 insane.bbclass: special case gettext as it can't depend on itself
Only run the gettext section of the QA configure sanity check if
the package is not gettext as the gettext tools, shipped with
gettext, use the macro employed in the sanity check.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:34:00 +00:00
Joshua Lock
91d2e7d1bc gcc: add gettext to dependencies
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:34:00 +00:00
Joshua Lock
69f7bf8482 sed: add gettext to dependencies
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:59 +00:00
Joshua Lock
eb27ddfc02 python: remove unneeded gettext dependancy
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:59 +00:00
Joshua Lock
ccf2e8c603 gdbm: remove unneeded gettext dependancy
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:59 +00:00
Joshua Lock
5522e485ba update-rc.d: remove unneeded gettext dependancy
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:59 +00:00
Joshua Lock
5ad2aa2923 ofono: remove unneeded gettext dependancy
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:58 +00:00
Joshua Lock
e3f37d65ed mutter: remove unneeded gettext dependancy
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:58 +00:00
Joshua Lock
2d82287f4d loudmouth: remove unneeded gettext dependancy
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:58 +00:00
Joshua Lock
a15166ceaf libpng: remove unneeded gettext dependancy
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:58 +00:00
Joshua Lock
dc415f5dcc jpeg: remove unneeded gettext dependancy
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:57 +00:00
Joshua Lock
3e12340abf gnutls: add gettext to dependencies
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:57 +00:00
Joshua Lock
67883ba391 connman: remove unneeded gettext dependancy
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:57 +00:00
Joshua Lock
e33839b65b clutter: remove unneeded gettext dependancy
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:57 +00:00
Joshua Lock
dc07c33580 binutils: add gettext to depends
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:56 +00:00
Joshua Lock
4965a74fc5 nbtk: remove unneeded gettext dependancy
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:56 +00:00
Joshua Lock
8c3f5542d7 mx: remove unneeded gettext dependancy
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:56 +00:00
Joshua Lock
cf33df3059 libccss: remove unneeded gettext dependancy
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:56 +00:00
Joshua Lock
588e1c1640 clutter-imcontext: remove unneeded gettext dependancy
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:56 +00:00
Joshua Lock
97173220ec check: remove unneeded gettext dependancy
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-01-04 10:33:56 +00:00
Joshua Lock
2be65803cb insane.bbclass: Fix gettext test
The previous gettext check was broken resulting in many false positives.
This improved version works as follows:
* Adds to the existing os.walk() and builds a list of configure.in and
  configure.ac files
* Tests whether DEPENDS includes an appropriate gettext
* If not greps the configure files in the list for instances of AM_GNU_GETTEXT
* If if an instance is found we bb.fatal with an appropriate message

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-21 10:51:50 +00:00
Richard Purdie
52b821a384 tzdata: 2008b -> 2009s
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-18 14:55:12 +00:00
Richard Purdie
a4ba37ee2d tzcode: 2007h -> 2009r
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-18 14:54:46 +00:00
Richard Purdie
fe55fe7a41 base.bbclass: Fix missing argument
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-18 12:13:32 +00:00
Richard Purdie
1ec852688b base.bbclass: Fix indentation error 2009-12-18 12:11:42 +00:00
Joshua Lock
70a3946956 ofono: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-18 11:49:13 +00:00
Joshua Lock
5bc6539b22 nbtk: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-18 11:49:00 +00:00
Joshua Lock
daae258e26 mx: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-18 11:48:52 +00:00
Joshua Lock
c52ad72e00 mx: Add Mx based on nbtk recipe
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-18 11:48:42 +00:00
Joshua Lock
e1baebdb72 nbtk: update fixed revision to 1.2.3 git tag
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-18 11:48:05 +00:00
Joshua Lock
a1c4e3be10 handbook: Minor tweaks
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-18 11:47:52 +00:00
Joshua Lock
8904028db1 ofono: Initial recipe for ofono
Based on the connman recipe, add ofono.inc for generic recipe components
and use it from ofono_git.bb and tracking a fixed git revision and
ofono_0.12.bb packaging the latest release.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-18 11:47:44 +00:00
Joshua Lock
69027cda38 Remove use of gconnman as it's no longer maintained nor used
Also update the carrick fixed revision

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-18 11:47:22 +00:00
Richard Purdie
9f5e04a04b taskdata.py: Improve error message if a task dependency has an incorrect format
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-18 11:41:44 +00:00
Richard Purdie
dbd66fc808 bitbake/BBHandler: Only add do_ prefix to tasks if its not already present
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-18 11:41:44 +00:00
Richard Purdie
29ae46a866 kernel.bbclass: Use B, not S in KERNEL_VERSION
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-18 11:41:44 +00:00
Richard Purdie
e90771c6ae glibc-package.inc: Remove hardcoded path reference (from OE.dev)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-18 11:41:44 +00:00
Richard Purdie
9a2f361a59 devshell.bbclass: Merge tweaks from OE.dev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-18 11:41:44 +00:00
Richard Purdie
22429b6137 base.bbclass: Partially sync branch/scm handling functions with OE.dev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-18 11:41:43 +00:00
Joshua Lock
b28aa01ac8 glib-2.0: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:46:52 +00:00
Joshua Lock
26d20714df xorg-util: add gettext to DEPENDS where required
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:45:46 +00:00
Joshua Lock
5fda6f9667 xorg-proto: add gettext to DEPENDS where required
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:45:36 +00:00
Joshua Lock
b54602dece xorg-libs: Add gettext to DEPENDS where required
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:45:27 +00:00
Joshua Lock
41f43e1b98 python: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:45:19 +00:00
Joshua Lock
4ae547d05d telepathy-glib: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:45:10 +00:00
Joshua Lock
eb12b0416d telepathy-glib: Update 0.9.0 -> 0.9.2 2009-12-17 17:44:56 +00:00
Joshua Lock
8076573fe8 update-rc.d: add gettext to DEPENDS 2009-12-17 17:44:32 +00:00
Joshua Lock
f35aab2e94 mutter: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:44:17 +00:00
Joshua Lock
b703ee6a72 loudmouth: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:43:19 +00:00
Joshua Lock
674c9e52ed libpng: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:43:10 +00:00
Joshua Lock
d6cbbec747 jpeg: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:42:50 +00:00
Joshua Lock
7188bb4a26 gdbm: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:42:39 +00:00
Joshua Lock
fc2ba9acb4 connman: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:42:00 +00:00
Joshua Lock
5cd6d10807 connman: Updates and a recipe for the latest release
Split much of the recipe into connman.inc and created a recipe for the
latest 0.47 release.
Update the fixed revision and dropped unneeded patches.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:41:46 +00:00
Joshua Lock
2aa6a8aaf7 poky-fixed-revisions.inc: Fix preferred version for dbus-glib
Preferred version for dbus-glib was set to a version which we no longer
ship in Poky

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:39:24 +00:00
Joshua Lock
2286ffbb46 clutter: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:39:03 +00:00
Joshua Lock
fb34cbdca7 nbtk: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:37:48 +00:00
Joshua Lock
508dacc3a3 libccss: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:36:16 +00:00
Joshua Lock
29a65ece8b check: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:36:06 +00:00
Joshua Lock
33e137893f clutter-imcontext: add gettext to DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 17:35:53 +00:00
Joshua Lock
4859945b11 insane.bbclass: Handle native packages in the gettext test
When the package we are checking is a native package we need to check
for gettext-native rather than gettext in the DEPENDS.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-17 10:26:05 +00:00
Richard Purdie
459861b9c0 bitbake/data_smart.py: Fix error where update-rc.d would not get added to the dependency tree
If there was a variable such as:

X_${Y}_append = "Z"

The "Z" would be lost if X_${Y} was unset. This was due to a bug in the renameVar
function used by expandKeys().

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-16 08:39:47 +00:00
Joshua Lock
71e21a72cd insane.bbclass: Check whether gettext is required but not in DEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-15 21:07:14 +00:00
Joshua Lock
aa65b67722 chrpath: Add chrpath 0.13 based on recipe from OE.dev
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-15 13:16:13 +00:00
Richard Purdie
dd2a0e06f5 console-tools: Add missing gettext dependency
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-15 12:46:39 +00:00
Joshua Lock
ceb91f7b2b scripts: preserve BB_NUMBER_THREADS when sanitising environment
It's pretty useful to be able to define BB_NUMBER_THREADS on the cli when
executing bitbake. Add it to the extra whitelist defined in the
poky-env-internal script.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-14 17:46:59 +00:00
Richard Purdie
51497a7436 kernel.bbclass: Sync with OE.dev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-14 15:55:03 +00:00
Joshua Lock
62ab23e067 insane.bbclass: Skip arch check for Cross Canadian
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2009-12-14 11:56:01 +00:00
Joshua Lock
61d608e518 local.conf: Fix cross canadian variable, it's SDKMACHINE not SDK_ARCH 2009-12-11 17:33:55 +00:00
Richard Purdie
1183aff5e9 bitbake/git.py: Typo fix
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-11 17:20:06 +00:00
Richard Purdie
b80f6d8ac4 bitbake/git.py: Add support for fullclone parameter
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-11 17:12:53 +00:00
Richard Purdie
a94737f611 bitbake/git.py: Move variable init into the localpath function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-11 17:12:53 +00:00
Richard Purdie
7d937f0f4a qemugl: Only directly install for -nativesdk version
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-11 15:27:01 +00:00
Joshua Lock
bf69b8b737 local.conf: mention the Canadian Cross variable; SDK_ARCH 2009-12-11 14:34:20 +00:00
Joshua Lock
30b6c9b58b local.conf: use qemux86 as default target 2009-12-11 14:24:45 +00:00
Joshua Lock
2c5ae3eb9b handbook: point people at purple in the introduction 2009-12-11 14:22:46 +00:00
Richard Purdie
cb8684f9bc bitbake/cooker.py: Fix handling of extra configuration files
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-11 12:48:49 +00:00
Richard Purdie
c02e38901b git.py: Improve command failure error messages
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-11 12:48:14 +00:00
Richard Purdie
72327cb070 moblin-web-browser: Fix xpidl patch to make sure idl include files are found
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-11 10:24:14 +00:00
Richard Purdie
d5ad4877f2 mozilla-headless: Fix xulrunner version references
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-11 09:42:15 +00:00
Richard Purdie
1805dbd849 dbus-glib: 0.78 -> 0.82
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-11 09:33:21 +00:00
Richard Purdie
12691f24e5 mozilla-headless: Set PKG_CONFIG_ALLOW_SYSTEM_LIBS to avoid host libraries being found
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-11 00:37:26 +00:00
Richard Purdie
ac397328a0 moblin-floating-revisions: Set fixed revision for bisho
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 22:38:40 +00:00
Richard Purdie
fd2e201742 moblin-app-installer: Fix syntax error
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 22:32:25 +00:00
Richard Purdie
d2e8c1f0ef moblin-app-installer: Update patch against latest git
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 21:46:17 +00:00
Richard Purdie
386d564b20 moblin-fixed-revisions: Bump clutter revision
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 21:33:30 +00:00
Richard Purdie
507dcf9dbe meta-moblin: Switch to gtk+ 2.18.5
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 18:17:15 +00:00
Richard Purdie
db2e750c3a gtk+: Add 2.18.5
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 18:16:40 +00:00
Richard Purdie
bd874faabb poky-fixed-revisions.inc: Update glib-2.0 revision
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 18:09:45 +00:00
Richard Purdie
35e8e3fd56 gtk-doc: Update gtk-doc.m4
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 18:07:49 +00:00
Richard Purdie
eee88f3abc glib-2.0: 2.20 -> 2.22
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 18:07:26 +00:00
Richard Purdie
e5a21c4dd9 moblin-web-browser: Update patch
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 17:17:42 +00:00
Richard Purdie
57bf2cf3b6 clutter: Fix locked down revision patch
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 16:59:56 +00:00
Enric Balletbo i Serra
5386327d34 udev: Add local.rules for the IGEP v2 to symlink the first framebuffer to /dev/fb
Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 16:51:01 +00:00
Richard Purdie
9bd948e18b bognor-regis: Add missing DEPENDS on libnotify
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 15:12:09 +00:00
Richard Purdie
8caa290d89 rpm: Update for python 2.6
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 14:15:01 +00:00
Richard Purdie
13ee301416 moblin-floating-revisions: Enable floating revisions for mozilla-headless
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 14:01:08 +00:00
Richard Purdie
7ab7ad82f4 mozilla-headless: Update to work with recent git changes
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 14:00:23 +00:00
Richard Purdie
9e27801055 sqlite3: Add missing DEPENDS on tcl-native
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-10 00:00:11 +00:00
Richard Purdie
f4674faeaa tcl: Add tcltk from OE.dev but with legacy staging function removed and converted to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-09 23:59:44 +00:00
Richard Purdie
7b8e1efb0d mojito: Add RDEPENDS on connman and set configure flags to match, also disable shave
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-09 13:46:31 +00:00
Richard Purdie
21c54dd674 sqlite3: 3.6.16 -> 3.6.20
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-09 13:44:41 +00:00
Richard Purdie
c924e98262 leadpad/pcmanfm/puzzles: Make libowl optional
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-07 17:21:56 +00:00
Richard Purdie
aeabb07d85 tasks: Fix missing quote
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-07 16:45:59 +00:00
Richard Purdie
ad51b8c0a1 poky-fixed-revisions.inc: Update dates revision
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-07 16:41:51 +00:00
Richard Purdie
3ab04a953d pimlico: Clean up libowl handling to be consistent 2009-12-07 16:23:56 +00:00
Richard Purdie
e584e7c246 libowl: Remove stale comments and enable packaging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-07 16:23:56 +00:00
Richard Purdie
288e62a221 distutils: Sync with OE.dev
Signed-off-by: Richard Purdie <richard@rex.(none)>
2009-12-05 23:18:02 +00:00
Richard Purdie
c7d4ad8e9d gdb: Make sure cross-candian version does not provide gdbserver
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-04 23:36:19 +00:00
Richard Purdie
98192bf414 site/ix86-common: Add moz variables
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-03 17:49:13 +00:00
Richard Purdie
ba1c4fa944 python: Update 2.5 -> 2.6 (from OE.dev)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-03 12:08:52 +00:00
Richard Purdie
3b5336f7cf python: Update 2.5 -> 2.6 (from OE.dev)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-03 12:07:18 +00:00
Richard Purdie
de73c65121 alsa-utils/xdg-user-dirs/diffstat: Add missing DEPENDS on gettext
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-03 09:52:22 +00:00
Richard Purdie
73e514b0e8 rpm: Bump PR
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-02 15:36:18 +00:00
Richard Purdie
1678395e60 libtool: Fix sysroot preprocess function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-02 13:25:14 +00:00
Richard Purdie
28fc110e6d nativesdk.bbclass: Disable debug
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-02 13:16:01 +00:00
Richard Purdie
82fd3bda34 nativesdk.bbclass: Fix DEPENDS handling
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-02 13:12:53 +00:00
Richard Purdie
7bb37ffb35 gdb: Clean up recipe and don't inherit cross for cross-canadian
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-02 11:35:35 +00:00
Richard Purdie
4248fbef9f cross-canadian: Set PKGHIST_DIR to a correct value
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-02 11:34:47 +00:00
Richard Purdie
18bd18313c libexif: Add gettext DEPENDS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-01 17:14:46 +00:00
Richard Purdie
515b0f19ca util-linux: Fix DEPENDS on gettext
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-01 16:58:49 +00:00
Richard Purdie
f866f511ad gstreamer: Fix DEPENDS on gettext
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-01 16:57:41 +00:00
Richard Purdie
68518c4130 popt: Fix DEPENDS on gettext
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-01 16:56:57 +00:00
Richard Purdie
a76bdfb87b libgpg-error: Add missing DEPENDS on gettext
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-01 16:56:12 +00:00
Richard Purdie
8917b6eb29 libidl: Add missing DEPENDS on flex
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-01 16:53:28 +00:00
Richard Purdie
212dedcde3 flex: Add missing DEPENDS on gettext
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-01 16:52:19 +00:00
Richard Purdie
ac0788e958 bison: Add missing DEPENDS on gettext
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-01 16:51:34 +00:00
Richard Purdie
5bc0235640 clutter-git: Update patch
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-30 17:44:00 +00:00
Richard Purdie
6661806a5e rpm: Disable dwarfdebug
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-30 17:24:59 +00:00
Richard Purdie
0ad571dde5 clutter-git: Disable DOLT
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-30 17:11:24 +00:00
Richard Purdie
66c952cbc2 autotools.bbclass: Make sure config.rpath is present if needed
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-30 17:03:38 +00:00
Richard Purdie
dfd32b429a base.bbclass: Stage etc directory for native packages
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-30 15:11:22 +00:00
Richard Purdie
659d4e2535 mutter: Bump PR
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-30 14:28:54 +00:00
Richard Purdie
414f9e88f3 gdk-pixbuf-csource: Make sure a loaders file is generated after recent staging changes
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-30 14:28:38 +00:00
Richard Purdie
6348b70797 libtool-cross: Don't allow bad staging files break libtooL
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-30 12:20:44 +00:00
Richard Purdie
15b5395444 libtool: Only apply sysroot mangling to libtool itself (not native/cross/nativesdk)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-30 12:08:39 +00:00
Richard Purdie
35433abab3 rpm: Bump PR
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-30 12:04:29 +00:00
Richard Purdie
7cf518c754 gvfs: Add missing DEPEND on gnome-keyring and disable libarchive
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-30 11:54:19 +00:00
Richard Purdie
499c15a61c pycairo: Fix staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-30 10:10:35 +00:00
Richard Purdie
67a8d2dc46 ribosome: Build workarounds
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-30 09:56:27 +00:00
Richard Purdie
20abebf95f xapps: Add configure sed to remove problems with the XAW_CHECK_XPRINT_SUPPORT macro
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 18:08:54 +00:00
Richard Purdie
3d5a8ffe40 clutter-gst: Bump PR
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 17:59:14 +00:00
Richard Purdie
4fb92e75d4 clutter-gst: Disable DOLT
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 17:52:12 +00:00
Richard Purdie
400f1ca023 libtool: Allow ltdl to stage only
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 17:42:45 +00:00
Richard Purdie
8e3364236f Add missing patches
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 16:24:13 +00:00
Richard Purdie
6e6320bc2a gupnp: Fix staging preprocess function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 15:40:33 +00:00
Richard Purdie
63d30e31a4 clutter-1.0: Disable DOLT
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 15:35:55 +00:00
Richard Purdie
463f99cbe0 clutter-1.0: Disable DOLT
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 15:35:43 +00:00
Richard Purdie
78ed945542 syncevolution: Correct branchname
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 15:22:08 +00:00
Richard Purdie
1b0fd595dd moblin-floating-revisions.inc: Disable head revisions for now
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 15:08:17 +00:00
Richard Purdie
e1e36219c9 moblin-fixed-revisions.inc: Update gtk+ version
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 11:41:23 +00:00
Richard Purdie
ad2dfda276 subversion: Bump PR
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 11:36:18 +00:00
Richard Purdie
8265d8d87f gnu-config: Add missings sed command
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 11:34:58 +00:00
Richard Purdie
a813f239d4 libtool: Don't install into staging since we need libtool-cross there
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 11:32:43 +00:00
Richard Purdie
c770141305 e2fsprogs: Fix typo and bump appropriate PRs
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 00:41:36 +00:00
Richard Purdie
e8c26e1933 xclipboard/xclock/xkbprint/xkbutils: Upgrade to lastest releases
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 00:29:14 +00:00
Richard Purdie
3f27fdaf59 xserver-xf86-dri-lite: Add m4_pattern_allow
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-27 00:10:24 +00:00
Richard Purdie
441446c6cb gtk+: 2.16.4 -> 2.16.6
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-26 23:24:05 +00:00
Richard Purdie
6834d3c9eb xserver-xf86-dri-lite: Fix typo
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-26 23:19:38 +00:00
Richard Purdie
0d4c056ca5 xserver-xf86-dri-lite: Fix macro in .m4 file
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-26 23:15:21 +00:00
Richard Purdie
011557c157 bitbake: Fix dict changing size problems
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-26 22:45:52 +00:00
Richard Purdie
71b10e3045 poky-init-build-env: Remove now unneeded return
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-26 11:25:16 +00:00
Richard Purdie
289332253b distro/poky: Set EXTRAOPKGCONFIG
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-26 11:19:37 +00:00
Richard Purdie
b46f349b32 Add poky-feed-config-opkg (based off moblin version)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-26 11:17:37 +00:00
Richard Purdie
87113e40d7 xserver-kdrive-1.3.0.0: Add randr12 fix from OE
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-26 09:19:11 +00:00
Richard Purdie
2c1211bab9 scripts/poky-qemu-internal: Make sure qemuarm cursor is visible
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-26 09:18:08 +00:00
Richard Purdie
f0d2b37989 libxcalibrate: Fix with xcb
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-26 09:17:08 +00:00
Richard Purdie
f721f7bc34 pointercal: Update qemuarm calibration files after recent qemu changes to wacom code
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-26 09:16:19 +00:00
Richard Purdie
43dd23b93d udev-141: Backport fix from 145 which is also needed here
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-25 15:01:47 +00:00
Richard Purdie
b6b45ca538 runqemu: staging -> sysroots
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-25 14:53:37 +00:00
Richard Purdie
4ee3295dd8 apmd/jpeg: libtool is on STAGING_BINDIR_CROSS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-25 14:39:19 +00:00
Richard Purdie
1b8493ad41 qemu: Update to 0.10.6 and add fix wacom emulation issues
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-25 14:37:20 +00:00
Richard Purdie
429837b613 udev: Fix touchscreen link creation with latest version
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-25 14:31:53 +00:00
Nicolas Dechesne
663dc3684f sato: move policykit from meta-moblin to met
policykit recipe is required to build a sato image, and it was moved in the
meta-moblin collection by mistake, and sato build was broken.

policykit is a dependency of networkmanager.

Signed-off-by: Nicolas Dechesne <n-dechesne@ti.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-20 17:48:21 +00:00
Nicolas Dechesne
2163649b4e sato: move pam from meta-moblin to meta
pam recipe is required to build a sato image, and it was moved in the
meta-moblin collection by mistake, and sato build was broken.

pam is a dependency of policykit which is a dependency of networkmanager.

Signed-off-by: Nicolas Dechesne <n-dechesne@ti.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-20 17:47:18 +00:00
Richard Purdie
5892090c1c external-toolchain-csl: Convert to use glibc-package
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-20 17:32:23 +00:00
Richard Purdie
246dbec868 package.bbclass: Clear package directory copy before installing new files to prevent stale data
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-20 17:11:27 +00:00
Richard Purdie
6ebcb57968 glibc-package.bbclass: Fix the case PN == glibc
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-20 17:10:49 +00:00
Richard Purdie
46fbe4cd80 glibc-package.bbclass: Add GLIBC_INTERNAL_USE_BINARY_LOCALE precompiled mode
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-20 15:50:34 +00:00
Richard Purdie
7379ee7786 glibc: Add missing .inc file from last commit
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 22:48:07 +00:00
Richard Purdie
1e549b98e1 glibc: Separate out core glibc packaging functionality into a class
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 22:37:45 +00:00
Richard Purdie
ebf6159c7b tune-atom.inc: Improve optmisation flags
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 22:01:55 +00:00
Richard Purdie
0ad4a95607 genext2fs: The makefile is broken, just do the correct thing ourselves
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 21:50:02 +00:00
Richard Purdie
0037679ca9 stagemanager-native: Set NATIVE_INSTALL_WORKS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 14:11:42 +00:00
Richard Purdie
aa20954681 mozilla-headless: Convert to use SYSROOT_PREPROCESS_FUNCS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 13:51:06 +00:00
Richard Purdie
a6f36aedaf apt: Stage include headers in do_install and drop custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 13:45:01 +00:00
Richard Purdie
24f0ecbb14 apt-native: Use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 13:42:11 +00:00
Richard Purdie
bb9a858c58 stagemanager-native: Set PSTAGING_DISABLED and drop unused staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 13:38:33 +00:00
Richard Purdie
43bee8b735 Disable packaged-staging for cross-linkage/staging-linkage and external-poky-toolchain
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 13:37:11 +00:00
Richard Purdie
40a88a1063 poky-external-toolchain: Alter staging in do_install step
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 13:33:14 +00:00
Richard Purdie
b90e55697d cross-linkage/staging-linkage: Convert to mangle staging in do_install step
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 13:31:52 +00:00
Richard Purdie
affbcf3202 kernel.bbclass: Merge do_stage into do_install
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 13:22:48 +00:00
Richard Purdie
3a2ad83b38 osc-native: Stage using do_install (and add SRCREV)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 13:15:43 +00:00
Richard Purdie
47c19bb87a python: Drop staging functions. If failures occur we just need to improve do_install
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 11:50:58 +00:00
Richard Purdie
5716a14bf4 package.bbclass: Fix runtime_maping_rename so version information isn't removed
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 10:13:10 +00:00
Richard Purdie
0846d1f498 python: Drop custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 00:33:40 +00:00
Richard Purdie
0309edc8d9 python-native: Convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 00:26:06 +00:00
Richard Purdie
5b44fa1f29 perl: Updates to ensure Config-heavy-target.pl is found
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-18 22:04:55 +00:00
Richard Purdie
ca5f36ee6a perl: Update from OE.dev and convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-18 20:05:55 +00:00
Richard Purdie
06685d7558 libapci: Remove unneeded staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-18 00:49:32 +00:00
Richard Purdie
b977fca26f tzcode-native: Set NATIVE_INSTALL_WORKS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-18 00:48:31 +00:00
Richard Purdie
0d51d807aa xerces-c: Patch out local linking directories
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-18 00:38:44 +00:00
Richard Purdie
bc111fc45c xerces-c: Reuse do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-18 00:36:48 +00:00
Richard Purdie
892ff04e4b libol: Drop custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-18 00:27:14 +00:00
Richard Purdie
659717fb52 samba: Remove unneeded custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-18 00:19:38 +00:00
Richard Purdie
770af5b1f5 gettext: Convert to use BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-18 00:16:53 +00:00
Richard Purdie
5e6726dc19 dfu-util: Remove unneeded staging functions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-18 00:16:15 +00:00
Richard Purdie
6e7cac96bb uicmoc3-native: Set NATIVE_INSTALL_WORKS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-18 00:15:03 +00:00
Richard Purdie
dd9e54df3e boost-jam-native: Use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-18 00:12:12 +00:00
Richard Purdie
84a7f89bbf boost: Switch to using do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-18 00:10:50 +00:00
Richard Purdie
6b05a7af6a qmake-native: Convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-18 00:09:33 +00:00
Richard Purdie
54682f2d6f libpcre: Drop staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-18 00:06:35 +00:00
Richard Purdie
9fe6114da0 uicmoc3-native: Convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-18 00:02:59 +00:00
Richard Purdie
354221d878 moblin-feeds: Remove unneeded staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 23:57:25 +00:00
Richard Purdie
d26596806e linux-dummy: Drop do_stage
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 23:54:04 +00:00
Richard Purdie
57a7346f6c libiconv: Convert to use autotools_stage
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 23:49:37 +00:00
Richard Purdie
90a50d59d9 e2fsprogs: Drop unneeded custom staging function by improving do_install and convert to use BBCLASSEXTEND for -native recipe
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 23:48:54 +00:00
Richard Purdie
e4d0c6479e gcc-native: Convert to stage using do_install
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 23:33:52 +00:00
Richard Purdie
8d5f7fa6dc binutils: Remove unneeded staging functions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 23:31:51 +00:00
Richard Purdie
bf9725eb93 dbus-native: Convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 22:06:40 +00:00
Richard Purdie
be033d2d0b dbus: Remove unneeded staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 22:04:53 +00:00
Richard Purdie
7bf17e82eb alsa-oss: Drop unneeded custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 21:51:36 +00:00
Richard Purdie
c5f2ff91f6 u-boot-mkimage-native: Convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 21:49:29 +00:00
Richard Purdie
b36dcf3a48 signgp-native: Convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 21:47:21 +00:00
Richard Purdie
d715026666 update-alternatives-dpkg: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 21:44:17 +00:00
Richard Purdie
a00293790b gnome-doc-utils: Convert staging function to a do_install_append
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 21:38:51 +00:00
Richard Purdie
dc607cfb60 qemugl: This package is usually installed as an alternative so no need to use the package postinstall. Remove staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 21:35:22 +00:00
Richard Purdie
f8eb8a3817 insserv: Convert to BBCLASSEXTEND, mark do_install as safe for native staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 21:31:15 +00:00
Richard Purdie
e2b66cca92 wireless-tools: Drop custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 16:26:21 +00:00
Richard Purdie
bd910094a1 yaffs2-utils: Convert to BBCLASSEXTEND and drop custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 16:24:53 +00:00
Richard Purdie
a09fcd0c90 uicmoc4: Set NATIVE_INSTALL_WORKS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 16:24:14 +00:00
Richard Purdie
de19e4b154 gtk-doc: Set NATIVE_INSTALL_WORKS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 16:23:44 +00:00
Richard Purdie
54c9e936a2 syslinux/syslinux-installer-native: Convert to stage with do_install
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 16:18:38 +00:00
Richard Purdie
fe89792652 gtk-doc: Drop custom staging functions as now unneeded
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 16:14:34 +00:00
Richard Purdie
6cad69b4d8 libusb/libusb0: Drop unneeded custom staging functions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 16:13:03 +00:00
Richard Purdie
6327525060 libsdl-natvesdk: Drop unneeded stage_append
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 16:03:53 +00:00
Richard Purdie
0d816ac986 uclibc: Upgrade 0.9.29 -> 0.9.30.1 (from OE.dev) and massively cleanup the recipes, using install step for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 16:00:20 +00:00
Richard Purdie
2ce975dba2 automake-native: Remove unneeded staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 14:38:25 +00:00
Richard Purdie
a1f2ed6e7f matchbox-desktop: Drop custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 14:36:35 +00:00
Richard Purdie
089e29b779 uicmoc4-native: Convert to use install step for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 14:35:27 +00:00
Richard Purdie
40abdeadf7 helix-libs/ribosome: Convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 14:32:08 +00:00
Richard Purdie
cb5f3a4c9a freetype: Drop unneeded custom staging functions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 14:23:25 +00:00
Richard Purdie
06b28b570a db: Convert to use staging from install
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 14:21:22 +00:00
Richard Purdie
833152ee0b cmake-native: Drop unneeded staging function and use do_install
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 14:17:35 +00:00
Richard Purdie
e9a1c2f913 apr: Convert staging mangling to a sysroot_preprocess function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 13:56:55 +00:00
Richard Purdie
559aa188d1 intltool: Use autotools_stage
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 13:19:59 +00:00
Richard Purdie
b3ccc4e7cb bzip2: Use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 13:09:07 +00:00
Richard Purdie
bf7547778e libxaw: Add symlinks in do_install step and use this for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 13:06:49 +00:00
Richard Purdie
22569b8452 ncurses: Use do_install (and add missing symlink)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 13:04:55 +00:00
Richard Purdie
e82831ca11 lirc: Drop unneeded custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 13:02:31 +00:00
Richard Purdie
89e1fb0e99 libassuan: Drop unneeded custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:49:30 +00:00
Richard Purdie
032ef482fb js: Use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:47:14 +00:00
Richard Purdie
dab103ff91 liba52: Drop unneeded custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:46:25 +00:00
Richard Purdie
aec1e12582 gdbm: Drop unneeded custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:45:18 +00:00
Richard Purdie
4c57e9328c libfribidi: Drop unneeded custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:42:36 +00:00
Richard Purdie
9de4ef4516 tzcode-native: Convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:37:23 +00:00
Richard Purdie
49abf93f5a genext2fs: Convert to use do_install for staging and use BBCLASSEXTEND for native recipe
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:36:10 +00:00
Richard Purdie
a7d453bdcd udev: Convert old versions to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:33:59 +00:00
Richard Purdie
138417949b gnome-common: Drop unneeded custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:32:01 +00:00
Richard Purdie
4359a22bce glibc: Convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:29:18 +00:00
Richard Purdie
9734c516e8 external-csl-toolchain: Drop uneeded staging functions (a make sure mangling happens in do_install)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:24:51 +00:00
Richard Purdie
45fbc1c095 package-index/run-postinsts: Drop staging functions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:24:16 +00:00
Richard Purdie
ed0a52a8e5 openssl: Convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:17:43 +00:00
Richard Purdie
6a54171997 dosfstools: Convert to use install step for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:12:48 +00:00
Richard Purdie
551e0bb842 cdrtools-native: Use install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:08:48 +00:00
Richard Purdie
a04941ccd3 lame: Use autotools_stage_all
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:03:16 +00:00
Richard Purdie
b73a731460 module-init-tools-cross: Use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:01:18 +00:00
Richard Purdie
040cf26c51 modutils-cross: Use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:01:05 +00:00
Richard Purdie
a78d298e8e qmake2-cross: Use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 12:00:50 +00:00
Richard Purdie
7d9e2e530e cross.bbclass: Adjust the core class staging method as all users have been vetted and won't be affected
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 10:32:45 +00:00
Richard Purdie
d560f9fa61 gdb: Clean up do_install and convert to use install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 10:26:33 +00:00
Richard Purdie
5b8b6c6bc7 libtool: Convert various varients to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-17 00:15:07 +00:00
Richard Purdie
b6a0684f26 linux-libc-headers: Drop unneeded custom staging functions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 23:41:13 +00:00
Richard Purdie
ec22e232d4 gcc: Convert cross recipes to stage in do_install. Also moves stdc++ and other libs into the sysroot
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 23:36:11 +00:00
Richard Purdie
977b3fe554 cross.bbclass: Add defitions of target_*dir variables and improve sysroot_stage_all to cope with mixed packages as found in cross recipes
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 23:34:42 +00:00
Richard Purdie
94577a77ce glib-2.0: Clean up staging functions and convert to do_install
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 23:27:31 +00:00
Richard Purdie
6349b2b072 fontconfig: Update staging to use do_install
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 23:09:51 +00:00
Richard Purdie
3ba6fce06a libmad: Drop custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 22:54:14 +00:00
Richard Purdie
7edbe81181 gupnp: Convert to new staging method
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 22:51:51 +00:00
Richard Purdie
0d5818ea8e pcap: Drop custom staging function and use autotool_stage_all. Some hopefully legacy leftovers remain commented
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 22:49:39 +00:00
Richard Purdie
79c0a43c2c elfutils: Convert to autotools_stage_all
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 22:45:27 +00:00
Richard Purdie
76d9b6ea7f native.bbclass: Make sure PACKAGES is empty in case _prepend or _append are used
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 22:38:44 +00:00
Richard Purdie
6568a6d8a9 base.bbclass: Drop unused PSTAGE_BROKEN_DESTDIR variable and run sysroot_prehook at the right point
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 22:38:23 +00:00
Richard Purdie
7096a54436 packaged-staging.bbclass: Fix staging reference -> sysroots
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 22:37:39 +00:00
Richard Purdie
9a3da23e10 dbus-glib-native: Convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 22:37:01 +00:00
Richard Purdie
6341ebc588 unifdef-native: Convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 22:36:35 +00:00
Richard Purdie
70fbc8858d pkgconfig: Drop pointless staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 22:36:10 +00:00
Richard Purdie
699c0aa37e apmd: Convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 22:35:40 +00:00
Richard Purdie
2f435dab59 ldconfig-native: Convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 22:35:21 +00:00
Richard Purdie
2b62b6e4f7 quilt: Convert to use install step for staging and cleanup the include files a bit
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 22:33:56 +00:00
Richard Purdie
7d353d394c gtk+/gdk-pixbuf-csource-native: Convert to staging from do_install
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 22:32:41 +00:00
Richard Purdie
81d1490b1d gpgme: Convert to autotools_stage_all
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 22:28:18 +00:00
Richard Purdie
668ae67a4f update-rc.d: Add native version, add native dependency to class, convert staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 22:00:22 +00:00
Richard Purdie
d89b641578 sha-native: Update staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 21:53:21 +00:00
Richard Purdie
3044578403 pth: Drop custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 21:50:55 +00:00
Richard Purdie
1c9d2baa2d ppp: Drop custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 21:48:08 +00:00
Richard Purdie
31ad2cf87b gnutls: Convert to autotools_stage
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 21:44:44 +00:00
Richard Purdie
c0a972e4fe gpg-error: Convert to autotools_stage
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 21:42:41 +00:00
Richard Purdie
7807791083 tiff: Convert to autotools_stage
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 21:39:37 +00:00
Richard Purdie
84c2500e99 libxsettings-client: Convert to autotools_stage
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 21:39:11 +00:00
Richard Purdie
5c0dce866d fakeroot: Remove leagacy staging function and improve installed -dev package
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 20:17:00 +00:00
Richard Purdie
7acfa9467f perl: Standardise config.sh location
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 10:56:17 +00:00
Richard Purdie
5c0111cb9d lib_package.bbclass: Sync with OE.dev to remove hardcoded layout assumption 2009-11-16 10:53:16 +00:00
Richard Purdie
5f22458409 debian/kernel/gconf/gtk-icon-cache: PKGDESK/PKG fixes
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 10:52:35 +00:00
Richard Purdie
01f75c1b48 rootfs_rpm/icecc: Sync whitespace with OE.dev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 10:51:24 +00:00
Richard Purdie
a59f67fdb9 gtk-icon-cache.bbclass: Fix hardcoded PKGDEST reference and operate on directories other than hicolor (from OE.dev)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 10:13:39 +00:00
Richard Purdie
67fa7a1c60 gconf.bbclass: Fix hardcoded PKGDEST reference
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 10:12:59 +00:00
Richard Purdie
7da2f8c51d packaged-staging: Fix libdir references to use libdir_native
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 10:09:01 +00:00
Richard Purdie
c226b38181 package_ipk.bbclass: Fix typo
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 10:06:52 +00:00
Richard Purdie
30087f80c7 binutils-cross-canadian.inc: Convert to use sysroot staging approach
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 15:39:37 +00:00
Richard Purdie
94ceada493 binutils-cross.inc: Convert to use sysroot staging approach
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 15:39:23 +00:00
Richard Purdie
9198908755 cross.bbclass: Override the sysroot_stage_all to work appropriately for cross packages
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 15:37:50 +00:00
Richard Purdie
e2677471e6 base.bbclass: Add special stage keyword to override leagcy mode
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 15:37:00 +00:00
Richard Purdie
b772c8cde5 bitbake.conf/base.bbclass: Rename the staging directory to sysroots and the populate_staging task to populate_sysroot
This change makes the purpose of the staging directory more obvious and
the taskname more true to what it now actually does.

The layout version number is increased due to the change in layout
but code to convert existing directories and insert a symlink for
backwards compatibility is included.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:42 +00:00
Richard Purdie
6c92cfc020 glibc-package.bbclass: Operate on PKG, not D after package.bbclass updates
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:42 +00:00
Richard Purdie
7ad17848de gtk-icon-cache.bbclass: Drop unneeded module import
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:41 +00:00
Richard Purdie
c8dc3928fb gconf.bbclass: Drop unneeded module import
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:41 +00:00
Richard Purdie
d4f23b6c00 icu: Fix typo
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:28 +00:00
Richard Purdie
7b849ae2f5 native.bbclass: Fix DEPENDS handling for BBCLASSEXTEND use
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:28 +00:00
Richard Purdie
e782788756 gnu-config: Don't run sed substituation for perl location in native case
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:28 +00:00
Richard Purdie
c6f860596c base/autotools.bbclass: Make sure extra dependencies are not lost for native and nativesdk BBCLASSEXTEND. Ugly but no simpler/neater way seems possible
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:28 +00:00
Richard Purdie
aa08ac8f68 libtool: Drop unneeded include
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:28 +00:00
Richard Purdie
c54117458a classes: Remove and sanitise import statements
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:28 +00:00
Richard Purdie
80d55bbd6e base.bbclass: Drop import bb and import os as no longer needed
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:27 +00:00
Richard Purdie
f1faef3e6b icu: Fix -native version so it doesn't use target substituions in configure step
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:27 +00:00
Richard Purdie
22ddc76b2f gconf-dbus: Convert to BBCLASSEXTEND and drop custom staging append since its no longer needed
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:27 +00:00
Richard Purdie
b26b8f4f23 native.bbclass: Improve DEPENDS mangling code so sub matches don't break upon substitutions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:27 +00:00
Richard Purdie
abe3902c2c bitbake.conf: Add virtual/libintl-native to ASSUME_PROVIDED
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:27 +00:00
Richard Purdie
d594dcf085 pax-utils: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:27 +00:00
Richard Purdie
e1ba0ea25d gmp: Convert to BBCLASSEXTEND
* darwin build hacks dropped - need proper fixes
* nativesdk custom do_configure should no longer be needed
  with sdk changes

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:27 +00:00
Richard Purdie
0b1aee3163 nasm: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:27 +00:00
Richard Purdie
5b2610af77 m4: Drop 1.4.9 version, convert to autotools_stage
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:27 +00:00
Richard Purdie
f2a5be46cc libx11: Convert -native/-nativesdk versions to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:27 +00:00
Richard Purdie
5308a1d9f5 sqlite3: Cleanups - use BBCLASSEXTEND, drop strange compile bugfix (now unneeded?), convert to autotools_stage class
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:26 +00:00
Richard Purdie
03ed0dbcae xcb-proto: Drop custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:26 +00:00
Richard Purdie
4523bc1bef xcb-proto: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:26 +00:00
Richard Purdie
f9a857d08c libxslt: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:26 +00:00
Richard Purdie
f8e52056be autoconf: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:26 +00:00
Richard Purdie
71b09b016b mtd-utils: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:26 +00:00
Richard Purdie
f74f080643 libusb: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:26 +00:00
Richard Purdie
837dabc63d Drop gcc-native 3.4.4
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:26 +00:00
Richard Purdie
7541841b56 libxml2: Convert to BBCLASSEXTEND (and drop unneeded custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:26 +00:00
Richard Purdie
b9cac51c38 gettext: Drop old version
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:26 +00:00
Richard Purdie
aee10f3029 makedevs: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:25 +00:00
Richard Purdie
1d82f91348 jpeg: Convert to BBCLASSEXTEND (and drop unneeded custom staging function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:25 +00:00
Richard Purdie
65d097ca22 gperf: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:25 +00:00
Richard Purdie
b8def21047 qemu: Convert to BBCLASSEXTEND (git version only, drop 0.9.1 native/nativesdk versions)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:25 +00:00
Richard Purdie
ffb23018b5 git: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:25 +00:00
Richard Purdie
18fe7edf55 intltool: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:25 +00:00
Richard Purdie
88de83a0dc intltool: Drop old version
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:25 +00:00
Richard Purdie
9a17752a7c shared-mime-info: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:25 +00:00
Richard Purdie
6e642b436f readline: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:25 +00:00
Richard Purdie
3baff56fe6 beecrypt: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:25 +00:00
Richard Purdie
29327b9936 mtools: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:25 +00:00
Richard Purdie
3d6e246188 libidl: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:24 +00:00
Richard Purdie
3a201d0d4b pkgconfig: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:24 +00:00
Richard Purdie
cfc57fd144 ncurses: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:24 +00:00
Richard Purdie
c304734adf libpng: Convert to BBCLASSEXTEND and drop custom staging function as unneeded
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:24 +00:00
Richard Purdie
afc22e54ae curl: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:24 +00:00
Richard Purdie
039a1b4459 bison: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:24 +00:00
Richard Purdie
5c834057cb icu: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:24 +00:00
Richard Purdie
170604d54c gdbm: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:24 +00:00
Richard Purdie
315d4ab7c8 file: Convert to BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:24 +00:00
Richard Purdie
2a4760dfc9 popt: Convert to use BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:24 +00:00
Richard Purdie
677102368b gnu-config: Convert to use BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:23 +00:00
Richard Purdie
20f35974a4 bzip-full-native: Convert to use BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:23 +00:00
Richard Purdie
cd7f623b6f lzo: Convert to use BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:23 +00:00
Richard Purdie
91a071b469 unzip: Convert to use BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:23 +00:00
Richard Purdie
bb4dfbf39b zip: Convert to use BBCLASSEXTEND
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:23 +00:00
Richard Purdie
b5a059ff28 fetch/__init__.py: Try and make the sortable_revision code mode readable
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:23 +00:00
Richard Purdie
aaf9b6aa5f base.bbclass: Add an option of forcing the new staging mechanism
Add an option of forcing the new staging mechanism for native packages
that don't use autotools with the NATIVE_INSTALL_WORKS option

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:23 +00:00
Richard Purdie
08d949ee12 base.bbclass: Fix do_populate_staging to operating on TMPDIR, not STAGING_DIR_TARGET
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:23 +00:00
Richard Purdie
379bc4788f classes: Various staging improvement fixups
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:23 +00:00
Richard Purdie
d7399bd56c base.bbclass: Rework staging function to use a DESTDIR style configuration based on the data from the do_install step. This falls back to any standard do_stage function if defined, see the mailing list for more info.
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:23 +00:00
Richard Purdie
a1d93ee326 packaged-staging.bbclass: Use a variable for the location of the staging lock file
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:22 +00:00
Richard Purdie
3c83baeb26 native.bbclass: If do_stage isn't overridden, allow do_install to run for native packages
Also let do_install run for packages that run autotools_stage_all directly

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:22 +00:00
Richard Purdie
7c97538327 binconfig/pkgconfig.bbclass: Convert staging functions into SYSROOT_PREPROCESS_FUNCS operating on SYSROOT_DESTDIR
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:22 +00:00
Richard Purdie
6ea78d6489 autotools.bbclass: Separate out useful staging functions into base.bbclass and call from autotools classes
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:22 +00:00
Richard Purdie
1383f0fb4c autotools.bbclass: No need to fork sed each time
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:22 +00:00
Richard Purdie
cbcad726fe autotools.bbclass: Convert .la file mangling to package preprocessing hook
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:22 +00:00
Richard Purdie
99cdb59aed binconfig.bbclass: Convert do_install_append() into a PACKAGE_PREPROCESS_FUNCS
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:22 +00:00
Richard Purdie
7501b625b6 package.bbclass: Add the option to declare package preprocess function hooks
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:22 +00:00
Richard Purdie
4b0332c431 package.bbclass: Change to operate on a copy of the install directory instead of directly. Also take the opportunity to rename the temp directories so their function is clear
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:22 +00:00
Richard Purdie
0eee29e451 package.bbclass: Remove hardcoded use of PKGDEST variable
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:22 +00:00
Richard Purdie
4f4a3da843 package.bbclass: Move variable checks to one place making the code more readable
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:22 +00:00
Richard Purdie
764f73a033 base.bbclass: Only run do_stage if its been overwritten as the default is empty and its pointless to run it
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:21 +00:00
Richard Purdie
483f85802a bitbake: Sync various functions with those from bitbake-dev and bitbake upstream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:21 +00:00
Richard Purdie
c2b5a61728 bitbake: Sync module import cleanups back from bitbake trunk
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:21 +00:00
Richard Purdie
1fd3265374 build.py: Fix zero size logfile problems
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:21 +00:00
Richard Purdie
58c01c147c xfce.bbclass: Sync with OE.dev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:21 +00:00
2181 changed files with 315389 additions and 1909980 deletions

22
.gitignore vendored
View File

@@ -1,7 +1,9 @@
*.pyc
*.pyo
build/conf/local.conf
build/conf/bblayers.conf
build/tmp/
pstage/
scripts/poky-git-proxy-socks
sources/
meta-darwin
@@ -11,3 +13,23 @@ poky-autobuilder*
*.swp
*.orig
*.rej
*~
handbook/poky-doc-tools/Makefile
handbook/poky-doc-tools/Makefile.in
handbook/poky-doc-tools/aclocal.m4
handbook/poky-doc-tools/autom4te.cache/
handbook/poky-doc-tools/common/Makefile
handbook/poky-doc-tools/common/Makefile.in
handbook/poky-doc-tools/common/fop-config.xml
handbook/poky-doc-tools/config.log
handbook/poky-doc-tools/config.status
handbook/poky-doc-tools/configure
handbook/poky-doc-tools/install-sh
handbook/poky-doc-tools/missing
handbook/poky-doc-tools/poky-docbook-to-pdf
handbook/poky-handbook.html
handbook/poky-handbook.pdf
handbook/poky-handbook.tgz
handbook/bsp-guide.html
handbook/bsp-guide.pdf

View File

@@ -5,7 +5,10 @@ bitbake/COPYING (GPLv2)
meta/COPYING.MIT (MIT)
meta-extras/COPYING.MIT (MIT)
which cover the components in those subdirectories.
which cover the components in those subdirectories. This means all
metadata is MIT licensed unless otherwise stated. Source code included
in tree for individual recipes is under the LICENSE stated in the .bb
file for those software projects unless otherwise stated.
License information for any other files is either explicitly stated
or defaults to GPL version 2.

View File

@@ -1,10 +0,0 @@
Tim Ansell <mithro@mithis.net>
Phil Blundell <pb@handhelds.org>
Seb Frankengul <seb@frankengul.org>
Holger Freyther <zecke@handhelds.org>
Marcin Juszkiewicz <marcin@haerwu.biz>
Chris Larson <kergoth@handhelds.org>
Ulrich Luckas <luckas@musoft.de>
Mickey Lauer <mickey@Vanille.de>
Richard Purdie <rpurdie@rpsys.net>
Holger Schurig <holgerschurig@gmx.de>

View File

@@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@@ -1,315 +0,0 @@
Changes in Bitbake 1.9.x:
- Add PE (Package Epoch) support from Philipp Zabel (pH5)
- Treat python functions the same as shell functions for logging
- Use TMPDIR/anonfunc as a __anonfunc temp directory (T)
- Catch truncated cache file errors
- Allow operations other than assignment on flag variables
- Add code to handle inter-task dependencies
- Fix cache errors when generation dotGraphs
- Make sure __inherit_cache is updated before calling include() (from Michael Krelin)
- Fix bug when target was in ASSUME_PROVIDED (#2236)
- Raise ParseError for filenames with multiple underscores instead of infinitely looping (#2062)
- Fix invalid regexp in BBMASK error handling (missing import) (#1124)
- Promote certain warnings from debug to note 2 level
- Update manual
- Correctly redirect stdin when forking
- If parsing errors are found, exit, too many users miss the errors
- Remove supriours PREFERRED_PROVIDER warnings
- svn fetcher: Add _buildsvncommand function
- Improve certain error messages
- Rewrite svn fetcher to make adding extra operations easier
as part of future SRCDATE="now" fixes
(requires new FETCHCMD_svn definition in bitbake.conf)
- Change SVNDIR layout to be more unique (fixes #2644 and #2624)
- Add ConfigParsed Event after configuration parsing is complete
- Add SRCREV support for svn fetcher
- data.emit_var() - only call getVar if we need the variable
- Stop generating the A variable (seems to be legacy code)
- Make sure intertask depends get processed correcting in recursive depends
- Add pn-PN to overrides when evaluating PREFERRED_VERSION
- Improve the progress indicator by skipping tasks that have
already run before starting the build rather than during it
- Add profiling option (-P)
- Add BB_SRCREV_POLICY variable (clear or cache) to control SRCREV cache
- Add SRCREV_FORMAT support
- Fix local fetcher's localpath return values
- Apply OVERRIDES before performing immediate expansions
- Allow the -b -e option combination to take regular expressions
- Fix handling of variables with expansion in the name using _append/_prepend
e.g. RRECOMMENDS_${PN}_append_xyz = "abc"
- Add plain message function to bb.msg
- Sort the list of providers before processing so dependency problems are
reproducible rather than effectively random
- Fix/improve bitbake -s output
- Add locking for fetchers so only one tries to fetch a given file at a given time
- Fix int(0)/None confusion in runqueue.py which causes random gaps in dependency chains
- Expand data in addtasks
- Print the list of missing DEPENDS,RDEPENDS for the "No buildable providers available for required...."
error message.
- Rework add_task to be more efficient (6% speedup, 7% number of function calls reduction)
- Sort digraph output to make builds more reproducible
- Split expandKeys into two for loops to benefit from the expand_cache (12% speedup)
- runqueue.py: Fix idepends handling to avoid dependency errors
- Clear the terminal TOSTOP flag if set (and warn the user)
- Fix regression from r653 and make SRCDATE/CVSDATE work for packages again
- Fix a bug in bb.decodeurl where http://some.where.com/somefile.tgz decoded to host="" (#1530)
- Warn about malformed PREFERRED_PROVIDERS (#1072)
- Add support for BB_NICE_LEVEL option (#1627)
- Psyco is used only on x86 as there is no support for other architectures.
- Sort initial providers list by default preference (#1145, #2024)
- Improve provider sorting so prefered versions have preference over latest versions (#768)
- Detect builds of tasks with overlapping providers and warn (will become a fatal error) (#1359)
- Add MULTI_PROVIDER_WHITELIST variable to allow known safe multiple providers to be listed
- Handle paths in svn fetcher module parameter
- Support the syntax "export VARIABLE"
- Add bzr fetcher
- Add support for cleaning directories before a task in the form:
do_taskname[cleandirs] = "dir"
- bzr fetcher tweaks from Robert Schuster (#2913)
- Add mercurial (hg) fetcher from Robert Schuster (#2913)
- Don't add duplicates to BBPATH
- Fix preferred_version return values (providers.py)
- Fix 'depends' flag splitting
- Fix unexport handling (#3135)
- Add bb.copyfile function similar to bb.movefile (and improve movefile error reporting)
- Allow multiple options for deptask flag
- Use git-fetch instead of git-pull removing any need for merges when
fetching (we don't care about the index). Fixes fetch errors.
- Add BB_GENERATE_MIRROR_TARBALLS option, set to 0 to make git fetches
faster at the expense of not creating mirror tarballs.
- SRCREV handling updates, improvements and fixes from Poky
- Add bb.utils.lockfile() and bb.utils.unlockfile() from Poky
- Add support for task selfstamp and lockfiles flags
- Disable task number acceleration since it can allow the tasks to run
out of sequence
- Improve runqueue code comments
- Add task scheduler abstraction and some example schedulers
- Improve circular dependency chain debugging code and user feedback
- Don't give a stacktrace for invalid tasks, have a user friendly message (#3431)
- Add support for "-e target" (#3432)
- Fix shell showdata command (#3259)
- Fix shell data updating problems (#1880)
- Properly raise errors for invalid source URI protocols
- Change the wget fetcher failure handling to avoid lockfile problems
- Add support for branches in git fetcher (Otavio Salvador, Michael Lauer)
- Make taskdata and runqueue errors more user friendly
- Add norecurse and fullpath options to cvs fetcher
- Fix exit code for build failures in --continue mode
- Fix git branch tags fetching
- Change parseConfigurationFile so it works on real data, not a copy
- Handle 'base' inherit and all other INHERITs from parseConfigurationFile
instead of BBHandler
- Fix getVarFlags bug in data_smart
- Optmise cache handling by more quickly detecting an invalid cache, only
saving the cache when its changed, moving the cache validity check into
the parsing loop and factoring some getVar calls outside a for loop
- Cooker: Remove a debug message from the parsing loop to lower overhead
- Convert build.py exec_task to use getVarFlags
- Update shell to use cooker.buildFile
- Add StampUpdate event
- Convert -b option to use taskdata/runqueue
- Remove digraph and switch to new stamp checking code. exec_task no longer
honours dependencies
- Make fetcher timestamp updating non-fatal when permissions don't allow
updates
- Add BB_SCHEDULER variable/option ("completion" or "speed") controlling
the way bitbake schedules tasks
- Add BB_STAMP_POLICY variable/option ("perfile" or "full") controlling
how extensively stamps are looked at for validity
- When handling build target failures make sure idepends are checked and
failed where needed. Fixes --continue mode crashes.
- Fix -f (force) in conjunction with -b
- Fix problems with recrdeptask handling where some idepends weren't handled
correctly.
- Handle exit codes correctly (from pH5)
- Work around refs/HEAD issues with git over http (#3410)
- Add proxy support to the CVS fetcher (from Cyril Chemparathy)
- Improve runfetchcmd so errors are seen and various GIT variables are exported
- Add ability to fetchers to check URL validity without downloading
- Improve runtime PREFERRED_PROVIDERS warning message
- Add BB_STAMP_WHITELIST option which contains a list of stamps to ignore when
checking stamp dependencies and using a BB_STAMP_POLICY of "whitelist"
- No longer weight providers on the basis of a package being "already staged". This
leads to builds being non-deterministic.
- Flush stdout/stderr before forking to fix duplicate console output
- Make sure recrdeps tasks include all inter-task dependencies of a given fn
- Add bb.runqueue.check_stamp_fn() for use by packaged-staging
- Add PERSISTENT_DIR to store the PersistData in a persistent
directory != the cache dir.
- Add md5 and sha256 checksum generation functions to utils.py
- Correctly handle '-' characters in class names (#2958)
- Make sure expandKeys has been called on the data dictonary before running tasks
- Correctly add a task override in the form task-TASKNAME.
- Revert the '-' character fix in class names since it breaks things
- When a regexp fails to compile for PACKAGES_DYNAMIC, print a more useful error (#4444)
- Allow to checkout CVS by Date and Time. Just add HHmm to the SRCDATE.
- Move prunedir function to utils.py and add explode_dep_versions function
- Raise an exception if SRCREV == 'INVALID'
- Fix hg fetcher username/password handling and fix crash
- Fix PACKAGES_DYNAMIC handling of packages with '++' in the name
- Rename __depends to __base_depends after configuration parsing so we don't
recheck the validity of the config files time after time
- Add better environmental variable handling. By default it will now only pass certain
whitelisted variables into the data store. If BB_PRESERVE_ENV is set bitbake will use
all variable from the environment. If BB_ENV_WHITELIST is set, that whitelist will be
used instead of the internal bitbake one. Alternatively, BB_ENV_EXTRAWHITE can be used
to extend the internal whitelist.
- Perforce fetcher fix to use commandline options instead of being overriden by the environment
- bb.utils.prunedir can cope with symlinks to directoriees without exceptions
- use @rev when doing a svn checkout
- Add osc fetcher (from Joshua Lock in Poky)
- When SRCREV autorevisioning for a recipe is in use, don't cache the recipe
- Add tryaltconfigs option to control whether bitbake trys using alternative providers
to fulfil failed dependencies. It defaults to off, changing the default since this
behaviour confuses many users and isn't often useful.
- Improve lock file function error handling
- Add username handling to the git fetcher (Robert Bragg)
- Add support for HTTP_PROXY and HTTP_PROXY_IGNORE variables to the wget fetcher
- Export more variables to the fetcher commands to allow ssh checkouts and checkouts through
proxies to work better. (from Poky)
- Also allow user and pswd options in SRC_URIs globally (from Poky)
- Improve proxy handling when using mirrors (from Poky)
- Add bb.utils.prune_suffix function
- Fix hg checkouts of specific revisions (from Poky)
- Fix wget fetching of urls with parameters specified (from Poky)
- Add username handling to git fetcher (from Poky)
- Set HOME environmental variable when running fetcher commands (from Poky)
- Make sure allowed variables inherited from the environment are exported again (from Poky)
- When running a stage task in bbshell, run populate_staging, not the stage task (from Poky)
Changes in Bitbake 1.8.0:
- Release 1.7.x as a stable series
Changes in BitBake 1.7.x:
- Major updates of the dependency handling and execution
of tasks. Code from bin/bitbake replaced with runqueue.py
and taskdata.py
- New task execution code supports multithreading with a simplistic
threading algorithm controlled by BB_NUMBER_THREADS
- Change of the SVN Fetcher to keep the checkout around
courtsey of Paul Sokolovsky (#1367)
- PATH fix to bbimage (#1108)
- Allow debug domains to be specified on the commandline (-l)
- Allow 'interactive' tasks
- Logging message improvements
- Drop now uneeded BUILD_ALL_DEPS variable
- Add support for wildcards to -b option
- Major overhaul of the fetchers making a large amount of code common
including mirroring code
- Fetchers now touch md5 stamps upon access (to show activity)
- Fix -f force option when used without -b (long standing bug)
- Add expand_cache to data_cache.py, caching expanded data (speedup)
- Allow version field in DEPENDS (ignored for now)
- Add abort flag support to the shell
- Make inherit fail if the class doesn't exist (#1478)
- Fix data.emit_env() to expand keynames as well as values
- Add ssh fetcher
- Add perforce fetcher
- Make PREFERRED_PROVIDER_foobar defaults to foobar if available
- Share the parser's mtime_cache, reducing the number of stat syscalls
- Compile all anonfuncs at once!
*** Anonfuncs must now use common spacing format ***
- Memorise the list of handlers in __BBHANDLERS and tasks in __BBTASKS
This removes 2 million function calls resulting in a 5-10% speedup
- Add manpage
- Update generateDotGraph to use taskData/runQueue improving accuracy
and also adding a task dependency graph
- Fix/standardise on GPLv2 licence
- Move most functionality from bin/bitbake to cooker.py and split into
separate funcitons
- CVS fetcher: Added support for non-default port
- Add BBINCLUDELOGS_LINES, the number of lines to read from any logfile
- Drop shebangs from lib/bb scripts
Changes in Bitbake 1.6.0:
- Better msg handling
- COW dict implementation from Tim Ansell (mithro) leading
to better performance
- Speed up of -s
Changes in Bitbake 1.4.4:
- SRCDATE now handling courtsey Justin Patrin
- #1017 fix to work with rm_work
Changes in BitBake 1.4.2:
- Send logs to oe.pastebin.com instead of pastebin.com
fixes #856
- Copy the internal bitbake data before building the
dependency graph. This fixes nano not having a
virtual/libc dependency
- Allow multiple TARBALL_STASH entries
- Cache, check if the directory exists before changing
into it
- git speedup cloning by not doing a checkout
- allow to have spaces in filenames (.conf, .bb, .bbclass)
Changes in BitBake 1.4.0:
- Fix to check both RDEPENDS and RDEPENDS_${PN}
- Fix a RDEPENDS parsing bug in utils:explode_deps()
- Update git fetcher behaviour to match git changes
- ASSUME_PROVIDED allowed to include runtime packages
- git fetcher cleanup and efficency improvements
- Change the format of the cache
- Update usermanual to document the Fetchers
- Major changes to caching with a new strategy
giving a major performance increase when reparsing
with few data changes
Changes in BitBake 1.3.3:
- Create a new Fetcher module to ease the
development of new Fetchers.
Issue #438 fixed by rpurdie@openedhand.com
- Make the Subversion fetcher honor the SRC Date
(CVSDATE).
Issue #555 fixed by chris@openedhand.com
- Expand PREFERRED_PROVIDER properly
Issue #436 fixed by rprudie@openedhand.com
- Typo fix for Issue #531 by Philipp Zabel for the
BitBake Shell
- Introduce a new special variable SRCDATE as
a generic naming to replace CVSDATE.
- Introduce a new keyword 'required'. In contrast
to 'include' parsing will fail if a to be included
file can not be found.
- Remove hardcoding of the STAMP directory. Patch
courtsey pHilipp Zabel
- Track the RDEPENDS of each package (rpurdie@openedhand.com)
- Introduce BUILD_ALL_DEPS to build all RDEPENDS. E.g
this is used by the OpenEmbedded Meta Packages.
(rpurdie@openedhand.com).
Changes in BitBake 1.3.2:
- reintegration of make.py into BitBake
- bbread is gone, use bitbake -e
- lots of shell updates and bugfixes
- Introduction of the .= and =. operator
- Sort variables, keys and groups in bitdoc
- Fix regression in the handling of BBCOLLECTIONS
- Update the bitbake usermanual
Changes in BitBake 1.3.0:
- add bitbake interactive shell (bitbake -i)
- refactor bitbake utility in OO style
- kill default arguments in methods in the bb.data module
- kill default arguments in methods in the bb.fetch module
- the http/https/ftp fetcher will fail if the to be
downloaded file was not found in DL_DIR (this is needed
to avoid unpacking the sourceforge mirror page)
- Switch to a cow like data instance for persistent and non
persisting mode (called data_smart.py)
- Changed the callback of bb.make.collect_bbfiles to carry
additional parameters
- Drastically reduced the amount of needed RAM by not holding
each data instance in memory when using a cache/persistent
storage
Changes in BitBake 1.2.1:
The 1.2.1 release is meant as a intermediate release to lay the
ground for more radical changes. The most notable changes are:
- Do not hardcode {}, use bb.data.init() instead if you want to
get a instance of a data class
- bb.data.init() is a factory and the old bb.data methods are delegates
- Do not use deepcopy use bb.data.createCopy() instead.
- Removed default arguments in bb.fetch

View File

@@ -1,207 +0,0 @@
#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2003, 2004 Phil Blundell
# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
# Copyright (C) 2005 Holger Hans Peter Freyther
# Copyright (C) 2005 ROAD GmbH
# Copyright (C) 2006 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import sys, os, getopt, re, time, optparse, xmlrpclib
sys.path.insert(0,os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
import bb
from bb import cooker
from bb import daemonize
from bb import ui
from bb.ui import uievent
__version__ = "1.9.0"
if sys.hexversion < 0x020600F0:
print "Sorry, python 2.6 or later is required for this version of bitbake"
sys.exit(1)
#============================================================================#
# BBOptions
#============================================================================#
class BBConfiguration( object ):
"""
Manages build options and configurations for one run
"""
def __init__( self, options ):
for key, val in options.__dict__.items():
setattr( self, key, val )
def print_exception(exc, value, tb):
"""
Print the exception to stderr, only showing the traceback if bitbake
debugging is enabled.
"""
if not bb.msg.debug_level['default']:
tb = None
sys.__excepthook__(exc, value, tb)
#============================================================================#
# main
#============================================================================#
def main():
return_value = 0
pythonver = sys.version_info
if pythonver[0] < 2 or (pythonver[0] == 2 and pythonver[1] < 5):
print "Sorry, bitbake needs python 2.5 or later."
sys.exit(1)
parser = optparse.OptionParser( version = "BitBake Build Tool Core version %s, %%prog version %s" % ( bb.__version__, __version__ ),
usage = """%prog [options] [package ...]
Executes the specified task (default is 'build') for a given set of BitBake files.
It expects that BBFILES is defined, which is a space separated list of files to
be executed. BBFILES does support wildcards.
Default BBFILES are the .bb files in the current directory.""" )
parser.add_option( "-b", "--buildfile", help = "execute the task against this .bb file, rather than a package from BBFILES.",
action = "store", dest = "buildfile", default = None )
parser.add_option( "-k", "--continue", help = "continue as much as possible after an error. While the target that failed, and those that depend on it, cannot be remade, the other dependencies of these targets can be processed all the same.",
action = "store_false", dest = "abort", default = True )
parser.add_option( "-a", "--tryaltconfigs", help = "continue with builds by trying to use alternative providers where possible.",
action = "store_true", dest = "tryaltconfigs", default = False )
parser.add_option( "-f", "--force", help = "force run of specified cmd, regardless of stamp status",
action = "store_true", dest = "force", default = False )
parser.add_option( "-i", "--interactive", help = "drop into the interactive mode also called the BitBake shell.",
action = "store_true", dest = "interactive", default = False )
parser.add_option( "-c", "--cmd", help = "Specify task to execute. Note that this only executes the specified task for the providee and the packages it depends on, i.e. 'compile' does not implicitly call stage for the dependencies (IOW: use only if you know what you are doing). Depending on the base.bbclass a listtasks tasks is defined and will show available tasks",
action = "store", dest = "cmd" )
parser.add_option( "-r", "--read", help = "read the specified file before bitbake.conf",
action = "append", dest = "file", default = [] )
parser.add_option( "-v", "--verbose", help = "output more chit-chat to the terminal",
action = "store_true", dest = "verbose", default = False )
parser.add_option( "-D", "--debug", help = "Increase the debug level. You can specify this more than once.",
action = "count", dest="debug", default = 0)
parser.add_option( "-n", "--dry-run", help = "don't execute, just go through the motions",
action = "store_true", dest = "dry_run", default = False )
parser.add_option( "-p", "--parse-only", help = "quit after parsing the BB files (developers only)",
action = "store_true", dest = "parse_only", default = False )
parser.add_option( "-d", "--disable-psyco", help = "disable using the psyco just-in-time compiler (not recommended)",
action = "store_true", dest = "disable_psyco", default = False )
parser.add_option( "-s", "--show-versions", help = "show current and preferred versions of all packages",
action = "store_true", dest = "show_versions", default = False )
parser.add_option( "-e", "--environment", help = "show the global or per-package environment (this is what used to be bbread)",
action = "store_true", dest = "show_environment", default = False )
parser.add_option( "-g", "--graphviz", help = "emit the dependency trees of the specified packages in the dot syntax",
action = "store_true", dest = "dot_graph", default = False )
parser.add_option( "-I", "--ignore-deps", help = """Assume these dependencies don't exist and are already provided (equivalent to ASSUME_PROVIDED). Useful to make dependency graphs more appealing""",
action = "append", dest = "extra_assume_provided", default = [] )
parser.add_option( "-l", "--log-domains", help = """Show debug logging for the specified logging domains""",
action = "append", dest = "debug_domains", default = [] )
parser.add_option( "-P", "--profile", help = "profile the command and print a report",
action = "store_true", dest = "profile", default = False )
parser.add_option( "-u", "--ui", help = "userinterface to use",
action = "store", dest = "ui")
parser.add_option( "", "--revisions-changed", help = "Set the exit code depending on whether upstream floating revisions have changed or not",
action = "store_true", dest = "revisions_changed", default = False )
options, args = parser.parse_args(sys.argv)
configuration = BBConfiguration(options)
configuration.pkgs_to_build = []
configuration.pkgs_to_build.extend(args[1:])
cooker = bb.cooker.BBCooker(configuration)
# Clear away any spurious environment variables. But don't wipe the
# environment totally. This is necessary to ensure the correct operation
# of the UIs (e.g. for DISPLAY, etc.)
bb.utils.clean_environment()
cooker.parseCommandLine()
host = cooker.server.host
port = cooker.server.port
# Save a logfile for cooker into the current working directory. When the
# server is daemonized this logfile will be truncated.
cooker_logfile = os.path.join (os.getcwd(), "cooker.log")
daemonize.createDaemon(cooker.serve, cooker_logfile)
del cooker
# Setup a connection to the server (cooker)
server = xmlrpclib.Server("http://%s:%s" % (host, port), allow_none=True)
# Setup an event receiving queue
eventHandler = uievent.BBUIEventQueue(server)
# Launch the UI
if configuration.ui:
ui = configuration.ui
else:
ui = "knotty"
try:
# Dynamically load the UI based on the ui name. Although we
# suggest a fixed set this allows you to have flexibility in which
# ones are available.
exec "from bb.ui import " + ui
exec "return_value = " + ui + ".init(server, eventHandler)"
except ImportError:
print "FATAL: Invalid user interface '%s' specified. " % ui
print "Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'."
except Exception, e:
print "FATAL: Unable to start to '%s' UI: %s." % (configuration.ui, e.message)
finally:
# Don't wait for server indefinitely
import socket
socket.setdefaulttimeout(2)
try:
eventHandler.system_quit()
except:
pass
try:
server.terminateServer()
except:
pass
return return_value
if __name__ == "__main__":
print """WARNING, WARNING, WARNING
This is a Bitbake from the Unstable/Development 1.9 Branch. This software is a work in progress and should only be used by Bitbake developers/testers"""
ret = main()
sys.exit(ret)

View File

@@ -1,534 +0,0 @@
#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2005 Holger Hans Peter Freyther
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import optparse, os, sys
# bitbake
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
import bb
import bb.parse
from string import split, join
__version__ = "0.0.2"
class HTMLFormatter:
"""
Simple class to help to generate some sort of HTML files. It is
quite inferior solution compared to docbook, gtkdoc, doxygen but it
should work for now.
We've a global introduction site (index.html) and then one site for
the list of keys (alphabetical sorted) and one for the list of groups,
one site for each key with links to the relations and groups.
index.html
all_keys.html
all_groups.html
groupNAME.html
keyNAME.html
"""
def replace(self, text, *pairs):
"""
From pydoc... almost identical at least
"""
while pairs:
(a,b) = pairs[0]
text = join(split(text, a), b)
pairs = pairs[1:]
return text
def escape(self, text):
"""
Escape string to be conform HTML
"""
return self.replace(text,
('&', '&amp;'),
('<', '&lt;' ),
('>', '&gt;' ) )
def createNavigator(self):
"""
Create the navgiator
"""
return """<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="g" href="index.html">Home</a></td>
<td><a accesskey="n" href="all_groups.html">Groups</a></td>
<td><a accesskey="u" href="all_keys.html">Keys</a></td>
</tr></table>
"""
def relatedKeys(self, item):
"""
Create HTML to link to foreign keys
"""
if len(item.related()) == 0:
return ""
txt = "<p><b>See also:</b><br>"
txts = []
for it in item.related():
txts.append("""<a href="key%(it)s.html">%(it)s</a>""" % vars() )
return txt + ",".join(txts)
def groups(self,item):
"""
Create HTML to link to related groups
"""
if len(item.groups()) == 0:
return ""
txt = "<p><b>See also:</b><br>"
txts = []
for group in item.groups():
txts.append( """<a href="group%s.html">%s</a> """ % (group,group) )
return txt + ",".join(txts)
def createKeySite(self,item):
"""
Create a site for a key. It contains the header/navigator, a heading,
the description, links to related keys and to the groups.
"""
return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Key %s</title></head>
<link rel="stylesheet" href="style.css" type="text/css">
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
%s
<h2><span class="refentrytitle">%s</span></h2>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<p>
%s
</p>
</div>
<div class="refsynopsisdiv">
<h2>Related Keys</h2>
<p>
%s
</p>
</div>
<div class="refsynopsisdiv">
<h2>Groups</h2>
<p>
%s
</p>
</div>
</body>
""" % (item.name(), self.createNavigator(), item.name(),
self.escape(item.description()), self.relatedKeys(item), self.groups(item))
def createGroupsSite(self, doc):
"""
Create the Group Overview site
"""
groups = ""
sorted_groups = doc.groups()
sorted_groups.sort()
for group in sorted_groups:
groups += """<a href="group%s.html">%s</a><br>""" % (group, group)
return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Group overview</title></head>
<link rel="stylesheet" href="style.css" type="text/css">
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
%s
<h2>Available Groups</h2>
%s
</body>
""" % (self.createNavigator(), groups)
def createIndex(self):
"""
Create the index file
"""
return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Bitbake Documentation</title></head>
<link rel="stylesheet" href="style.css" type="text/css">
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
%s
<h2>Documentation Entrance</h2>
<a href="all_groups.html">All available groups</a><br>
<a href="all_keys.html">All available keys</a><br>
</body>
""" % self.createNavigator()
def createKeysSite(self, doc):
"""
Create Overview of all avilable keys
"""
keys = ""
sorted_keys = doc.doc_keys()
sorted_keys.sort()
for key in sorted_keys:
keys += """<a href="key%s.html">%s</a><br>""" % (key, key)
return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Key overview</title></head>
<link rel="stylesheet" href="style.css" type="text/css">
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
%s
<h2>Available Keys</h2>
%s
</body>
""" % (self.createNavigator(), keys)
def createGroupSite(self, gr, items, _description = None):
"""
Create a site for a group:
Group the name of the group, items contain the name of the keys
inside this group
"""
groups = ""
description = ""
# create a section with the group descriptions
if _description:
description += "<h2 Description of Grozp %s</h2>" % gr
description += _description
items.sort(lambda x,y:cmp(x.name(),y.name()))
for group in items:
groups += """<a href="key%s.html">%s</a><br>""" % (group.name(), group.name())
return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Group %s</title></head>
<link rel="stylesheet" href="style.css" type="text/css">
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
%s
%s
<div class="refsynopsisdiv">
<h2>Keys in Group %s</h2>
<pre class="synopsis">
%s
</pre>
</div>
</body>
""" % (gr, self.createNavigator(), description, gr, groups)
def createCSS(self):
"""
Create the CSS file
"""
return """.synopsis, .classsynopsis
{
background: #eeeeee;
border: solid 1px #aaaaaa;
padding: 0.5em;
}
.programlisting
{
background: #eeeeff;
border: solid 1px #aaaaff;
padding: 0.5em;
}
.variablelist
{
padding: 4px;
margin-left: 3em;
}
.variablelist td:first-child
{
vertical-align: top;
}
table.navigation
{
background: #ffeeee;
border: solid 1px #ffaaaa;
margin-top: 0.5em;
margin-bottom: 0.5em;
}
.navigation a
{
color: #770000;
}
.navigation a:visited
{
color: #550000;
}
.navigation .title
{
font-size: 200%;
}
div.refnamediv
{
margin-top: 2em;
}
div.gallery-float
{
float: left;
padding: 10px;
}
div.gallery-float img
{
border-style: none;
}
div.gallery-spacer
{
clear: both;
}
a
{
text-decoration: none;
}
a:hover
{
text-decoration: underline;
color: #FF0000;
}
"""
class DocumentationItem:
"""
A class to hold information about a configuration
item. It contains the key name, description, a list of related names,
and the group this item is contained in.
"""
def __init__(self):
self._groups = []
self._related = []
self._name = ""
self._desc = ""
def groups(self):
return self._groups
def name(self):
return self._name
def description(self):
return self._desc
def related(self):
return self._related
def setName(self, name):
self._name = name
def setDescription(self, desc):
self._desc = desc
def addGroup(self, group):
self._groups.append(group)
def addRelation(self,relation):
self._related.append(relation)
def sort(self):
self._related.sort()
self._groups.sort()
class Documentation:
"""
Holds the documentation... with mappings from key to items...
"""
def __init__(self):
self.__keys = {}
self.__groups = {}
def insert_doc_item(self, item):
"""
Insert the Doc Item into the internal list
of representation
"""
item.sort()
self.__keys[item.name()] = item
for group in item.groups():
if not group in self.__groups:
self.__groups[group] = []
self.__groups[group].append(item)
self.__groups[group].sort()
def doc_item(self, key):
"""
Return the DocumentationInstance describing the key
"""
try:
return self.__keys[key]
except KeyError:
return None
def doc_keys(self):
"""
Return the documented KEYS (names)
"""
return self.__keys.keys()
def groups(self):
"""
Return the names of available groups
"""
return self.__groups.keys()
def group_content(self,group_name):
"""
Return a list of keys/names that are in a specefic
group or the empty list
"""
try:
return self.__groups[group_name]
except KeyError:
return []
def parse_cmdline(args):
"""
Parse the CMD line and return the result as a n-tuple
"""
parser = optparse.OptionParser( version = "Bitbake Documentation Tool Core version %s, %%prog version %s" % (bb.__version__,__version__))
usage = """%prog [options]
Create a set of html pages (documentation) for a bitbake.conf....
"""
# Add the needed options
parser.add_option( "-c", "--config", help = "Use the specified configuration file as source",
action = "store", dest = "config", default = os.path.join("conf", "documentation.conf") )
parser.add_option( "-o", "--output", help = "Output directory for html files",
action = "store", dest = "output", default = "html/" )
parser.add_option( "-D", "--debug", help = "Increase the debug level",
action = "count", dest = "debug", default = 0 )
parser.add_option( "-v","--verbose", help = "output more chit-char to the terminal",
action = "store_true", dest = "verbose", default = False )
options, args = parser.parse_args( sys.argv )
if options.debug:
bb.msg.set_debug_level(options.debug)
return options.config, options.output
def main():
"""
The main Method
"""
(config_file,output_dir) = parse_cmdline( sys.argv )
# right to let us load the file now
try:
documentation = bb.parse.handle( config_file, bb.data.init() )
except IOError:
bb.fatal( "Unable to open %s" % config_file )
except bb.parse.ParseError:
bb.fatal( "Unable to parse %s" % config_file )
if isinstance(documentation, dict):
documentation = documentation[""]
# Assuming we've the file loaded now, we will initialize the 'tree'
doc = Documentation()
# defined states
state_begin = 0
state_see = 1
state_group = 2
for key in bb.data.keys(documentation):
data = bb.data.getVarFlag(key, "doc", documentation)
if not data:
continue
# The Documentation now starts
doc_ins = DocumentationItem()
doc_ins.setName(key)
tokens = data.split(' ')
state = state_begin
string= ""
for token in tokens:
token = token.strip(',')
if not state == state_see and token == "@see":
state = state_see
continue
elif not state == state_group and token == "@group":
state = state_group
continue
if state == state_begin:
string += " %s" % token
elif state == state_see:
doc_ins.addRelation(token)
elif state == state_group:
doc_ins.addGroup(token)
# set the description
doc_ins.setDescription(string)
doc.insert_doc_item(doc_ins)
# let us create the HTML now
bb.mkdirhier(output_dir)
os.chdir(output_dir)
# Let us create the sites now. We do it in the following order
# Start with the index.html. It will point to sites explaining all
# keys and groups
html_slave = HTMLFormatter()
f = file('style.css', 'w')
print >> f, html_slave.createCSS()
f = file('index.html', 'w')
print >> f, html_slave.createIndex()
f = file('all_groups.html', 'w')
print >> f, html_slave.createGroupsSite(doc)
f = file('all_keys.html', 'w')
print >> f, html_slave.createKeysSite(doc)
# now for each group create the site
for group in doc.groups():
f = file('group%s.html' % group, 'w')
print >> f, html_slave.createGroupSite(group, doc.group_content(group))
# now for the keys
for key in doc.doc_keys():
f = file('key%s.html' % doc.doc_item(key).name(), 'w')
print >> f, html_slave.createKeySite(doc.doc_item(key))
if __name__ == "__main__":
main()

View File

@@ -1,318 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# This is a copy on write dictionary and set which abuses classes to try and be nice and fast.
#
# Copyright (C) 2006 Tim Amsell
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#Please Note:
# Be careful when using mutable types (ie Dict and Lists) - operations involving these are SLOW.
# Assign a file to __warn__ to get warnings about slow operations.
#
import copy
import types
types.ImmutableTypes = tuple([ \
types.BooleanType, \
types.ComplexType, \
types.FloatType, \
types.IntType, \
types.LongType, \
types.NoneType, \
types.TupleType, \
frozenset] + \
list(types.StringTypes))
MUTABLE = "__mutable__"
class COWMeta(type):
pass
class COWDictMeta(COWMeta):
__warn__ = False
__hasmutable__ = False
__marker__ = tuple()
def __str__(cls):
# FIXME: I have magic numbers!
return "<COWDict Level: %i Current Keys: %i>" % (cls.__count__, len(cls.__dict__) - 3)
__repr__ = __str__
def cow(cls):
class C(cls):
__count__ = cls.__count__ + 1
return C
copy = cow
__call__ = cow
def __setitem__(cls, key, value):
if not isinstance(value, types.ImmutableTypes):
if not isinstance(value, COWMeta):
cls.__hasmutable__ = True
key += MUTABLE
setattr(cls, key, value)
def __getmutable__(cls, key, readonly=False):
nkey = key + MUTABLE
try:
return cls.__dict__[nkey]
except KeyError:
pass
value = getattr(cls, nkey)
if readonly:
return value
if not cls.__warn__ is False and not isinstance(value, COWMeta):
print >> cls.__warn__, "Warning: Doing a copy because %s is a mutable type." % key
try:
value = value.copy()
except AttributeError, e:
value = copy.copy(value)
setattr(cls, nkey, value)
return value
__getmarker__ = []
def __getreadonly__(cls, key, default=__getmarker__):
"""\
Get a value (even if mutable) which you promise not to change.
"""
return cls.__getitem__(key, default, True)
def __getitem__(cls, key, default=__getmarker__, readonly=False):
try:
try:
value = getattr(cls, key)
except AttributeError:
value = cls.__getmutable__(key, readonly)
# This is for values which have been deleted
if value is cls.__marker__:
raise AttributeError("key %s does not exist." % key)
return value
except AttributeError, e:
if not default is cls.__getmarker__:
return default
raise KeyError(str(e))
def __delitem__(cls, key):
cls.__setitem__(key, cls.__marker__)
def __revertitem__(cls, key):
if not cls.__dict__.has_key(key):
key += MUTABLE
delattr(cls, key)
def has_key(cls, key):
value = cls.__getreadonly__(key, cls.__marker__)
if value is cls.__marker__:
return False
return True
def iter(cls, type, readonly=False):
for key in dir(cls):
if key.startswith("__"):
continue
if key.endswith(MUTABLE):
key = key[:-len(MUTABLE)]
if type == "keys":
yield key
try:
if readonly:
value = cls.__getreadonly__(key)
else:
value = cls[key]
except KeyError:
continue
if type == "values":
yield value
if type == "items":
yield (key, value)
raise StopIteration()
def iterkeys(cls):
return cls.iter("keys")
def itervalues(cls, readonly=False):
if not cls.__warn__ is False and cls.__hasmutable__ and readonly is False:
print >> cls.__warn__, "Warning: If you arn't going to change any of the values call with True."
return cls.iter("values", readonly)
def iteritems(cls, readonly=False):
if not cls.__warn__ is False and cls.__hasmutable__ and readonly is False:
print >> cls.__warn__, "Warning: If you arn't going to change any of the values call with True."
return cls.iter("items", readonly)
class COWSetMeta(COWDictMeta):
def __str__(cls):
# FIXME: I have magic numbers!
return "<COWSet Level: %i Current Keys: %i>" % (cls.__count__, len(cls.__dict__) -3)
__repr__ = __str__
def cow(cls):
class C(cls):
__count__ = cls.__count__ + 1
return C
def add(cls, value):
COWDictMeta.__setitem__(cls, repr(hash(value)), value)
def remove(cls, value):
COWDictMeta.__delitem__(cls, repr(hash(value)))
def __in__(cls, value):
return COWDictMeta.has_key(repr(hash(value)))
def iterkeys(cls):
raise TypeError("sets don't have keys")
def iteritems(cls):
raise TypeError("sets don't have 'items'")
# These are the actual classes you use!
class COWDictBase(object):
__metaclass__ = COWDictMeta
__count__ = 0
class COWSetBase(object):
__metaclass__ = COWSetMeta
__count__ = 0
if __name__ == "__main__":
import sys
COWDictBase.__warn__ = sys.stderr
a = COWDictBase()
print "a", a
a['a'] = 'a'
a['b'] = 'b'
a['dict'] = {}
b = a.copy()
print "b", b
b['c'] = 'b'
print
print "a", a
for x in a.iteritems():
print x
print "--"
print "b", b
for x in b.iteritems():
print x
print
b['dict']['a'] = 'b'
b['a'] = 'c'
print "a", a
for x in a.iteritems():
print x
print "--"
print "b", b
for x in b.iteritems():
print x
print
try:
b['dict2']
except KeyError, e:
print "Okay!"
a['set'] = COWSetBase()
a['set'].add("o1")
a['set'].add("o1")
a['set'].add("o2")
print "a", a
for x in a['set'].itervalues():
print x
print "--"
print "b", b
for x in b['set'].itervalues():
print x
print
b['set'].add('o3')
print "a", a
for x in a['set'].itervalues():
print x
print "--"
print "b", b
for x in b['set'].itervalues():
print x
print
a['set2'] = set()
a['set2'].add("o1")
a['set2'].add("o1")
a['set2'].add("o2")
print "a", a
for x in a.iteritems():
print x
print "--"
print "b", b
for x in b.iteritems(readonly=True):
print x
print
del b['b']
try:
print b['b']
except KeyError:
print "Yay! deleted key raises error"
if b.has_key('b'):
print "Boo!"
else:
print "Yay - has_key with delete works!"
print "a", a
for x in a.iteritems():
print x
print "--"
print "b", b
for x in b.iteritems(readonly=True):
print x
print
b.__revertitem__('b')
print "a", a
for x in a.iteritems():
print x
print "--"
print "b", b
for x in b.iteritems(readonly=True):
print x
print
b.__revertitem__('dict')
print "a", a
for x in a.iteritems():
print x
print "--"
print "b", b
for x in b.iteritems(readonly=True):
print x
print

File diff suppressed because it is too large Load Diff

View File

@@ -1,394 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake 'Build' implementation
#
# Core code for function execution and task handling in the
# BitBake build tools.
#
# Copyright (C) 2003, 2004 Chris Larson
#
# Based on Gentoo's portage.py.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#Based on functions from the base bb module, Copyright 2003 Holger Schurig
from bb import data, event, mkdirhier, utils
import bb, os, sys
# When we execute a python function we'd like certain things
# in all namespaces, hence we add them to __builtins__
# If we do not do this and use the exec globals, they will
# not be available to subfunctions.
__builtins__['bb'] = bb
__builtins__['os'] = os
# events
class FuncFailed(Exception):
"""
Executed function failed
First parameter a message
Second paramter is a logfile (optional)
"""
class EventException(Exception):
"""Exception which is associated with an Event."""
def __init__(self, msg, event):
self.args = msg, event
class TaskBase(event.Event):
"""Base class for task events"""
def __init__(self, t, d ):
self._task = t
self._package = bb.data.getVar("PF", d, 1)
event.Event.__init__(self, d)
self._message = "package %s: task %s: %s" % (bb.data.getVar("PF", d, 1), t, bb.event.getName(self)[4:])
def getTask(self):
return self._task
def setTask(self, task):
self._task = task
task = property(getTask, setTask, None, "task property")
class TaskStarted(TaskBase):
"""Task execution started"""
class TaskSucceeded(TaskBase):
"""Task execution completed"""
class TaskFailed(TaskBase):
"""Task execution failed"""
def __init__(self, msg, logfile, t, d ):
self.logfile = logfile
self.msg = msg
TaskBase.__init__(self, t, d)
class InvalidTask(TaskBase):
"""Invalid Task"""
# functions
def exec_func(func, d, dirs = None):
"""Execute an BB 'function'"""
body = data.getVar(func, d)
if not body:
return
flags = data.getVarFlags(func, d)
for item in ['deps', 'check', 'interactive', 'python', 'cleandirs', 'dirs', 'lockfiles', 'fakeroot']:
if not item in flags:
flags[item] = None
ispython = flags['python']
cleandirs = (data.expand(flags['cleandirs'], d) or "").split()
for cdir in cleandirs:
os.system("rm -rf %s" % cdir)
if dirs:
dirs = data.expand(dirs, d)
else:
dirs = (data.expand(flags['dirs'], d) or "").split()
for adir in dirs:
mkdirhier(adir)
if len(dirs) > 0:
adir = dirs[-1]
else:
adir = data.getVar('B', d, 1)
# Save current directory
try:
prevdir = os.getcwd()
except OSError:
prevdir = data.getVar('TOPDIR', d, True)
# Setup logfiles
t = data.getVar('T', d, 1)
if not t:
bb.msg.fatal(bb.msg.domain.Build, "T not set")
mkdirhier(t)
# Gross hack, FIXME
import random
logfile = "%s/log.%s.%s.%s" % (t, func, str(os.getpid()),random.random())
runfile = "%s/run.%s.%s" % (t, func, str(os.getpid()))
# Change to correct directory (if specified)
if adir and os.access(adir, os.F_OK):
os.chdir(adir)
# Handle logfiles
si = file('/dev/null', 'r')
try:
if bb.msg.debug_level['default'] > 0 or ispython:
so = os.popen("tee \"%s\"" % logfile, "w")
else:
so = file(logfile, 'w')
except OSError, e:
bb.msg.error(bb.msg.domain.Build, "opening log file: %s" % e)
pass
se = so
# Dup the existing fds so we dont lose them
osi = [os.dup(sys.stdin.fileno()), sys.stdin.fileno()]
oso = [os.dup(sys.stdout.fileno()), sys.stdout.fileno()]
ose = [os.dup(sys.stderr.fileno()), sys.stderr.fileno()]
# Replace those fds with our own
os.dup2(si.fileno(), osi[1])
os.dup2(so.fileno(), oso[1])
os.dup2(se.fileno(), ose[1])
locks = []
lockfiles = (data.expand(flags['lockfiles'], d) or "").split()
for lock in lockfiles:
locks.append(bb.utils.lockfile(lock))
try:
# Run the function
if ispython:
exec_func_python(func, d, runfile, logfile)
else:
exec_func_shell(func, d, runfile, logfile, flags)
# Restore original directory
try:
os.chdir(prevdir)
except:
pass
finally:
# Unlock any lockfiles
for lock in locks:
bb.utils.unlockfile(lock)
# Restore the backup fds
os.dup2(osi[0], osi[1])
os.dup2(oso[0], oso[1])
os.dup2(ose[0], ose[1])
# Close our logs
si.close()
so.close()
se.close()
if os.path.exists(logfile) and os.path.getsize(logfile) == 0:
bb.msg.debug(2, bb.msg.domain.Build, "Zero size logfile %s, removing" % logfile)
os.remove(logfile)
# Close the backup fds
os.close(osi[0])
os.close(oso[0])
os.close(ose[0])
def exec_func_python(func, d, runfile, logfile):
"""Execute a python BB 'function'"""
import re, os
bbfile = bb.data.getVar('FILE', d, 1)
tmp = "def " + func + "():\n%s" % data.getVar(func, d)
tmp += '\n' + func + '()'
f = open(runfile, "w")
f.write(tmp)
comp = utils.better_compile(tmp, func, bbfile)
g = {} # globals
g['d'] = d
try:
utils.better_exec(comp, g, tmp, bbfile)
except:
(t,value,tb) = sys.exc_info()
if t in [bb.parse.SkipPackage, bb.build.FuncFailed]:
raise
bb.msg.error(bb.msg.domain.Build, "Function %s failed" % func)
raise FuncFailed("function %s failed" % func, logfile)
def exec_func_shell(func, d, runfile, logfile, flags):
"""Execute a shell BB 'function' Returns true if execution was successful.
For this, it creates a bash shell script in the tmp dectory, writes the local
data into it and finally executes. The output of the shell will end in a log file and stdout.
Note on directory behavior. The 'dirs' varflag should contain a list
of the directories you need created prior to execution. The last
item in the list is where we will chdir/cd to.
"""
deps = flags['deps']
check = flags['check']
if check in globals():
if globals()[check](func, deps):
return
f = open(runfile, "w")
f.write("#!/bin/sh -e\n")
if bb.msg.debug_level['default'] > 0: f.write("set -x\n")
data.emit_env(f, d)
f.write("cd %s\n" % os.getcwd())
if func: f.write("%s\n" % func)
f.close()
os.chmod(runfile, 0775)
if not func:
bb.msg.error(bb.msg.domain.Build, "Function not specified")
raise FuncFailed("Function not specified for exec_func_shell")
# execute function
if flags['fakeroot']:
maybe_fakeroot = "PATH=\"%s\" fakeroot " % bb.data.getVar("PATH", d, 1)
else:
maybe_fakeroot = ''
lang_environment = "LC_ALL=C "
ret = os.system('%s%ssh -e %s' % (lang_environment, maybe_fakeroot, runfile))
if ret == 0:
return
bb.msg.error(bb.msg.domain.Build, "Function %s failed" % func)
raise FuncFailed("function %s failed" % func, logfile)
def exec_task(task, d):
"""Execute an BB 'task'
The primary difference between executing a task versus executing
a function is that a task exists in the task digraph, and therefore
has dependencies amongst other tasks."""
# Check whther this is a valid task
if not data.getVarFlag(task, 'task', d):
raise EventException("No such task", InvalidTask(task, d))
try:
bb.msg.debug(1, bb.msg.domain.Build, "Executing task %s" % task)
old_overrides = data.getVar('OVERRIDES', d, 0)
localdata = data.createCopy(d)
data.setVar('OVERRIDES', 'task-%s:%s' % (task[3:], old_overrides), localdata)
data.update_data(localdata)
data.expandKeys(localdata)
event.fire(TaskStarted(task, localdata))
exec_func(task, localdata)
event.fire(TaskSucceeded(task, localdata))
except FuncFailed, message:
# Try to extract the optional logfile
try:
(msg, logfile) = message
except:
logfile = None
msg = message
bb.msg.note(1, bb.msg.domain.Build, "Task failed: %s" % message )
failedevent = TaskFailed(msg, logfile, task, d)
event.fire(failedevent)
raise EventException("Function failed in task: %s" % message, failedevent)
# make stamp, or cause event and raise exception
if not data.getVarFlag(task, 'nostamp', d) and not data.getVarFlag(task, 'selfstamp', d):
make_stamp(task, d)
def extract_stamp(d, fn):
"""
Extracts stamp format which is either a data dictonary (fn unset)
or a dataCache entry (fn set).
"""
if fn:
return d.stamp[fn]
return data.getVar('STAMP', d, 1)
def stamp_internal(task, d, file_name):
"""
Internal stamp helper function
Removes any stamp for the given task
Makes sure the stamp directory exists
Returns the stamp path+filename
"""
stamp = extract_stamp(d, file_name)
if not stamp:
return
stamp = "%s.%s" % (stamp, task)
mkdirhier(os.path.dirname(stamp))
# Remove the file and recreate to force timestamp
# change on broken NFS filesystems
if os.access(stamp, os.F_OK):
os.remove(stamp)
return stamp
def make_stamp(task, d, file_name = None):
"""
Creates/updates a stamp for a given task
(d can be a data dict or dataCache)
"""
stamp = stamp_internal(task, d, file_name)
if stamp:
f = open(stamp, "w")
f.close()
def del_stamp(task, d, file_name = None):
"""
Removes a stamp for a given task
(d can be a data dict or dataCache)
"""
stamp_internal(task, d, file_name)
def add_tasks(tasklist, d):
task_deps = data.getVar('_task_deps', d)
if not task_deps:
task_deps = {}
if not 'tasks' in task_deps:
task_deps['tasks'] = []
if not 'parents' in task_deps:
task_deps['parents'] = {}
for task in tasklist:
task = data.expand(task, d)
data.setVarFlag(task, 'task', 1, d)
if not task in task_deps['tasks']:
task_deps['tasks'].append(task)
flags = data.getVarFlags(task, d)
def getTask(name):
if not name in task_deps:
task_deps[name] = {}
if name in flags:
deptask = data.expand(flags[name], d)
task_deps[name][task] = deptask
getTask('depends')
getTask('deptask')
getTask('rdeptask')
getTask('recrdeptask')
getTask('nostamp')
task_deps['parents'][task] = []
for dep in flags['deps']:
dep = data.expand(dep, d)
task_deps['parents'][task].append(dep)
# don't assume holding a reference
data.setVar('_task_deps', task_deps, d)
def remove_task(task, kill, d):
"""Remove an BB 'task'.
If kill is 1, also remove tasks that depend on this task."""
data.delVarFlag(task, 'task', d)

View File

@@ -1,534 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake 'Event' implementation
#
# Caching of bitbake variables before task execution
# Copyright (C) 2006 Richard Purdie
# but small sections based on code from bin/bitbake:
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2003, 2004 Phil Blundell
# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
# Copyright (C) 2005 Holger Hans Peter Freyther
# Copyright (C) 2005 ROAD GmbH
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os, re
import bb.data
import bb.utils
try:
import cPickle as pickle
except ImportError:
import pickle
bb.msg.note(1, bb.msg.domain.Cache, "Importing cPickle failed. Falling back to a very slow implementation.")
__cache_version__ = "130"
class Cache:
"""
BitBake Cache implementation
"""
def __init__(self, cooker):
self.cachedir = bb.data.getVar("CACHE", cooker.configuration.data, True)
self.clean = {}
self.checked = {}
self.depends_cache = {}
self.data = None
self.data_fn = None
self.cacheclean = True
if self.cachedir in [None, '']:
self.has_cache = False
bb.msg.note(1, bb.msg.domain.Cache, "Not using a cache. Set CACHE = <directory> to enable.")
return
self.has_cache = True
self.cachefile = os.path.join(self.cachedir,"bb_cache.dat")
bb.msg.debug(1, bb.msg.domain.Cache, "Using cache in '%s'" % self.cachedir)
try:
os.stat( self.cachedir )
except OSError:
bb.mkdirhier( self.cachedir )
# If any of configuration.data's dependencies are newer than the
# cache there isn't even any point in loading it...
newest_mtime = 0
deps = bb.data.getVar("__depends", cooker.configuration.data, True)
for f,old_mtime in deps:
if old_mtime > newest_mtime:
newest_mtime = old_mtime
if bb.parse.cached_mtime_noerror(self.cachefile) >= newest_mtime:
try:
p = pickle.Unpickler(file(self.cachefile, "rb"))
self.depends_cache, version_data = p.load()
if version_data['CACHE_VER'] != __cache_version__:
raise ValueError, 'Cache Version Mismatch'
if version_data['BITBAKE_VER'] != bb.__version__:
raise ValueError, 'Bitbake Version Mismatch'
except EOFError:
bb.msg.note(1, bb.msg.domain.Cache, "Truncated cache found, rebuilding...")
self.depends_cache = {}
except:
bb.msg.note(1, bb.msg.domain.Cache, "Invalid cache found, rebuilding...")
self.depends_cache = {}
else:
try:
os.stat( self.cachefile )
bb.msg.note(1, bb.msg.domain.Cache, "Out of date cache found, rebuilding...")
except OSError:
pass
def getVar(self, var, fn, exp = 0):
"""
Gets the value of a variable
(similar to getVar in the data class)
There are two scenarios:
1. We have cached data - serve from depends_cache[fn]
2. We're learning what data to cache - serve from data
backend but add a copy of the data to the cache.
"""
if fn in self.clean:
return self.depends_cache[fn][var]
if not fn in self.depends_cache:
self.depends_cache[fn] = {}
if fn != self.data_fn:
# We're trying to access data in the cache which doesn't exist
# yet setData hasn't been called to setup the right access. Very bad.
bb.msg.error(bb.msg.domain.Cache, "Parsing error data_fn %s and fn %s don't match" % (self.data_fn, fn))
self.cacheclean = False
result = bb.data.getVar(var, self.data, exp)
self.depends_cache[fn][var] = result
return result
def setData(self, virtualfn, fn, data):
"""
Called to prime bb_cache ready to learn which variables to cache.
Will be followed by calls to self.getVar which aren't cached
but can be fulfilled from self.data.
"""
self.data_fn = virtualfn
self.data = data
# Make sure __depends makes the depends_cache
self.getVar("__depends", virtualfn, True)
self.depends_cache[virtualfn]["CACHETIMESTAMP"] = bb.parse.cached_mtime(fn)
def virtualfn2realfn(self, virtualfn):
"""
Convert a virtual file name to a real one + the associated subclass keyword
"""
fn = virtualfn
cls = ""
if virtualfn.startswith('virtual:'):
cls = virtualfn.split(':', 2)[1]
fn = virtualfn.replace('virtual:' + cls + ':', '')
#bb.msg.debug(2, bb.msg.domain.Cache, "virtualfn2realfn %s to %s %s" % (virtualfn, fn, cls))
return (fn, cls)
def realfn2virtual(self, realfn, cls):
"""
Convert a real filename + the associated subclass keyword to a virtual filename
"""
if cls == "":
#bb.msg.debug(2, bb.msg.domain.Cache, "realfn2virtual %s and '%s' to %s" % (realfn, cls, realfn))
return realfn
#bb.msg.debug(2, bb.msg.domain.Cache, "realfn2virtual %s and %s to %s" % (realfn, cls, "virtual:" + cls + ":" + realfn))
return "virtual:" + cls + ":" + realfn
def loadDataFull(self, virtualfn, cfgData):
"""
Return a complete set of data for fn.
To do this, we need to parse the file.
"""
(fn, cls) = self.virtualfn2realfn(virtualfn)
bb.msg.debug(1, bb.msg.domain.Cache, "Parsing %s (full)" % fn)
bb_data, skipped = self.load_bbfile(fn, cfgData)
if isinstance(bb_data, dict):
return bb_data[cls]
return bb_data
def loadData(self, fn, cfgData, cacheData):
"""
Load a subset of data for fn.
If the cached data is valid we do nothing,
To do this, we need to parse the file and set the system
to record the variables accessed.
Return the cache status and whether the file was skipped when parsed
"""
if fn not in self.checked:
self.cacheValidUpdate(fn)
if self.cacheValid(fn):
if "SKIPPED" in self.depends_cache[fn]:
return True, True
self.handle_data(fn, cacheData)
multi = self.getVar('BBCLASSEXTEND', fn, True)
if multi:
for cls in multi.split():
virtualfn = self.realfn2virtual(fn, cls)
# Pretend we're clean so getVar works
self.clean[virtualfn] = ""
self.handle_data(virtualfn, cacheData)
return True, False
bb.msg.debug(1, bb.msg.domain.Cache, "Parsing %s" % fn)
bb_data, skipped = self.load_bbfile(fn, cfgData)
if skipped:
if isinstance(bb_data, dict):
self.setData(fn, fn, bb_data[""])
else:
self.setData(fn, fn, bb_data)
return False, skipped
if isinstance(bb_data, dict):
for data in bb_data:
virtualfn = self.realfn2virtual(fn, data)
self.setData(virtualfn, fn, bb_data[data])
self.handle_data(virtualfn, cacheData)
return False, skipped
self.setData(fn, fn, bb_data)
self.handle_data(fn, cacheData)
return False, skipped
def cacheValid(self, fn):
"""
Is the cache valid for fn?
Fast version, no timestamps checked.
"""
# Is cache enabled?
if not self.has_cache:
return False
if fn in self.clean:
return True
return False
def cacheValidUpdate(self, fn):
"""
Is the cache valid for fn?
Make thorough (slower) checks including timestamps.
"""
# Is cache enabled?
if not self.has_cache:
return False
self.checked[fn] = ""
# Pretend we're clean so getVar works
self.clean[fn] = ""
# File isn't in depends_cache
if not fn in self.depends_cache:
bb.msg.debug(2, bb.msg.domain.Cache, "Cache: %s is not cached" % fn)
self.remove(fn)
return False
mtime = bb.parse.cached_mtime_noerror(fn)
# Check file still exists
if mtime == 0:
bb.msg.debug(2, bb.msg.domain.Cache, "Cache: %s not longer exists" % fn)
self.remove(fn)
return False
# Check the file's timestamp
if mtime != self.getVar("CACHETIMESTAMP", fn, True):
bb.msg.debug(2, bb.msg.domain.Cache, "Cache: %s changed" % fn)
self.remove(fn)
return False
# Check dependencies are still valid
depends = self.getVar("__depends", fn, True)
if depends:
for f,old_mtime in depends:
fmtime = bb.parse.cached_mtime_noerror(f)
# Check if file still exists
if old_mtime != 0 and fmtime == 0:
self.remove(fn)
return False
if (fmtime != old_mtime):
bb.msg.debug(2, bb.msg.domain.Cache, "Cache: %s's dependency %s changed" % (fn, f))
self.remove(fn)
return False
#bb.msg.debug(2, bb.msg.domain.Cache, "Depends Cache: %s is clean" % fn)
if not fn in self.clean:
self.clean[fn] = ""
return True
def skip(self, fn):
"""
Mark a fn as skipped
Called from the parser
"""
if not fn in self.depends_cache:
self.depends_cache[fn] = {}
self.depends_cache[fn]["SKIPPED"] = "1"
def remove(self, fn):
"""
Remove a fn from the cache
Called from the parser in error cases
"""
bb.msg.debug(1, bb.msg.domain.Cache, "Removing %s from cache" % fn)
if fn in self.depends_cache:
del self.depends_cache[fn]
if fn in self.clean:
del self.clean[fn]
def sync(self):
"""
Save the cache
Called from the parser when complete (or exiting)
"""
import copy
if not self.has_cache:
return
if self.cacheclean:
bb.msg.note(1, bb.msg.domain.Cache, "Cache is clean, not saving.")
return
version_data = {}
version_data['CACHE_VER'] = __cache_version__
version_data['BITBAKE_VER'] = bb.__version__
cache_data = copy.deepcopy(self.depends_cache)
for fn in self.depends_cache:
if '__BB_DONT_CACHE' in self.depends_cache[fn] and self.depends_cache[fn]['__BB_DONT_CACHE']:
bb.msg.debug(2, bb.msg.domain.Cache, "Not caching %s, marked as not cacheable" % fn)
del cache_data[fn]
elif 'PV' in self.depends_cache[fn] and 'SRCREVINACTION' in self.depends_cache[fn]['PV']:
bb.msg.error(bb.msg.domain.Cache, "Not caching %s as it had SRCREVINACTION in PV. Please report this bug" % fn)
del cache_data[fn]
p = pickle.Pickler(file(self.cachefile, "wb" ), -1 )
p.dump([cache_data, version_data])
def mtime(self, cachefile):
return bb.parse.cached_mtime_noerror(cachefile)
def handle_data(self, file_name, cacheData):
"""
Save data we need into the cache
"""
pn = self.getVar('PN', file_name, True)
pe = self.getVar('PE', file_name, True) or "0"
pv = self.getVar('PV', file_name, True)
if 'SRCREVINACTION' in pv:
bb.note("Found SRCREVINACTION in PV (%s) or %s. Please report this bug." % (pv, file_name))
pr = self.getVar('PR', file_name, True)
dp = int(self.getVar('DEFAULT_PREFERENCE', file_name, True) or "0")
depends = bb.utils.explode_deps(self.getVar("DEPENDS", file_name, True) or "")
packages = (self.getVar('PACKAGES', file_name, True) or "").split()
packages_dynamic = (self.getVar('PACKAGES_DYNAMIC', file_name, True) or "").split()
rprovides = (self.getVar("RPROVIDES", file_name, True) or "").split()
cacheData.task_deps[file_name] = self.getVar("_task_deps", file_name, True)
# build PackageName to FileName lookup table
if pn not in cacheData.pkg_pn:
cacheData.pkg_pn[pn] = []
cacheData.pkg_pn[pn].append(file_name)
cacheData.stamp[file_name] = self.getVar('STAMP', file_name, True)
# build FileName to PackageName lookup table
cacheData.pkg_fn[file_name] = pn
cacheData.pkg_pepvpr[file_name] = (pe,pv,pr)
cacheData.pkg_dp[file_name] = dp
provides = [pn]
for provide in (self.getVar("PROVIDES", file_name, True) or "").split():
if provide not in provides:
provides.append(provide)
# Build forward and reverse provider hashes
# Forward: virtual -> [filenames]
# Reverse: PN -> [virtuals]
if pn not in cacheData.pn_provides:
cacheData.pn_provides[pn] = []
cacheData.fn_provides[file_name] = provides
for provide in provides:
if provide not in cacheData.providers:
cacheData.providers[provide] = []
cacheData.providers[provide].append(file_name)
if not provide in cacheData.pn_provides[pn]:
cacheData.pn_provides[pn].append(provide)
cacheData.deps[file_name] = []
for dep in depends:
if not dep in cacheData.deps[file_name]:
cacheData.deps[file_name].append(dep)
if not dep in cacheData.all_depends:
cacheData.all_depends.append(dep)
# Build reverse hash for PACKAGES, so runtime dependencies
# can be be resolved (RDEPENDS, RRECOMMENDS etc.)
for package in packages:
if not package in cacheData.packages:
cacheData.packages[package] = []
cacheData.packages[package].append(file_name)
rprovides += (self.getVar("RPROVIDES_%s" % package, file_name, 1) or "").split()
for package in packages_dynamic:
if not package in cacheData.packages_dynamic:
cacheData.packages_dynamic[package] = []
cacheData.packages_dynamic[package].append(file_name)
for rprovide in rprovides:
if not rprovide in cacheData.rproviders:
cacheData.rproviders[rprovide] = []
cacheData.rproviders[rprovide].append(file_name)
# Build hash of runtime depends and rececommends
if not file_name in cacheData.rundeps:
cacheData.rundeps[file_name] = {}
if not file_name in cacheData.runrecs:
cacheData.runrecs[file_name] = {}
rdepends = self.getVar('RDEPENDS', file_name, True) or ""
rrecommends = self.getVar('RRECOMMENDS', file_name, True) or ""
for package in packages + [pn]:
if not package in cacheData.rundeps[file_name]:
cacheData.rundeps[file_name][package] = []
if not package in cacheData.runrecs[file_name]:
cacheData.runrecs[file_name][package] = []
cacheData.rundeps[file_name][package] = rdepends + " " + (self.getVar("RDEPENDS_%s" % package, file_name, True) or "")
cacheData.runrecs[file_name][package] = rrecommends + " " + (self.getVar("RRECOMMENDS_%s" % package, file_name, True) or "")
# Collect files we may need for possible world-dep
# calculations
if not self.getVar('BROKEN', file_name, True) and not self.getVar('EXCLUDE_FROM_WORLD', file_name, True):
cacheData.possible_world.append(file_name)
# Touch this to make sure its in the cache
self.getVar('__BB_DONT_CACHE', file_name, True)
self.getVar('BBCLASSEXTEND', file_name, True)
def load_bbfile( self, bbfile , config):
"""
Load and parse one .bb build file
Return the data and whether parsing resulted in the file being skipped
"""
import bb
from bb import utils, data, parse, debug, event, fatal
# expand tmpdir to include this topdir
data.setVar('TMPDIR', data.getVar('TMPDIR', config, 1) or "", config)
bbfile_loc = os.path.abspath(os.path.dirname(bbfile))
oldpath = os.path.abspath(os.getcwd())
if bb.parse.cached_mtime_noerror(bbfile_loc):
os.chdir(bbfile_loc)
bb_data = data.init_db(config)
try:
bb_data = parse.handle(bbfile, bb_data) # read .bb data
os.chdir(oldpath)
return bb_data, False
except bb.parse.SkipPackage:
os.chdir(oldpath)
return bb_data, True
except:
os.chdir(oldpath)
raise
def init(cooker):
"""
The Objective: Cache the minimum amount of data possible yet get to the
stage of building packages (i.e. tryBuild) without reparsing any .bb files.
To do this, we intercept getVar calls and only cache the variables we see
being accessed. We rely on the cache getVar calls being made for all
variables bitbake might need to use to reach this stage. For each cached
file we need to track:
* Its mtime
* The mtimes of all its dependencies
* Whether it caused a parse.SkipPackage exception
Files causing parsing errors are evicted from the cache.
"""
return Cache(cooker)
#============================================================================#
# CacheData
#============================================================================#
class CacheData:
"""
The data structures we compile from the cached data
"""
def __init__(self):
"""
Direct cache variables
(from Cache.handle_data)
"""
self.providers = {}
self.rproviders = {}
self.packages = {}
self.packages_dynamic = {}
self.possible_world = []
self.pkg_pn = {}
self.pkg_fn = {}
self.pkg_pepvpr = {}
self.pkg_dp = {}
self.pn_provides = {}
self.fn_provides = {}
self.all_depends = []
self.deps = {}
self.rundeps = {}
self.runrecs = {}
self.task_queues = {}
self.task_deps = {}
self.stamp = {}
self.preferred = {}
"""
Indirect Cache variables
(set elsewhere)
"""
self.ignored_dependencies = []
self.world_target = set()
self.bbfile_priority = {}
self.bbfile_config_priorities = []

View File

@@ -1,977 +0,0 @@
#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2003, 2004 Phil Blundell
# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
# Copyright (C) 2005 Holger Hans Peter Freyther
# Copyright (C) 2005 ROAD GmbH
# Copyright (C) 2006 - 2007 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import sys, os, getopt, glob, copy, os.path, re, time
import bb
from bb import utils, data, parse, event, cache, providers, taskdata, runqueue
from bb import xmlrpcserver, command
import itertools, sre_constants
class MultipleMatches(Exception):
"""
Exception raised when multiple file matches are found
"""
class ParsingErrorsFound(Exception):
"""
Exception raised when parsing errors are found
"""
class NothingToBuild(Exception):
"""
Exception raised when there is nothing to build
"""
# Different states cooker can be in
cookerClean = 1
cookerParsing = 2
cookerParsed = 3
# Different action states the cooker can be in
cookerRun = 1 # Cooker is running normally
cookerShutdown = 2 # Active tasks should be brought to a controlled stop
cookerStop = 3 # Stop, now!
#============================================================================#
# BBCooker
#============================================================================#
class BBCooker:
"""
Manages one bitbake build run
"""
def __init__(self, configuration):
self.status = None
self.cache = None
self.bb_cache = None
self.server = bb.xmlrpcserver.BitBakeXMLRPCServer(self)
#self.server.register_function(self.showEnvironment)
self.configuration = configuration
if self.configuration.verbose:
bb.msg.set_verbose(True)
if self.configuration.debug:
bb.msg.set_debug_level(self.configuration.debug)
else:
bb.msg.set_debug_level(0)
if self.configuration.debug_domains:
bb.msg.set_debug_domains(self.configuration.debug_domains)
self.configuration.data = bb.data.init()
bb.data.inheritFromOS(self.configuration.data)
for f in self.configuration.file:
self.parseConfigurationFile( f )
self.parseConfigurationFile( os.path.join( "conf", "bitbake.conf" ) )
if not self.configuration.cmd:
self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data, True) or "build"
bbpkgs = bb.data.getVar('BBPKGS', self.configuration.data, True)
if bbpkgs and len(self.configuration.pkgs_to_build) == 0:
self.configuration.pkgs_to_build.extend(bbpkgs.split())
#
# Special updated configuration we use for firing events
#
self.configuration.event_data = bb.data.createCopy(self.configuration.data)
bb.data.update_data(self.configuration.event_data)
# TOSTOP must not be set or our children will hang when they output
fd = sys.stdout.fileno()
if os.isatty(fd):
import termios
tcattr = termios.tcgetattr(fd)
if tcattr[3] & termios.TOSTOP:
bb.msg.note(1, bb.msg.domain.Build, "The terminal had the TOSTOP bit set, clearing...")
tcattr[3] = tcattr[3] & ~termios.TOSTOP
termios.tcsetattr(fd, termios.TCSANOW, tcattr)
self.command = bb.command.Command(self)
self.cookerState = cookerClean
self.cookerAction = cookerRun
def parseConfiguration(self):
# Change nice level if we're asked to
nice = bb.data.getVar("BB_NICE_LEVEL", self.configuration.data, True)
if nice:
curnice = os.nice(0)
nice = int(nice) - curnice
bb.msg.note(2, bb.msg.domain.Build, "Renice to %s " % os.nice(nice))
def parseCommandLine(self):
# Parse any commandline into actions
if self.configuration.show_environment:
self.commandlineAction = None
if 'world' in self.configuration.pkgs_to_build:
bb.error("'world' is not a valid target for --environment.")
elif len(self.configuration.pkgs_to_build) > 1:
bb.error("Only one target can be used with the --environment option.")
elif self.configuration.buildfile and len(self.configuration.pkgs_to_build) > 0:
bb.error("No target should be used with the --environment and --buildfile options.")
elif len(self.configuration.pkgs_to_build) > 0:
self.commandlineAction = ["showEnvironmentTarget", self.configuration.pkgs_to_build]
else:
self.commandlineAction = ["showEnvironment", self.configuration.buildfile]
elif self.configuration.buildfile is not None:
self.commandlineAction = ["buildFile", self.configuration.buildfile, self.configuration.cmd]
elif self.configuration.revisions_changed:
self.commandlineAction = ["compareRevisions"]
elif self.configuration.show_versions:
self.commandlineAction = ["showVersions"]
elif self.configuration.parse_only:
self.commandlineAction = ["parseFiles"]
# FIXME - implement
#elif self.configuration.interactive:
# self.interactiveMode()
elif self.configuration.dot_graph:
if self.configuration.pkgs_to_build:
self.commandlineAction = ["generateDotGraph", self.configuration.pkgs_to_build, self.configuration.cmd]
else:
self.commandlineAction = None
bb.error("Please specify a package name for dependency graph generation.")
else:
if self.configuration.pkgs_to_build:
self.commandlineAction = ["buildTargets", self.configuration.pkgs_to_build, self.configuration.cmd]
else:
self.commandlineAction = None
bb.error("Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.")
def runCommands(self, server, data, abort):
"""
Run any queued asynchronous command
This is done by the idle handler so it runs in true context rather than
tied to any UI.
"""
return self.command.runAsyncCommand()
def tryBuildPackage(self, fn, item, task, the_data):
"""
Build one task of a package, optionally build following task depends
"""
try:
if not self.configuration.dry_run:
bb.build.exec_task('do_%s' % task, the_data)
return True
except bb.build.FuncFailed:
bb.msg.error(bb.msg.domain.Build, "task stack execution failed")
raise
except bb.build.EventException, e:
event = e.args[1]
bb.msg.error(bb.msg.domain.Build, "%s event exception, aborting" % bb.event.getName(event))
raise
def tryBuild(self, fn, task):
"""
Build a provider and its dependencies.
build_depends is a list of previous build dependencies (not runtime)
If build_depends is empty, we're dealing with a runtime depends
"""
the_data = self.bb_cache.loadDataFull(fn, self.configuration.data)
item = self.status.pkg_fn[fn]
#if bb.build.stamp_is_current('do_%s' % self.configuration.cmd, the_data):
# return True
return self.tryBuildPackage(fn, item, task, the_data)
def showVersions(self):
# Need files parsed
self.updateCache()
pkg_pn = self.status.pkg_pn
preferred_versions = {}
latest_versions = {}
# Sort by priority
for pn in pkg_pn.keys():
(last_ver,last_file,pref_ver,pref_file) = bb.providers.findBestProvider(pn, self.configuration.data, self.status)
preferred_versions[pn] = (pref_ver, pref_file)
latest_versions[pn] = (last_ver, last_file)
pkg_list = pkg_pn.keys()
pkg_list.sort()
bb.msg.plain("%-35s %25s %25s" % ("Package Name", "Latest Version", "Preferred Version"))
bb.msg.plain("%-35s %25s %25s\n" % ("============", "==============", "================="))
for p in pkg_list:
pref = preferred_versions[p]
latest = latest_versions[p]
prefstr = pref[0][0] + ":" + pref[0][1] + '-' + pref[0][2]
lateststr = latest[0][0] + ":" + latest[0][1] + "-" + latest[0][2]
if pref == latest:
prefstr = ""
bb.msg.plain("%-35s %25s %25s" % (p, lateststr, prefstr))
def compareRevisions(self):
ret = bb.fetch.fetcher_compare_revisons(self.configuration.data)
bb.event.fire(bb.command.CookerCommandSetExitCode(self.configuration.event_data, ret))
def showEnvironment(self, buildfile = None, pkgs_to_build = []):
"""
Show the outer or per-package environment
"""
fn = None
envdata = None
if buildfile:
self.cb = None
self.bb_cache = bb.cache.init(self)
fn = self.matchFile(buildfile)
elif len(pkgs_to_build) == 1:
self.updateCache()
localdata = data.createCopy(self.configuration.data)
bb.data.update_data(localdata)
bb.data.expandKeys(localdata)
taskdata = bb.taskdata.TaskData(self.configuration.abort)
taskdata.add_provider(localdata, self.status, pkgs_to_build[0])
taskdata.add_unresolved(localdata, self.status)
targetid = taskdata.getbuild_id(pkgs_to_build[0])
fnid = taskdata.build_targets[targetid][0]
fn = taskdata.fn_index[fnid]
else:
envdata = self.configuration.data
if fn:
try:
envdata = self.bb_cache.loadDataFull(fn, self.configuration.data)
except IOError, e:
bb.msg.error(bb.msg.domain.Parsing, "Unable to read %s: %s" % (fn, e))
raise
except Exception, e:
bb.msg.error(bb.msg.domain.Parsing, "%s" % e)
raise
class dummywrite:
def __init__(self):
self.writebuf = ""
def write(self, output):
self.writebuf = self.writebuf + output
# emit variables and shell functions
try:
data.update_data(envdata)
wb = dummywrite()
data.emit_env(wb, envdata, True)
bb.msg.plain(wb.writebuf)
except Exception, e:
bb.msg.fatal(bb.msg.domain.Parsing, "%s" % e)
# emit the metadata which isnt valid shell
data.expandKeys(envdata)
for e in envdata.keys():
if data.getVarFlag( e, 'python', envdata ):
bb.msg.plain("\npython %s () {\n%s}\n" % (e, data.getVar(e, envdata, 1)))
def generateDepTreeData(self, pkgs_to_build, task):
"""
Create a dependency tree of pkgs_to_build, returning the data.
"""
# Need files parsed
self.updateCache()
# If we are told to do the None task then query the default task
if (task == None):
task = self.configuration.cmd
pkgs_to_build = self.checkPackages(pkgs_to_build)
localdata = data.createCopy(self.configuration.data)
bb.data.update_data(localdata)
bb.data.expandKeys(localdata)
taskdata = bb.taskdata.TaskData(self.configuration.abort)
runlist = []
for k in pkgs_to_build:
taskdata.add_provider(localdata, self.status, k)
runlist.append([k, "do_%s" % task])
taskdata.add_unresolved(localdata, self.status)
rq = bb.runqueue.RunQueue(self, self.configuration.data, self.status, taskdata, runlist)
rq.prepare_runqueue()
seen_fnids = []
depend_tree = {}
depend_tree["depends"] = {}
depend_tree["tdepends"] = {}
depend_tree["pn"] = {}
depend_tree["rdepends-pn"] = {}
depend_tree["packages"] = {}
depend_tree["rdepends-pkg"] = {}
depend_tree["rrecs-pkg"] = {}
for task in range(len(rq.runq_fnid)):
taskname = rq.runq_task[task]
fnid = rq.runq_fnid[task]
fn = taskdata.fn_index[fnid]
pn = self.status.pkg_fn[fn]
version = "%s:%s-%s" % self.status.pkg_pepvpr[fn]
if pn not in depend_tree["pn"]:
depend_tree["pn"][pn] = {}
depend_tree["pn"][pn]["filename"] = fn
depend_tree["pn"][pn]["version"] = version
for dep in rq.runq_depends[task]:
depfn = taskdata.fn_index[rq.runq_fnid[dep]]
deppn = self.status.pkg_fn[depfn]
dotname = "%s.%s" % (pn, rq.runq_task[task])
if not dotname in depend_tree["tdepends"]:
depend_tree["tdepends"][dotname] = []
depend_tree["tdepends"][dotname].append("%s.%s" % (deppn, rq.runq_task[dep]))
if fnid not in seen_fnids:
seen_fnids.append(fnid)
packages = []
depend_tree["depends"][pn] = []
for dep in taskdata.depids[fnid]:
depend_tree["depends"][pn].append(taskdata.build_names_index[dep])
depend_tree["rdepends-pn"][pn] = []
for rdep in taskdata.rdepids[fnid]:
depend_tree["rdepends-pn"][pn].append(taskdata.run_names_index[rdep])
rdepends = self.status.rundeps[fn]
for package in rdepends:
depend_tree["rdepends-pkg"][package] = []
for rdepend in rdepends[package]:
depend_tree["rdepends-pkg"][package].append(rdepend)
packages.append(package)
rrecs = self.status.runrecs[fn]
for package in rrecs:
depend_tree["rrecs-pkg"][package] = []
for rdepend in rrecs[package]:
depend_tree["rrecs-pkg"][package].append(rdepend)
if not package in packages:
packages.append(package)
for package in packages:
if package not in depend_tree["packages"]:
depend_tree["packages"][package] = {}
depend_tree["packages"][package]["pn"] = pn
depend_tree["packages"][package]["filename"] = fn
depend_tree["packages"][package]["version"] = version
return depend_tree
def generateDepTreeEvent(self, pkgs_to_build, task):
"""
Create a task dependency graph of pkgs_to_build.
Generate an event with the result
"""
depgraph = self.generateDepTreeData(pkgs_to_build, task)
bb.event.fire(bb.event.DepTreeGenerated(self.configuration.data, depgraph))
def generateDotGraphFiles(self, pkgs_to_build, task):
"""
Create a task dependency graph of pkgs_to_build.
Save the result to a set of .dot files.
"""
depgraph = self.generateDepTreeData(pkgs_to_build, task)
# Prints a flattened form of package-depends below where subpackages of a package are merged into the main pn
depends_file = file('pn-depends.dot', 'w' )
print >> depends_file, "digraph depends {"
for pn in depgraph["pn"]:
fn = depgraph["pn"][pn]["filename"]
version = depgraph["pn"][pn]["version"]
print >> depends_file, '"%s" [label="%s %s\\n%s"]' % (pn, pn, version, fn)
for pn in depgraph["depends"]:
for depend in depgraph["depends"][pn]:
print >> depends_file, '"%s" -> "%s"' % (pn, depend)
for pn in depgraph["rdepends-pn"]:
for rdepend in depgraph["rdepends-pn"][pn]:
print >> depends_file, '"%s" -> "%s" [style=dashed]' % (pn, rdepend)
print >> depends_file, "}"
bb.msg.plain("PN dependencies saved to 'pn-depends.dot'")
depends_file = file('package-depends.dot', 'w' )
print >> depends_file, "digraph depends {"
for package in depgraph["packages"]:
pn = depgraph["packages"][package]["pn"]
fn = depgraph["packages"][package]["filename"]
version = depgraph["packages"][package]["version"]
if package == pn:
print >> depends_file, '"%s" [label="%s %s\\n%s"]' % (pn, pn, version, fn)
else:
print >> depends_file, '"%s" [label="%s(%s) %s\\n%s"]' % (package, package, pn, version, fn)
for depend in depgraph["depends"][pn]:
print >> depends_file, '"%s" -> "%s"' % (package, depend)
for package in depgraph["rdepends-pkg"]:
for rdepend in depgraph["rdepends-pkg"][package]:
print >> depends_file, '"%s" -> "%s" [style=dashed]' % (package, rdepend)
for package in depgraph["rrecs-pkg"]:
for rdepend in depgraph["rrecs-pkg"][package]:
print >> depends_file, '"%s" -> "%s" [style=dashed]' % (package, rdepend)
print >> depends_file, "}"
bb.msg.plain("Package dependencies saved to 'package-depends.dot'")
tdepends_file = file('task-depends.dot', 'w' )
print >> tdepends_file, "digraph depends {"
for task in depgraph["tdepends"]:
(pn, taskname) = task.rsplit(".", 1)
fn = depgraph["pn"][pn]["filename"]
version = depgraph["pn"][pn]["version"]
print >> tdepends_file, '"%s.%s" [label="%s %s\\n%s\\n%s"]' % (pn, taskname, pn, taskname, version, fn)
for dep in depgraph["tdepends"][task]:
print >> tdepends_file, '"%s" -> "%s"' % (task, dep)
print >> tdepends_file, "}"
bb.msg.plain("Task dependencies saved to 'task-depends.dot'")
def buildDepgraph( self ):
all_depends = self.status.all_depends
pn_provides = self.status.pn_provides
localdata = data.createCopy(self.configuration.data)
bb.data.update_data(localdata)
bb.data.expandKeys(localdata)
def calc_bbfile_priority(filename):
for (regex, pri) in self.status.bbfile_config_priorities:
if regex.match(filename):
return pri
return 0
# Handle PREFERRED_PROVIDERS
for p in (bb.data.getVar('PREFERRED_PROVIDERS', localdata, 1) or "").split():
try:
(providee, provider) = p.split(':')
except:
bb.msg.fatal(bb.msg.domain.Provider, "Malformed option in PREFERRED_PROVIDERS variable: %s" % p)
continue
if providee in self.status.preferred and self.status.preferred[providee] != provider:
bb.msg.error(bb.msg.domain.Provider, "conflicting preferences for %s: both %s and %s specified" % (providee, provider, self.status.preferred[providee]))
self.status.preferred[providee] = provider
# Calculate priorities for each file
for p in self.status.pkg_fn.keys():
self.status.bbfile_priority[p] = calc_bbfile_priority(p)
def buildWorldTargetList(self):
"""
Build package list for "bitbake world"
"""
all_depends = self.status.all_depends
pn_provides = self.status.pn_provides
bb.msg.debug(1, bb.msg.domain.Parsing, "collating packages for \"world\"")
for f in self.status.possible_world:
terminal = True
pn = self.status.pkg_fn[f]
for p in pn_provides[pn]:
if p.startswith('virtual/'):
bb.msg.debug(2, bb.msg.domain.Parsing, "World build skipping %s due to %s provider starting with virtual/" % (f, p))
terminal = False
break
for pf in self.status.providers[p]:
if self.status.pkg_fn[pf] != pn:
bb.msg.debug(2, bb.msg.domain.Parsing, "World build skipping %s due to both us and %s providing %s" % (f, pf, p))
terminal = False
break
if terminal:
self.status.world_target.add(pn)
# drop reference count now
self.status.possible_world = None
self.status.all_depends = None
def interactiveMode( self ):
"""Drop off into a shell"""
try:
from bb import shell
except ImportError, details:
bb.msg.fatal(bb.msg.domain.Parsing, "Sorry, shell not available (%s)" % details )
else:
shell.start( self )
def parseConfigurationFile( self, afile ):
try:
self.configuration.data = bb.parse.handle( afile, self.configuration.data )
# Handle any INHERITs and inherit the base class
inherits = ["base"] + (bb.data.getVar('INHERIT', self.configuration.data, True ) or "").split()
for inherit in inherits:
self.configuration.data = bb.parse.handle(os.path.join('classes', '%s.bbclass' % inherit), self.configuration.data, True )
# Nomally we only register event handlers at the end of parsing .bb files
# We register any handlers we've found so far here...
for var in data.getVar('__BBHANDLERS', self.configuration.data) or []:
bb.event.register(var,bb.data.getVar(var, self.configuration.data))
bb.fetch.fetcher_init(self.configuration.data)
bb.event.fire(bb.event.ConfigParsed(self.configuration.data))
except IOError, e:
bb.msg.fatal(bb.msg.domain.Parsing, "Error when parsing %s: %s" % (afile, str(e)))
except bb.parse.ParseError, details:
bb.msg.fatal(bb.msg.domain.Parsing, "Unable to parse %s (%s)" % (afile, details) )
def handleCollections( self, collections ):
"""Handle collections"""
if collections:
collection_list = collections.split()
for c in collection_list:
regex = bb.data.getVar("BBFILE_PATTERN_%s" % c, self.configuration.data, 1)
if regex == None:
bb.msg.error(bb.msg.domain.Parsing, "BBFILE_PATTERN_%s not defined" % c)
continue
priority = bb.data.getVar("BBFILE_PRIORITY_%s" % c, self.configuration.data, 1)
if priority == None:
bb.msg.error(bb.msg.domain.Parsing, "BBFILE_PRIORITY_%s not defined" % c)
continue
try:
cre = re.compile(regex)
except re.error:
bb.msg.error(bb.msg.domain.Parsing, "BBFILE_PATTERN_%s \"%s\" is not a valid regular expression" % (c, regex))
continue
try:
pri = int(priority)
self.status.bbfile_config_priorities.append((cre, pri))
except ValueError:
bb.msg.error(bb.msg.domain.Parsing, "invalid value for BBFILE_PRIORITY_%s: \"%s\"" % (c, priority))
def buildSetVars(self):
"""
Setup any variables needed before starting a build
"""
if not bb.data.getVar("BUILDNAME", self.configuration.data):
bb.data.setVar("BUILDNAME", os.popen('date +%Y%m%d%H%M').readline().strip(), self.configuration.data)
bb.data.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S',time.gmtime()), self.configuration.data)
def matchFiles(self, buildfile):
"""
Find the .bb files which match the expression in 'buildfile'.
"""
bf = os.path.abspath(buildfile)
try:
os.stat(bf)
return [bf]
except OSError:
(filelist, masked) = self.collect_bbfiles()
regexp = re.compile(buildfile)
matches = []
for f in filelist:
if regexp.search(f) and os.path.isfile(f):
bf = f
matches.append(f)
return matches
def matchFile(self, buildfile):
"""
Find the .bb file which matches the expression in 'buildfile'.
Raise an error if multiple files
"""
matches = self.matchFiles(buildfile)
if len(matches) != 1:
bb.msg.error(bb.msg.domain.Parsing, "Unable to match %s (%s matches found):" % (buildfile, len(matches)))
for f in matches:
bb.msg.error(bb.msg.domain.Parsing, " %s" % f)
raise MultipleMatches
return matches[0]
def buildFile(self, buildfile, task):
"""
Build the file matching regexp buildfile
"""
# Parse the configuration here. We need to do it explicitly here since
# buildFile() doesn't use the cache
self.parseConfiguration()
# If we are told to do the None task then query the default task
if (task == None):
task = self.configuration.cmd
fn = self.matchFile(buildfile)
self.buildSetVars()
# Load data into the cache for fn and parse the loaded cache data
self.bb_cache = bb.cache.init(self)
self.status = bb.cache.CacheData()
self.bb_cache.loadData(fn, self.configuration.data, self.status)
# Tweak some variables
item = self.bb_cache.getVar('PN', fn, True)
self.status.ignored_dependencies = set()
self.status.bbfile_priority[fn] = 1
# Remove external dependencies
self.status.task_deps[fn]['depends'] = {}
self.status.deps[fn] = []
self.status.rundeps[fn] = []
self.status.runrecs[fn] = []
# Remove stamp for target if force mode active
if self.configuration.force:
bb.msg.note(2, bb.msg.domain.RunQueue, "Remove stamp %s, %s" % (task, fn))
bb.build.del_stamp('do_%s' % task, self.status, fn)
# Setup taskdata structure
taskdata = bb.taskdata.TaskData(self.configuration.abort)
taskdata.add_provider(self.configuration.data, self.status, item)
buildname = bb.data.getVar("BUILDNAME", self.configuration.data)
bb.event.fire(bb.event.BuildStarted(buildname, [item], self.configuration.event_data))
# Execute the runqueue
runlist = [[item, "do_%s" % task]]
rq = bb.runqueue.RunQueue(self, self.configuration.data, self.status, taskdata, runlist)
def buildFileIdle(server, rq, abort):
if abort or self.cookerAction == cookerStop:
rq.finish_runqueue(True)
elif self.cookerAction == cookerShutdown:
rq.finish_runqueue(False)
failures = 0
try:
retval = rq.execute_runqueue()
except runqueue.TaskFailure, fnids:
for fnid in fnids:
bb.msg.error(bb.msg.domain.Build, "'%s' failed" % taskdata.fn_index[fnid])
failures = failures + 1
retval = False
if not retval:
self.command.finishAsyncCommand()
bb.event.fire(bb.event.BuildCompleted(buildname, targets, self.configuration.event_data, failures))
return False
return 0.5
self.server.register_idle_function(buildFileIdle, rq)
def buildTargets(self, targets, task):
"""
Attempt to build the targets specified
"""
# Need files parsed
self.updateCache()
# If we are told to do the NULL task then query the default task
if (task == None):
task = self.configuration.cmd
targets = self.checkPackages(targets)
def buildTargetsIdle(server, rq, abort):
if abort or self.cookerAction == cookerStop:
rq.finish_runqueue(True)
elif self.cookerAction == cookerShutdown:
rq.finish_runqueue(False)
failures = 0
try:
retval = rq.execute_runqueue()
except runqueue.TaskFailure, fnids:
for fnid in fnids:
bb.msg.error(bb.msg.domain.Build, "'%s' failed" % taskdata.fn_index[fnid])
failures = failures + 1
retval = False
if not retval:
self.command.finishAsyncCommand()
bb.event.fire(bb.event.BuildCompleted(buildname, targets, self.configuration.event_data, failures))
return None
return 0.5
self.buildSetVars()
buildname = bb.data.getVar("BUILDNAME", self.configuration.data)
bb.event.fire(bb.event.BuildStarted(buildname, targets, self.configuration.event_data))
localdata = data.createCopy(self.configuration.data)
bb.data.update_data(localdata)
bb.data.expandKeys(localdata)
taskdata = bb.taskdata.TaskData(self.configuration.abort)
runlist = []
for k in targets:
taskdata.add_provider(localdata, self.status, k)
runlist.append([k, "do_%s" % task])
taskdata.add_unresolved(localdata, self.status)
rq = bb.runqueue.RunQueue(self, self.configuration.data, self.status, taskdata, runlist)
self.server.register_idle_function(buildTargetsIdle, rq)
def updateCache(self):
if self.cookerState == cookerParsed:
return
if self.cookerState != cookerParsing:
self.parseConfiguration ()
# Import Psyco if available and not disabled
import platform
if platform.machine() in ['i386', 'i486', 'i586', 'i686']:
if not self.configuration.disable_psyco:
try:
import psyco
except ImportError:
bb.msg.note(1, bb.msg.domain.Collection, "Psyco JIT Compiler (http://psyco.sf.net) not available. Install it to increase performance.")
else:
psyco.bind( CookerParser.parse_next )
else:
bb.msg.note(1, bb.msg.domain.Collection, "You have disabled Psyco. This decreases performance.")
self.status = bb.cache.CacheData()
ignore = bb.data.getVar("ASSUME_PROVIDED", self.configuration.data, 1) or ""
self.status.ignored_dependencies = set(ignore.split())
for dep in self.configuration.extra_assume_provided:
self.status.ignored_dependencies.add(dep)
self.handleCollections( bb.data.getVar("BBFILE_COLLECTIONS", self.configuration.data, 1) )
bb.msg.debug(1, bb.msg.domain.Collection, "collecting .bb files")
(filelist, masked) = self.collect_bbfiles()
bb.data.renameVar("__depends", "__base_depends", self.configuration.data)
self.parser = CookerParser(self, filelist, masked)
self.cookerState = cookerParsing
if not self.parser.parse_next():
bb.msg.debug(1, bb.msg.domain.Collection, "parsing complete")
self.buildDepgraph()
self.cookerState = cookerParsed
return None
return 0.00001
def checkPackages(self, pkgs_to_build):
if len(pkgs_to_build) == 0:
raise NothingToBuild
if 'world' in pkgs_to_build:
self.buildWorldTargetList()
pkgs_to_build.remove('world')
for t in self.status.world_target:
pkgs_to_build.append(t)
return pkgs_to_build
def get_bbfiles( self, path = os.getcwd() ):
"""Get list of default .bb files by reading out the current directory"""
contents = os.listdir(path)
bbfiles = []
for f in contents:
(root, ext) = os.path.splitext(f)
if ext == ".bb":
bbfiles.append(os.path.abspath(os.path.join(os.getcwd(),f)))
return bbfiles
def find_bbfiles( self, path ):
"""Find all the .bb files in a directory"""
from os.path import join
found = []
for dir, dirs, files in os.walk(path):
for ignored in ('SCCS', 'CVS', '.svn'):
if ignored in dirs:
dirs.remove(ignored)
found += [join(dir,f) for f in files if f.endswith('.bb')]
return found
def collect_bbfiles( self ):
"""Collect all available .bb build files"""
parsed, cached, skipped, masked = 0, 0, 0, 0
self.bb_cache = bb.cache.init(self)
files = (data.getVar( "BBFILES", self.configuration.data, 1 ) or "").split()
data.setVar("BBFILES", " ".join(files), self.configuration.data)
if not len(files):
files = self.get_bbfiles()
if not len(files):
bb.msg.error(bb.msg.domain.Collection, "no files to build.")
newfiles = []
for f in files:
if os.path.isdir(f):
dirfiles = self.find_bbfiles(f)
if dirfiles:
newfiles += dirfiles
continue
else:
globbed = glob.glob(f)
if not globbed and os.path.exists(f):
globbed = [f]
newfiles += globbed
bbmask = bb.data.getVar('BBMASK', self.configuration.data, 1)
if not bbmask:
return (newfiles, 0)
try:
bbmask_compiled = re.compile(bbmask)
except sre_constants.error:
bb.msg.fatal(bb.msg.domain.Collection, "BBMASK is not a valid regular expression.")
finalfiles = []
for f in newfiles:
if bbmask_compiled.search(f):
bb.msg.debug(1, bb.msg.domain.Collection, "skipping masked file %s" % f)
masked += 1
continue
finalfiles.append(f)
return (finalfiles, masked)
def serve(self):
# Empty the environment. The environment will be populated as
# necessary from the data store.
bb.utils.empty_environment()
if self.configuration.profile:
try:
import cProfile as profile
except:
import profile
profile.runctx("self.server.serve_forever()", globals(), locals(), "profile.log")
# Redirect stdout to capture profile information
pout = open('profile.log.processed', 'w')
so = sys.stdout.fileno()
os.dup2(pout.fileno(), so)
import pstats
p = pstats.Stats('profile.log')
p.sort_stats('time')
p.print_stats()
p.print_callers()
p.sort_stats('cumulative')
p.print_stats()
os.dup2(so, pout.fileno())
pout.flush()
pout.close()
else:
self.server.serve_forever()
bb.event.fire(CookerExit(self.configuration.event_data))
class CookerExit(bb.event.Event):
"""
Notify clients of the Cooker shutdown
"""
def __init__(self, d):
bb.event.Event.__init__(self, d)
class CookerParser:
def __init__(self, cooker, filelist, masked):
# Internal data
self.filelist = filelist
self.cooker = cooker
# Accounting statistics
self.parsed = 0
self.cached = 0
self.skipped = 0
self.error = 0
self.masked = masked
self.total = len(filelist)
# Pointer to the next file to parse
self.pointer = 0
def parse_next(self):
print "Pointer %d" % self.pointer
if self.pointer < len(self.filelist):
f = self.filelist[self.pointer]
cooker = self.cooker
try:
fromCache, skip = cooker.bb_cache.loadData(f, cooker.configuration.data, cooker.status)
if skip:
self.skipped += 1
bb.msg.debug(2, bb.msg.domain.Collection, "skipping %s" % f)
cooker.bb_cache.skip(f)
elif fromCache: self.cached += 1
else: self.parsed += 1
except IOError, e:
self.error += 1
cooker.bb_cache.remove(f)
bb.msg.error(bb.msg.domain.Collection, "opening %s: %s" % (f, e))
pass
except KeyboardInterrupt:
cooker.bb_cache.remove(f)
cooker.bb_cache.sync()
raise
except Exception, e:
self.error += 1
cooker.bb_cache.remove(f)
bb.msg.error(bb.msg.domain.Collection, "%s while parsing %s" % (e, f))
except:
cooker.bb_cache.remove(f)
raise
finally:
bb.event.fire(bb.event.ParseProgress(cooker.configuration.event_data, self.cached, self.parsed, self.skipped, self.masked, self.error, self.total))
self.pointer += 1
if self.pointer >= self.total:
cooker.bb_cache.sync()
if self.error > 0:
raise ParsingErrorsFound
return False
return True

View File

@@ -1,562 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Data' implementations
Functions for interacting with the data structure used by the
BitBake build tools.
The expandData and update_data are the most expensive
operations. At night the cookie monster came by and
suggested 'give me cookies on setting the variables and
things will work out'. Taking this suggestion into account
applying the skills from the not yet passed 'Entwurf und
Analyse von Algorithmen' lecture and the cookie
monster seems to be right. We will track setVar more carefully
to have faster update_data and expandKeys operations.
This is a treade-off between speed and memory again but
the speed is more critical here.
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2005 Holger Hans Peter Freyther
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#Based on functions from the base bb module, Copyright 2003 Holger Schurig
import sys, os, re, types
if sys.argv[0][-5:] == "pydoc":
path = os.path.dirname(os.path.dirname(sys.argv[1]))
else:
path = os.path.dirname(os.path.dirname(sys.argv[0]))
sys.path.insert(0,path)
from bb import data_smart
import bb
_dict_type = data_smart.DataSmart
def init():
return _dict_type()
def init_db(parent = None):
if parent:
return parent.createCopy()
else:
return _dict_type()
def createCopy(source):
"""Link the source set to the destination
If one does not find the value in the destination set,
search will go on to the source set to get the value.
Value from source are copy-on-write. i.e. any try to
modify one of them will end up putting the modified value
in the destination set.
"""
return source.createCopy()
def initVar(var, d):
"""Non-destructive var init for data structure"""
d.initVar(var)
def setVar(var, value, d):
"""Set a variable to a given value
Example:
>>> d = init()
>>> setVar('TEST', 'testcontents', d)
>>> print getVar('TEST', d)
testcontents
"""
d.setVar(var,value)
def getVar(var, d, exp = 0):
"""Gets the value of a variable
Example:
>>> d = init()
>>> setVar('TEST', 'testcontents', d)
>>> print getVar('TEST', d)
testcontents
"""
return d.getVar(var,exp)
def renameVar(key, newkey, d):
"""Renames a variable from key to newkey
Example:
>>> d = init()
>>> setVar('TEST', 'testcontents', d)
>>> renameVar('TEST', 'TEST2', d)
>>> print getVar('TEST2', d)
testcontents
"""
d.renameVar(key, newkey)
def delVar(var, d):
"""Removes a variable from the data set
Example:
>>> d = init()
>>> setVar('TEST', 'testcontents', d)
>>> print getVar('TEST', d)
testcontents
>>> delVar('TEST', d)
>>> print getVar('TEST', d)
None
"""
d.delVar(var)
def setVarFlag(var, flag, flagvalue, d):
"""Set a flag for a given variable to a given value
Example:
>>> d = init()
>>> setVarFlag('TEST', 'python', 1, d)
>>> print getVarFlag('TEST', 'python', d)
1
"""
d.setVarFlag(var,flag,flagvalue)
def getVarFlag(var, flag, d):
"""Gets given flag from given var
Example:
>>> d = init()
>>> setVarFlag('TEST', 'python', 1, d)
>>> print getVarFlag('TEST', 'python', d)
1
"""
return d.getVarFlag(var,flag)
def delVarFlag(var, flag, d):
"""Removes a given flag from the variable's flags
Example:
>>> d = init()
>>> setVarFlag('TEST', 'testflag', 1, d)
>>> print getVarFlag('TEST', 'testflag', d)
1
>>> delVarFlag('TEST', 'testflag', d)
>>> print getVarFlag('TEST', 'testflag', d)
None
"""
d.delVarFlag(var,flag)
def setVarFlags(var, flags, d):
"""Set the flags for a given variable
Note:
setVarFlags will not clear previous
flags. Think of this method as
addVarFlags
Example:
>>> d = init()
>>> myflags = {}
>>> myflags['test'] = 'blah'
>>> setVarFlags('TEST', myflags, d)
>>> print getVarFlag('TEST', 'test', d)
blah
"""
d.setVarFlags(var,flags)
def getVarFlags(var, d):
"""Gets a variable's flags
Example:
>>> d = init()
>>> setVarFlag('TEST', 'test', 'blah', d)
>>> print getVarFlags('TEST', d)['test']
blah
"""
return d.getVarFlags(var)
def delVarFlags(var, d):
"""Removes a variable's flags
Example:
>>> data = init()
>>> setVarFlag('TEST', 'testflag', 1, data)
>>> print getVarFlag('TEST', 'testflag', data)
1
>>> delVarFlags('TEST', data)
>>> print getVarFlags('TEST', data)
None
"""
d.delVarFlags(var)
def keys(d):
"""Return a list of keys in d
Example:
>>> d = init()
>>> setVar('TEST', 1, d)
>>> setVar('MOO' , 2, d)
>>> setVarFlag('TEST', 'test', 1, d)
>>> keys(d)
['TEST', 'MOO']
"""
return d.keys()
def getData(d):
"""Returns the data object used"""
return d
def setData(newData, d):
"""Sets the data object to the supplied value"""
d = newData
##
## Cookie Monsters' query functions
##
def _get_override_vars(d, override):
"""
Internal!!!
Get the Names of Variables that have a specific
override. This function returns a iterable
Set or an empty list
"""
return []
def _get_var_flags_triple(d):
"""
Internal!!!
"""
return []
__expand_var_regexp__ = re.compile(r"\${[^{}]+}")
__expand_python_regexp__ = re.compile(r"\${@.+?}")
def expand(s, d, varname = None):
"""Variable expansion using the data store.
Example:
Standard expansion:
>>> d = init()
>>> setVar('A', 'sshd', d)
>>> print expand('/usr/bin/${A}', d)
/usr/bin/sshd
Python expansion:
>>> d = init()
>>> print expand('result: ${@37 * 72}', d)
result: 2664
Shell expansion:
>>> d = init()
>>> print expand('${TARGET_MOO}', d)
${TARGET_MOO}
>>> setVar('TARGET_MOO', 'yupp', d)
>>> print expand('${TARGET_MOO}',d)
yupp
>>> setVar('SRC_URI', 'http://somebug.${TARGET_MOO}', d)
>>> delVar('TARGET_MOO', d)
>>> print expand('${SRC_URI}', d)
http://somebug.${TARGET_MOO}
"""
return d.expand(s, varname)
def expandKeys(alterdata, readdata = None):
if readdata == None:
readdata = alterdata
todolist = {}
for key in keys(alterdata):
if not '${' in key:
continue
ekey = expand(key, readdata)
if key == ekey:
continue
todolist[key] = ekey
# These two for loops are split for performance to maximise the
# usefulness of the expand cache
for key in todolist:
ekey = todolist[key]
renameVar(key, ekey, alterdata)
def expandData(alterdata, readdata = None):
"""For each variable in alterdata, expand it, and update the var contents.
Replacements use data from readdata.
Example:
>>> a=init()
>>> b=init()
>>> setVar("dlmsg", "dl_dir is ${DL_DIR}", a)
>>> setVar("DL_DIR", "/path/to/whatever", b)
>>> expandData(a, b)
>>> print getVar("dlmsg", a)
dl_dir is /path/to/whatever
"""
if readdata == None:
readdata = alterdata
for key in keys(alterdata):
val = getVar(key, alterdata)
if type(val) is not types.StringType:
continue
expanded = expand(val, readdata)
# print "key is %s, val is %s, expanded is %s" % (key, val, expanded)
if val != expanded:
setVar(key, expanded, alterdata)
def inheritFromOS(d):
"""Inherit variables from the environment."""
for s in os.environ.keys():
try:
setVar(s, os.environ[s], d)
setVarFlag(s, "export", True, d)
except TypeError:
pass
def emit_var(var, o=sys.__stdout__, d = init(), all=False):
"""Emit a variable to be sourced by a shell."""
if getVarFlag(var, "python", d):
return 0
export = getVarFlag(var, "export", d)
unexport = getVarFlag(var, "unexport", d)
func = getVarFlag(var, "func", d)
if not all and not export and not unexport and not func:
return 0
try:
if all:
oval = getVar(var, d, 0)
val = getVar(var, d, 1)
except KeyboardInterrupt:
raise
except:
excname = str(sys.exc_info()[0])
if excname == "bb.build.FuncFailed":
raise
o.write('# expansion of %s threw %s\n' % (var, excname))
return 0
if all:
o.write('# %s=%s\n' % (var, oval))
if type(val) is not types.StringType:
return 0
if (var.find("-") != -1 or var.find(".") != -1 or var.find('{') != -1 or var.find('}') != -1 or var.find('+') != -1) and not all:
return 0
varExpanded = expand(var, d)
if unexport:
o.write('unset %s\n' % varExpanded)
return 1
val.rstrip()
if not val:
return 0
if func:
# NOTE: should probably check for unbalanced {} within the var
o.write("%s() {\n%s\n}\n" % (varExpanded, val))
return 1
if export:
o.write('export ')
# if we're going to output this within doublequotes,
# to a shell, we need to escape the quotes in the var
alter = re.sub('"', '\\"', val.strip())
o.write('%s="%s"\n' % (varExpanded, alter))
return 1
def emit_env(o=sys.__stdout__, d = init(), all=False):
"""Emits all items in the data store in a format such that it can be sourced by a shell."""
env = keys(d)
for e in env:
if getVarFlag(e, "func", d):
continue
emit_var(e, o, d, all) and o.write('\n')
for e in env:
if not getVarFlag(e, "func", d):
continue
emit_var(e, o, d) and o.write('\n')
def update_data(d):
"""Modifies the environment vars according to local overrides and commands.
Examples:
Appending to a variable:
>>> d = init()
>>> setVar('TEST', 'this is a', d)
>>> setVar('TEST_append', ' test', d)
>>> setVar('TEST_append', ' of the emergency broadcast system.', d)
>>> update_data(d)
>>> print getVar('TEST', d)
this is a test of the emergency broadcast system.
Prepending to a variable:
>>> setVar('TEST', 'virtual/libc', d)
>>> setVar('TEST_prepend', 'virtual/tmake ', d)
>>> setVar('TEST_prepend', 'virtual/patcher ', d)
>>> update_data(d)
>>> print getVar('TEST', d)
virtual/patcher virtual/tmake virtual/libc
Overrides:
>>> setVar('TEST_arm', 'target', d)
>>> setVar('TEST_ramses', 'machine', d)
>>> setVar('TEST_local', 'local', d)
>>> setVar('OVERRIDES', 'arm', d)
>>> setVar('TEST', 'original', d)
>>> update_data(d)
>>> print getVar('TEST', d)
target
>>> setVar('OVERRIDES', 'arm:ramses:local', d)
>>> setVar('TEST', 'original', d)
>>> update_data(d)
>>> print getVar('TEST', d)
local
CopyMonster:
>>> e = d.createCopy()
>>> setVar('TEST_foo', 'foo', e)
>>> update_data(e)
>>> print getVar('TEST', e)
local
>>> setVar('OVERRIDES', 'arm:ramses:local:foo', e)
>>> update_data(e)
>>> print getVar('TEST', e)
foo
>>> f = d.createCopy()
>>> setVar('TEST_moo', 'something', f)
>>> setVar('OVERRIDES', 'moo:arm:ramses:local:foo', e)
>>> update_data(e)
>>> print getVar('TEST', e)
foo
>>> h = init()
>>> setVar('SRC_URI', 'file://append.foo;patch=1 ', h)
>>> g = h.createCopy()
>>> setVar('SRC_URI_append_arm', 'file://other.foo;patch=1', g)
>>> setVar('OVERRIDES', 'arm:moo', g)
>>> update_data(g)
>>> print getVar('SRC_URI', g)
file://append.foo;patch=1 file://other.foo;patch=1
"""
bb.msg.debug(2, bb.msg.domain.Data, "update_data()")
# now ask the cookie monster for help
#print "Cookie Monster"
#print "Append/Prepend %s" % d._special_values
#print "Overrides %s" % d._seen_overrides
overrides = (getVar('OVERRIDES', d, 1) or "").split(':') or []
#
# Well let us see what breaks here. We used to iterate
# over each variable and apply the override and then
# do the line expanding.
# If we have bad luck - which we will have - the keys
# where in some order that is so important for this
# method which we don't have anymore.
# Anyway we will fix that and write test cases this
# time.
#
# First we apply all overrides
# Then we will handle _append and _prepend
#
for o in overrides:
# calculate '_'+override
l = len(o)+1
# see if one should even try
if not d._seen_overrides.has_key(o):
continue
vars = d._seen_overrides[o]
for var in vars:
name = var[:-l]
try:
d[name] = d[var]
except:
bb.msg.note(1, bb.msg.domain.Data, "Untracked delVar")
# now on to the appends and prepends
if d._special_values.has_key('_append'):
appends = d._special_values['_append'] or []
for append in appends:
for (a, o) in getVarFlag(append, '_append', d) or []:
# maybe the OVERRIDE was not yet added so keep the append
if (o and o in overrides) or not o:
delVarFlag(append, '_append', d)
if o and not o in overrides:
continue
sval = getVar(append,d) or ""
sval+=a
setVar(append, sval, d)
if d._special_values.has_key('_prepend'):
prepends = d._special_values['_prepend'] or []
for prepend in prepends:
for (a, o) in getVarFlag(prepend, '_prepend', d) or []:
# maybe the OVERRIDE was not yet added so keep the prepend
if (o and o in overrides) or not o:
delVarFlag(prepend, '_prepend', d)
if o and not o in overrides:
continue
sval = a + (getVar(prepend,d) or "")
setVar(prepend, sval, d)
def inherits_class(klass, d):
val = getVar('__inherit_cache', d) or []
if os.path.join('classes', '%s.bbclass' % klass) in val:
return True
return False
def _test():
"""Start a doctest run on this module"""
import doctest
import bb
from bb import data
bb.msg.set_debug_level(0)
doctest.testmod(data)
if __name__ == "__main__":
_test()

View File

@@ -1,288 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake Smart Dictionary Implementation
Functions for interacting with the data structure used by the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2004, 2005 Seb Frankengul
# Copyright (C) 2005, 2006 Holger Hans Peter Freyther
# Copyright (C) 2005 Uli Luckas
# Copyright (C) 2005 ROAD GmbH
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import copy, os, re, sys, time, types
import bb
from bb import utils, methodpool
from COW import COWDictBase
from new import classobj
__setvar_keyword__ = ["_append","_prepend"]
__setvar_regexp__ = re.compile('(?P<base>.*?)(?P<keyword>_append|_prepend)(_(?P<add>.*))?')
__expand_var_regexp__ = re.compile(r"\${[^{}]+}")
__expand_python_regexp__ = re.compile(r"\${@.+?}")
class DataSmart:
def __init__(self, special = COWDictBase.copy(), seen = COWDictBase.copy() ):
self.dict = {}
# cookie monster tribute
self._special_values = special
self._seen_overrides = seen
self.expand_cache = {}
def expand(self,s, varname):
def var_sub(match):
key = match.group()[2:-1]
if varname and key:
if varname == key:
raise Exception("variable %s references itself!" % varname)
var = self.getVar(key, 1)
if var is not None:
return var
else:
return match.group()
def python_sub(match):
import bb
code = match.group()[3:-1]
locals()['d'] = self
s = eval(code)
if type(s) == types.IntType: s = str(s)
return s
if type(s) is not types.StringType: # sanity check
return s
if varname and varname in self.expand_cache:
return self.expand_cache[varname]
while s.find('${') != -1:
olds = s
try:
s = __expand_var_regexp__.sub(var_sub, s)
s = __expand_python_regexp__.sub(python_sub, s)
if s == olds: break
if type(s) is not types.StringType: # sanity check
bb.msg.error(bb.msg.domain.Data, 'expansion of %s returned non-string %s' % (olds, s))
except KeyboardInterrupt:
raise
except:
bb.msg.note(1, bb.msg.domain.Data, "%s:%s while evaluating:\n%s" % (sys.exc_info()[0], sys.exc_info()[1], s))
raise
if varname:
self.expand_cache[varname] = s
return s
def initVar(self, var):
self.expand_cache = {}
if not var in self.dict:
self.dict[var] = {}
def _findVar(self,var):
_dest = self.dict
while (_dest and var not in _dest):
if not "_data" in _dest:
_dest = None
break
_dest = _dest["_data"]
if _dest and var in _dest:
return _dest[var]
return None
def _makeShadowCopy(self, var):
if var in self.dict:
return
local_var = self._findVar(var)
if local_var:
self.dict[var] = copy.copy(local_var)
else:
self.initVar(var)
def setVar(self,var,value):
self.expand_cache = {}
match = __setvar_regexp__.match(var)
if match and match.group("keyword") in __setvar_keyword__:
base = match.group('base')
keyword = match.group("keyword")
override = match.group('add')
l = self.getVarFlag(base, keyword) or []
l.append([value, override])
self.setVarFlag(base, keyword, l)
# todo make sure keyword is not __doc__ or __module__
# pay the cookie monster
try:
self._special_values[keyword].add( base )
except:
self._special_values[keyword] = set()
self._special_values[keyword].add( base )
return
if not var in self.dict:
self._makeShadowCopy(var)
# more cookies for the cookie monster
if '_' in var:
override = var[var.rfind('_')+1:]
if not self._seen_overrides.has_key(override):
self._seen_overrides[override] = set()
self._seen_overrides[override].add( var )
# setting var
self.dict[var]["content"] = value
def getVar(self,var,exp):
value = self.getVarFlag(var,"content")
if exp and value:
return self.expand(value,var)
return value
def renameVar(self, key, newkey):
"""
Rename the variable key to newkey
"""
val = self.getVar(key, 0)
if val is None:
return
self.setVar(newkey, val)
for i in ('_append', '_prepend'):
dest = self.getVarFlag(newkey, i) or []
src = self.getVarFlag(key, i) or []
dest.extend(src)
self.setVarFlag(newkey, i, dest)
if self._special_values.has_key(i) and key in self._special_values[i]:
self._special_values[i].remove(key)
self._special_values[i].add(newkey)
self.delVar(key)
def delVar(self,var):
self.expand_cache = {}
self.dict[var] = {}
def setVarFlag(self,var,flag,flagvalue):
if not var in self.dict:
self._makeShadowCopy(var)
self.dict[var][flag] = flagvalue
def getVarFlag(self,var,flag):
local_var = self._findVar(var)
if local_var:
if flag in local_var:
return copy.copy(local_var[flag])
return None
def delVarFlag(self,var,flag):
local_var = self._findVar(var)
if not local_var:
return
if not var in self.dict:
self._makeShadowCopy(var)
if var in self.dict and flag in self.dict[var]:
del self.dict[var][flag]
def setVarFlags(self,var,flags):
if not var in self.dict:
self._makeShadowCopy(var)
for i in flags.keys():
if i == "content":
continue
self.dict[var][i] = flags[i]
def getVarFlags(self,var):
local_var = self._findVar(var)
flags = {}
if local_var:
for i in local_var.keys():
if i == "content":
continue
flags[i] = local_var[i]
if len(flags) == 0:
return None
return flags
def delVarFlags(self,var):
if not var in self.dict:
self._makeShadowCopy(var)
if var in self.dict:
content = None
# try to save the content
if "content" in self.dict[var]:
content = self.dict[var]["content"]
self.dict[var] = {}
self.dict[var]["content"] = content
else:
del self.dict[var]
def createCopy(self):
"""
Create a copy of self by setting _data to self
"""
# we really want this to be a DataSmart...
data = DataSmart(seen=self._seen_overrides.copy(), special=self._special_values.copy())
data.dict["_data"] = self.dict
return data
# Dictionary Methods
def keys(self):
def _keys(d, mykey):
if "_data" in d:
_keys(d["_data"],mykey)
for key in d.keys():
if key != "_data":
mykey[key] = None
keytab = {}
_keys(self.dict,keytab)
return keytab.keys()
def __getitem__(self,item):
#print "Warning deprecated"
return self.getVar(item, False)
def __setitem__(self,var,data):
#print "Warning deprecated"
self.setVar(var,data)

View File

@@ -1,302 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Event' implementation
Classes and functions for manipulating 'events' in the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os, re
import bb.utils
# This is the pid for which we should generate the event. This is set when
# the runqueue forks off.
worker_pid = 0
class Event:
"""Base class for events"""
type = "Event"
def __init__(self, d):
self._data = d
self.pid = worker_pid
def getData(self):
return self._data
def setData(self, data):
self._data = data
data = property(getData, setData, None, "data property")
NotHandled = 0
Handled = 1
Registered = 10
AlreadyRegistered = 14
# Internal
_handlers = {}
_ui_handlers = {}
_ui_handler_seq = 0
def fire(event):
"""Fire off an Event"""
for handler in _handlers:
h = _handlers[handler]
if type(h).__name__ == "code":
exec(h)
tmpHandler(event)
else:
h(event)
# Remove the event data elements for UI handlers - too much data otherwise
# They can request data if they need it
event.data = None
event._data = None
errors = []
for h in _ui_handlers:
#print "Sending event %s" % event
classid = "%s.%s" % (event.__class__.__module__, event.__class__.__name__)
try:
_ui_handlers[h].event.send((classid, event))
except:
errors.append(h)
for h in errors:
del _ui_handlers[h]
def register(name, handler):
"""Register an Event handler"""
# already registered
if name in _handlers:
return AlreadyRegistered
if handler is not None:
# handle string containing python code
if type(handler).__name__ == "str":
tmp = "def tmpHandler(e):\n%s" % handler
comp = bb.utils.better_compile(tmp, "tmpHandler(e)", "bb.event._registerCode")
_handlers[name] = comp
else:
_handlers[name] = handler
return Registered
def remove(name, handler):
"""Remove an Event handler"""
_handlers.pop(name)
def register_UIHhandler(handler):
bb.event._ui_handler_seq = bb.event._ui_handler_seq + 1
_ui_handlers[_ui_handler_seq] = handler
return _ui_handler_seq
def unregister_UIHhandler(handlerNum):
if handlerNum in _ui_handlers:
del _ui_handlers[handlerNum]
return
def getName(e):
"""Returns the name of a class or class instance"""
if getattr(e, "__name__", None) == None:
return e.__class__.__name__
else:
return e.__name__
class ConfigParsed(Event):
"""Configuration Parsing Complete"""
class RecipeParsed(Event):
""" Recipe Parsing Complete """
def __init__(self, fn, d):
self.fn = fn
Event.__init__(self, d)
class StampUpdate(Event):
"""Trigger for any adjustment of the stamp files to happen"""
def __init__(self, targets, stampfns, d):
self._targets = targets
self._stampfns = stampfns
Event.__init__(self, d)
def getStampPrefix(self):
return self._stampfns
def getTargets(self):
return self._targets
stampPrefix = property(getStampPrefix)
targets = property(getTargets)
class PkgBase(Event):
"""Base class for package events"""
def __init__(self, t, d):
self._pkg = t
Event.__init__(self, d)
self._message = "package %s: %s" % (bb.data.getVar("P", d, 1), getName(self)[3:])
def getPkg(self):
return self._pkg
def setPkg(self, pkg):
self._pkg = pkg
pkg = property(getPkg, setPkg, None, "pkg property")
class BuildBase(Event):
"""Base class for bbmake run events"""
def __init__(self, n, p, c, failures = 0):
self._name = n
self._pkgs = p
Event.__init__(self, c)
self._failures = failures
def getPkgs(self):
return self._pkgs
def setPkgs(self, pkgs):
self._pkgs = pkgs
def getName(self):
return self._name
def setName(self, name):
self._name = name
def getCfg(self):
return self.data
def setCfg(self, cfg):
self.data = cfg
def getFailures(self):
"""
Return the number of failed packages
"""
return self._failures
pkgs = property(getPkgs, setPkgs, None, "pkgs property")
name = property(getName, setName, None, "name property")
cfg = property(getCfg, setCfg, None, "cfg property")
class DepBase(PkgBase):
"""Base class for dependency events"""
def __init__(self, t, data, d):
self._dep = d
PkgBase.__init__(self, t, data)
def getDep(self):
return self._dep
def setDep(self, dep):
self._dep = dep
dep = property(getDep, setDep, None, "dep property")
class BuildStarted(BuildBase):
"""bbmake build run started"""
class BuildCompleted(BuildBase):
"""bbmake build run completed"""
class UnsatisfiedDep(DepBase):
"""Unsatisfied Dependency"""
class RecursiveDep(DepBase):
"""Recursive Dependency"""
class NoProvider(Event):
"""No Provider for an Event"""
def __init__(self, item, data, runtime=False):
Event.__init__(self, data)
self._item = item
self._runtime = runtime
def getItem(self):
return self._item
def isRuntime(self):
return self._runtime
class MultipleProviders(Event):
"""Multiple Providers"""
def __init__(self, item, candidates, data, runtime = False):
Event.__init__(self, data)
self._item = item
self._candidates = candidates
self._is_runtime = runtime
def isRuntime(self):
"""
Is this a runtime issue?
"""
return self._is_runtime
def getItem(self):
"""
The name for the to be build item
"""
return self._item
def getCandidates(self):
"""
Get the possible Candidates for a PROVIDER.
"""
return self._candidates
class ParseProgress(Event):
"""
Parsing Progress Event
"""
def __init__(self, d, cached, parsed, skipped, masked, errors, total):
Event.__init__(self, d)
self.cached = cached
self.parsed = parsed
self.skipped = skipped
self.masked = masked
self.errors = errors
self.sofar = cached + parsed + skipped
self.total = total
class DepTreeGenerated(Event):
"""
Event when a dependency tree has been generated
"""
def __init__(self, d, depgraph):
Event.__init__(self, d)
self._depgraph = depgraph

View File

@@ -1,606 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os, re
import bb
from bb import data
from bb import persist_data
class FetchError(Exception):
"""Exception raised when a download fails"""
class NoMethodError(Exception):
"""Exception raised when there is no method to obtain a supplied url or set of urls"""
class MissingParameterError(Exception):
"""Exception raised when a fetch method is missing a critical parameter in the url"""
class ParameterError(Exception):
"""Exception raised when a url cannot be proccessed due to invalid parameters."""
class MD5SumError(Exception):
"""Exception raised when a MD5SUM of a file does not match the expected one"""
class InvalidSRCREV(Exception):
"""Exception raised when an invalid SRCREV is encountered"""
def uri_replace(uri, uri_find, uri_replace, d):
# bb.msg.note(1, bb.msg.domain.Fetcher, "uri_replace: operating on %s" % uri)
if not uri or not uri_find or not uri_replace:
bb.msg.debug(1, bb.msg.domain.Fetcher, "uri_replace: passed an undefined value, not replacing")
uri_decoded = list(bb.decodeurl(uri))
uri_find_decoded = list(bb.decodeurl(uri_find))
uri_replace_decoded = list(bb.decodeurl(uri_replace))
result_decoded = ['','','','','',{}]
for i in uri_find_decoded:
loc = uri_find_decoded.index(i)
result_decoded[loc] = uri_decoded[loc]
import types
if type(i) == types.StringType:
if (re.match(i, uri_decoded[loc])):
result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc])
if uri_find_decoded.index(i) == 2:
if d:
localfn = bb.fetch.localpath(uri, d)
if localfn:
result_decoded[loc] = os.path.dirname(result_decoded[loc]) + "/" + os.path.basename(bb.fetch.localpath(uri, d))
# bb.msg.note(1, bb.msg.domain.Fetcher, "uri_replace: matching %s against %s and replacing with %s" % (i, uri_decoded[loc], uri_replace_decoded[loc]))
else:
# bb.msg.note(1, bb.msg.domain.Fetcher, "uri_replace: no match")
return uri
# else:
# for j in i.keys():
# FIXME: apply replacements against options
return bb.encodeurl(result_decoded)
methods = []
urldata_cache = {}
saved_headrevs = {}
def fetcher_init(d):
"""
Called to initilize the fetchers once the configuration data is known
Calls before this must not hit the cache.
"""
pd = persist_data.PersistData(d)
# When to drop SCM head revisions controled by user policy
srcrev_policy = bb.data.getVar('BB_SRCREV_POLICY', d, 1) or "clear"
if srcrev_policy == "cache":
bb.msg.debug(1, bb.msg.domain.Fetcher, "Keeping SRCREV cache due to cache policy of: %s" % srcrev_policy)
elif srcrev_policy == "clear":
bb.msg.debug(1, bb.msg.domain.Fetcher, "Clearing SRCREV cache due to cache policy of: %s" % srcrev_policy)
try:
bb.fetch.saved_headrevs = pd.getKeyValues("BB_URI_HEADREVS")
except:
pass
pd.delDomain("BB_URI_HEADREVS")
else:
bb.msg.fatal(bb.msg.domain.Fetcher, "Invalid SRCREV cache policy of: %s" % srcrev_policy)
# Make sure our domains exist
pd.addDomain("BB_URI_HEADREVS")
pd.addDomain("BB_URI_LOCALCOUNT")
def fetcher_compare_revisons(d):
"""
Compare the revisions in the persistant cache with current values and
return true/false on whether they've changed.
"""
pd = persist_data.PersistData(d)
data = pd.getKeyValues("BB_URI_HEADREVS")
data2 = bb.fetch.saved_headrevs
changed = False
for key in data:
if key not in data2 or data2[key] != data[key]:
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s changed" % key)
changed = True
return True
else:
bb.msg.debug(2, bb.msg.domain.Fetcher, "%s did not change" % key)
return False
# Function call order is usually:
# 1. init
# 2. go
# 3. localpaths
# localpath can be called at any time
def init(urls, d, setup = True):
urldata = {}
fn = bb.data.getVar('FILE', d, 1)
if fn in urldata_cache:
urldata = urldata_cache[fn]
for url in urls:
if url not in urldata:
urldata[url] = FetchData(url, d)
if setup:
for url in urldata:
if not urldata[url].setup:
urldata[url].setup_localpath(d)
urldata_cache[fn] = urldata
return urldata
def go(d):
"""
Fetch all urls
init must have previously been called
"""
urldata = init([], d, True)
for u in urldata:
ud = urldata[u]
m = ud.method
if ud.localfile:
if not m.forcefetch(u, ud, d) and os.path.exists(ud.md5):
# File already present along with md5 stamp file
# Touch md5 file to show activity
try:
os.utime(ud.md5, None)
except:
# Errors aren't fatal here
pass
continue
lf = bb.utils.lockfile(ud.lockfile)
if not m.forcefetch(u, ud, d) and os.path.exists(ud.md5):
# If someone else fetched this before we got the lock,
# notice and don't try again
try:
os.utime(ud.md5, None)
except:
# Errors aren't fatal here
pass
bb.utils.unlockfile(lf)
continue
m.go(u, ud, d)
if ud.localfile:
if not m.forcefetch(u, ud, d):
Fetch.write_md5sum(u, ud, d)
bb.utils.unlockfile(lf)
def checkstatus(d):
"""
Check all urls exist upstream
init must have previously been called
"""
urldata = init([], d, True)
for u in urldata:
ud = urldata[u]
m = ud.method
bb.msg.note(1, bb.msg.domain.Fetcher, "Testing URL %s" % u)
ret = m.checkstatus(u, ud, d)
if not ret:
bb.msg.fatal(bb.msg.domain.Fetcher, "URL %s doesn't work" % u)
def localpaths(d):
"""
Return a list of the local filenames, assuming successful fetch
"""
local = []
urldata = init([], d, True)
for u in urldata:
ud = urldata[u]
local.append(ud.localpath)
return local
srcrev_internal_call = False
def get_srcrev(d):
"""
Return the version string for the current package
(usually to be used as PV)
Most packages usually only have one SCM so we just pass on the call.
In the multi SCM case, we build a value based on SRCREV_FORMAT which must
have been set.
"""
#
# Ugly code alert. localpath in the fetchers will try to evaluate SRCREV which
# could translate into a call to here. If it does, we need to catch this
# and provide some way so it knows get_srcrev is active instead of being
# some number etc. hence the srcrev_internal_call tracking and the magic
# "SRCREVINACTION" return value.
#
# Neater solutions welcome!
#
if bb.fetch.srcrev_internal_call:
return "SRCREVINACTION"
scms = []
# Only call setup_localpath on URIs which suppports_srcrev()
urldata = init(bb.data.getVar('SRC_URI', d, 1).split(), d, False)
for u in urldata:
ud = urldata[u]
if ud.method.suppports_srcrev():
if not ud.setup:
ud.setup_localpath(d)
scms.append(u)
if len(scms) == 0:
bb.msg.error(bb.msg.domain.Fetcher, "SRCREV was used yet no valid SCM was found in SRC_URI")
raise ParameterError
bb.data.setVar('__BB_DONT_CACHE','1', d)
if len(scms) == 1:
return urldata[scms[0]].method.sortable_revision(scms[0], urldata[scms[0]], d)
#
# Mutiple SCMs are in SRC_URI so we resort to SRCREV_FORMAT
#
format = bb.data.getVar('SRCREV_FORMAT', d, 1)
if not format:
bb.msg.error(bb.msg.domain.Fetcher, "The SRCREV_FORMAT variable must be set when multiple SCMs are used.")
raise ParameterError
for scm in scms:
if 'name' in urldata[scm].parm:
name = urldata[scm].parm["name"]
rev = urldata[scm].method.sortable_revision(scm, urldata[scm], d)
format = format.replace(name, rev)
return format
def localpath(url, d, cache = True):
"""
Called from the parser with cache=False since the cache isn't ready
at this point. Also called from classed in OE e.g. patch.bbclass
"""
ud = init([url], d)
if ud[url].method:
return ud[url].localpath
return url
def runfetchcmd(cmd, d, quiet = False):
"""
Run cmd returning the command output
Raise an error if interrupted or cmd fails
Optionally echo command output to stdout
"""
# Need to export PATH as binary could be in metadata paths
# rather than host provided
# Also include some other variables.
# FIXME: Should really include all export varaiables?
exportvars = ['PATH', 'GIT_PROXY_COMMAND', 'GIT_PROXY_HOST', 'GIT_PROXY_PORT', 'GIT_CONFIG', 'http_proxy', 'ftp_proxy', 'SSH_AUTH_SOCK', 'SSH_AGENT_PID', 'HOME']
for var in exportvars:
val = data.getVar(var, d, True)
if val:
cmd = 'export ' + var + '=%s; %s' % (val, cmd)
bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % cmd)
# redirect stderr to stdout
stdout_handle = os.popen(cmd + " 2>&1", "r")
output = ""
while 1:
line = stdout_handle.readline()
if not line:
break
if not quiet:
print line,
output += line
status = stdout_handle.close() or 0
signal = status >> 8
exitstatus = status & 0xff
if signal:
raise FetchError("Fetch command %s failed with signal %s, output:\n%s" % (cmd, signal, output))
elif status != 0:
raise FetchError("Fetch command %s failed with exit code %s, output:\n%s" % (cmd, status, output))
return output
class FetchData(object):
"""
A class which represents the fetcher state for a given URI.
"""
def __init__(self, url, d):
self.localfile = ""
(self.type, self.host, self.path, self.user, self.pswd, self.parm) = bb.decodeurl(data.expand(url, d))
self.date = Fetch.getSRCDate(self, d)
self.url = url
if not self.user and "user" in self.parm:
self.user = self.parm["user"]
if not self.pswd and "pswd" in self.parm:
self.pswd = self.parm["pswd"]
self.setup = False
for m in methods:
if m.supports(url, self, d):
self.method = m
return
raise NoMethodError("Missing implementation for url %s" % url)
def setup_localpath(self, d):
self.setup = True
if "localpath" in self.parm:
# if user sets localpath for file, use it instead.
self.localpath = self.parm["localpath"]
else:
try:
bb.fetch.srcrev_internal_call = True
self.localpath = self.method.localpath(self.url, self, d)
finally:
bb.fetch.srcrev_internal_call = False
# We have to clear data's internal caches since the cached value of SRCREV is now wrong.
# Horrible...
bb.data.delVar("ISHOULDNEVEREXIST", d)
self.md5 = self.localpath + '.md5'
self.lockfile = self.localpath + '.lock'
class Fetch(object):
"""Base class for 'fetch'ing data"""
def __init__(self, urls = []):
self.urls = []
def supports(self, url, urldata, d):
"""
Check to see if this fetch class supports a given url.
"""
return 0
def localpath(self, url, urldata, d):
"""
Return the local filename of a given url assuming a successful fetch.
Can also setup variables in urldata for use in go (saving code duplication
and duplicate code execution)
"""
return url
def setUrls(self, urls):
self.__urls = urls
def getUrls(self):
return self.__urls
urls = property(getUrls, setUrls, None, "Urls property")
def forcefetch(self, url, urldata, d):
"""
Force a fetch, even if localpath exists?
"""
return False
def suppports_srcrev(self):
"""
The fetcher supports auto source revisions (SRCREV)
"""
return False
def go(self, url, urldata, d):
"""
Fetch urls
Assumes localpath was called first
"""
raise NoMethodError("Missing implementation for url")
def checkstatus(self, url, urldata, d):
"""
Check the status of a URL
Assumes localpath was called first
"""
bb.msg.note(1, bb.msg.domain.Fetcher, "URL %s could not be checked for status since no method exists." % url)
return True
def getSRCDate(urldata, d):
"""
Return the SRC Date for the component
d the bb.data module
"""
if "srcdate" in urldata.parm:
return urldata.parm['srcdate']
pn = data.getVar("PN", d, 1)
if pn:
return data.getVar("SRCDATE_%s" % pn, d, 1) or data.getVar("CVSDATE_%s" % pn, d, 1) or data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
return data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
getSRCDate = staticmethod(getSRCDate)
def srcrev_internal_helper(ud, d):
"""
Return:
a) a source revision if specified
b) True if auto srcrev is in action
c) False otherwise
"""
if 'rev' in ud.parm:
return ud.parm['rev']
if 'tag' in ud.parm:
return ud.parm['tag']
rev = None
if 'name' in ud.parm:
pn = data.getVar("PN", d, 1)
rev = data.getVar("SRCREV_pn-" + pn + "_" + ud.parm['name'], d, 1)
if not rev:
rev = data.getVar("SRCREV", d, 1)
if rev == "INVALID":
raise InvalidSRCREV("Please set SRCREV to a valid value")
if not rev:
return False
if rev is "SRCREVINACTION":
return True
return rev
srcrev_internal_helper = staticmethod(srcrev_internal_helper)
def try_mirror(d, tarfn):
"""
Try to use a mirrored version of the sources. We do this
to avoid massive loads on foreign cvs and svn servers.
This method will be used by the different fetcher
implementations.
d Is a bb.data instance
tarfn is the name of the tarball
"""
tarpath = os.path.join(data.getVar("DL_DIR", d, 1), tarfn)
if os.access(tarpath, os.R_OK):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists, skipping checkout." % tarfn)
return True
pn = data.getVar('PN', d, True)
src_tarball_stash = None
if pn:
src_tarball_stash = (data.getVar('SRC_TARBALL_STASH_%s' % pn, d, True) or data.getVar('CVS_TARBALL_STASH_%s' % pn, d, True) or data.getVar('SRC_TARBALL_STASH', d, True) or data.getVar('CVS_TARBALL_STASH', d, True) or "").split()
ld = d.createCopy()
for stash in src_tarball_stash:
url = stash + tarfn
try:
ud = FetchData(url, ld)
except bb.fetch.NoMethodError:
bb.msg.debug(1, bb.msg.domain.Fetcher, "No method for %s" % url)
continue
ud.setup_localpath(ld)
try:
ud.method.go(url, ud, ld)
return True
except (bb.fetch.MissingParameterError,
bb.fetch.FetchError,
bb.fetch.MD5SumError):
import sys
(type, value, traceback) = sys.exc_info()
bb.msg.debug(2, bb.msg.domain.Fetcher, "Tarball stash fetch failure: %s" % value)
return False
try_mirror = staticmethod(try_mirror)
def verify_md5sum(ud, got_sum):
"""
Verify the md5sum we wanted with the one we got
"""
wanted_sum = None
if 'md5sum' in ud.parm:
wanted_sum = ud.parm['md5sum']
if not wanted_sum:
return True
return wanted_sum == got_sum
verify_md5sum = staticmethod(verify_md5sum)
def write_md5sum(url, ud, d):
md5data = bb.utils.md5_file(ud.localpath)
# verify the md5sum
if not Fetch.verify_md5sum(ud, md5data):
raise MD5SumError(url)
md5out = file(ud.md5, 'w')
md5out.write(md5data)
md5out.close()
write_md5sum = staticmethod(write_md5sum)
def latest_revision(self, url, ud, d):
"""
Look in the cache for the latest revision, if not present ask the SCM.
"""
if not hasattr(self, "_latest_revision"):
raise ParameterError
pd = persist_data.PersistData(d)
key = self.generate_revision_key(url, ud, d)
rev = pd.getValue("BB_URI_HEADREVS", key)
if rev != None:
return str(rev)
rev = self._latest_revision(url, ud, d)
pd.setValue("BB_URI_HEADREVS", key, rev)
return rev
def sortable_revision(self, url, ud, d):
"""
"""
has_sortable = hasattr(self, "_sortable_revision")
if has_sortable:
return self._sortable_revision(url, ud, d)
pd = persist_data.PersistData(d)
key = self.generate_revision_key(url, ud, d)
latest_rev = self._build_revision(url, ud, d)
last_rev = pd.getValue("BB_URI_LOCALCOUNT", key + "_rev")
count = pd.getValue("BB_URI_LOCALCOUNT", key + "_count")
if last_rev == latest_rev:
return str(count + "+" + latest_rev)
if count is None:
count = "0"
else:
count = str(int(count) + 1)
pd.setValue("BB_URI_LOCALCOUNT", key + "_rev", latest_rev)
pd.setValue("BB_URI_LOCALCOUNT", key + "_count", count)
return str(count + "+" + latest_rev)
def generate_revision_key(self, url, ud, d):
key = self._revision_key(url, ud, d)
return "%s-%s" % (key, bb.data.getVar("PN", d, True) or "")
import cvs
import git
import local
import svn
import wget
import svk
import ssh
import perforce
import bzr
import hg
import osc
methods.append(local.Local())
methods.append(wget.Wget())
methods.append(svn.Svn())
methods.append(git.Git())
methods.append(cvs.Cvs())
methods.append(svk.Svk())
methods.append(ssh.SSH())
methods.append(perforce.Perforce())
methods.append(bzr.Bzr())
methods.append(hg.Hg())
methods.append(osc.Osc())

View File

@@ -1,153 +0,0 @@
"""
BitBake 'Fetch' implementation for bzr.
"""
# Copyright (C) 2007 Ross Burton
# Copyright (C) 2007 Richard Purdie
#
# Classes for obtaining upstream sources for the
# BitBake build tools.
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os
import sys
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import runfetchcmd
class Bzr(Fetch):
def supports(self, url, ud, d):
return ud.type in ['bzr']
def localpath (self, url, ud, d):
# Create paths to bzr checkouts
relpath = ud.path
if relpath.startswith('/'):
# Remove leading slash as os.path.join can't cope
relpath = relpath[1:]
ud.pkgdir = os.path.join(data.expand('${BZRDIR}', d), ud.host, relpath)
revision = Fetch.srcrev_internal_helper(ud, d)
if revision is True:
ud.revision = self.latest_revision(url, ud, d)
elif revision:
ud.revision = revision
if not ud.revision:
ud.revision = self.latest_revision(url, ud, d)
ud.localfile = data.expand('bzr_%s_%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.revision), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def _buildbzrcommand(self, ud, d, command):
"""
Build up an bzr commandline based on ud
command is "fetch", "update", "revno"
"""
basecmd = data.expand('${FETCHCMD_bzr}', d)
proto = "http"
if "proto" in ud.parm:
proto = ud.parm["proto"]
bzrroot = ud.host + ud.path
options = []
if command is "revno":
bzrcmd = "%s revno %s %s://%s" % (basecmd, " ".join(options), proto, bzrroot)
else:
if ud.revision:
options.append("-r %s" % ud.revision)
if command is "fetch":
bzrcmd = "%s co %s %s://%s" % (basecmd, " ".join(options), proto, bzrroot)
elif command is "update":
bzrcmd = "%s pull %s --overwrite" % (basecmd, " ".join(options))
else:
raise FetchError("Invalid bzr command %s" % command)
return bzrcmd
def go(self, loc, ud, d):
"""Fetch url"""
# try to use the tarball stash
if Fetch.try_mirror(d, ud.localfile):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists or was mirrored, skipping bzr checkout." % ud.localpath)
return
if os.access(os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir), '.bzr'), os.R_OK):
bzrcmd = self._buildbzrcommand(ud, d, "update")
bb.msg.debug(1, bb.msg.domain.Fetcher, "BZR Update %s" % loc)
os.chdir(os.path.join (ud.pkgdir, os.path.basename(ud.path)))
runfetchcmd(bzrcmd, d)
else:
os.system("rm -rf %s" % os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir)))
bzrcmd = self._buildbzrcommand(ud, d, "fetch")
bb.msg.debug(1, bb.msg.domain.Fetcher, "BZR Checkout %s" % loc)
bb.mkdirhier(ud.pkgdir)
os.chdir(ud.pkgdir)
bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % bzrcmd)
runfetchcmd(bzrcmd, d)
os.chdir(ud.pkgdir)
# tar them up to a defined filename
try:
runfetchcmd("tar -czf %s %s" % (ud.localpath, os.path.basename(ud.pkgdir)), d)
except:
t, v, tb = sys.exc_info()
try:
os.unlink(ud.localpath)
except OSError:
pass
raise t, v, tb
def suppports_srcrev(self):
return True
def _revision_key(self, url, ud, d):
"""
Return a unique key for the url
"""
return "bzr:" + ud.pkgdir
def _latest_revision(self, url, ud, d):
"""
Return the latest upstream revision number
"""
bb.msg.debug(2, bb.msg.domain.Fetcher, "BZR fetcher hitting network for %s" % url)
output = runfetchcmd(self._buildbzrcommand(ud, d, "revno"), d, True)
return output.strip()
def _sortable_revision(self, url, ud, d):
"""
Return a sortable revision number which in our case is the revision number
"""
return self._build_revision(url, ud, d)
def _build_revision(self, url, ud, d):
return ud.revision

View File

@@ -1,182 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#Based on functions from the base bb module, Copyright 2003 Holger Schurig
#
import os
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import MissingParameterError
class Cvs(Fetch):
"""
Class to fetch a module or modules from cvs repositories
"""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with cvs.
"""
return ud.type in ['cvs', 'pserver']
def localpath(self, url, ud, d):
if not "module" in ud.parm:
raise MissingParameterError("cvs method needs a 'module' parameter")
ud.module = ud.parm["module"]
ud.tag = ""
if 'tag' in ud.parm:
ud.tag = ud.parm['tag']
# Override the default date in certain cases
if 'date' in ud.parm:
ud.date = ud.parm['date']
elif ud.tag:
ud.date = ""
norecurse = ''
if 'norecurse' in ud.parm:
norecurse = '_norecurse'
fullpath = ''
if 'fullpath' in ud.parm:
fullpath = '_fullpath'
ud.localfile = data.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def forcefetch(self, url, ud, d):
if (ud.date == "now"):
return True
return False
def go(self, loc, ud, d):
# try to use the tarball stash
if not self.forcefetch(loc, ud, d) and Fetch.try_mirror(d, ud.localfile):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists or was mirrored, skipping cvs checkout." % ud.localpath)
return
method = "pserver"
if "method" in ud.parm:
method = ud.parm["method"]
localdir = ud.module
if "localdir" in ud.parm:
localdir = ud.parm["localdir"]
cvs_port = ""
if "port" in ud.parm:
cvs_port = ud.parm["port"]
cvs_rsh = None
if method == "ext":
if "rsh" in ud.parm:
cvs_rsh = ud.parm["rsh"]
if method == "dir":
cvsroot = ud.path
else:
cvsroot = ":" + method
cvsproxyhost = data.getVar('CVS_PROXY_HOST', d, True)
if cvsproxyhost:
cvsroot += ";proxy=" + cvsproxyhost
cvsproxyport = data.getVar('CVS_PROXY_PORT', d, True)
if cvsproxyport:
cvsroot += ";proxyport=" + cvsproxyport
cvsroot += ":" + ud.user
if ud.pswd:
cvsroot += ":" + ud.pswd
cvsroot += "@" + ud.host + ":" + cvs_port + ud.path
options = []
if 'norecurse' in ud.parm:
options.append("-l")
if ud.date:
# treat YYYYMMDDHHMM specially for CVS
if len(ud.date) == 12:
options.append("-D \"%s %s:%s UTC\"" % (ud.date[0:8], ud.date[8:10], ud.date[10:12]))
else:
options.append("-D \"%s UTC\"" % ud.date)
if ud.tag:
options.append("-r %s" % ud.tag)
localdata = data.createCopy(d)
data.setVar('OVERRIDES', "cvs:%s" % data.getVar('OVERRIDES', localdata), localdata)
data.update_data(localdata)
data.setVar('CVSROOT', cvsroot, localdata)
data.setVar('CVSCOOPTS', " ".join(options), localdata)
data.setVar('CVSMODULE', ud.module, localdata)
cvscmd = data.getVar('FETCHCOMMAND', localdata, 1)
cvsupdatecmd = data.getVar('UPDATECOMMAND', localdata, 1)
if cvs_rsh:
cvscmd = "CVS_RSH=\"%s\" %s" % (cvs_rsh, cvscmd)
cvsupdatecmd = "CVS_RSH=\"%s\" %s" % (cvs_rsh, cvsupdatecmd)
# create module directory
bb.msg.debug(2, bb.msg.domain.Fetcher, "Fetch: checking for module directory")
pkg = data.expand('${PN}', d)
pkgdir = os.path.join(data.expand('${CVSDIR}', localdata), pkg)
moddir = os.path.join(pkgdir,localdir)
if os.access(os.path.join(moddir,'CVS'), os.R_OK):
bb.msg.note(1, bb.msg.domain.Fetcher, "Update " + loc)
# update sources there
os.chdir(moddir)
myret = os.system(cvsupdatecmd)
else:
bb.msg.note(1, bb.msg.domain.Fetcher, "Fetch " + loc)
# check out sources there
bb.mkdirhier(pkgdir)
os.chdir(pkgdir)
bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % cvscmd)
myret = os.system(cvscmd)
if myret != 0 or not os.access(moddir, os.R_OK):
try:
os.rmdir(moddir)
except OSError:
pass
raise FetchError(ud.module)
# tar them up to a defined filename
if 'fullpath' in ud.parm:
os.chdir(pkgdir)
myret = os.system("tar -czf %s %s" % (ud.localpath, localdir))
else:
os.chdir(moddir)
os.chdir('..')
myret = os.system("tar -czf %s %s" % (ud.localpath, os.path.basename(moddir)))
if myret != 0:
try:
os.unlink(ud.localpath)
except OSError:
pass
raise FetchError(ud.module)

View File

@@ -1,188 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' git implementation
"""
#Copyright (C) 2005 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import runfetchcmd
class Git(Fetch):
"""Class to fetch a module or modules from git repositories"""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with git.
"""
return ud.type in ['git']
def localpath(self, url, ud, d):
if 'protocol' in ud.parm:
ud.proto = ud.parm['protocol']
elif not ud.host:
ud.proto = 'file'
else:
ud.proto = "rsync"
ud.branch = ud.parm.get("branch", "master")
tag = Fetch.srcrev_internal_helper(ud, d)
if tag is True:
ud.tag = self.latest_revision(url, ud, d)
elif tag:
ud.tag = tag
if not ud.tag or ud.tag == "master":
ud.tag = self.latest_revision(url, ud, d)
ud.localfile = data.expand('git_%s%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.tag), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def go(self, loc, ud, d):
"""Fetch url"""
if Fetch.try_mirror(d, ud.localfile):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists (or was stashed). Skipping git checkout." % ud.localpath)
return
if ud.user:
username = ud.user + '@'
else:
username = ""
gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.'))
repofilename = 'git_%s.tar.gz' % (gitsrcname)
repofile = os.path.join(data.getVar("DL_DIR", d, 1), repofilename)
repodir = os.path.join(data.expand('${GITDIR}', d), gitsrcname)
coname = '%s' % (ud.tag)
codir = os.path.join(repodir, coname)
if not os.path.exists(repodir):
if Fetch.try_mirror(d, repofilename):
bb.mkdirhier(repodir)
os.chdir(repodir)
runfetchcmd("tar -xzf %s" % (repofile), d)
else:
runfetchcmd("git clone -n %s://%s%s%s %s" % (ud.proto, username, ud.host, ud.path, repodir), d)
os.chdir(repodir)
# Remove all but the .git directory
if not self._contains_ref(ud.tag, d):
runfetchcmd("rm * -Rf", d)
runfetchcmd("git fetch %s://%s%s%s %s" % (ud.proto, username, ud.host, ud.path, ud.branch), d)
runfetchcmd("git fetch --tags %s://%s%s%s" % (ud.proto, username, ud.host, ud.path), d)
runfetchcmd("git prune-packed", d)
runfetchcmd("git pack-redundant --all | xargs -r rm", d)
os.chdir(repodir)
mirror_tarballs = data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True)
if mirror_tarballs != "0":
bb.msg.note(1, bb.msg.domain.Fetcher, "Creating tarball of git repository")
runfetchcmd("tar -czf %s %s" % (repofile, os.path.join(".", ".git", "*") ), d)
if os.path.exists(codir):
bb.utils.prunedir(codir)
bb.mkdirhier(codir)
os.chdir(repodir)
runfetchcmd("git read-tree %s" % (ud.tag), d)
runfetchcmd("git checkout-index -q -f --prefix=%s -a" % (os.path.join(codir, "git", "")), d)
os.chdir(codir)
bb.msg.note(1, bb.msg.domain.Fetcher, "Creating tarball of git checkout")
runfetchcmd("tar -czf %s %s" % (ud.localpath, os.path.join(".", "*") ), d)
os.chdir(repodir)
bb.utils.prunedir(codir)
def suppports_srcrev(self):
return True
def _contains_ref(self, tag, d):
output = runfetchcmd("git log --pretty=oneline -n 1 %s -- 2> /dev/null | wc -l" % tag, d, quiet=True)
return output.split()[0] != "0"
def _revision_key(self, url, ud, d):
"""
Return a unique key for the url
"""
return "git:" + ud.host + ud.path.replace('/', '.')
def _latest_revision(self, url, ud, d):
"""
Compute the HEAD revision for the url
"""
if ud.user:
username = ud.user + '@'
else:
username = ""
output = runfetchcmd("git ls-remote %s://%s%s%s %s" % (ud.proto, username, ud.host, ud.path, ud.branch), d, True)
return output.split()[0]
def _build_revision(self, url, ud, d):
return ud.tag
def _want_sortable_revision(self, url, ud, d):
return bb.data.getVar("BB_GIT_CLONE_FOR_SRCREV", d, True) or False
def _sortable_revision_disabled(self, url, ud, d):
"""
This is only called when _want_sortable_revision called true
We will have to get the updated revision.
"""
gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.'))
repodir = os.path.join(data.expand('${GITDIR}', d), gitsrcname)
key = "GIT_CACHED_REVISION-%s-%s" % (gitsrcname, ud.tag)
if bb.data.getVar(key, d):
return bb.data.getVar(key, d)
# Runtime warning on wrongly configured sources
if ud.tag == "1":
bb.msg.error(1, bb.msg.domain.Fetcher, "SRCREV is '1'. This indicates a configuration error of %s" % url)
return "0+1"
cwd = os.getcwd()
# Check if we have the rev already
if not os.path.exists(repodir):
print "no repo"
self.go(None, ud, d)
os.chdir(repodir)
if not self._contains_ref(ud.tag, d):
self.go(None, ud, d)
output = runfetchcmd("git rev-list %s -- 2> /dev/null | wc -l" % ud.tag, d, quiet=True)
os.chdir(cwd)
sortable_revision = "%s+%s" % (output.split()[0], ud.tag)
bb.data.setVar(key, sortable_revision, d)
return sortable_revision

View File

@@ -1,178 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementation for mercurial DRCS (hg).
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2004 Marcin Juszkiewicz
# Copyright (C) 2007 Robert Schuster
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
import sys
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import MissingParameterError
from bb.fetch import runfetchcmd
class Hg(Fetch):
"""Class to fetch a from mercurial repositories"""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with mercurial.
"""
return ud.type in ['hg']
def localpath(self, url, ud, d):
if not "module" in ud.parm:
raise MissingParameterError("hg method needs a 'module' parameter")
ud.module = ud.parm["module"]
# Create paths to mercurial checkouts
relpath = ud.path
if relpath.startswith('/'):
# Remove leading slash as os.path.join can't cope
relpath = relpath[1:]
ud.pkgdir = os.path.join(data.expand('${HGDIR}', d), ud.host, relpath)
ud.moddir = os.path.join(ud.pkgdir, ud.module)
if 'rev' in ud.parm:
ud.revision = ud.parm['rev']
else:
tag = Fetch.srcrev_internal_helper(ud, d)
if tag is True:
ud.revision = self.latest_revision(url, ud, d)
elif tag:
ud.revision = tag
else:
ud.revision = self.latest_revision(url, ud, d)
ud.localfile = data.expand('%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def _buildhgcommand(self, ud, d, command):
"""
Build up an hg commandline based on ud
command is "fetch", "update", "info"
"""
basecmd = data.expand('${FETCHCMD_hg}', d)
proto = "http"
if "proto" in ud.parm:
proto = ud.parm["proto"]
host = ud.host
if proto == "file":
host = "/"
ud.host = "localhost"
if not ud.user:
hgroot = host + ud.path
else:
hgroot = ud.user + "@" + host + ud.path
if command is "info":
return "%s identify -i %s://%s/%s" % (basecmd, proto, hgroot, ud.module)
options = [];
if ud.revision:
options.append("-r %s" % ud.revision)
if command is "fetch":
cmd = "%s clone %s %s://%s/%s %s" % (basecmd, " ".join(options), proto, hgroot, ud.module, ud.module)
elif command is "pull":
# do not pass options list; limiting pull to rev causes the local
# repo not to contain it and immediately following "update" command
# will crash
cmd = "%s pull" % (basecmd)
elif command is "update":
cmd = "%s update -C %s" % (basecmd, " ".join(options))
else:
raise FetchError("Invalid hg command %s" % command)
return cmd
def go(self, loc, ud, d):
"""Fetch url"""
# try to use the tarball stash
if Fetch.try_mirror(d, ud.localfile):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists or was mirrored, skipping hg checkout." % ud.localpath)
return
bb.msg.debug(2, bb.msg.domain.Fetcher, "Fetch: checking for module directory '" + ud.moddir + "'")
if os.access(os.path.join(ud.moddir, '.hg'), os.R_OK):
updatecmd = self._buildhgcommand(ud, d, "pull")
bb.msg.note(1, bb.msg.domain.Fetcher, "Update " + loc)
# update sources there
os.chdir(ud.moddir)
bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % updatecmd)
runfetchcmd(updatecmd, d)
else:
fetchcmd = self._buildhgcommand(ud, d, "fetch")
bb.msg.note(1, bb.msg.domain.Fetcher, "Fetch " + loc)
# check out sources there
bb.mkdirhier(ud.pkgdir)
os.chdir(ud.pkgdir)
bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % fetchcmd)
runfetchcmd(fetchcmd, d)
# Even when we clone (fetch), we still need to update as hg's clone
# won't checkout the specified revision if its on a branch
updatecmd = self._buildhgcommand(ud, d, "update")
bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % updatecmd)
runfetchcmd(updatecmd, d)
os.chdir(ud.pkgdir)
try:
runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d)
except:
t, v, tb = sys.exc_info()
try:
os.unlink(ud.localpath)
except OSError:
pass
raise t, v, tb
def suppports_srcrev(self):
return True
def _latest_revision(self, url, ud, d):
"""
Compute tip revision for the url
"""
output = runfetchcmd(self._buildhgcommand(ud, d, "info"), d)
return output.strip()
def _build_revision(self, url, ud, d):
return ud.revision
def _revision_key(self, url, ud, d):
"""
Return a unique key for the url
"""
return "hg:" + ud.moddir

View File

@@ -1,72 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
import bb
from bb import data
from bb.fetch import Fetch
class Local(Fetch):
def supports(self, url, urldata, d):
"""
Check to see if a given url can be fetched with cvs.
"""
return urldata.type in ['file','patch']
def localpath(self, url, urldata, d):
"""
Return the local filename of a given url assuming a successful fetch.
"""
path = url.split("://")[1]
path = path.split(";")[0]
newpath = path
if path[0] != "/":
filespath = data.getVar('FILESPATH', d, 1)
if filespath:
newpath = bb.which(filespath, path)
if not newpath:
filesdir = data.getVar('FILESDIR', d, 1)
if filesdir:
newpath = os.path.join(filesdir, path)
# We don't set localfile as for this fetcher the file is already local!
return newpath
def go(self, url, urldata, d):
"""Fetch urls (no-op for Local method)"""
# no need to fetch local files, we'll deal with them in place.
return 1
def checkstatus(self, url, urldata, d):
"""
Check the status of the url
"""
if urldata.localpath.find("*") != -1:
bb.msg.note(1, bb.msg.domain.Fetcher, "URL %s looks like a glob and was therefore not checked." % url)
return True
if os.path.exists(urldata.localpath):
return True
return False

View File

@@ -1,155 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
Bitbake "Fetch" implementation for osc (Opensuse build service client).
Based on the svn "Fetch" implementation.
"""
import os
import sys
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import MissingParameterError
from bb.fetch import runfetchcmd
class Osc(Fetch):
"""Class to fetch a module or modules from Opensuse build server
repositories."""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with osc.
"""
return ud.type in ['osc']
def localpath(self, url, ud, d):
if not "module" in ud.parm:
raise MissingParameterError("osc method needs a 'module' parameter.")
ud.module = ud.parm["module"]
# Create paths to osc checkouts
relpath = ud.path
if relpath.startswith('/'):
# Remove leading slash as os.path.join can't cope
relpath = relpath[1:]
ud.pkgdir = os.path.join(data.expand('${OSCDIR}', d), ud.host)
ud.moddir = os.path.join(ud.pkgdir, relpath, ud.module)
if 'rev' in ud.parm:
ud.revision = ud.parm['rev']
else:
pv = data.getVar("PV", d, 0)
rev = Fetch.srcrev_internal_helper(ud, d)
if rev and rev != True:
ud.revision = rev
else:
ud.revision = ""
ud.localfile = data.expand('%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.path.replace('/', '.'), ud.revision), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def _buildosccommand(self, ud, d, command):
"""
Build up an ocs commandline based on ud
command is "fetch", "update", "info"
"""
basecmd = data.expand('${FETCHCMD_osc}', d)
proto = "ocs"
if "proto" in ud.parm:
proto = ud.parm["proto"]
options = []
config = "-c %s" % self.generate_config(ud, d)
if ud.revision:
options.append("-r %s" % ud.revision)
coroot = ud.path
if coroot.startswith('/'):
# Remove leading slash as os.path.join can't cope
coroot= coroot[1:]
if command is "fetch":
osccmd = "%s %s co %s/%s %s" % (basecmd, config, coroot, ud.module, " ".join(options))
elif command is "update":
osccmd = "%s %s up %s" % (basecmd, config, " ".join(options))
else:
raise FetchError("Invalid osc command %s" % command)
return osccmd
def go(self, loc, ud, d):
"""
Fetch url
"""
# Try to use the tarball stash
if Fetch.try_mirror(d, ud.localfile):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists or was mirrored, skipping osc checkout." % ud.localpath)
return
bb.msg.debug(2, bb.msg.domain.Fetcher, "Fetch: checking for module directory '" + ud.moddir + "'")
if os.access(os.path.join(data.expand('${OSCDIR}', d), ud.path, ud.module), os.R_OK):
oscupdatecmd = self._buildosccommand(ud, d, "update")
bb.msg.note(1, bb.msg.domain.Fetcher, "Update "+ loc)
# update sources there
os.chdir(ud.moddir)
bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % oscupdatecmd)
runfetchcmd(oscupdatecmd, d)
else:
oscfetchcmd = self._buildosccommand(ud, d, "fetch")
bb.msg.note(1, bb.msg.domain.Fetcher, "Fetch " + loc)
# check out sources there
bb.mkdirhier(ud.pkgdir)
os.chdir(ud.pkgdir)
bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % oscfetchcmd)
runfetchcmd(oscfetchcmd, d)
os.chdir(os.path.join(ud.pkgdir + ud.path))
# tar them up to a defined filename
try:
runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d)
except:
t, v, tb = sys.exc_info()
try:
os.unlink(ud.localpath)
except OSError:
pass
raise t, v, tb
def supports_srcrev(self):
return False
def generate_config(self, ud, d):
"""
Generate a .oscrc to be used for this run.
"""
config_path = "%s/oscrc" % data.expand('${OSCDIR}', d)
if (os.path.exists(config_path)):
os.remove(config_path)
f = open(config_path, 'w')
f.write("[general]\n")
f.write("apisrv = %s\n" % ud.host)
f.write("scheme = http\n")
f.write("su-wrapper = su -c\n")
f.write("build-root = %s\n" % data.expand('${WORKDIR}', d))
f.write("urllist = http://moblin-obs.jf.intel.com:8888/build/%(project)s/%(repository)s/%(buildarch)s/:full/%(name)s.rpm\n")
f.write("extra-pkgs = gzip\n")
f.write("\n")
f.write("[%s]\n" % ud.host)
f.write("user = %s\n" % ud.parm["user"])
f.write("pass = %s\n" % ud.parm["pswd"])
f.close()
return config_path

View File

@@ -1,214 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
class Perforce(Fetch):
def supports(self, url, ud, d):
return ud.type in ['p4']
def doparse(url,d):
parm = {}
path = url.split("://")[1]
delim = path.find("@");
if delim != -1:
(user,pswd,host,port) = path.split('@')[0].split(":")
path = path.split('@')[1]
else:
(host,port) = data.getVar('P4PORT', d).split(':')
user = ""
pswd = ""
if path.find(";") != -1:
keys=[]
values=[]
plist = path.split(';')
for item in plist:
if item.count('='):
(key,value) = item.split('=')
keys.append(key)
values.append(value)
parm = dict(zip(keys,values))
path = "//" + path.split(';')[0]
host += ":%s" % (port)
parm["cset"] = Perforce.getcset(d, path, host, user, pswd, parm)
return host,path,user,pswd,parm
doparse = staticmethod(doparse)
def getcset(d, depot,host,user,pswd,parm):
p4opt = ""
if "cset" in parm:
return parm["cset"];
if user:
p4opt += " -u %s" % (user)
if pswd:
p4opt += " -P %s" % (pswd)
if host:
p4opt += " -p %s" % (host)
p4date = data.getVar("P4DATE", d, 1)
if "revision" in parm:
depot += "#%s" % (parm["revision"])
elif "label" in parm:
depot += "@%s" % (parm["label"])
elif p4date:
depot += "@%s" % (p4date)
p4cmd = data.getVar('FETCHCOMMAND_p4', d, 1)
bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s%s changes -m 1 %s" % (p4cmd, p4opt, depot))
p4file = os.popen("%s%s changes -m 1 %s" % (p4cmd, p4opt, depot))
cset = p4file.readline().strip()
bb.msg.debug(1, bb.msg.domain.Fetcher, "READ %s" % (cset))
if not cset:
return -1
return cset.split(' ')[1]
getcset = staticmethod(getcset)
def localpath(self, url, ud, d):
(host,path,user,pswd,parm) = Perforce.doparse(url,d)
# If a label is specified, we use that as our filename
if "label" in parm:
ud.localfile = "%s.tar.gz" % (parm["label"])
return os.path.join(data.getVar("DL_DIR", d, 1), ud.localfile)
base = path
which = path.find('/...')
if which != -1:
base = path[:which]
if base[0] == "/":
base = base[1:]
cset = Perforce.getcset(d, path, host, user, pswd, parm)
ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host,base.replace('/', '.'), cset), d)
return os.path.join(data.getVar("DL_DIR", d, 1), ud.localfile)
def go(self, loc, ud, d):
"""
Fetch urls
"""
# try to use the tarball stash
if Fetch.try_mirror(d, ud.localfile):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists or was mirrored, skipping perforce checkout." % ud.localpath)
return
(host,depot,user,pswd,parm) = Perforce.doparse(loc, d)
if depot.find('/...') != -1:
path = depot[:depot.find('/...')]
else:
path = depot
if "module" in parm:
module = parm["module"]
else:
module = os.path.basename(path)
localdata = data.createCopy(d)
data.setVar('OVERRIDES', "p4:%s" % data.getVar('OVERRIDES', localdata), localdata)
data.update_data(localdata)
# Get the p4 command
p4opt = ""
if user:
p4opt += " -u %s" % (user)
if pswd:
p4opt += " -P %s" % (pswd)
if host:
p4opt += " -p %s" % (host)
p4cmd = data.getVar('FETCHCOMMAND', localdata, 1)
# create temp directory
bb.msg.debug(2, bb.msg.domain.Fetcher, "Fetch: creating temporary directory")
bb.mkdirhier(data.expand('${WORKDIR}', localdata))
data.setVar('TMPBASE', data.expand('${WORKDIR}/oep4.XXXXXX', localdata), localdata)
tmppipe = os.popen(data.getVar('MKTEMPDIRCMD', localdata, 1) or "false")
tmpfile = tmppipe.readline().strip()
if not tmpfile:
bb.error("Fetch: unable to create temporary directory.. make sure 'mktemp' is in the PATH.")
raise FetchError(module)
if "label" in parm:
depot = "%s@%s" % (depot,parm["label"])
else:
cset = Perforce.getcset(d, depot, host, user, pswd, parm)
depot = "%s@%s" % (depot,cset)
os.chdir(tmpfile)
bb.msg.note(1, bb.msg.domain.Fetcher, "Fetch " + loc)
bb.msg.note(1, bb.msg.domain.Fetcher, "%s%s files %s" % (p4cmd, p4opt, depot))
p4file = os.popen("%s%s files %s" % (p4cmd, p4opt, depot))
if not p4file:
bb.error("Fetch: unable to get the P4 files from %s" % (depot))
raise FetchError(module)
count = 0
for file in p4file:
list = file.split()
if list[2] == "delete":
continue
dest = list[0][len(path)+1:]
where = dest.find("#")
os.system("%s%s print -o %s/%s %s" % (p4cmd, p4opt, module,dest[:where],list[0]))
count = count + 1
if count == 0:
bb.error("Fetch: No files gathered from the P4 fetch")
raise FetchError(module)
myret = os.system("tar -czf %s %s" % (ud.localpath, module))
if myret != 0:
try:
os.unlink(ud.localpath)
except OSError:
pass
raise FetchError(module)
# cleanup
os.system('rm -rf %s' % tmpfile)

View File

@@ -1,118 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
'''
BitBake 'Fetch' implementations
This implementation is for Secure Shell (SSH), and attempts to comply with the
IETF secsh internet draft:
http://tools.ietf.org/wg/secsh/draft-ietf-secsh-scp-sftp-ssh-uri/
Currently does not support the sftp parameters, as this uses scp
Also does not support the 'fingerprint' connection parameter.
'''
# Copyright (C) 2006 OpenedHand Ltd.
#
#
# Based in part on svk.py:
# Copyright (C) 2006 Holger Hans Peter Freyther
# Based on svn.py:
# Copyright (C) 2003, 2004 Chris Larson
# Based on functions from the base bb module:
# Copyright 2003 Holger Schurig
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import re, os
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
__pattern__ = re.compile(r'''
\s* # Skip leading whitespace
ssh:// # scheme
( # Optional username/password block
(?P<user>\S+) # username
(:(?P<pass>\S+))? # colon followed by the password (optional)
)?
(?P<cparam>(;[^;]+)*)? # connection parameters block (optional)
@
(?P<host>\S+?) # non-greedy match of the host
(:(?P<port>[0-9]+))? # colon followed by the port (optional)
/
(?P<path>[^;]+) # path on the remote system, may be absolute or relative,
# and may include the use of '~' to reference the remote home
# directory
(?P<sparam>(;[^;]+)*)? # parameters block (optional)
$
''', re.VERBOSE)
class SSH(Fetch):
'''Class to fetch a module or modules via Secure Shell'''
def supports(self, url, urldata, d):
return __pattern__.match(url) != None
def localpath(self, url, urldata, d):
m = __pattern__.match(url)
path = m.group('path')
host = m.group('host')
lpath = os.path.join(data.getVar('DL_DIR', d, True), host, os.path.basename(path))
return lpath
def go(self, url, urldata, d):
dldir = data.getVar('DL_DIR', d, 1)
m = __pattern__.match(url)
path = m.group('path')
host = m.group('host')
port = m.group('port')
user = m.group('user')
password = m.group('pass')
ldir = os.path.join(dldir, host)
lpath = os.path.join(ldir, os.path.basename(path))
if not os.path.exists(ldir):
os.makedirs(ldir)
if port:
port = '-P %s' % port
else:
port = ''
if user:
fr = user
if password:
fr += ':%s' % password
fr += '@%s' % host
else:
fr = host
fr += ':%s' % path
import commands
cmd = 'scp -B -r %s %s %s/' % (
port,
commands.mkarg(fr),
commands.mkarg(ldir)
)
(exitstatus, output) = commands.getstatusoutput(cmd)
if exitstatus != 0:
print output
raise FetchError('Unable to fetch %s' % url)

View File

@@ -1,109 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
This implementation is for svk. It is based on the svn implementation
"""
# Copyright (C) 2006 Holger Hans Peter Freyther
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import MissingParameterError
class Svk(Fetch):
"""Class to fetch a module or modules from svk repositories"""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with cvs.
"""
return ud.type in ['svk']
def localpath(self, url, ud, d):
if not "module" in ud.parm:
raise MissingParameterError("svk method needs a 'module' parameter")
else:
ud.module = ud.parm["module"]
ud.revision = ""
if 'rev' in ud.parm:
ud.revision = ud.parm['rev']
ud.localfile = data.expand('%s_%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision, ud.date), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def forcefetch(self, url, ud, d):
if (ud.date == "now"):
return True
return False
def go(self, loc, ud, d):
"""Fetch urls"""
if not self.forcefetch(loc, ud, d) and Fetch.try_mirror(d, ud.localfile):
return
svkroot = ud.host + ud.path
svkcmd = "svk co -r {%s} %s/%s" % (ud.date, svkroot, ud.module)
if ud.revision:
svkcmd = "svk co -r %s %s/%s" % (ud.revision, svkroot, ud.module)
# create temp directory
localdata = data.createCopy(d)
data.update_data(localdata)
bb.msg.debug(2, bb.msg.domain.Fetcher, "Fetch: creating temporary directory")
bb.mkdirhier(data.expand('${WORKDIR}', localdata))
data.setVar('TMPBASE', data.expand('${WORKDIR}/oesvk.XXXXXX', localdata), localdata)
tmppipe = os.popen(data.getVar('MKTEMPDIRCMD', localdata, 1) or "false")
tmpfile = tmppipe.readline().strip()
if not tmpfile:
bb.msg.error(bb.msg.domain.Fetcher, "Fetch: unable to create temporary directory.. make sure 'mktemp' is in the PATH.")
raise FetchError(ud.module)
# check out sources there
os.chdir(tmpfile)
bb.msg.note(1, bb.msg.domain.Fetcher, "Fetch " + loc)
bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % svkcmd)
myret = os.system(svkcmd)
if myret != 0:
try:
os.rmdir(tmpfile)
except OSError:
pass
raise FetchError(ud.module)
os.chdir(os.path.join(tmpfile, os.path.dirname(ud.module)))
# tar them up to a defined filename
myret = os.system("tar -czf %s %s" % (ud.localpath, os.path.basename(ud.module)))
if myret != 0:
try:
os.unlink(ud.localpath)
except OSError:
pass
raise FetchError(ud.module)
# cleanup
os.system('rm -rf %s' % tmpfile)

View File

@@ -1,206 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementation for svn.
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2004 Marcin Juszkiewicz
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
import sys
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import MissingParameterError
from bb.fetch import runfetchcmd
class Svn(Fetch):
"""Class to fetch a module or modules from svn repositories"""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with svn.
"""
return ud.type in ['svn']
def localpath(self, url, ud, d):
if not "module" in ud.parm:
raise MissingParameterError("svn method needs a 'module' parameter")
ud.module = ud.parm["module"]
# Create paths to svn checkouts
relpath = ud.path
if relpath.startswith('/'):
# Remove leading slash as os.path.join can't cope
relpath = relpath[1:]
ud.pkgdir = os.path.join(data.expand('${SVNDIR}', d), ud.host, relpath)
ud.moddir = os.path.join(ud.pkgdir, ud.module)
if 'rev' in ud.parm:
ud.date = ""
ud.revision = ud.parm['rev']
elif 'date' in ud.date:
ud.date = ud.parm['date']
ud.revision = ""
else:
#
# ***Nasty hack***
# If DATE in unexpanded PV, use ud.date (which is set from SRCDATE)
# Should warn people to switch to SRCREV here
#
pv = data.getVar("PV", d, 0)
if "DATE" in pv:
ud.revision = ""
else:
rev = Fetch.srcrev_internal_helper(ud, d)
if rev is True:
ud.revision = self.latest_revision(url, ud, d)
ud.date = ""
elif rev:
ud.revision = rev
ud.date = ""
else:
ud.revision = ""
ud.localfile = data.expand('%s_%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision, ud.date), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def _buildsvncommand(self, ud, d, command):
"""
Build up an svn commandline based on ud
command is "fetch", "update", "info"
"""
basecmd = data.expand('${FETCHCMD_svn}', d)
proto = "svn"
if "proto" in ud.parm:
proto = ud.parm["proto"]
svn_rsh = None
if proto == "svn+ssh" and "rsh" in ud.parm:
svn_rsh = ud.parm["rsh"]
svnroot = ud.host + ud.path
# either use the revision, or SRCDATE in braces,
options = []
if ud.user:
options.append("--username %s" % ud.user)
if ud.pswd:
options.append("--password %s" % ud.pswd)
if command is "info":
svncmd = "%s info %s %s://%s/%s/" % (basecmd, " ".join(options), proto, svnroot, ud.module)
else:
suffix = ""
if ud.revision:
options.append("-r %s" % ud.revision)
suffix = "@%s" % (ud.revision)
elif ud.date:
options.append("-r {%s}" % ud.date)
if command is "fetch":
svncmd = "%s co %s %s://%s/%s%s %s" % (basecmd, " ".join(options), proto, svnroot, ud.module, suffix, ud.module)
elif command is "update":
svncmd = "%s update %s" % (basecmd, " ".join(options))
else:
raise FetchError("Invalid svn command %s" % command)
if svn_rsh:
svncmd = "svn_RSH=\"%s\" %s" % (svn_rsh, svncmd)
return svncmd
def go(self, loc, ud, d):
"""Fetch url"""
# try to use the tarball stash
if Fetch.try_mirror(d, ud.localfile):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists or was mirrored, skipping svn checkout." % ud.localpath)
return
bb.msg.debug(2, bb.msg.domain.Fetcher, "Fetch: checking for module directory '" + ud.moddir + "'")
if os.access(os.path.join(ud.moddir, '.svn'), os.R_OK):
svnupdatecmd = self._buildsvncommand(ud, d, "update")
bb.msg.note(1, bb.msg.domain.Fetcher, "Update " + loc)
# update sources there
os.chdir(ud.moddir)
bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % svnupdatecmd)
runfetchcmd(svnupdatecmd, d)
else:
svnfetchcmd = self._buildsvncommand(ud, d, "fetch")
bb.msg.note(1, bb.msg.domain.Fetcher, "Fetch " + loc)
# check out sources there
bb.mkdirhier(ud.pkgdir)
os.chdir(ud.pkgdir)
bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % svnfetchcmd)
runfetchcmd(svnfetchcmd, d)
os.chdir(ud.pkgdir)
# tar them up to a defined filename
try:
runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d)
except:
t, v, tb = sys.exc_info()
try:
os.unlink(ud.localpath)
except OSError:
pass
raise t, v, tb
def suppports_srcrev(self):
return True
def _revision_key(self, url, ud, d):
"""
Return a unique key for the url
"""
return "svn:" + ud.moddir
def _latest_revision(self, url, ud, d):
"""
Return the latest upstream revision number
"""
bb.msg.debug(2, bb.msg.domain.Fetcher, "SVN fetcher hitting network for %s" % url)
output = runfetchcmd("LANG=C LC_ALL=C " + self._buildsvncommand(ud, d, "info"), d, True)
revision = None
for line in output.splitlines():
if "Last Changed Rev" in line:
revision = line.split(":")[1].strip()
return revision
def _sortable_revision(self, url, ud, d):
"""
Return a sortable revision number which in our case is the revision number
"""
return self._build_revision(url, ud, d)
def _build_revision(self, url, ud, d):
return ud.revision

View File

@@ -1,130 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import uri_replace
class Wget(Fetch):
"""Class to fetch urls via 'wget'"""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with cvs.
"""
return ud.type in ['http','https','ftp']
def localpath(self, url, ud, d):
url = bb.encodeurl([ud.type, ud.host, ud.path, ud.user, ud.pswd, {}])
ud.basename = os.path.basename(ud.path)
ud.localfile = data.expand(os.path.basename(url), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def go(self, uri, ud, d, checkonly = False):
"""Fetch urls"""
def fetch_uri(uri, ud, d):
if checkonly:
fetchcmd = data.getVar("CHECKCOMMAND", d, 1)
elif os.path.exists(ud.localpath):
# file exists, but we didnt complete it.. trying again..
fetchcmd = data.getVar("RESUMECOMMAND", d, 1)
else:
fetchcmd = data.getVar("FETCHCOMMAND", d, 1)
uri = uri.split(";")[0]
uri_decoded = list(bb.decodeurl(uri))
uri_type = uri_decoded[0]
uri_host = uri_decoded[1]
bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri)
fetchcmd = fetchcmd.replace("${URI}", uri.split(";")[0])
fetchcmd = fetchcmd.replace("${FILE}", ud.basename)
httpproxy = None
ftpproxy = None
if uri_type == 'http':
httpproxy = data.getVar("HTTP_PROXY", d, True)
httpproxy_ignore = (data.getVar("HTTP_PROXY_IGNORE", d, True) or "").split()
for p in httpproxy_ignore:
if uri_host.endswith(p):
httpproxy = None
break
if uri_type == 'ftp':
ftpproxy = data.getVar("FTP_PROXY", d, True)
ftpproxy_ignore = (data.getVar("HTTP_PROXY_IGNORE", d, True) or "").split()
for p in ftpproxy_ignore:
if uri_host.endswith(p):
ftpproxy = None
break
if httpproxy:
fetchcmd = "http_proxy=" + httpproxy + " " + fetchcmd
if ftpproxy:
fetchcmd = "ftp_proxy=" + ftpproxy + " " + fetchcmd
bb.msg.debug(2, bb.msg.domain.Fetcher, "executing " + fetchcmd)
ret = os.system(fetchcmd)
if ret != 0:
return False
# Sanity check since wget can pretend it succeed when it didn't
# Also, this used to happen if sourceforge sent us to the mirror page
if not os.path.exists(ud.localpath) and not checkonly:
bb.msg.debug(2, bb.msg.domain.Fetcher, "The fetch command for %s returned success but %s doesn't exist?..." % (uri, ud.localpath))
return False
return True
localdata = data.createCopy(d)
data.setVar('OVERRIDES', "wget:" + data.getVar('OVERRIDES', localdata), localdata)
data.update_data(localdata)
premirrors = [ i.split() for i in (data.getVar('PREMIRRORS', localdata, 1) or "").split('\n') if i ]
for (find, replace) in premirrors:
newuri = uri_replace(uri, find, replace, d)
if newuri != uri:
if fetch_uri(newuri, ud, localdata):
return True
if fetch_uri(uri, ud, localdata):
return True
# try mirrors
mirrors = [ i.split() for i in (data.getVar('MIRRORS', localdata, 1) or "").split('\n') if i ]
for (find, replace) in mirrors:
newuri = uri_replace(uri, find, replace, d)
if newuri != uri:
if fetch_uri(newuri, ud, localdata):
return True
raise FetchError(uri)
def checkstatus(self, uri, ud, d):
return self.go(uri, ud, d, True)

View File

@@ -1,144 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os, sys
import bb, bb.data
def getfields(line):
fields = {}
fieldmap = ( "pkg", "src", "dest", "type", "mode", "uid", "gid", "major", "minor", "start", "inc", "count" )
for f in xrange(len(fieldmap)):
fields[fieldmap[f]] = None
if not line:
return None
splitline = line.split()
if not len(splitline):
return None
try:
for f in xrange(len(fieldmap)):
if splitline[f] == '-':
continue
fields[fieldmap[f]] = splitline[f]
except IndexError:
pass
return fields
def parse (mfile, d):
manifest = []
while 1:
line = mfile.readline()
if not line:
break
if line.startswith("#"):
continue
fields = getfields(line)
if not fields:
continue
manifest.append(fields)
return manifest
def emit (func, manifest, d):
#str = "%s () {\n" % func
str = ""
for line in manifest:
emittedline = emit_line(func, line, d)
if not emittedline:
continue
str += emittedline + "\n"
# str += "}\n"
return str
def mangle (func, line, d):
import copy
newline = copy.copy(line)
src = bb.data.expand(newline["src"], d)
if src:
if not os.path.isabs(src):
src = "${WORKDIR}/" + src
dest = newline["dest"]
if not dest:
return
if dest.startswith("/"):
dest = dest[1:]
if func is "do_install":
dest = "${D}/" + dest
elif func is "do_populate":
dest = "${WORKDIR}/install/" + newline["pkg"] + "/" + dest
elif func is "do_stage":
varmap = {}
varmap["${bindir}"] = "${STAGING_DIR}/${HOST_SYS}/bin"
varmap["${libdir}"] = "${STAGING_DIR}/${HOST_SYS}/lib"
varmap["${includedir}"] = "${STAGING_DIR}/${HOST_SYS}/include"
varmap["${datadir}"] = "${STAGING_DATADIR}"
matched = 0
for key in varmap.keys():
if dest.startswith(key):
dest = varmap[key] + "/" + dest[len(key):]
matched = 1
if not matched:
newline = None
return
else:
newline = None
return
newline["src"] = src
newline["dest"] = dest
return newline
def emit_line (func, line, d):
import copy
newline = copy.deepcopy(line)
newline = mangle(func, newline, d)
if not newline:
return None
str = ""
type = newline["type"]
mode = newline["mode"]
src = newline["src"]
dest = newline["dest"]
if type is "d":
str = "install -d "
if mode:
str += "-m %s " % mode
str += dest
elif type is "f":
if not src:
return None
if dest.endswith("/"):
str = "install -d "
str += dest + "\n"
str += "install "
else:
str = "install -D "
if mode:
str += "-m %s " % mode
str += src + " " + dest
del newline
return str

View File

@@ -1,84 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
#
# Copyright (C) 2006 Holger Hans Peter Freyther
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
What is a method pool?
BitBake has a global method scope where .bb, .inc and .bbclass
files can install methods. These methods are parsed from strings.
To avoid recompiling and executing these string we introduce
a method pool to do this task.
This pool will be used to compile and execute the functions. It
will be smart enough to
"""
from bb.utils import better_compile, better_exec
from bb import error
# A dict of modules we have handled
# it is the number of .bbclasses + x in size
_parsed_methods = { }
_parsed_fns = { }
def insert_method(modulename, code, fn):
"""
Add code of a module should be added. The methods
will be simply added, no checking will be done
"""
comp = better_compile(code, "<bb>", fn )
better_exec(comp, __builtins__, code, fn)
# now some instrumentation
code = comp.co_names
for name in code:
if name in ['None', 'False']:
continue
elif name in _parsed_fns and not _parsed_fns[name] == modulename:
error( "Error Method already seen: %s in' %s' now in '%s'" % (name, _parsed_fns[name], modulename))
else:
_parsed_fns[name] = modulename
def check_insert_method(modulename, code, fn):
"""
Add the code if it wasnt added before. The module
name will be used for that
Variables:
@modulename a short name e.g. base.bbclass
@code The actual python code
@fn The filename from the outer file
"""
if not modulename in _parsed_methods:
return insert_method(modulename, code, fn)
_parsed_methods[modulename] = 1
def parsed_module(modulename):
"""
Inform me file xyz was parsed
"""
return modulename in _parsed_methods
def get_parsed_dict():
"""
shortcut
"""
return _parsed_methods

View File

@@ -1,125 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'msg' implementation
Message handling infrastructure for bitbake
"""
# Copyright (C) 2006 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import sys, bb
from bb import event
debug_level = {}
verbose = False
domain = bb.utils.Enum(
'Build',
'Cache',
'Collection',
'Data',
'Depends',
'Fetcher',
'Parsing',
'PersistData',
'Provider',
'RunQueue',
'TaskData',
'Util')
class MsgBase(bb.event.Event):
"""Base class for messages"""
def __init__(self, msg, d ):
self._message = msg
event.Event.__init__(self, d)
class MsgDebug(MsgBase):
"""Debug Message"""
class MsgNote(MsgBase):
"""Note Message"""
class MsgWarn(MsgBase):
"""Warning Message"""
class MsgError(MsgBase):
"""Error Message"""
class MsgFatal(MsgBase):
"""Fatal Message"""
class MsgPlain(MsgBase):
"""General output"""
#
# Message control functions
#
def set_debug_level(level):
bb.msg.debug_level = {}
for domain in bb.msg.domain:
bb.msg.debug_level[domain] = level
bb.msg.debug_level['default'] = level
def set_verbose(level):
bb.msg.verbose = level
def set_debug_domains(domains):
for domain in domains:
found = False
for ddomain in bb.msg.domain:
if domain == str(ddomain):
bb.msg.debug_level[ddomain] = bb.msg.debug_level[ddomain] + 1
found = True
if not found:
bb.msg.warn(None, "Logging domain %s is not valid, ignoring" % domain)
#
# Message handling functions
#
def debug(level, domain, msg, fn = None):
if not domain:
domain = 'default'
if debug_level[domain] >= level:
bb.event.fire(MsgDebug(msg, None))
def note(level, domain, msg, fn = None):
if not domain:
domain = 'default'
if level == 1 or verbose or debug_level[domain] >= 1:
bb.event.fire(MsgNote(msg, None))
def warn(domain, msg, fn = None):
bb.event.fire(MsgWarn(msg, None))
def error(domain, msg, fn = None):
bb.event.fire(MsgError(msg, None))
print 'ERROR: ' + msg
def fatal(domain, msg, fn = None):
bb.event.fire(MsgFatal(msg, None))
print 'FATAL: ' + msg
sys.exit(1)
def plain(msg, fn = None):
bb.event.fire(MsgPlain(msg, None))

View File

@@ -1,84 +0,0 @@
"""
BitBake Parsers
File parsers for the BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2003, 2004 Phil Blundell
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
__all__ = [ 'ParseError', 'SkipPackage', 'cached_mtime', 'mark_dependency',
'supports', 'handle', 'init' ]
handlers = []
import bb, os
class ParseError(Exception):
"""Exception raised when parsing fails"""
class SkipPackage(Exception):
"""Exception raised to skip this package"""
__mtime_cache = {}
def cached_mtime(f):
if not __mtime_cache.has_key(f):
__mtime_cache[f] = os.stat(f)[8]
return __mtime_cache[f]
def cached_mtime_noerror(f):
if not __mtime_cache.has_key(f):
try:
__mtime_cache[f] = os.stat(f)[8]
except OSError:
return 0
return __mtime_cache[f]
def update_mtime(f):
__mtime_cache[f] = os.stat(f)[8]
return __mtime_cache[f]
def mark_dependency(d, f):
if f.startswith('./'):
f = "%s/%s" % (os.getcwd(), f[2:])
deps = bb.data.getVar('__depends', d) or []
deps.append( (f, cached_mtime(f)) )
bb.data.setVar('__depends', deps, d)
def supports(fn, data):
"""Returns true if we have a handler for this file, false otherwise"""
for h in handlers:
if h['supports'](fn, data):
return 1
return 0
def handle(fn, data, include = 0):
"""Call the handler that is appropriate for this file"""
for h in handlers:
if h['supports'](fn, data):
return h['handle'](fn, data, include)
raise ParseError("%s is not a BitBake file" % fn)
def init(fn, data):
for h in handlers:
if h['supports'](fn):
return h['init'](data)
from parse_py import __version__, ConfHandler, BBHandler

View File

@@ -1,401 +0,0 @@
#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
class for handling .bb files
Reads a .bb file and obtains its metadata
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2003, 2004 Phil Blundell
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import re, bb, os, sys, time, string
import bb.fetch, bb.build, bb.utils
from bb import data, fetch, methodpool
from ConfHandler import include, localpath, obtain, init
from bb.parse import ParseError
__func_start_regexp__ = re.compile( r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>[\w\.\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" )
__inherit_regexp__ = re.compile( r"inherit\s+(.+)" )
__export_func_regexp__ = re.compile( r"EXPORT_FUNCTIONS\s+(.+)" )
__addtask_regexp__ = re.compile("addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*")
__addhandler_regexp__ = re.compile( r"addhandler\s+(.+)" )
__def_regexp__ = re.compile( r"def\s+(\w+).*:" )
__python_func_regexp__ = re.compile( r"(\s+.*)|(^$)" )
__word__ = re.compile(r"\S+")
__infunc__ = ""
__inpython__ = False
__body__ = []
__classname__ = ""
classes = [ None, ]
# We need to indicate EOF to the feeder. This code is so messy that
# factoring it out to a close_parse_file method is out of question.
# We will use the IN_PYTHON_EOF as an indicator to just close the method
#
# The two parts using it are tightly integrated anyway
IN_PYTHON_EOF = -9999999999999
__parsed_methods__ = methodpool.get_parsed_dict()
def supports(fn, d):
localfn = localpath(fn, d)
return localfn[-3:] == ".bb" or localfn[-8:] == ".bbclass" or localfn[-4:] == ".inc"
def inherit(files, d):
__inherit_cache = data.getVar('__inherit_cache', d) or []
fn = ""
lineno = 0
files = data.expand(files, d)
for file in files:
if file[0] != "/" and file[-8:] != ".bbclass":
file = os.path.join('classes', '%s.bbclass' % file)
if not file in __inherit_cache:
bb.msg.debug(2, bb.msg.domain.Parsing, "BB %s:%d: inheriting %s" % (fn, lineno, file))
__inherit_cache.append( file )
data.setVar('__inherit_cache', __inherit_cache, d)
include(fn, file, d, "inherit")
__inherit_cache = data.getVar('__inherit_cache', d) or []
def finalise(fn, d):
data.expandKeys(d)
data.update_data(d)
anonqueue = data.getVar("__anonqueue", d, 1) or []
body = [x['content'] for x in anonqueue]
flag = { 'python' : 1, 'func' : 1 }
data.setVar("__anonfunc", "\n".join(body), d)
data.setVarFlags("__anonfunc", flag, d)
from bb import build
try:
t = data.getVar('T', d)
data.setVar('T', '${TMPDIR}/anonfunc/', d)
anonfuncs = data.getVar('__BBANONFUNCS', d) or []
code = ""
for f in anonfuncs:
code = code + " %s(d)\n" % f
data.setVar("__anonfunc", code, d)
build.exec_func("__anonfunc", d)
data.delVar('T', d)
if t:
data.setVar('T', t, d)
except Exception, e:
bb.msg.debug(1, bb.msg.domain.Parsing, "Exception when executing anonymous function: %s" % e)
raise
data.delVar("__anonqueue", d)
data.delVar("__anonfunc", d)
data.update_data(d)
all_handlers = {}
for var in data.getVar('__BBHANDLERS', d) or []:
# try to add the handler
handler = data.getVar(var,d)
bb.event.register(var, handler)
tasklist = data.getVar('__BBTASKS', d) or []
bb.build.add_tasks(tasklist, d)
bb.event.fire(bb.event.RecipeParsed(fn, d))
def handle(fn, d, include = 0):
global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __infunc__, __body__, __residue__
__body__ = []
__infunc__ = ""
__classname__ = ""
__residue__ = []
if include == 0:
bb.msg.debug(2, bb.msg.domain.Parsing, "BB " + fn + ": handle(data)")
else:
bb.msg.debug(2, bb.msg.domain.Parsing, "BB " + fn + ": handle(data, include)")
(root, ext) = os.path.splitext(os.path.basename(fn))
base_name = "%s%s" % (root,ext)
init(d)
if ext == ".bbclass":
__classname__ = root
classes.append(__classname__)
__inherit_cache = data.getVar('__inherit_cache', d) or []
if not fn in __inherit_cache:
__inherit_cache.append(fn)
data.setVar('__inherit_cache', __inherit_cache, d)
if include != 0:
oldfile = data.getVar('FILE', d)
else:
oldfile = None
fn = obtain(fn, d)
bbpath = (data.getVar('BBPATH', d, 1) or '').split(':')
if not os.path.isabs(fn):
f = None
for p in bbpath:
j = os.path.join(p, fn)
if os.access(j, os.R_OK):
abs_fn = j
f = open(j, 'r')
break
if f is None:
raise IOError("file %s not found" % fn)
else:
f = open(fn,'r')
abs_fn = fn
if include:
bb.parse.mark_dependency(d, abs_fn)
if ext != ".bbclass":
data.setVar('FILE', fn, d)
lineno = 0
while 1:
lineno = lineno + 1
s = f.readline()
if not s: break
s = s.rstrip()
feeder(lineno, s, fn, base_name, d)
if __inpython__:
# add a blank line to close out any python definition
feeder(IN_PYTHON_EOF, "", fn, base_name, d)
if ext == ".bbclass":
classes.remove(__classname__)
else:
if include == 0:
multi = data.getVar('BBCLASSEXTEND', d, 1)
if multi:
based = bb.data.createCopy(d)
finalise(fn, based)
darray = {"": based}
for cls in multi.split():
pn = data.getVar('PN', d, True)
based = bb.data.createCopy(d)
data.setVar('PN', pn + '-' + cls, based)
inherit([cls], based)
finalise(fn, based)
darray[cls] = based
return darray
else:
finalise(fn, d)
bbpath.pop(0)
if oldfile:
bb.data.setVar("FILE", oldfile, d)
# we have parsed the bb class now
if ext == ".bbclass" or ext == ".inc":
__parsed_methods__[base_name] = 1
return d
def feeder(lineno, s, fn, root, d):
global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __def_regexp__, __python_func_regexp__, __inpython__,__infunc__, __body__, classes, bb, __residue__
if __infunc__:
if s == '}':
__body__.append('')
if __infunc__ == "__anonymous":
funcname = ("__anon_%s_%s" % (lineno, fn.translate(string.maketrans('/.+-', '____'))))
if not funcname in methodpool._parsed_fns:
text = "def %s(d):\n" % (funcname) + '\n'.join(__body__)
methodpool.insert_method(funcname, text, fn)
anonfuncs = data.getVar('__BBANONFUNCS', d) or []
anonfuncs.append(funcname)
data.setVar('__BBANONFUNCS', anonfuncs, d)
else:
data.setVarFlag(__infunc__, "func", 1, d)
data.setVar(__infunc__, '\n'.join(__body__), d)
__infunc__ = ""
__body__ = []
else:
__body__.append(s)
return
if __inpython__:
m = __python_func_regexp__.match(s)
if m and lineno != IN_PYTHON_EOF:
__body__.append(s)
return
else:
# Note we will add root to parsedmethods after having parse
# 'this' file. This means we will not parse methods from
# bb classes twice
if not root in __parsed_methods__:
text = '\n'.join(__body__)
methodpool.insert_method( root, text, fn )
__body__ = []
__inpython__ = False
if lineno == IN_PYTHON_EOF:
return
# fall through
if s == '' or s[0] == '#': return # skip comments and empty lines
if s[-1] == '\\':
__residue__.append(s[:-1])
return
s = "".join(__residue__) + s
__residue__ = []
m = __func_start_regexp__.match(s)
if m:
__infunc__ = m.group("func") or "__anonymous"
key = __infunc__
if data.getVar(key, d):
# clean up old version of this piece of metadata, as its
# flags could cause problems
data.setVarFlag(key, 'python', None, d)
data.setVarFlag(key, 'fakeroot', None, d)
if m.group("py") is not None:
data.setVarFlag(key, "python", "1", d)
else:
data.delVarFlag(key, "python", d)
if m.group("fr") is not None:
data.setVarFlag(key, "fakeroot", "1", d)
else:
data.delVarFlag(key, "fakeroot", d)
return
m = __def_regexp__.match(s)
if m:
__body__.append(s)
__inpython__ = True
return
m = __export_func_regexp__.match(s)
if m:
fns = m.group(1)
n = __word__.findall(fns)
for f in n:
allvars = []
allvars.append(f)
allvars.append(classes[-1] + "_" + f)
vars = [[ allvars[0], allvars[1] ]]
if len(classes) > 1 and classes[-2] is not None:
allvars.append(classes[-2] + "_" + f)
vars = []
vars.append([allvars[2], allvars[1]])
vars.append([allvars[0], allvars[2]])
for (var, calledvar) in vars:
if data.getVar(var, d) and not data.getVarFlag(var, 'export_func', d):
continue
if data.getVar(var, d):
data.setVarFlag(var, 'python', None, d)
data.setVarFlag(var, 'func', None, d)
for flag in [ "func", "python" ]:
if data.getVarFlag(calledvar, flag, d):
data.setVarFlag(var, flag, data.getVarFlag(calledvar, flag, d), d)
for flag in [ "dirs" ]:
if data.getVarFlag(var, flag, d):
data.setVarFlag(calledvar, flag, data.getVarFlag(var, flag, d), d)
if data.getVarFlag(calledvar, "python", d):
data.setVar(var, "\tbb.build.exec_func('" + calledvar + "', d)\n", d)
else:
data.setVar(var, "\t" + calledvar + "\n", d)
data.setVarFlag(var, 'export_func', '1', d)
return
m = __addtask_regexp__.match(s)
if m:
func = m.group("func")
before = m.group("before")
after = m.group("after")
if func is None:
return
var = "do_" + func
data.setVarFlag(var, "task", 1, d)
bbtasks = data.getVar('__BBTASKS', d) or []
if not var in bbtasks:
bbtasks.append(var)
data.setVar('__BBTASKS', bbtasks, d)
existing = data.getVarFlag(var, "deps", d) or []
if after is not None:
# set up deps for function
for entry in after.split():
if entry not in existing:
existing.append(entry)
data.setVarFlag(var, "deps", existing, d)
if before is not None:
# set up things that depend on this func
for entry in before.split():
existing = data.getVarFlag(entry, "deps", d) or []
if var not in existing:
data.setVarFlag(entry, "deps", [var] + existing, d)
return
m = __addhandler_regexp__.match(s)
if m:
fns = m.group(1)
hs = __word__.findall(fns)
bbhands = data.getVar('__BBHANDLERS', d) or []
for h in hs:
bbhands.append(h)
data.setVarFlag(h, "handler", 1, d)
data.setVar('__BBHANDLERS', bbhands, d)
return
m = __inherit_regexp__.match(s)
if m:
files = m.group(1)
n = __word__.findall(files)
inherit(n, d)
return
from bb.parse import ConfHandler
return ConfHandler.feeder(lineno, s, fn, d)
__pkgsplit_cache__={}
def vars_from_file(mypkg, d):
if not mypkg:
return (None, None, None)
if mypkg in __pkgsplit_cache__:
return __pkgsplit_cache__[mypkg]
myfile = os.path.splitext(os.path.basename(mypkg))
parts = myfile[0].split('_')
__pkgsplit_cache__[mypkg] = parts
if len(parts) > 3:
raise ParseError("Unable to generate default variables from the filename: %s (too many underscores)" % mypkg)
exp = 3 - len(parts)
tmplist = []
while exp != 0:
exp -= 1
tmplist.append(None)
parts.extend(tmplist)
return parts
# Add us to the handlers list
from bb.parse import handlers
handlers.append({'supports': supports, 'handle': handle, 'init': init})
del handlers

View File

@@ -1,234 +0,0 @@
#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
class for handling configuration data files
Reads a .conf file and obtains its metadata
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2003, 2004 Phil Blundell
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import re, bb.data, os, sys
from bb.parse import ParseError
#__config_regexp__ = re.compile( r"(?P<exp>export\s*)?(?P<var>[a-zA-Z0-9\-_+.${}]+)\s*(?P<colon>:)?(?P<ques>\?)?=\s*(?P<apo>['\"]?)(?P<value>.*)(?P=apo)$")
__config_regexp__ = re.compile( r"(?P<exp>export\s*)?(?P<var>[a-zA-Z0-9\-_+.${}/]+)(\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])?\s*((?P<colon>:=)|(?P<ques>\?=)|(?P<append>\+=)|(?P<prepend>=\+)|(?P<predot>=\.)|(?P<postdot>\.=)|=)\s*(?P<apo>['\"]?)(?P<value>.*)(?P=apo)$")
__include_regexp__ = re.compile( r"include\s+(.+)" )
__require_regexp__ = re.compile( r"require\s+(.+)" )
__export_regexp__ = re.compile( r"export\s+(.+)" )
def init(data):
if not bb.data.getVar('TOPDIR', data):
bb.data.setVar('TOPDIR', os.getcwd(), data)
if not bb.data.getVar('BBPATH', data):
bb.data.setVar('BBPATH', os.path.join(sys.prefix, 'share', 'bitbake'), data)
def supports(fn, d):
return localpath(fn, d)[-5:] == ".conf"
def localpath(fn, d):
if os.path.exists(fn):
return fn
if "://" not in fn:
return fn
localfn = None
try:
localfn = bb.fetch.localpath(fn, d, False)
except bb.MalformedUrl:
pass
if not localfn:
return fn
return localfn
def obtain(fn, data):
import sys, bb
fn = bb.data.expand(fn, data)
localfn = bb.data.expand(localpath(fn, data), data)
if localfn != fn:
dldir = bb.data.getVar('DL_DIR', data, 1)
if not dldir:
bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: DL_DIR not defined")
return localfn
bb.mkdirhier(dldir)
try:
bb.fetch.init([fn], data)
except bb.fetch.NoMethodError:
(type, value, traceback) = sys.exc_info()
bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: no method: %s" % value)
return localfn
try:
bb.fetch.go(data)
except bb.fetch.MissingParameterError:
(type, value, traceback) = sys.exc_info()
bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: missing parameters: %s" % value)
return localfn
except bb.fetch.FetchError:
(type, value, traceback) = sys.exc_info()
bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: failed: %s" % value)
return localfn
return localfn
def include(oldfn, fn, data, error_out):
"""
error_out If True a ParseError will be reaised if the to be included
"""
if oldfn == fn: # prevent infinate recursion
return None
import bb
fn = bb.data.expand(fn, data)
oldfn = bb.data.expand(oldfn, data)
if not os.path.isabs(fn):
dname = os.path.dirname(oldfn)
bbpath = "%s:%s" % (dname, bb.data.getVar("BBPATH", data, 1))
abs_fn = bb.which(bbpath, fn)
if abs_fn:
fn = abs_fn
from bb.parse import handle
try:
ret = handle(fn, data, True)
except IOError:
if error_out:
raise ParseError("Could not %(error_out)s file %(fn)s" % vars() )
bb.msg.debug(2, bb.msg.domain.Parsing, "CONF file '%s' not found" % fn)
def handle(fn, data, include = 0):
if include:
inc_string = "including"
else:
inc_string = "reading"
init(data)
if include == 0:
oldfile = None
else:
oldfile = bb.data.getVar('FILE', data)
fn = obtain(fn, data)
if not os.path.isabs(fn):
f = None
bbpath = bb.data.getVar("BBPATH", data, 1) or []
for p in bbpath.split(":"):
currname = os.path.join(p, fn)
if os.access(currname, os.R_OK):
f = open(currname, 'r')
abs_fn = currname
bb.msg.debug(2, bb.msg.domain.Parsing, "CONF %s %s" % (inc_string, currname))
break
if f is None:
raise IOError("file '%s' not found" % fn)
else:
f = open(fn,'r')
bb.msg.debug(1, bb.msg.domain.Parsing, "CONF %s %s" % (inc_string,fn))
abs_fn = fn
if include:
bb.parse.mark_dependency(data, abs_fn)
lineno = 0
bb.data.setVar('FILE', fn, data)
while 1:
lineno = lineno + 1
s = f.readline()
if not s: break
w = s.strip()
if not w: continue # skip empty lines
s = s.rstrip()
if s[0] == '#': continue # skip comments
while s[-1] == '\\':
s2 = f.readline()[:-1].strip()
lineno = lineno + 1
s = s[:-1] + s2
feeder(lineno, s, fn, data)
if oldfile:
bb.data.setVar('FILE', oldfile, data)
return data
def feeder(lineno, s, fn, data):
def getFunc(groupd, key, data):
if 'flag' in groupd and groupd['flag'] != None:
return bb.data.getVarFlag(key, groupd['flag'], data)
else:
return bb.data.getVar(key, data)
m = __config_regexp__.match(s)
if m:
groupd = m.groupdict()
key = groupd["var"]
if "exp" in groupd and groupd["exp"] != None:
bb.data.setVarFlag(key, "export", 1, data)
if "ques" in groupd and groupd["ques"] != None:
val = getFunc(groupd, key, data)
if val == None:
val = groupd["value"]
elif "colon" in groupd and groupd["colon"] != None:
e = data.createCopy()
bb.data.update_data(e)
val = bb.data.expand(groupd["value"], e)
elif "append" in groupd and groupd["append"] != None:
val = "%s %s" % ((getFunc(groupd, key, data) or ""), groupd["value"])
elif "prepend" in groupd and groupd["prepend"] != None:
val = "%s %s" % (groupd["value"], (getFunc(groupd, key, data) or ""))
elif "postdot" in groupd and groupd["postdot"] != None:
val = "%s%s" % ((getFunc(groupd, key, data) or ""), groupd["value"])
elif "predot" in groupd and groupd["predot"] != None:
val = "%s%s" % (groupd["value"], (getFunc(groupd, key, data) or ""))
else:
val = groupd["value"]
if 'flag' in groupd and groupd['flag'] != None:
bb.msg.debug(3, bb.msg.domain.Parsing, "setVarFlag(%s, %s, %s, data)" % (key, groupd['flag'], val))
bb.data.setVarFlag(key, groupd['flag'], val, data)
else:
bb.data.setVar(key, val, data)
return
m = __include_regexp__.match(s)
if m:
s = bb.data.expand(m.group(1), data)
bb.msg.debug(3, bb.msg.domain.Parsing, "CONF %s:%d: including %s" % (fn, lineno, s))
include(fn, s, data, False)
return
m = __require_regexp__.match(s)
if m:
s = bb.data.expand(m.group(1), data)
include(fn, s, data, "include required")
return
m = __export_regexp__.match(s)
if m:
bb.data.setVarFlag(m.group(1), "export", 1, data)
return
raise ParseError("%s:%d: unparsed line: '%s'" % (fn, lineno, s));
# Add us to the handlers list
from bb.parse import handlers
handlers.append({'supports': supports, 'handle': handle, 'init': init})
del handlers

View File

@@ -1,33 +0,0 @@
#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake Parsers
File parsers for the BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2003, 2004 Phil Blundell
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
__version__ = '1.0'
__all__ = [ 'ConfHandler', 'BBHandler']
import ConfHandler
import BBHandler

View File

@@ -1,121 +0,0 @@
# BitBake Persistent Data Store
#
# Copyright (C) 2007 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import bb, os
try:
import sqlite3
except ImportError:
try:
from pysqlite2 import dbapi2 as sqlite3
except ImportError:
bb.msg.fatal(bb.msg.domain.PersistData, "Importing sqlite3 and pysqlite2 failed, please install one of them. Python 2.5 or a 'python-pysqlite2' like package is likely to be what you need.")
sqlversion = sqlite3.sqlite_version_info
if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3):
bb.msg.fatal(bb.msg.domain.PersistData, "sqlite3 version 3.3.0 or later is required.")
class PersistData:
"""
BitBake Persistent Data Store
Used to store data in a central location such that other threads/tasks can
access them at some future date.
The "domain" is used as a key to isolate each data pool and in this
implementation corresponds to an SQL table. The SQL table consists of a
simple key and value pair.
Why sqlite? It handles all the locking issues for us.
"""
def __init__(self, d):
self.cachedir = bb.data.getVar("PERSISTENT_DIR", d, True) or bb.data.getVar("CACHE", d, True)
if self.cachedir in [None, '']:
bb.msg.fatal(bb.msg.domain.PersistData, "Please set the 'PERSISTENT_DIR' or 'CACHE' variable.")
try:
os.stat(self.cachedir)
except OSError:
bb.mkdirhier(self.cachedir)
self.cachefile = os.path.join(self.cachedir,"bb_persist_data.sqlite3")
bb.msg.debug(1, bb.msg.domain.PersistData, "Using '%s' as the persistent data cache" % self.cachefile)
self.connection = sqlite3.connect(self.cachefile, timeout=5, isolation_level=None)
def addDomain(self, domain):
"""
Should be called before any domain is used
Creates it if it doesn't exist.
"""
self.connection.execute("CREATE TABLE IF NOT EXISTS %s(key TEXT, value TEXT);" % domain)
def delDomain(self, domain):
"""
Removes a domain and all the data it contains
"""
self.connection.execute("DROP TABLE IF EXISTS %s;" % domain)
def getKeyValues(self, domain):
"""
Return a list of key + value pairs for a domain
"""
ret = {}
data = self.connection.execute("SELECT key, value from %s;" % domain)
for row in data:
ret[str(row[0])] = str(row[1])
return ret
def getValue(self, domain, key):
"""
Return the value of a key for a domain
"""
data = self.connection.execute("SELECT * from %s where key=?;" % domain, [key])
for row in data:
return row[1]
def setValue(self, domain, key, value):
"""
Sets the value of a key for a domain
"""
data = self.connection.execute("SELECT * from %s where key=?;" % domain, [key])
rows = 0
for row in data:
rows = rows + 1
if rows:
self._execute("UPDATE %s SET value=? WHERE key=?;" % domain, [value, key])
else:
self._execute("INSERT into %s(key, value) values (?, ?);" % domain, [key, value])
def delValue(self, domain, key):
"""
Deletes a key/value pair
"""
self._execute("DELETE from %s where key=?;" % domain, [key])
def _execute(self, *query):
while True:
try:
self.connection.execute(*query)
return
except sqlite3.OperationalError, e:
if 'database is locked' in str(e):
continue
raise

View File

@@ -1,315 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2003, 2004 Phil Blundell
# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
# Copyright (C) 2005 Holger Hans Peter Freyther
# Copyright (C) 2005 ROAD GmbH
# Copyright (C) 2006 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import re
from bb import data, utils
import bb
class NoProvider(Exception):
"""Exception raised when no provider of a build dependency can be found"""
class NoRProvider(Exception):
"""Exception raised when no provider of a runtime dependency can be found"""
def sortPriorities(pn, dataCache, pkg_pn = None):
"""
Reorder pkg_pn by file priority and default preference
"""
if not pkg_pn:
pkg_pn = dataCache.pkg_pn
files = pkg_pn[pn]
priorities = {}
for f in files:
priority = dataCache.bbfile_priority[f]
preference = dataCache.pkg_dp[f]
if priority not in priorities:
priorities[priority] = {}
if preference not in priorities[priority]:
priorities[priority][preference] = []
priorities[priority][preference].append(f)
pri_list = priorities.keys()
pri_list.sort(lambda a, b: a - b)
tmp_pn = []
for pri in pri_list:
pref_list = priorities[pri].keys()
pref_list.sort(lambda a, b: b - a)
tmp_pref = []
for pref in pref_list:
tmp_pref.extend(priorities[pri][pref])
tmp_pn = [tmp_pref] + tmp_pn
return tmp_pn
def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
"""
Find the first provider in pkg_pn with a PREFERRED_VERSION set.
"""
preferred_file = None
preferred_ver = None
localdata = data.createCopy(cfgData)
bb.data.setVar('OVERRIDES', "pn-%s:%s:%s" % (pn, pn, data.getVar('OVERRIDES', localdata)), localdata)
bb.data.update_data(localdata)
preferred_v = bb.data.getVar('PREFERRED_VERSION_%s' % pn, localdata, True)
if preferred_v:
m = re.match('(\d+:)*(.*)(_.*)*', preferred_v)
if m:
if m.group(1):
preferred_e = int(m.group(1)[:-1])
else:
preferred_e = None
preferred_v = m.group(2)
if m.group(3):
preferred_r = m.group(3)[1:]
else:
preferred_r = None
else:
preferred_e = None
preferred_r = None
for file_set in pkg_pn:
for f in file_set:
pe,pv,pr = dataCache.pkg_pepvpr[f]
if preferred_v == pv and (preferred_r == pr or preferred_r == None) and (preferred_e == pe or preferred_e == None):
preferred_file = f
preferred_ver = (pe, pv, pr)
break
if preferred_file:
break;
if preferred_r:
pv_str = '%s-%s' % (preferred_v, preferred_r)
else:
pv_str = preferred_v
if not (preferred_e is None):
pv_str = '%s:%s' % (preferred_e, pv_str)
itemstr = ""
if item:
itemstr = " (for item %s)" % item
if preferred_file is None:
bb.msg.note(1, bb.msg.domain.Provider, "preferred version %s of %s not available%s" % (pv_str, pn, itemstr))
else:
bb.msg.debug(1, bb.msg.domain.Provider, "selecting %s as PREFERRED_VERSION %s of package %s%s" % (preferred_file, pv_str, pn, itemstr))
return (preferred_ver, preferred_file)
def findLatestProvider(pn, cfgData, dataCache, file_set):
"""
Return the highest version of the providers in file_set.
Take default preferences into account.
"""
latest = None
latest_p = 0
latest_f = None
for file_name in file_set:
pe,pv,pr = dataCache.pkg_pepvpr[file_name]
dp = dataCache.pkg_dp[file_name]
if (latest is None) or ((latest_p == dp) and (utils.vercmp(latest, (pe, pv, pr)) < 0)) or (dp > latest_p):
latest = (pe, pv, pr)
latest_f = file_name
latest_p = dp
return (latest, latest_f)
def findBestProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
"""
If there is a PREFERRED_VERSION, find the highest-priority bbfile
providing that version. If not, find the latest version provided by
an bbfile in the highest-priority set.
"""
sortpkg_pn = sortPriorities(pn, dataCache, pkg_pn)
# Find the highest priority provider with a PREFERRED_VERSION set
(preferred_ver, preferred_file) = findPreferredProvider(pn, cfgData, dataCache, sortpkg_pn, item)
# Find the latest version of the highest priority provider
(latest, latest_f) = findLatestProvider(pn, cfgData, dataCache, sortpkg_pn[0])
if preferred_file is None:
preferred_file = latest_f
preferred_ver = latest
return (latest, latest_f, preferred_ver, preferred_file)
def _filterProviders(providers, item, cfgData, dataCache):
"""
Take a list of providers and filter/reorder according to the
environment variables and previous build results
"""
eligible = []
preferred_versions = {}
sortpkg_pn = {}
# The order of providers depends on the order of the files on the disk
# up to here. Sort pkg_pn to make dependency issues reproducible rather
# than effectively random.
providers.sort()
# Collate providers by PN
pkg_pn = {}
for p in providers:
pn = dataCache.pkg_fn[p]
if pn not in pkg_pn:
pkg_pn[pn] = []
pkg_pn[pn].append(p)
bb.msg.debug(1, bb.msg.domain.Provider, "providers for %s are: %s" % (item, pkg_pn.keys()))
# First add PREFERRED_VERSIONS
for pn in pkg_pn.keys():
sortpkg_pn[pn] = sortPriorities(pn, dataCache, pkg_pn)
preferred_versions[pn] = findPreferredProvider(pn, cfgData, dataCache, sortpkg_pn[pn], item)
if preferred_versions[pn][1]:
eligible.append(preferred_versions[pn][1])
# Now add latest verisons
for pn in pkg_pn.keys():
if pn in preferred_versions and preferred_versions[pn][1]:
continue
preferred_versions[pn] = findLatestProvider(pn, cfgData, dataCache, sortpkg_pn[pn][0])
eligible.append(preferred_versions[pn][1])
if len(eligible) == 0:
bb.msg.error(bb.msg.domain.Provider, "no eligible providers for %s" % item)
return 0
# If pn == item, give it a slight default preference
# This means PREFERRED_PROVIDER_foobar defaults to foobar if available
for p in providers:
pn = dataCache.pkg_fn[p]
if pn != item:
continue
(newvers, fn) = preferred_versions[pn]
if not fn in eligible:
continue
eligible.remove(fn)
eligible = [fn] + eligible
return eligible
def filterProviders(providers, item, cfgData, dataCache):
"""
Take a list of providers and filter/reorder according to the
environment variables and previous build results
Takes a "normal" target item
"""
eligible = _filterProviders(providers, item, cfgData, dataCache)
prefervar = bb.data.getVar('PREFERRED_PROVIDER_%s' % item, cfgData, 1)
if prefervar:
dataCache.preferred[item] = prefervar
foundUnique = False
if item in dataCache.preferred:
for p in eligible:
pn = dataCache.pkg_fn[p]
if dataCache.preferred[item] == pn:
bb.msg.note(2, bb.msg.domain.Provider, "selecting %s to satisfy %s due to PREFERRED_PROVIDERS" % (pn, item))
eligible.remove(p)
eligible = [p] + eligible
foundUnique = True
break
bb.msg.debug(1, bb.msg.domain.Provider, "sorted providers for %s are: %s" % (item, eligible))
return eligible, foundUnique
def filterProvidersRunTime(providers, item, cfgData, dataCache):
"""
Take a list of providers and filter/reorder according to the
environment variables and previous build results
Takes a "runtime" target item
"""
eligible = _filterProviders(providers, item, cfgData, dataCache)
# Should use dataCache.preferred here?
preferred = []
preferred_vars = []
for p in eligible:
pn = dataCache.pkg_fn[p]
provides = dataCache.pn_provides[pn]
for provide in provides:
bb.msg.note(2, bb.msg.domain.Provider, "checking PREFERRED_PROVIDER_%s" % (provide))
prefervar = bb.data.getVar('PREFERRED_PROVIDER_%s' % provide, cfgData, 1)
if prefervar == pn:
var = "PREFERRED_PROVIDER_%s = %s" % (provide, prefervar)
bb.msg.note(2, bb.msg.domain.Provider, "selecting %s to satisfy runtime %s due to %s" % (pn, item, var))
preferred_vars.append(var)
eligible.remove(p)
eligible = [p] + eligible
preferred.append(p)
break
numberPreferred = len(preferred)
if numberPreferred > 1:
bb.msg.error(bb.msg.domain.Provider, "Conflicting PREFERRED_PROVIDER entries were found which resulted in an attempt to select multiple providers (%s) for runtime dependecy %s\nThe entries resulting in this conflict were: %s" % (preferred, item, preferred_vars))
bb.msg.debug(1, bb.msg.domain.Provider, "sorted providers for %s are: %s" % (item, eligible))
return eligible, numberPreferred
regexp_cache = {}
def getRuntimeProviders(dataCache, rdepend):
"""
Return any providers of runtime dependency
"""
rproviders = []
if rdepend in dataCache.rproviders:
rproviders += dataCache.rproviders[rdepend]
if rdepend in dataCache.packages:
rproviders += dataCache.packages[rdepend]
if rproviders:
return rproviders
# Only search dynamic packages if we can't find anything in other variables
for pattern in dataCache.packages_dynamic:
pattern = pattern.replace('+', "\+")
if pattern in regexp_cache:
regexp = regexp_cache[pattern]
else:
try:
regexp = re.compile(pattern)
except:
bb.msg.error(bb.msg.domain.Provider, "Error parsing re expression: %s" % pattern)
raise
regexp_cache[pattern] = regexp
if regexp.match(rdepend):
rproviders += dataCache.packages_dynamic[pattern]
return rproviders

File diff suppressed because it is too large Load Diff

View File

@@ -1,824 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
##########################################################################
#
# Copyright (C) 2005-2006 Michael 'Mickey' Lauer <mickey@Vanille.de>
# Copyright (C) 2005-2006 Vanille Media
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
##########################################################################
#
# Thanks to:
# * Holger Freyther <zecke@handhelds.org>
# * Justin Patrin <papercrane@reversefold.com>
#
##########################################################################
"""
BitBake Shell
IDEAS:
* list defined tasks per package
* list classes
* toggle force
* command to reparse just one (or more) bbfile(s)
* automatic check if reparsing is necessary (inotify?)
* frontend for bb file manipulation
* more shell-like features:
- output control, i.e. pipe output into grep, sort, etc.
- job control, i.e. bring running commands into background and foreground
* start parsing in background right after startup
* ncurses interface
PROBLEMS:
* force doesn't always work
* readline completion for commands with more than one parameters
"""
##########################################################################
# Import and setup global variables
##########################################################################
try:
set
except NameError:
from sets import Set as set
import sys, os, readline, socket, httplib, urllib, commands, popen2, copy, shlex, Queue, fnmatch
from bb import data, parse, build, fatal, cache, taskdata, runqueue, providers as Providers
__version__ = "0.5.3.1"
__credits__ = """BitBake Shell Version %s (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de>
Type 'help' for more information, press CTRL-D to exit.""" % __version__
cmds = {}
leave_mainloop = False
last_exception = None
cooker = None
parsed = False
debug = os.environ.get( "BBSHELL_DEBUG", "" )
##########################################################################
# Class BitBakeShellCommands
##########################################################################
class BitBakeShellCommands:
"""This class contains the valid commands for the shell"""
def __init__( self, shell ):
"""Register all the commands"""
self._shell = shell
for attr in BitBakeShellCommands.__dict__:
if not attr.startswith( "_" ):
if attr.endswith( "_" ):
command = attr[:-1].lower()
else:
command = attr[:].lower()
method = getattr( BitBakeShellCommands, attr )
debugOut( "registering command '%s'" % command )
# scan number of arguments
usage = getattr( method, "usage", "" )
if usage != "<...>":
numArgs = len( usage.split() )
else:
numArgs = -1
shell.registerCommand( command, method, numArgs, "%s %s" % ( command, usage ), method.__doc__ )
def _checkParsed( self ):
if not parsed:
print "SHELL: This command needs to parse bbfiles..."
self.parse( None )
def _findProvider( self, item ):
self._checkParsed()
# Need to use taskData for this information
preferred = data.getVar( "PREFERRED_PROVIDER_%s" % item, cooker.configuration.data, 1 )
if not preferred: preferred = item
try:
lv, lf, pv, pf = Providers.findBestProvider(preferred, cooker.configuration.data, cooker.status)
except KeyError:
if item in cooker.status.providers:
pf = cooker.status.providers[item][0]
else:
pf = None
return pf
def alias( self, params ):
"""Register a new name for a command"""
new, old = params
if not old in cmds:
print "ERROR: Command '%s' not known" % old
else:
cmds[new] = cmds[old]
print "OK"
alias.usage = "<alias> <command>"
def buffer( self, params ):
"""Dump specified output buffer"""
index = params[0]
print self._shell.myout.buffer( int( index ) )
buffer.usage = "<index>"
def buffers( self, params ):
"""Show the available output buffers"""
commands = self._shell.myout.bufferedCommands()
if not commands:
print "SHELL: No buffered commands available yet. Start doing something."
else:
print "="*35, "Available Output Buffers", "="*27
for index, cmd in enumerate( commands ):
print "| %s %s" % ( str( index ).ljust( 3 ), cmd )
print "="*88
def build( self, params, cmd = "build" ):
"""Build a providee"""
global last_exception
globexpr = params[0]
self._checkParsed()
names = globfilter( cooker.status.pkg_pn.keys(), globexpr )
if len( names ) == 0: names = [ globexpr ]
print "SHELL: Building %s" % ' '.join( names )
td = taskdata.TaskData(cooker.configuration.abort)
localdata = data.createCopy(cooker.configuration.data)
data.update_data(localdata)
data.expandKeys(localdata)
try:
tasks = []
for name in names:
td.add_provider(localdata, cooker.status, name)
providers = td.get_provider(name)
if len(providers) == 0:
raise Providers.NoProvider
tasks.append([name, "do_%s" % cmd])
td.add_unresolved(localdata, cooker.status)
rq = runqueue.RunQueue(cooker, localdata, cooker.status, td, tasks)
rq.prepare_runqueue()
rq.execute_runqueue()
except Providers.NoProvider:
print "ERROR: No Provider"
last_exception = Providers.NoProvider
except runqueue.TaskFailure, fnids:
for fnid in fnids:
print "ERROR: '%s' failed" % td.fn_index[fnid]
last_exception = runqueue.TaskFailure
except build.EventException, e:
print "ERROR: Couldn't build '%s'" % names
last_exception = e
build.usage = "<providee>"
def clean( self, params ):
"""Clean a providee"""
self.build( params, "clean" )
clean.usage = "<providee>"
def compile( self, params ):
"""Execute 'compile' on a providee"""
self.build( params, "compile" )
compile.usage = "<providee>"
def configure( self, params ):
"""Execute 'configure' on a providee"""
self.build( params, "configure" )
configure.usage = "<providee>"
def install( self, params ):
"""Execute 'install' on a providee"""
self.build( params, "install" )
install.usage = "<providee>"
def edit( self, params ):
"""Call $EDITOR on a providee"""
name = params[0]
bbfile = self._findProvider( name )
if bbfile is not None:
os.system( "%s %s" % ( os.environ.get( "EDITOR", "vi" ), bbfile ) )
else:
print "ERROR: Nothing provides '%s'" % name
edit.usage = "<providee>"
def environment( self, params ):
"""Dump out the outer BitBake environment"""
cooker.showEnvironment()
def exit_( self, params ):
"""Leave the BitBake Shell"""
debugOut( "setting leave_mainloop to true" )
global leave_mainloop
leave_mainloop = True
def fetch( self, params ):
"""Fetch a providee"""
self.build( params, "fetch" )
fetch.usage = "<providee>"
def fileBuild( self, params, cmd = "build" ):
"""Parse and build a .bb file"""
global last_exception
name = params[0]
bf = completeFilePath( name )
print "SHELL: Calling '%s' on '%s'" % ( cmd, bf )
try:
cooker.buildFile(bf, cmd)
except parse.ParseError:
print "ERROR: Unable to open or parse '%s'" % bf
except build.EventException, e:
print "ERROR: Couldn't build '%s'" % name
last_exception = e
fileBuild.usage = "<bbfile>"
def fileClean( self, params ):
"""Clean a .bb file"""
self.fileBuild( params, "clean" )
fileClean.usage = "<bbfile>"
def fileEdit( self, params ):
"""Call $EDITOR on a .bb file"""
name = params[0]
os.system( "%s %s" % ( os.environ.get( "EDITOR", "vi" ), completeFilePath( name ) ) )
fileEdit.usage = "<bbfile>"
def fileRebuild( self, params ):
"""Rebuild (clean & build) a .bb file"""
self.fileBuild( params, "rebuild" )
fileRebuild.usage = "<bbfile>"
def fileReparse( self, params ):
"""(re)Parse a bb file"""
bbfile = params[0]
print "SHELL: Parsing '%s'" % bbfile
parse.update_mtime( bbfile )
cooker.bb_cache.cacheValidUpdate(bbfile)
fromCache = cooker.bb_cache.loadData(bbfile, cooker.configuration.data, cooker.status)
cooker.bb_cache.sync()
if False: #fromCache:
print "SHELL: File has not been updated, not reparsing"
else:
print "SHELL: Parsed"
fileReparse.usage = "<bbfile>"
def abort( self, params ):
"""Toggle abort task execution flag (see bitbake -k)"""
cooker.configuration.abort = not cooker.configuration.abort
print "SHELL: Abort Flag is now '%s'" % repr( cooker.configuration.abort )
def force( self, params ):
"""Toggle force task execution flag (see bitbake -f)"""
cooker.configuration.force = not cooker.configuration.force
print "SHELL: Force Flag is now '%s'" % repr( cooker.configuration.force )
def help( self, params ):
"""Show a comprehensive list of commands and their purpose"""
print "="*30, "Available Commands", "="*30
allcmds = cmds.keys()
allcmds.sort()
for cmd in allcmds:
function,numparams,usage,helptext = cmds[cmd]
print "| %s | %s" % (usage.ljust(30), helptext)
print "="*78
def lastError( self, params ):
"""Show the reason or log that was produced by the last BitBake event exception"""
if last_exception is None:
print "SHELL: No Errors yet (Phew)..."
else:
reason, event = last_exception.args
print "SHELL: Reason for the last error: '%s'" % reason
if ':' in reason:
msg, filename = reason.split( ':' )
filename = filename.strip()
print "SHELL: Dumping log file for last error:"
try:
print open( filename ).read()
except IOError:
print "ERROR: Couldn't open '%s'" % filename
def match( self, params ):
"""Dump all files or providers matching a glob expression"""
what, globexpr = params
if what == "files":
self._checkParsed()
for key in globfilter( cooker.status.pkg_fn.keys(), globexpr ): print key
elif what == "providers":
self._checkParsed()
for key in globfilter( cooker.status.pkg_pn.keys(), globexpr ): print key
else:
print "Usage: match %s" % self.print_.usage
match.usage = "<files|providers> <glob>"
def new( self, params ):
"""Create a new .bb file and open the editor"""
dirname, filename = params
packages = '/'.join( data.getVar( "BBFILES", cooker.configuration.data, 1 ).split('/')[:-2] )
fulldirname = "%s/%s" % ( packages, dirname )
if not os.path.exists( fulldirname ):
print "SHELL: Creating '%s'" % fulldirname
os.mkdir( fulldirname )
if os.path.exists( fulldirname ) and os.path.isdir( fulldirname ):
if os.path.exists( "%s/%s" % ( fulldirname, filename ) ):
print "SHELL: ERROR: %s/%s already exists" % ( fulldirname, filename )
return False
print "SHELL: Creating '%s/%s'" % ( fulldirname, filename )
newpackage = open( "%s/%s" % ( fulldirname, filename ), "w" )
print >>newpackage,"""DESCRIPTION = ""
SECTION = ""
AUTHOR = ""
HOMEPAGE = ""
MAINTAINER = ""
LICENSE = "GPL"
PR = "r0"
SRC_URI = ""
#inherit base
#do_configure() {
#
#}
#do_compile() {
#
#}
#do_stage() {
#
#}
#do_install() {
#
#}
"""
newpackage.close()
os.system( "%s %s/%s" % ( os.environ.get( "EDITOR" ), fulldirname, filename ) )
new.usage = "<directory> <filename>"
def package( self, params ):
"""Execute 'package' on a providee"""
self.build( params, "package" )
package.usage = "<providee>"
def pasteBin( self, params ):
"""Send a command + output buffer to the pastebin at http://rafb.net/paste"""
index = params[0]
contents = self._shell.myout.buffer( int( index ) )
sendToPastebin( "output of " + params[0], contents )
pasteBin.usage = "<index>"
def pasteLog( self, params ):
"""Send the last event exception error log (if there is one) to http://rafb.net/paste"""
if last_exception is None:
print "SHELL: No Errors yet (Phew)..."
else:
reason, event = last_exception.args
print "SHELL: Reason for the last error: '%s'" % reason
if ':' in reason:
msg, filename = reason.split( ':' )
filename = filename.strip()
print "SHELL: Pasting log file to pastebin..."
file = open( filename ).read()
sendToPastebin( "contents of " + filename, file )
def patch( self, params ):
"""Execute 'patch' command on a providee"""
self.build( params, "patch" )
patch.usage = "<providee>"
def parse( self, params ):
"""(Re-)parse .bb files and calculate the dependency graph"""
cooker.status = cache.CacheData()
ignore = data.getVar("ASSUME_PROVIDED", cooker.configuration.data, 1) or ""
cooker.status.ignored_dependencies = set( ignore.split() )
cooker.handleCollections( data.getVar("BBFILE_COLLECTIONS", cooker.configuration.data, 1) )
(filelist, masked) = cooker.collect_bbfiles()
cooker.parse_bbfiles(filelist, masked, cooker.myProgressCallback)
cooker.buildDepgraph()
global parsed
parsed = True
print
def reparse( self, params ):
"""(re)Parse a providee's bb file"""
bbfile = self._findProvider( params[0] )
if bbfile is not None:
print "SHELL: Found bbfile '%s' for '%s'" % ( bbfile, params[0] )
self.fileReparse( [ bbfile ] )
else:
print "ERROR: Nothing provides '%s'" % params[0]
reparse.usage = "<providee>"
def getvar( self, params ):
"""Dump the contents of an outer BitBake environment variable"""
var = params[0]
value = data.getVar( var, cooker.configuration.data, 1 )
print value
getvar.usage = "<variable>"
def peek( self, params ):
"""Dump contents of variable defined in providee's metadata"""
name, var = params
bbfile = self._findProvider( name )
if bbfile is not None:
the_data = cooker.bb_cache.loadDataFull(bbfile, cooker.configuration.data)
value = the_data.getVar( var, 1 )
print value
else:
print "ERROR: Nothing provides '%s'" % name
peek.usage = "<providee> <variable>"
def poke( self, params ):
"""Set contents of variable defined in providee's metadata"""
name, var, value = params
bbfile = self._findProvider( name )
if bbfile is not None:
print "ERROR: Sorry, this functionality is currently broken"
#d = cooker.pkgdata[bbfile]
#data.setVar( var, value, d )
# mark the change semi persistant
#cooker.pkgdata.setDirty(bbfile, d)
#print "OK"
else:
print "ERROR: Nothing provides '%s'" % name
poke.usage = "<providee> <variable> <value>"
def print_( self, params ):
"""Dump all files or providers"""
what = params[0]
if what == "files":
self._checkParsed()
for key in cooker.status.pkg_fn.keys(): print key
elif what == "providers":
self._checkParsed()
for key in cooker.status.providers.keys(): print key
else:
print "Usage: print %s" % self.print_.usage
print_.usage = "<files|providers>"
def python( self, params ):
"""Enter the expert mode - an interactive BitBake Python Interpreter"""
sys.ps1 = "EXPERT BB>>> "
sys.ps2 = "EXPERT BB... "
import code
interpreter = code.InteractiveConsole( dict( globals() ) )
interpreter.interact( "SHELL: Expert Mode - BitBake Python %s\nType 'help' for more information, press CTRL-D to switch back to BBSHELL." % sys.version )
def showdata( self, params ):
"""Execute 'showdata' on a providee"""
cooker.showEnvironment(None, params)
showdata.usage = "<providee>"
def setVar( self, params ):
"""Set an outer BitBake environment variable"""
var, value = params
data.setVar( var, value, cooker.configuration.data )
print "OK"
setVar.usage = "<variable> <value>"
def rebuild( self, params ):
"""Clean and rebuild a .bb file or a providee"""
self.build( params, "clean" )
self.build( params, "build" )
rebuild.usage = "<providee>"
def shell( self, params ):
"""Execute a shell command and dump the output"""
if params != "":
print commands.getoutput( " ".join( params ) )
shell.usage = "<...>"
def stage( self, params ):
"""Execute 'stage' on a providee"""
self.build( params, "populate_staging" )
stage.usage = "<providee>"
def status( self, params ):
"""<just for testing>"""
print "-" * 78
print "building list = '%s'" % cooker.building_list
print "build path = '%s'" % cooker.build_path
print "consider_msgs_cache = '%s'" % cooker.consider_msgs_cache
print "build stats = '%s'" % cooker.stats
if last_exception is not None: print "last_exception = '%s'" % repr( last_exception.args )
print "memory output contents = '%s'" % self._shell.myout._buffer
def test( self, params ):
"""<just for testing>"""
print "testCommand called with '%s'" % params
def unpack( self, params ):
"""Execute 'unpack' on a providee"""
self.build( params, "unpack" )
unpack.usage = "<providee>"
def which( self, params ):
"""Computes the providers for a given providee"""
# Need to use taskData for this information
item = params[0]
self._checkParsed()
preferred = data.getVar( "PREFERRED_PROVIDER_%s" % item, cooker.configuration.data, 1 )
if not preferred: preferred = item
try:
lv, lf, pv, pf = Providers.findBestProvider(preferred, cooker.configuration.data, cooker.status)
except KeyError:
lv, lf, pv, pf = (None,)*4
try:
providers = cooker.status.providers[item]
except KeyError:
print "SHELL: ERROR: Nothing provides", preferred
else:
for provider in providers:
if provider == pf: provider = " (***) %s" % provider
else: provider = " %s" % provider
print provider
which.usage = "<providee>"
##########################################################################
# Common helper functions
##########################################################################
def completeFilePath( bbfile ):
"""Get the complete bbfile path"""
if not cooker.status: return bbfile
if not cooker.status.pkg_fn: return bbfile
for key in cooker.status.pkg_fn.keys():
if key.endswith( bbfile ):
return key
return bbfile
def sendToPastebin( desc, content ):
"""Send content to http://oe.pastebin.com"""
mydata = {}
mydata["lang"] = "Plain Text"
mydata["desc"] = desc
mydata["cvt_tabs"] = "No"
mydata["nick"] = "%s@%s" % ( os.environ.get( "USER", "unknown" ), socket.gethostname() or "unknown" )
mydata["text"] = content
params = urllib.urlencode( mydata )
headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain"}
host = "rafb.net"
conn = httplib.HTTPConnection( "%s:80" % host )
conn.request("POST", "/paste/paste.php", params, headers )
response = conn.getresponse()
conn.close()
if response.status == 302:
location = response.getheader( "location" ) or "unknown"
print "SHELL: Pasted to http://%s%s" % ( host, location )
else:
print "ERROR: %s %s" % ( response.status, response.reason )
def completer( text, state ):
"""Return a possible readline completion"""
debugOut( "completer called with text='%s', state='%d'" % ( text, state ) )
if state == 0:
line = readline.get_line_buffer()
if " " in line:
line = line.split()
# we are in second (or more) argument
if line[0] in cmds and hasattr( cmds[line[0]][0], "usage" ): # known command and usage
u = getattr( cmds[line[0]][0], "usage" ).split()[0]
if u == "<variable>":
allmatches = cooker.configuration.data.keys()
elif u == "<bbfile>":
if cooker.status.pkg_fn is None: allmatches = [ "(No Matches Available. Parsed yet?)" ]
else: allmatches = [ x.split("/")[-1] for x in cooker.status.pkg_fn.keys() ]
elif u == "<providee>":
if cooker.status.pkg_fn is None: allmatches = [ "(No Matches Available. Parsed yet?)" ]
else: allmatches = cooker.status.providers.iterkeys()
else: allmatches = [ "(No tab completion available for this command)" ]
else: allmatches = [ "(No tab completion available for this command)" ]
else:
# we are in first argument
allmatches = cmds.iterkeys()
completer.matches = [ x for x in allmatches if x[:len(text)] == text ]
#print "completer.matches = '%s'" % completer.matches
if len( completer.matches ) > state:
return completer.matches[state]
else:
return None
def debugOut( text ):
if debug:
sys.stderr.write( "( %s )\n" % text )
def columnize( alist, width = 80 ):
"""
A word-wrap function that preserves existing line breaks
and most spaces in the text. Expects that existing line
breaks are posix newlines (\n).
"""
return reduce(lambda line, word, width=width: '%s%s%s' %
(line,
' \n'[(len(line[line.rfind('\n')+1:])
+ len(word.split('\n',1)[0]
) >= width)],
word),
alist
)
def globfilter( names, pattern ):
return fnmatch.filter( names, pattern )
##########################################################################
# Class MemoryOutput
##########################################################################
class MemoryOutput:
"""File-like output class buffering the output of the last 10 commands"""
def __init__( self, delegate ):
self.delegate = delegate
self._buffer = []
self.text = []
self._command = None
def startCommand( self, command ):
self._command = command
self.text = []
def endCommand( self ):
if self._command is not None:
if len( self._buffer ) == 10: del self._buffer[0]
self._buffer.append( ( self._command, self.text ) )
def removeLast( self ):
if self._buffer:
del self._buffer[ len( self._buffer ) - 1 ]
self.text = []
self._command = None
def lastBuffer( self ):
if self._buffer:
return self._buffer[ len( self._buffer ) -1 ][1]
def bufferedCommands( self ):
return [ cmd for cmd, output in self._buffer ]
def buffer( self, i ):
if i < len( self._buffer ):
return "BB>> %s\n%s" % ( self._buffer[i][0], "".join( self._buffer[i][1] ) )
else: return "ERROR: Invalid buffer number. Buffer needs to be in (0, %d)" % ( len( self._buffer ) - 1 )
def write( self, text ):
if self._command is not None and text != "BB>> ": self.text.append( text )
if self.delegate is not None: self.delegate.write( text )
def flush( self ):
return self.delegate.flush()
def fileno( self ):
return self.delegate.fileno()
def isatty( self ):
return self.delegate.isatty()
##########################################################################
# Class BitBakeShell
##########################################################################
class BitBakeShell:
def __init__( self ):
"""Register commands and set up readline"""
self.commandQ = Queue.Queue()
self.commands = BitBakeShellCommands( self )
self.myout = MemoryOutput( sys.stdout )
self.historyfilename = os.path.expanduser( "~/.bbsh_history" )
self.startupfilename = os.path.expanduser( "~/.bbsh_startup" )
readline.set_completer( completer )
readline.set_completer_delims( " " )
readline.parse_and_bind("tab: complete")
try:
readline.read_history_file( self.historyfilename )
except IOError:
pass # It doesn't exist yet.
print __credits__
def cleanup( self ):
"""Write readline history and clean up resources"""
debugOut( "writing command history" )
try:
readline.write_history_file( self.historyfilename )
except:
print "SHELL: Unable to save command history"
def registerCommand( self, command, function, numparams = 0, usage = "", helptext = "" ):
"""Register a command"""
if usage == "": usage = command
if helptext == "": helptext = function.__doc__ or "<not yet documented>"
cmds[command] = ( function, numparams, usage, helptext )
def processCommand( self, command, params ):
"""Process a command. Check number of params and print a usage string, if appropriate"""
debugOut( "processing command '%s'..." % command )
try:
function, numparams, usage, helptext = cmds[command]
except KeyError:
print "SHELL: ERROR: '%s' command is not a valid command." % command
self.myout.removeLast()
else:
if (numparams != -1) and (not len( params ) == numparams):
print "Usage: '%s'" % usage
return
result = function( self.commands, params )
debugOut( "result was '%s'" % result )
def processStartupFile( self ):
"""Read and execute all commands found in $HOME/.bbsh_startup"""
if os.path.exists( self.startupfilename ):
startupfile = open( self.startupfilename, "r" )
for cmdline in startupfile:
debugOut( "processing startup line '%s'" % cmdline )
if not cmdline:
continue
if "|" in cmdline:
print "ERROR: '|' in startup file is not allowed. Ignoring line"
continue
self.commandQ.put( cmdline.strip() )
def main( self ):
"""The main command loop"""
while not leave_mainloop:
try:
if self.commandQ.empty():
sys.stdout = self.myout.delegate
cmdline = raw_input( "BB>> " )
sys.stdout = self.myout
else:
cmdline = self.commandQ.get()
if cmdline:
allCommands = cmdline.split( ';' )
for command in allCommands:
pipecmd = None
#
# special case for expert mode
if command == 'python':
sys.stdout = self.myout.delegate
self.processCommand( command, "" )
sys.stdout = self.myout
else:
self.myout.startCommand( command )
if '|' in command: # disable output
command, pipecmd = command.split( '|' )
delegate = self.myout.delegate
self.myout.delegate = None
tokens = shlex.split( command, True )
self.processCommand( tokens[0], tokens[1:] or "" )
self.myout.endCommand()
if pipecmd is not None: # restore output
self.myout.delegate = delegate
pipe = popen2.Popen4( pipecmd )
pipe.tochild.write( "\n".join( self.myout.lastBuffer() ) )
pipe.tochild.close()
sys.stdout.write( pipe.fromchild.read() )
#
except EOFError:
print
return
except KeyboardInterrupt:
print
##########################################################################
# Start function - called from the BitBake command line utility
##########################################################################
def start( aCooker ):
global cooker
cooker = aCooker
bbshell = BitBakeShell()
bbshell.processStartupFile()
bbshell.main()
bbshell.cleanup()
if __name__ == "__main__":
print "SHELL: Sorry, this program should only be called by BitBake."

View File

@@ -1,595 +0,0 @@
#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'TaskData' implementation
Task data collection and handling
"""
# Copyright (C) 2006 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import bb
class TaskData:
"""
BitBake Task Data implementation
"""
def __init__(self, abort = True, tryaltconfigs = False):
self.build_names_index = []
self.run_names_index = []
self.fn_index = []
self.build_targets = {}
self.run_targets = {}
self.external_targets = []
self.tasks_fnid = []
self.tasks_name = []
self.tasks_tdepends = []
self.tasks_idepends = []
# Cache to speed up task ID lookups
self.tasks_lookup = {}
self.depids = {}
self.rdepids = {}
self.consider_msgs_cache = []
self.failed_deps = []
self.failed_rdeps = []
self.failed_fnids = []
self.abort = abort
self.tryaltconfigs = tryaltconfigs
def getbuild_id(self, name):
"""
Return an ID number for the build target name.
If it doesn't exist, create one.
"""
if not name in self.build_names_index:
self.build_names_index.append(name)
return len(self.build_names_index) - 1
return self.build_names_index.index(name)
def getrun_id(self, name):
"""
Return an ID number for the run target name.
If it doesn't exist, create one.
"""
if not name in self.run_names_index:
self.run_names_index.append(name)
return len(self.run_names_index) - 1
return self.run_names_index.index(name)
def getfn_id(self, name):
"""
Return an ID number for the filename.
If it doesn't exist, create one.
"""
if not name in self.fn_index:
self.fn_index.append(name)
return len(self.fn_index) - 1
return self.fn_index.index(name)
def gettask_ids(self, fnid):
"""
Return an array of the ID numbers matching a given fnid.
"""
ids = []
if fnid in self.tasks_lookup:
for task in self.tasks_lookup[fnid]:
ids.append(self.tasks_lookup[fnid][task])
return ids
def gettask_id(self, fn, task, create = True):
"""
Return an ID number for the task matching fn and task.
If it doesn't exist, create one by default.
Optionally return None instead.
"""
fnid = self.getfn_id(fn)
if fnid in self.tasks_lookup:
if task in self.tasks_lookup[fnid]:
return self.tasks_lookup[fnid][task]
if not create:
return None
self.tasks_name.append(task)
self.tasks_fnid.append(fnid)
self.tasks_tdepends.append([])
self.tasks_idepends.append([])
listid = len(self.tasks_name) - 1
if fnid not in self.tasks_lookup:
self.tasks_lookup[fnid] = {}
self.tasks_lookup[fnid][task] = listid
return listid
def add_tasks(self, fn, dataCache):
"""
Add tasks for a given fn to the database
"""
task_deps = dataCache.task_deps[fn]
fnid = self.getfn_id(fn)
if fnid in self.failed_fnids:
bb.msg.fatal(bb.msg.domain.TaskData, "Trying to re-add a failed file? Something is broken...")
# Check if we've already seen this fn
if fnid in self.tasks_fnid:
return
for task in task_deps['tasks']:
# Work out task dependencies
parentids = []
for dep in task_deps['parents'][task]:
parentid = self.gettask_id(fn, dep)
parentids.append(parentid)
taskid = self.gettask_id(fn, task)
self.tasks_tdepends[taskid].extend(parentids)
# Touch all intertask dependencies
if 'depends' in task_deps and task in task_deps['depends']:
ids = []
for dep in task_deps['depends'][task].split():
if dep:
ids.append(((self.getbuild_id(dep.split(":")[0])), dep.split(":")[1]))
self.tasks_idepends[taskid].extend(ids)
# Work out build dependencies
if not fnid in self.depids:
dependids = {}
for depend in dataCache.deps[fn]:
bb.msg.debug(2, bb.msg.domain.TaskData, "Added dependency %s for %s" % (depend, fn))
dependids[self.getbuild_id(depend)] = None
self.depids[fnid] = dependids.keys()
# Work out runtime dependencies
if not fnid in self.rdepids:
rdependids = {}
rdepends = dataCache.rundeps[fn]
rrecs = dataCache.runrecs[fn]
for package in rdepends:
for rdepend in bb.utils.explode_deps(rdepends[package]):
bb.msg.debug(2, bb.msg.domain.TaskData, "Added runtime dependency %s for %s" % (rdepend, fn))
rdependids[self.getrun_id(rdepend)] = None
for package in rrecs:
for rdepend in bb.utils.explode_deps(rrecs[package]):
bb.msg.debug(2, bb.msg.domain.TaskData, "Added runtime recommendation %s for %s" % (rdepend, fn))
rdependids[self.getrun_id(rdepend)] = None
self.rdepids[fnid] = rdependids.keys()
for dep in self.depids[fnid]:
if dep in self.failed_deps:
self.fail_fnid(fnid)
return
for dep in self.rdepids[fnid]:
if dep in self.failed_rdeps:
self.fail_fnid(fnid)
return
def have_build_target(self, target):
"""
Have we a build target matching this name?
"""
targetid = self.getbuild_id(target)
if targetid in self.build_targets:
return True
return False
def have_runtime_target(self, target):
"""
Have we a runtime target matching this name?
"""
targetid = self.getrun_id(target)
if targetid in self.run_targets:
return True
return False
def add_build_target(self, fn, item):
"""
Add a build target.
If already present, append the provider fn to the list
"""
targetid = self.getbuild_id(item)
fnid = self.getfn_id(fn)
if targetid in self.build_targets:
if fnid in self.build_targets[targetid]:
return
self.build_targets[targetid].append(fnid)
return
self.build_targets[targetid] = [fnid]
def add_runtime_target(self, fn, item):
"""
Add a runtime target.
If already present, append the provider fn to the list
"""
targetid = self.getrun_id(item)
fnid = self.getfn_id(fn)
if targetid in self.run_targets:
if fnid in self.run_targets[targetid]:
return
self.run_targets[targetid].append(fnid)
return
self.run_targets[targetid] = [fnid]
def mark_external_target(self, item):
"""
Mark a build target as being externally requested
"""
targetid = self.getbuild_id(item)
if targetid not in self.external_targets:
self.external_targets.append(targetid)
def get_unresolved_build_targets(self, dataCache):
"""
Return a list of build targets who's providers
are unknown.
"""
unresolved = []
for target in self.build_names_index:
if target in dataCache.ignored_dependencies:
continue
if self.build_names_index.index(target) in self.failed_deps:
continue
if not self.have_build_target(target):
unresolved.append(target)
return unresolved
def get_unresolved_run_targets(self, dataCache):
"""
Return a list of runtime targets who's providers
are unknown.
"""
unresolved = []
for target in self.run_names_index:
if target in dataCache.ignored_dependencies:
continue
if self.run_names_index.index(target) in self.failed_rdeps:
continue
if not self.have_runtime_target(target):
unresolved.append(target)
return unresolved
def get_provider(self, item):
"""
Return a list of providers of item
"""
targetid = self.getbuild_id(item)
return self.build_targets[targetid]
def get_dependees(self, itemid):
"""
Return a list of targets which depend on item
"""
dependees = []
for fnid in self.depids:
if itemid in self.depids[fnid]:
dependees.append(fnid)
return dependees
def get_dependees_str(self, item):
"""
Return a list of targets which depend on item as a user readable string
"""
itemid = self.getbuild_id(item)
dependees = []
for fnid in self.depids:
if itemid in self.depids[fnid]:
dependees.append(self.fn_index[fnid])
return dependees
def get_rdependees(self, itemid):
"""
Return a list of targets which depend on runtime item
"""
dependees = []
for fnid in self.rdepids:
if itemid in self.rdepids[fnid]:
dependees.append(fnid)
return dependees
def get_rdependees_str(self, item):
"""
Return a list of targets which depend on runtime item as a user readable string
"""
itemid = self.getrun_id(item)
dependees = []
for fnid in self.rdepids:
if itemid in self.rdepids[fnid]:
dependees.append(self.fn_index[fnid])
return dependees
def add_provider(self, cfgData, dataCache, item):
try:
self.add_provider_internal(cfgData, dataCache, item)
except bb.providers.NoProvider:
if self.abort:
if self.get_rdependees_str(item):
bb.msg.error(bb.msg.domain.Provider, "Nothing PROVIDES '%s' (but '%s' DEPENDS on or otherwise requires it)" % (item, self.get_dependees_str(item)))
else:
bb.msg.error(bb.msg.domain.Provider, "Nothing PROVIDES '%s'" % (item))
raise
targetid = self.getbuild_id(item)
self.remove_buildtarget(targetid)
self.mark_external_target(item)
def add_provider_internal(self, cfgData, dataCache, item):
"""
Add the providers of item to the task data
Mark entries were specifically added externally as against dependencies
added internally during dependency resolution
"""
if item in dataCache.ignored_dependencies:
return
if not item in dataCache.providers:
if self.get_rdependees_str(item):
bb.msg.note(2, bb.msg.domain.Provider, "Nothing PROVIDES '%s' (but '%s' DEPENDS on or otherwise requires it)" % (item, self.get_dependees_str(item)))
else:
bb.msg.note(2, bb.msg.domain.Provider, "Nothing PROVIDES '%s'" % (item))
bb.event.fire(bb.event.NoProvider(item, cfgData))
raise bb.providers.NoProvider(item)
if self.have_build_target(item):
return
all_p = dataCache.providers[item]
eligible, foundUnique = bb.providers.filterProviders(all_p, item, cfgData, dataCache)
eligible = [p for p in eligible if not self.getfn_id(p) in self.failed_fnids]
if not eligible:
bb.msg.note(2, bb.msg.domain.Provider, "No buildable provider PROVIDES '%s' but '%s' DEPENDS on or otherwise requires it. Enable debugging and see earlier logs to find unbuildable providers." % (item, self.get_dependees_str(item)))
bb.event.fire(bb.event.NoProvider(item, cfgData))
raise bb.providers.NoProvider(item)
if len(eligible) > 1 and foundUnique == False:
if item not in self.consider_msgs_cache:
providers_list = []
for fn in eligible:
providers_list.append(dataCache.pkg_fn[fn])
bb.msg.note(1, bb.msg.domain.Provider, "multiple providers are available for %s (%s);" % (item, ", ".join(providers_list)))
bb.msg.note(1, bb.msg.domain.Provider, "consider defining PREFERRED_PROVIDER_%s" % item)
bb.event.fire(bb.event.MultipleProviders(item, providers_list, cfgData))
self.consider_msgs_cache.append(item)
for fn in eligible:
fnid = self.getfn_id(fn)
if fnid in self.failed_fnids:
continue
bb.msg.debug(2, bb.msg.domain.Provider, "adding %s to satisfy %s" % (fn, item))
self.add_build_target(fn, item)
self.add_tasks(fn, dataCache)
#item = dataCache.pkg_fn[fn]
def add_rprovider(self, cfgData, dataCache, item):
"""
Add the runtime providers of item to the task data
(takes item names from RDEPENDS/PACKAGES namespace)
"""
if item in dataCache.ignored_dependencies:
return
if self.have_runtime_target(item):
return
all_p = bb.providers.getRuntimeProviders(dataCache, item)
if not all_p:
bb.msg.error(bb.msg.domain.Provider, "'%s' RDEPENDS/RRECOMMENDS or otherwise requires the runtime entity '%s' but it wasn't found in any PACKAGE or RPROVIDES variables" % (self.get_rdependees_str(item), item))
bb.event.fire(bb.event.NoProvider(item, cfgData, runtime=True))
raise bb.providers.NoRProvider(item)
eligible, numberPreferred = bb.providers.filterProvidersRunTime(all_p, item, cfgData, dataCache)
eligible = [p for p in eligible if not self.getfn_id(p) in self.failed_fnids]
if not eligible:
bb.msg.error(bb.msg.domain.Provider, "'%s' RDEPENDS/RRECOMMENDS or otherwise requires the runtime entity '%s' but it wasn't found in any PACKAGE or RPROVIDES variables of any buildable targets.\nEnable debugging and see earlier logs to find unbuildable targets." % (self.get_rdependees_str(item), item))
bb.event.fire(bb.event.NoProvider(item, cfgData, runtime=True))
raise bb.providers.NoRProvider(item)
if len(eligible) > 1 and numberPreferred == 0:
if item not in self.consider_msgs_cache:
providers_list = []
for fn in eligible:
providers_list.append(dataCache.pkg_fn[fn])
bb.msg.note(2, bb.msg.domain.Provider, "multiple providers are available for runtime %s (%s);" % (item, ", ".join(providers_list)))
bb.msg.note(2, bb.msg.domain.Provider, "consider defining a PREFERRED_PROVIDER entry to match runtime %s" % item)
bb.event.fire(bb.event.MultipleProviders(item,providers_list, cfgData, runtime=True))
self.consider_msgs_cache.append(item)
if numberPreferred > 1:
if item not in self.consider_msgs_cache:
providers_list = []
for fn in eligible:
providers_list.append(dataCache.pkg_fn[fn])
bb.msg.note(2, bb.msg.domain.Provider, "multiple providers are available for runtime %s (top %s entries preferred) (%s);" % (item, numberPreferred, ", ".join(providers_list)))
bb.msg.note(2, bb.msg.domain.Provider, "consider defining only one PREFERRED_PROVIDER entry to match runtime %s" % item)
bb.event.fire(bb.event.MultipleProviders(item,providers_list, cfgData, runtime=True))
self.consider_msgs_cache.append(item)
# run through the list until we find one that we can build
for fn in eligible:
fnid = self.getfn_id(fn)
if fnid in self.failed_fnids:
continue
bb.msg.debug(2, bb.msg.domain.Provider, "adding '%s' to satisfy runtime '%s'" % (fn, item))
self.add_runtime_target(fn, item)
self.add_tasks(fn, dataCache)
def fail_fnid(self, fnid, missing_list = []):
"""
Mark a file as failed (unbuildable)
Remove any references from build and runtime provider lists
missing_list, A list of missing requirements for this target
"""
if fnid in self.failed_fnids:
return
bb.msg.debug(1, bb.msg.domain.Provider, "File '%s' is unbuildable, removing..." % self.fn_index[fnid])
self.failed_fnids.append(fnid)
for target in self.build_targets:
if fnid in self.build_targets[target]:
self.build_targets[target].remove(fnid)
if len(self.build_targets[target]) == 0:
self.remove_buildtarget(target, missing_list)
for target in self.run_targets:
if fnid in self.run_targets[target]:
self.run_targets[target].remove(fnid)
if len(self.run_targets[target]) == 0:
self.remove_runtarget(target, missing_list)
def remove_buildtarget(self, targetid, missing_list = []):
"""
Mark a build target as failed (unbuildable)
Trigger removal of any files that have this as a dependency
"""
if not missing_list:
missing_list = [self.build_names_index[targetid]]
else:
missing_list = [self.build_names_index[targetid]] + missing_list
bb.msg.note(2, bb.msg.domain.Provider, "Target '%s' is unbuildable, removing...\nMissing or unbuildable dependency chain was: %s" % (self.build_names_index[targetid], missing_list))
self.failed_deps.append(targetid)
dependees = self.get_dependees(targetid)
for fnid in dependees:
self.fail_fnid(fnid, missing_list)
for taskid in range(len(self.tasks_idepends)):
idepends = self.tasks_idepends[taskid]
for (idependid, idependtask) in idepends:
if idependid == targetid:
self.fail_fnid(self.tasks_fnid[taskid], missing_list)
if self.abort and targetid in self.external_targets:
bb.msg.error(bb.msg.domain.Provider, "Required build target '%s' has no buildable providers.\nMissing or unbuildable dependency chain was: %s" % (self.build_names_index[targetid], missing_list))
raise bb.providers.NoProvider
def remove_runtarget(self, targetid, missing_list = []):
"""
Mark a run target as failed (unbuildable)
Trigger removal of any files that have this as a dependency
"""
if not missing_list:
missing_list = [self.run_names_index[targetid]]
else:
missing_list = [self.run_names_index[targetid]] + missing_list
bb.msg.note(1, bb.msg.domain.Provider, "Runtime target '%s' is unbuildable, removing...\nMissing or unbuildable dependency chain was: %s" % (self.run_names_index[targetid], missing_list))
self.failed_rdeps.append(targetid)
dependees = self.get_rdependees(targetid)
for fnid in dependees:
self.fail_fnid(fnid, missing_list)
def add_unresolved(self, cfgData, dataCache):
"""
Resolve all unresolved build and runtime targets
"""
bb.msg.note(1, bb.msg.domain.TaskData, "Resolving any missing task queue dependencies")
while 1:
added = 0
for target in self.get_unresolved_build_targets(dataCache):
try:
self.add_provider_internal(cfgData, dataCache, target)
added = added + 1
except bb.providers.NoProvider:
targetid = self.getbuild_id(target)
if self.abort and targetid in self.external_targets:
if self.get_rdependees_str(target):
bb.msg.error(bb.msg.domain.Provider, "Nothing PROVIDES '%s' (but '%s' DEPENDS on or otherwise requires it)" % (target, self.get_dependees_str(target)))
else:
bb.msg.error(bb.msg.domain.Provider, "Nothing PROVIDES '%s'" % (target))
raise
self.remove_buildtarget(targetid)
for target in self.get_unresolved_run_targets(dataCache):
try:
self.add_rprovider(cfgData, dataCache, target)
added = added + 1
except bb.providers.NoRProvider:
self.remove_runtarget(self.getrun_id(target))
bb.msg.debug(1, bb.msg.domain.TaskData, "Resolved " + str(added) + " extra dependecies")
if added == 0:
break
# self.dump_data()
def dump_data(self):
"""
Dump some debug information on the internal data structures
"""
bb.msg.debug(3, bb.msg.domain.TaskData, "build_names:")
bb.msg.debug(3, bb.msg.domain.TaskData, ", ".join(self.build_names_index))
bb.msg.debug(3, bb.msg.domain.TaskData, "run_names:")
bb.msg.debug(3, bb.msg.domain.TaskData, ", ".join(self.run_names_index))
bb.msg.debug(3, bb.msg.domain.TaskData, "build_targets:")
for buildid in range(len(self.build_names_index)):
target = self.build_names_index[buildid]
targets = "None"
if buildid in self.build_targets:
targets = self.build_targets[buildid]
bb.msg.debug(3, bb.msg.domain.TaskData, " (%s)%s: %s" % (buildid, target, targets))
bb.msg.debug(3, bb.msg.domain.TaskData, "run_targets:")
for runid in range(len(self.run_names_index)):
target = self.run_names_index[runid]
targets = "None"
if runid in self.run_targets:
targets = self.run_targets[runid]
bb.msg.debug(3, bb.msg.domain.TaskData, " (%s)%s: %s" % (runid, target, targets))
bb.msg.debug(3, bb.msg.domain.TaskData, "tasks:")
for task in range(len(self.tasks_name)):
bb.msg.debug(3, bb.msg.domain.TaskData, " (%s)%s - %s: %s" % (
task,
self.fn_index[self.tasks_fnid[task]],
self.tasks_name[task],
self.tasks_tdepends[task]))
bb.msg.debug(3, bb.msg.domain.TaskData, "dependency ids (per fn):")
for fnid in self.depids:
bb.msg.debug(3, bb.msg.domain.TaskData, " %s %s: %s" % (fnid, self.fn_index[fnid], self.depids[fnid]))
bb.msg.debug(3, bb.msg.domain.TaskData, "runtime dependency ids (per fn):")
for fnid in self.rdepids:
bb.msg.debug(3, bb.msg.domain.TaskData, " %s %s: %s" % (fnid, self.fn_index[fnid], self.rdepids[fnid]))

View File

@@ -1,417 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake Utility Functions
"""
# Copyright (C) 2004 Michael Lauer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
digits = "0123456789"
ascii_letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
import re, fcntl, os
def explode_version(s):
r = []
alpha_regexp = re.compile('^([a-zA-Z]+)(.*)$')
numeric_regexp = re.compile('^(\d+)(.*)$')
while (s != ''):
if s[0] in digits:
m = numeric_regexp.match(s)
r.append(int(m.group(1)))
s = m.group(2)
continue
if s[0] in ascii_letters:
m = alpha_regexp.match(s)
r.append(m.group(1))
s = m.group(2)
continue
s = s[1:]
return r
def vercmp_part(a, b):
va = explode_version(a)
vb = explode_version(b)
while True:
if va == []:
ca = None
else:
ca = va.pop(0)
if vb == []:
cb = None
else:
cb = vb.pop(0)
if ca == None and cb == None:
return 0
if ca > cb:
return 1
if ca < cb:
return -1
def vercmp(ta, tb):
(ea, va, ra) = ta
(eb, vb, rb) = tb
r = int(ea)-int(eb)
if (r == 0):
r = vercmp_part(va, vb)
if (r == 0):
r = vercmp_part(ra, rb)
return r
def explode_deps(s):
"""
Take an RDEPENDS style string of format:
"DEPEND1 (optional version) DEPEND2 (optional version) ..."
and return a list of dependencies.
Version information is ignored.
"""
r = []
l = s.split()
flag = False
for i in l:
if i[0] == '(':
flag = True
#j = []
if not flag:
r.append(i)
#else:
# j.append(i)
if flag and i.endswith(')'):
flag = False
# Ignore version
#r[-1] += ' ' + ' '.join(j)
return r
def explode_dep_versions(s):
"""
Take an RDEPENDS style string of format:
"DEPEND1 (optional version) DEPEND2 (optional version) ..."
and return a dictonary of dependencies and versions.
"""
r = {}
l = s.split()
lastdep = None
lastver = ""
inversion = False
for i in l:
if i[0] == '(':
inversion = True
lastver = i[1:] or ""
#j = []
elif inversion and i.endswith(')'):
inversion = False
lastver = lastver + " " + (i[:-1] or "")
r[lastdep] = lastver
elif not inversion:
r[i] = None
lastdep = i
lastver = ""
elif inversion:
lastver = lastver + " " + i
return r
def _print_trace(body, line):
"""
Print the Environment of a Text Body
"""
import bb
# print the environment of the method
bb.msg.error(bb.msg.domain.Util, "Printing the environment of the function")
min_line = max(1,line-4)
max_line = min(line+4,len(body)-1)
for i in range(min_line,max_line+1):
bb.msg.error(bb.msg.domain.Util, "\t%.4d:%s" % (i, body[i-1]) )
def better_compile(text, file, realfile):
"""
A better compile method. This method
will print the offending lines.
"""
try:
return compile(text, file, "exec")
except Exception, e:
import bb,sys
# split the text into lines again
body = text.split('\n')
bb.msg.error(bb.msg.domain.Util, "Error in compiling python function in: ", realfile)
bb.msg.error(bb.msg.domain.Util, "The lines resulting into this error were:")
bb.msg.error(bb.msg.domain.Util, "\t%d:%s:'%s'" % (e.lineno, e.__class__.__name__, body[e.lineno-1]))
_print_trace(body, e.lineno)
# exit now
sys.exit(1)
def better_exec(code, context, text, realfile):
"""
Similiar to better_compile, better_exec will
print the lines that are responsible for the
error.
"""
import bb,sys
try:
exec code in context
except:
(t,value,tb) = sys.exc_info()
if t in [bb.parse.SkipPackage, bb.build.FuncFailed]:
raise
# print the Header of the Error Message
bb.msg.error(bb.msg.domain.Util, "Error in executing python function in: %s" % realfile)
bb.msg.error(bb.msg.domain.Util, "Exception:%s Message:%s" % (t,value) )
# let us find the line number now
while tb.tb_next:
tb = tb.tb_next
import traceback
line = traceback.tb_lineno(tb)
_print_trace( text.split('\n'), line )
raise
def Enum(*names):
"""
A simple class to give Enum support
"""
assert names, "Empty enums are not supported"
class EnumClass(object):
__slots__ = names
def __iter__(self): return iter(constants)
def __len__(self): return len(constants)
def __getitem__(self, i): return constants[i]
def __repr__(self): return 'Enum' + str(names)
def __str__(self): return 'enum ' + str(constants)
class EnumValue(object):
__slots__ = ('__value')
def __init__(self, value): self.__value = value
Value = property(lambda self: self.__value)
EnumType = property(lambda self: EnumType)
def __hash__(self): return hash(self.__value)
def __cmp__(self, other):
# C fans might want to remove the following assertion
# to make all enums comparable by ordinal value {;))
assert self.EnumType is other.EnumType, "Only values from the same enum are comparable"
return cmp(self.__value, other.__value)
def __invert__(self): return constants[maximum - self.__value]
def __nonzero__(self): return bool(self.__value)
def __repr__(self): return str(names[self.__value])
maximum = len(names) - 1
constants = [None] * len(names)
for i, each in enumerate(names):
val = EnumValue(i)
setattr(EnumClass, each, val)
constants[i] = val
constants = tuple(constants)
EnumType = EnumClass()
return EnumType
def lockfile(name):
"""
Use the file fn as a lock file, return when the lock has been acquired.
Returns a variable to pass to unlockfile().
"""
path = os.path.dirname(name)
if not os.path.isdir(path):
import bb, sys
bb.msg.error(bb.msg.domain.Util, "Error, lockfile path does not exist!: %s" % path)
sys.exit(1)
while True:
# If we leave the lockfiles lying around there is no problem
# but we should clean up after ourselves. This gives potential
# for races though. To work around this, when we acquire the lock
# we check the file we locked was still the lock file on disk.
# by comparing inode numbers. If they don't match or the lockfile
# no longer exists, we start again.
# This implementation is unfair since the last person to request the
# lock is the most likely to win it.
try:
lf = open(name, "a+")
fcntl.flock(lf.fileno(), fcntl.LOCK_EX)
statinfo = os.fstat(lf.fileno())
if os.path.exists(lf.name):
statinfo2 = os.stat(lf.name)
if statinfo.st_ino == statinfo2.st_ino:
return lf
# File no longer exists or changed, retry
lf.close
except Exception, e:
continue
def unlockfile(lf):
"""
Unlock a file locked using lockfile()
"""
os.unlink(lf.name)
fcntl.flock(lf.fileno(), fcntl.LOCK_UN)
lf.close
def md5_file(filename):
"""
Return the hex string representation of the MD5 checksum of filename.
"""
try:
import hashlib
m = hashlib.md5()
except ImportError:
import md5
m = md5.new()
for line in open(filename):
m.update(line)
return m.hexdigest()
def sha256_file(filename):
"""
Return the hex string representation of the 256-bit SHA checksum of
filename. On Python 2.4 this will return None, so callers will need to
handle that by either skipping SHA checks, or running a standalone sha256sum
binary.
"""
try:
import hashlib
except ImportError:
return None
s = hashlib.sha256()
for line in open(filename):
s.update(line)
return s.hexdigest()
def preserved_envvars_list():
return [
'BBPATH',
'BB_PRESERVE_ENV',
'BB_ENV_WHITELIST',
'BB_ENV_EXTRAWHITE',
'COLORTERM',
'DBUS_SESSION_BUS_ADDRESS',
'DESKTOP_SESSION',
'DESKTOP_STARTUP_ID',
'DISPLAY',
'GNOME_KEYRING_PID',
'GNOME_KEYRING_SOCKET',
'GPG_AGENT_INFO',
'GTK_RC_FILES',
'HOME',
'LANG',
'LOGNAME',
'PATH',
'PWD',
'SESSION_MANAGER',
'SHELL',
'SSH_AUTH_SOCK',
'TERM',
'USER',
'USERNAME',
'_',
'XAUTHORITY',
'XDG_DATA_DIRS',
'XDG_SESSION_COOKIE',
]
def filter_environment(good_vars):
"""
Create a pristine environment for bitbake. This will remove variables that
are not known and may influence the build in a negative way.
"""
import bb
removed_vars = []
for key in os.environ.keys():
if key in good_vars:
continue
removed_vars.append(key)
os.unsetenv(key)
del os.environ[key]
if len(removed_vars):
bb.debug(1, "Removed the following variables from the environment:", ",".join(removed_vars))
return removed_vars
def clean_environment():
"""
Clean up any spurious environment variables. This will remove any
variables the user hasn't chose to preserve.
"""
if 'BB_PRESERVE_ENV' not in os.environ:
if 'BB_ENV_WHITELIST' in os.environ:
good_vars = os.environ['BB_ENV_WHITELIST'].split()
else:
good_vars = preserved_envvars_list()
if 'BB_ENV_EXTRAWHITE' in os.environ:
good_vars.extend(os.environ['BB_ENV_EXTRAWHITE'].split())
filter_environment(good_vars)
def empty_environment():
"""
Remove all variable from the environment.
"""
for s in os.environ.keys():
os.unsetenv(s)
del os.environ[s]
def build_environment(d):
"""
Build an environment from all exported variables.
"""
import bb
for var in bb.data.keys(d):
export = bb.data.getVarFlag(var, "export", d)
if export:
os.environ[var] = bb.data.getVar(var, d, True)
def prunedir(topdir):
# Delete everything reachable from the directory named in 'topdir'.
# CAUTION: This is dangerous!
for root, dirs, files in os.walk(topdir, topdown=False):
for name in files:
os.remove(os.path.join(root, name))
for name in dirs:
if os.path.islink(os.path.join(root, name)):
os.remove(os.path.join(root, name))
else:
os.rmdir(os.path.join(root, name))
os.rmdir(topdir)
#
# Could also use return re.compile("(%s)" % "|".join(map(re.escape, suffixes))).sub(lambda mo: "", var)
# but thats possibly insane and suffixes is probably going to be small
#
def prune_suffix(var, suffixes, d):
# See if var ends with any of the suffixes listed and
# remove it if found
for suffix in suffixes:
if var.endswith(suffix):
return var.replace(suffix, "")
return var

View File

@@ -2,7 +2,7 @@ Tim Ansell <mithro@mithis.net>
Phil Blundell <pb@handhelds.org>
Seb Frankengul <seb@frankengul.org>
Holger Freyther <zecke@handhelds.org>
Marcin Juszkiewicz <marcin@haerwu.biz>
Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Chris Larson <kergoth@handhelds.org>
Ulrich Luckas <luckas@musoft.de>
Mickey Lauer <mickey@Vanille.de>

View File

@@ -1,8 +1,99 @@
Changes in BitBake 1.8.x:
- Add bb.utils.prune_suffix function
Changes in BitBake 1.8.12:
- Fix -f (force) in conjunction with -b
Changes in Bitbake 1.9.x:
- Add PE (Package Epoch) support from Philipp Zabel (pH5)
- Treat python functions the same as shell functions for logging
- Use TMPDIR/anonfunc as a __anonfunc temp directory (T)
- Catch truncated cache file errors
- Allow operations other than assignment on flag variables
- Add code to handle inter-task dependencies
- Fix cache errors when generation dotGraphs
- Make sure __inherit_cache is updated before calling include() (from Michael Krelin)
- Fix bug when target was in ASSUME_PROVIDED (#2236)
- Raise ParseError for filenames with multiple underscores instead of infinitely looping (#2062)
- Fix invalid regexp in BBMASK error handling (missing import) (#1124)
- Promote certain warnings from debug to note 2 level
- Update manual
- Correctly redirect stdin when forking
- If parsing errors are found, exit, too many users miss the errors
- Remove supriours PREFERRED_PROVIDER warnings
- svn fetcher: Add _buildsvncommand function
- Improve certain error messages
- Rewrite svn fetcher to make adding extra operations easier
as part of future SRCDATE="now" fixes
(requires new FETCHCMD_svn definition in bitbake.conf)
- Change SVNDIR layout to be more unique (fixes #2644 and #2624)
- Add ConfigParsed Event after configuration parsing is complete
- Add SRCREV support for svn fetcher
- data.emit_var() - only call getVar if we need the variable
- Stop generating the A variable (seems to be legacy code)
- Make sure intertask depends get processed correcting in recursive depends
- Add pn-PN to overrides when evaluating PREFERRED_VERSION
- Improve the progress indicator by skipping tasks that have
already run before starting the build rather than during it
- Add profiling option (-P)
- Add BB_SRCREV_POLICY variable (clear or cache) to control SRCREV cache
- Add SRCREV_FORMAT support
- Fix local fetcher's localpath return values
- Apply OVERRIDES before performing immediate expansions
- Allow the -b -e option combination to take regular expressions
- Fix handling of variables with expansion in the name using _append/_prepend
e.g. RRECOMMENDS_${PN}_append_xyz = "abc"
- Add plain message function to bb.msg
- Sort the list of providers before processing so dependency problems are
reproducible rather than effectively random
- Fix/improve bitbake -s output
- Add locking for fetchers so only one tries to fetch a given file at a given time
- Fix int(0)/None confusion in runqueue.py which causes random gaps in dependency chains
- Expand data in addtasks
- Print the list of missing DEPENDS,RDEPENDS for the "No buildable providers available for required...."
error message.
- Rework add_task to be more efficient (6% speedup, 7% number of function calls reduction)
- Sort digraph output to make builds more reproducible
- Split expandKeys into two for loops to benefit from the expand_cache (12% speedup)
- runqueue.py: Fix idepends handling to avoid dependency errors
- Clear the terminal TOSTOP flag if set (and warn the user)
- Fix regression from r653 and make SRCDATE/CVSDATE work for packages again
- Fix a bug in bb.decodeurl where http://some.where.com/somefile.tgz decoded to host="" (#1530)
- Warn about malformed PREFERRED_PROVIDERS (#1072)
- Add support for BB_NICE_LEVEL option (#1627)
- Psyco is used only on x86 as there is no support for other architectures.
- Sort initial providers list by default preference (#1145, #2024)
- Improve provider sorting so prefered versions have preference over latest versions (#768)
- Detect builds of tasks with overlapping providers and warn (will become a fatal error) (#1359)
- Add MULTI_PROVIDER_WHITELIST variable to allow known safe multiple providers to be listed
- Handle paths in svn fetcher module parameter
- Support the syntax "export VARIABLE"
- Add bzr fetcher
- Add support for cleaning directories before a task in the form:
do_taskname[cleandirs] = "dir"
- bzr fetcher tweaks from Robert Schuster (#2913)
- Add mercurial (hg) fetcher from Robert Schuster (#2913)
- Don't add duplicates to BBPATH
- Fix preferred_version return values (providers.py)
- Fix 'depends' flag splitting
- Fix unexport handling (#3135)
- Add bb.copyfile function similar to bb.movefile (and improve movefile error reporting)
- Allow multiple options for deptask flag
- Use git-fetch instead of git-pull removing any need for merges when
fetching (we don't care about the index). Fixes fetch errors.
- Add BB_GENERATE_MIRROR_TARBALLS option, set to 0 to make git fetches
faster at the expense of not creating mirror tarballs.
- SRCREV handling updates, improvements and fixes from Poky
- Add bb.utils.lockfile() and bb.utils.unlockfile() from Poky
- Add support for task selfstamp and lockfiles flags
- Disable task number acceleration since it can allow the tasks to run
out of sequence
- Improve runqueue code comments
- Add task scheduler abstraction and some example schedulers
- Improve circular dependency chain debugging code and user feedback
- Don't give a stacktrace for invalid tasks, have a user friendly message (#3431)
- Add support for "-e target" (#3432)
- Fix shell showdata command (#3259)
- Fix shell data updating problems (#1880)
- Properly raise errors for invalid source URI protocols
- Change the wget fetcher failure handling to avoid lockfile problems
- Add support for branches in git fetcher (Otavio Salvador, Michael Lauer)
- Make taskdata and runqueue errors more user friendly
- Add norecurse and fullpath options to cvs fetcher
- Fix exit code for build failures in --continue mode
- Fix git branch tags fetching
- Change parseConfigurationFile so it works on real data, not a copy
@@ -27,8 +118,10 @@ Changes in BitBake 1.8.12:
how extensively stamps are looked at for validity
- When handling build target failures make sure idepends are checked and
failed where needed. Fixes --continue mode crashes.
- Fix -f (force) in conjunction with -b
- Fix problems with recrdeptask handling where some idepends weren't handled
correctly.
- Handle exit codes correctly (from pH5)
- Work around refs/HEAD issues with git over http (#3410)
- Add proxy support to the CVS fetcher (from Cyril Chemparathy)
- Improve runfetchcmd so errors are seen and various GIT variables are exported
@@ -44,7 +137,6 @@ Changes in BitBake 1.8.12:
- Add PERSISTENT_DIR to store the PersistData in a persistent
directory != the cache dir.
- Add md5 and sha256 checksum generation functions to utils.py
- Make sure Build Completed events are generated even when tasks fail
- Correctly handle '-' characters in class names (#2958)
- Make sure expandKeys has been called on the data dictonary before running tasks
- Correctly add a task override in the form task-TASKNAME.
@@ -63,6 +155,7 @@ Changes in BitBake 1.8.12:
used instead of the internal bitbake one. Alternatively, BB_ENV_EXTRAWHITE can be used
to extend the internal whitelist.
- Perforce fetcher fix to use commandline options instead of being overriden by the environment
- bb.utils.prunedir can cope with symlinks to directoriees without exceptions
- use @rev when doing a svn checkout
- Add osc fetcher (from Joshua Lock in Poky)
- When SRCREV autorevisioning for a recipe is in use, don't cache the recipe
@@ -76,109 +169,15 @@ Changes in BitBake 1.8.12:
proxies to work better. (from Poky)
- Also allow user and pswd options in SRC_URIs globally (from Poky)
- Improve proxy handling when using mirrors (from Poky)
Changes in BitBake 1.8.10:
- Psyco is available only for x86 - do not use it on other architectures.
- Fix a bug in bb.decodeurl where http://some.where.com/somefile.tgz decoded to host="" (#1530)
- Warn about malformed PREFERRED_PROVIDERS (#1072)
- Add support for BB_NICE_LEVEL option (#1627)
- Sort initial providers list by default preference (#1145, #2024)
- Improve provider sorting so prefered versions have preference over latest versions (#768)
- Detect builds of tasks with overlapping providers and warn (will become a fatal error) (#1359)
- Add MULTI_PROVIDER_WHITELIST variable to allow known safe multiple providers to be listed
- Handle paths in svn fetcher module parameter
- Support the syntax "export VARIABLE"
- Add bzr fetcher
- Add support for cleaning directories before a task in the form:
do_taskname[cleandirs] = "dir"
- bzr fetcher tweaks from Robert Schuster (#2913)
- Add mercurial (hg) fetcher from Robert Schuster (#2913)
- Fix bogus preferred_version return values
- Fix 'depends' flag splitting
- Fix unexport handling (#3135)
- Add bb.copyfile function similar to bb.movefile (and improve movefile error reporting)
- Allow multiple options for deptask flag
- Use git-fetch instead of git-pull removing any need for merges when
fetching (we don't care about the index). Fixes fetch errors.
- Add BB_GENERATE_MIRROR_TARBALLS option, set to 0 to make git fetches
faster at the expense of not creating mirror tarballs.
- SRCREV handling updates, improvements and fixes from Poky
- Add bb.utils.lockfile() and bb.utils.unlockfile() from Poky
- Add support for task selfstamp and lockfiles flags
- Disable task number acceleration since it can allow the tasks to run
out of sequence
- Improve runqueue code comments
- Add task scheduler abstraction and some example schedulers
- Improve circular dependency chain debugging code and user feedback
- Don't give a stacktrace for invalid tasks, have a user friendly message (#3431)
- Add support for "-e target" (#3432)
- Fix shell showdata command (#3259)
- Fix shell data updating problems (#1880)
- Properly raise errors for invalid source URI protocols
- Change the wget fetcher failure handling to avoid lockfile problems
- Add git branch support
- Add support for branches in git fetcher (Otavio Salvador, Michael Lauer)
- Make taskdata and runqueue errors more user friendly
- Add norecurse and fullpath options to cvs fetcher
- bb.utils.prunedir can cope with symlinks to directories without exceptions
Changes in Bitbake 1.8.8:
- Rewrite svn fetcher to make adding extra operations easier
as part of future SRCDATE="now" fixes
(requires new FETCHCMD_svn definition in bitbake.conf)
- Change SVNDIR layout to be more unique (fixes #2644 and #2624)
- Import persistent data store from trunk
- Sync fetcher code with that in trunk, adding SRCREV support for svn
- Add ConfigParsed Event after configuration parsing is complete
- data.emit_var() - only call getVar if we need the variable
- Stop generating the A variable (seems to be legacy code)
- Make sure intertask depends get processed correcting in recursive depends
- Add pn-PN to overrides when evaluating PREFERRED_VERSION
- Improve the progress indicator by skipping tasks that have
already run before starting the build rather than during it
- Add profiling option (-P)
- Add BB_SRCREV_POLICY variable (clear or cache) to control SRCREV cache
- Add SRCREV_FORMAT support
- Fix local fetcher's localpath return values
- Apply OVERRIDES before performing immediate expansions
- Allow the -b -e option combination to take regular expressions
- Add plain message function to bb.msg
- Sort the list of providers before processing so dependency problems are
reproducible rather than effectively random
- Add locking for fetchers so only one tries to fetch a given file at a given time
- Fix int(0)/None confusion in runqueue.py which causes random gaps in dependency chains
- Fix handling of variables with expansion in the name using _append/_prepend
e.g. RRECOMMENDS_${PN}_append_xyz = "abc"
- Expand data in addtasks
- Print the list of missing DEPENDS,RDEPENDS for the "No buildable providers available for required...."
error message.
- Rework add_task to be more efficient (6% speedup, 7% number of function calls reduction)
- Sort digraph output to make builds more reproducible
- Split expandKeys into two for loops to benefit from the expand_cache (12% speedup)
- runqueue.py: Fix idepends handling to avoid dependency errors
- Clear the terminal TOSTOP flag if set (and warn the user)
- Fix regression from r653 and make SRCDATE/CVSDATE work for packages again
Changes in Bitbake 1.8.6:
- Correctly redirect stdin when forking
- If parsing errors are found, exit, too many users miss the errors
- Remove supriours PREFERRED_PROVIDER warnings
Changes in Bitbake 1.8.4:
- Make sure __inherit_cache is updated before calling include() (from Michael Krelin)
- Fix bug when target was in ASSUME_PROVIDED (#2236)
- Raise ParseError for filenames with multiple underscores instead of infinitely looping (#2062)
- Fix invalid regexp in BBMASK error handling (missing import) (#1124)
- Don't run build sanity checks on incomplete builds
- Promote certain warnings from debug to note 2 level
- Update manual
Changes in Bitbake 1.8.2:
- Catch truncated cache file errors
- Add PE (Package Epoch) support from Philipp Zabel (pH5)
- Add code to handle inter-task dependencies
- Allow operations other than assignment on flag variables
- Fix cache errors when generation dotGraphs
- Add bb.utils.prune_suffix function
- Fix hg checkouts of specific revisions (from Poky)
- Fix wget fetching of urls with parameters specified (from Poky)
- Add username handling to git fetcher (from Poky)
- Set HOME environmental variable when running fetcher commands (from Poky)
- Make sure allowed variables inherited from the environment are exported again (from Poky)
- When running a stage task in bbshell, run populate_staging, not the stage task (from Poky)
- Fix + character escaping from PACKAGES_DYNAMIC (thanks Otavio Salvador)
- Addition of BBCLASSEXTEND support for allowing one recipe to provide multiple targets (from Poky)
Changes in Bitbake 1.8.0:
- Release 1.7.x as a stable series

View File

@@ -1,53 +0,0 @@
AUTHORS
COPYING
ChangeLog
MANIFEST
setup.py
bin/bitdoc
bin/bbimage
bin/bitbake
lib/bb/__init__.py
lib/bb/build.py
lib/bb/cache.py
lib/bb/cooker.py
lib/bb/COW.py
lib/bb/data.py
lib/bb/data_smart.py
lib/bb/event.py
lib/bb/fetch/__init__.py
lib/bb/fetch/bzr.py
lib/bb/fetch/cvs.py
lib/bb/fetch/git.py
lib/bb/fetch/hg.py
lib/bb/fetch/local.py
lib/bb/fetch/osc.py
lib/bb/fetch/perforce.py
lib/bb/fetch/ssh.py
lib/bb/fetch/svk.py
lib/bb/fetch/svn.py
lib/bb/fetch/wget.py
lib/bb/manifest.py
lib/bb/methodpool.py
lib/bb/msg.py
lib/bb/parse/__init__.py
lib/bb/parse/parse_py/__init__.py
lib/bb/parse/parse_py/BBHandler.py
lib/bb/parse/parse_py/ConfHandler.py
lib/bb/persist_data.py
lib/bb/providers.py
lib/bb/runqueue.py
lib/bb/shell.py
lib/bb/taskdata.py
lib/bb/utils.py
setup.py
doc/COPYING.GPL
doc/COPYING.MIT
doc/bitbake.1
doc/manual/html.css
doc/manual/Makefile
doc/manual/usermanual.xml
contrib/bbdev.sh
contrib/vim/syntax/bitbake.vim
contrib/vim/ftdetect/bitbake.vim
conf/bitbake.conf
classes/base.bbclass

View File

@@ -22,12 +22,20 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import sys, os, getopt, re, time, optparse
import sys, os, getopt, re, time, optparse, xmlrpclib
sys.path.insert(0,os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
import bb
from bb import cooker
from bb import ui
from bb import server
from bb.server import none
#from bb.server import xmlrpc
__version__ = "1.8.13"
__version__ = "1.9.0"
if sys.hexversion < 0x020500F0:
print "Sorry, python 2.5 or later is required for this version of bitbake"
sys.exit(1)
#============================================================================#
# BBOptions
@@ -41,11 +49,28 @@ class BBConfiguration( object ):
setattr( self, key, val )
def print_exception(exc, value, tb):
"""
Print the exception to stderr, only showing the traceback if bitbake
debugging is enabled.
"""
if not bb.msg.debug_level['default']:
tb = None
sys.__excepthook__(exc, value, tb)
#============================================================================#
# main
#============================================================================#
def main():
return_value = 0
pythonver = sys.version_info
if pythonver[0] < 2 or (pythonver[0] == 2 and pythonver[1] < 5):
print "Sorry, bitbake needs python 2.5 or later."
sys.exit(1)
parser = optparse.OptionParser( version = "BitBake Build Tool Core version %s, %%prog version %s" % ( bb.__version__, __version__ ),
usage = """%prog [options] [package ...]
@@ -99,8 +124,8 @@ Default BBFILES are the .bb files in the current directory.""" )
parser.add_option( "-g", "--graphviz", help = "emit the dependency trees of the specified packages in the dot syntax",
action = "store_true", dest = "dot_graph", default = False )
parser.add_option( "-I", "--ignore-deps", help = """Stop processing at the given list of dependencies when generating dependency graphs. This can help to make the graph more appealing""",
action = "append", dest = "ignored_dot_deps", default = [] )
parser.add_option( "-I", "--ignore-deps", help = """Assume these dependencies don't exist and are already provided (equivalent to ASSUME_PROVIDED). Useful to make dependency graphs more appealing""",
action = "append", dest = "extra_assume_provided", default = [] )
parser.add_option( "-l", "--log-domains", help = """Show debug logging for the specified logging domains""",
action = "append", dest = "debug_domains", default = [] )
@@ -108,6 +133,9 @@ Default BBFILES are the .bb files in the current directory.""" )
parser.add_option( "-P", "--profile", help = "profile the command and print a report",
action = "store_true", dest = "profile", default = False )
parser.add_option( "-u", "--ui", help = "userinterface to use",
action = "store", dest = "ui")
parser.add_option( "", "--revisions-changed", help = "Set the exit code depending on whether upstream floating revisions have changed or not",
action = "store_true", dest = "revisions_changed", default = False )
@@ -117,30 +145,53 @@ Default BBFILES are the .bb files in the current directory.""" )
configuration.pkgs_to_build = []
configuration.pkgs_to_build.extend(args[1:])
cooker = bb.cooker.BBCooker(configuration)
#server = bb.server.xmlrpc
server = bb.server.none
# Save a logfile for cooker into the current working directory. When the
# server is daemonized this logfile will be truncated.
cooker_logfile = os.path.join (os.getcwd(), "cooker.log")
cooker = bb.cooker.BBCooker(configuration, server)
# Clear away any spurious environment variables. But don't wipe the
# environment totally.
# environment totally. This is necessary to ensure the correct operation
# of the UIs (e.g. for DISPLAY, etc.)
bb.utils.clean_environment()
cooker.parseConfiguration()
cooker.parseCommandLine()
if configuration.profile:
try:
import cProfile as profile
except:
import profile
serverinfo = server.BitbakeServerInfo(cooker.server)
profile.runctx("cooker.cook()", globals(), locals(), "profile.log")
import pstats
p = pstats.Stats('profile.log')
p.sort_stats('time')
p.print_stats()
p.print_callers()
p.sort_stats('cumulative')
p.print_stats()
server.BitBakeServerFork(serverinfo, cooker.serve, cooker_logfile)
del cooker
sys.excepthook = print_exception
# Setup a connection to the server (cooker)
serverConnection = server.BitBakeServerConnection(serverinfo)
# Launch the UI
if configuration.ui:
ui = configuration.ui
else:
cooker.cook()
ui = "knotty"
try:
# Dynamically load the UI based on the ui name. Although we
# suggest a fixed set this allows you to have flexibility in which
# ones are available.
exec "from bb.ui import " + ui
exec "return_value = " + ui + ".init(serverConnection.connection, serverConnection.events)"
except ImportError:
print "FATAL: Invalid user interface '%s' specified. " % ui
print "Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'."
except Exception, e:
print "FATAL: Unable to start to '%s' UI due to exception: %s." % (configuration.ui, e)
finally:
serverConnection.terminate()
return return_value
if __name__ == "__main__":
main()
ret = main()
sys.exit(ret)

View File

@@ -453,6 +453,8 @@ def main():
except bb.parse.ParseError:
bb.fatal( "Unable to parse %s" % config_file )
if isinstance(documentation, dict):
documentation = documentation[""]
# Assuming we've the file loaded now, we will initialize the 'tree'
doc = Documentation()

View File

@@ -16,12 +16,17 @@ endif
syn case match
" Catch incorrect syntax (only matches if nothing else does)
"
syn match bbUnmatched "."
syn include @python syntax/python.vim
if exists("b:current_syntax")
unlet b:current_syntax
endif
" Other
syn match bbComment "^#.*$" display contains=bbTodo
@@ -34,21 +39,25 @@ syn match bbArrayBrackets "[\[\]]" contained
" BitBake strings
syn match bbContinue "\\$"
syn region bbString matchgroup=bbQuote start=/"/ skip=/\\$/ excludenl end=/"/ contained keepend contains=bbTodo,bbContinue,bbVarDeref
syn region bbString matchgroup=bbQuote start=/'/ skip=/\\$/ excludenl end=/'/ contained keepend contains=bbTodo,bbContinue,bbVarDeref
syn region bbString matchgroup=bbQuote start=/"/ skip=/\\$/ excludenl end=/"/ contained keepend contains=bbTodo,bbContinue,bbVarInlinePy,bbVarDeref
syn region bbString matchgroup=bbQuote start=/'/ skip=/\\$/ excludenl end=/'/ contained keepend contains=bbTodo,bbContinue,bbVarInlinePy,bbVarDeref
" BitBake variable metadata
syn keyword bbExportFlag export contained nextgroup=bbIdentifier skipwhite
syn match bbVarDeref "${[a-zA-Z0-9\-_\.]\+}" contained
syn match bbVarDef "^\(export\s*\)\?\([a-zA-Z0-9\-_\.]\+\(_[${}a-zA-Z0-9\-_\.]\+\)\?\)\s*\(:=\|+=\|=+\|\.=\|=\.\|?=\|=\)\@=" contains=bbExportFlag,bbIdentifier,bbVarDeref nextgroup=bbVarEq
syn match bbVarBraces "[\${}]"
syn region bbVarDeref matchgroup=bbVarBraces start="${" end="}" contained
" syn region bbVarDeref start="${" end="}" contained
" syn region bbVarInlinePy start="${@" end="}" contained contains=@python
syn region bbVarInlinePy matchgroup=bbVarBraces start="${@" end="}" contained contains=@python
syn match bbIdentifier "[a-zA-Z0-9\-_\.]\+" display contained
syn keyword bbExportFlag export contained nextgroup=bbIdentifier skipwhite
" syn match bbVarDeref "${[a-zA-Z0-9\-_\.]\+}" contained
syn match bbVarDef "^\(export\s*\)\?\([a-zA-Z0-9\-_\.]\+\(_[${}a-zA/-Z0-9\-_\.]\+\)\?\)\s*\(:=\|+=\|=+\|\.=\|=\.\|?=\|=\)\@=" contains=bbExportFlag,bbIdentifier,bbVarDeref nextgroup=bbVarEq
syn match bbIdentifier "[a-zA-Z0-9\-_\./]\+" display contained
"syn keyword bbVarEq = display contained nextgroup=bbVarValue
syn match bbVarEq "\(:=\|+=\|=+\|\.=\|=\.\|?=\|=\)" contained nextgroup=bbVarValue
syn match bbVarValue ".*$" contained contains=bbString,bbVarDeref
syn match bbVarValue ".*$" contained contains=bbString
" BitBake variable metadata flags
syn match bbVarFlagDef "^\([a-zA-Z0-9\-_\.]\+\)\(\[[a-zA-Z0-9\-_\.]\+\]\)\@=" contains=bbIdentifier nextgroup=bbVarFlagFlag
@@ -61,10 +70,6 @@ syn match bbFunction "\h\w*" display contained
" BitBake python metadata
syn include @python syntax/python.vim
if exists("b:current_syntax")
unlet b:current_syntax
endif
syn keyword bbPythonFlag python contained nextgroup=bbFunction
syn match bbPythonFuncDef "^\(python\s\+\)\(\w\+\)\?\(\s*()\s*\)\({\)\@=" contains=bbPythonFlag,bbFunction,bbDelimiter nextgroup=bbPythonFuncRegion skipwhite
@@ -98,7 +103,6 @@ syn match bbStatementRest ".*$" contained contains=bbString,bbVarDeref
"
hi def link bbArrayBrackets Statement
hi def link bbUnmatched Error
hi def link bbVarDeref String
hi def link bbContinue Special
hi def link bbDef Statement
hi def link bbPythonFlag Type
@@ -116,5 +120,8 @@ hi def link bbIdentifier Identifier
hi def link bbVarEq Operator
hi def link bbQuote String
hi def link bbVarValue String
" hi def link bbVarInlinePy PreProc
hi def link bbVarDeref PreProc
hi def link bbVarBraces PreProc
let b:current_syntax = "bb"

View File

@@ -32,7 +32,7 @@ command.
\fBbitbake\fP is a program that executes the specified task (default is 'build')
for a given set of BitBake files.
.br
It expects that BBFILES is defined, which is a space seperated list of files to
It expects that BBFILES is defined, which is a space separated list of files to
be executed. BBFILES does support wildcards.
.br
Default BBFILES are the .bb files in the current directory.
@@ -67,7 +67,7 @@ drop into the interactive mode also called the BitBake shell.
Specify task to execute. Note that this only executes the specified task for
the providee and the packages it depends on, i.e. 'compile' does not implicitly
call stage for the dependencies (IOW: use only if you know what you are doing).
Depending on the base.bbclass a listtaks tasks is defined and will show
Depending on the base.bbclass a listtasks task is defined and will show
available tasks.
.TP
.B \-rFILE, \-\-read=FILE

View File

@@ -88,6 +88,17 @@ share common metadata between many packages.</para></listitem>
<varname>B</varname> = "pre${A}post"</screen></para>
<para>This results in <varname>A</varname> containing <literal>aval</literal> and <varname>B</varname> containing <literal>preavalpost</literal>.</para>
</section>
<section>
<title>Setting a default value (?=)</title>
<para><screen><varname>A</varname> ?= "aval"</screen></para>
<para>If <varname>A</varname> is set before the above is called, it will retain it's previous value. If <varname>A</varname> is unset prior to the above call, <varname>A</varname> will be set to <literal>aval</literal>. Note that this assignment is immediate, so if there are multiple ?= assignments to a single variable, the first of those will be used.</para>
</section>
<section>
<title>Setting a default value (??=)</title>
<para><screen><varname>A</varname> ??= "somevalue"</screen></para>
<para><screen><varname>A</varname> ??= "someothervalue"</screen></para>
<para>If <varname>A</varname> is set before the above, it will retain that value. If <varname>A</varname> is unset prior to the above, <varname>A</varname> will be set to <literal>someothervalue</literal>. This is a lazy version of ??=, in that the assignment does not occur until the end of the parsing process, so that the last, rather than the first, ??= assignment to a given variable will be used.</para>
</section>
<section>
<title>Immediate variable expansion (:=)</title>
<para>:= results in a variable's contents being expanded immediately, rather than when the variable is actually used.</para>
@@ -119,7 +130,7 @@ will be introduced.</para>
</section>
<section>
<title>Conditional metadata set</title>
<para>OVERRIDES is a <quote>:</quote> seperated variable containing each item you want to satisfy conditions. So, if you have a variable which is conditional on <quote>arm</quote>, and <quote>arm</quote> is in OVERRIDES, then the <quote>arm</quote> specific version of the variable is used rather than the non-conditional version. Example:</para>
<para>OVERRIDES is a <quote>:</quote> separated variable containing each item you want to satisfy conditions. So, if you have a variable which is conditional on <quote>arm</quote>, and <quote>arm</quote> is in OVERRIDES, then the <quote>arm</quote> specific version of the variable is used rather than the non-conditional version. Example:</para>
<para><screen><varname>OVERRIDES</varname> = "architecture:os:machine"
<varname>TEST</varname> = "defaultvalue"
<varname>TEST_os</varname> = "osspecificvalue"
@@ -184,7 +195,7 @@ include</literal> directive.</para>
<section>
<title>Inheritance</title>
<para><emphasis>NOTE:</emphasis> This is only supported in .bb and .bbclass files.</para>
<para>The <literal>inherit</literal> directive is a means of specifying what classes of functionality your .bb requires. It is a rudamentary form of inheritence. For example, you can easily abstract out the tasks involved in building a package that uses autoconf and automake, and put that into a bbclass for your packages to make use of. A given bbclass is located by searching for classes/filename.oeclass in <envar>BBPATH</envar>, where filename is what you inherited.</para>
<para>The <literal>inherit</literal> directive is a means of specifying what classes of functionality your .bb requires. It is a rudimentary form of inheritance. For example, you can easily abstract out the tasks involved in building a package that uses autoconf and automake, and put that into a bbclass for your packages to make use of. A given bbclass is located by searching for classes/filename.oeclass in <envar>BBPATH</envar>, where filename is what you inherited.</para>
</section>
<section>
<title>Tasks</title>
@@ -217,6 +228,18 @@ This event handler gets called every time an event is triggered. A global variab
method one can get the name of the triggered event.</para><para>The above event handler prints the name
of the event and the content of the <varname>FILE</varname> variable.</para>
</section>
<section>
<title>Variants</title>
<para>Two Bitbake features exist to facilitate the creation of multiple buildable incarnations from a single recipe file.</para>
<para>The first is <varname>BBCLASSEXTEND</varname>. This variable is a space separated list of classes to utilize to "extend" the recipe for each variant. As an example, setting <screen>BBCLASSEXTEND = "native"</screen> results in a second incarnation of the current recipe being available. This second incarantion will have the "native" class inherited.</para>
<para>The second feature is <varname>BBVERSIONS</varname>. This variable allows a single recipe to be able to build multiple versions of a project from a single recipe file, and allows you to specify conditional metadata (using the <varname>OVERRIDES</varname> mechanism) for a single version, or an optionally named range of versions:</para>
<para><screen>BBVERSIONS = "1.0 2.0 git"
SRC_URI_git = "git://someurl/somepath.git"</screen></para>
<para><screen>BBVERSIONS = "1.0.[0-6]:1.0.0+ \
1.0.[7-9]:1.0.7+"
SRC_URI_append_1.0.7+ = "file://some_patch_which_the_new_versions_need.patch;patch=1"</screen></para>
<para>Note that the name of the range will default to the original version of the recipe, so given OE, a recipe file of foo_1.0.0+.bb will default the name of its versions to 1.0.0+. This is useful, as the range name is not only placed into overrides, it's also made available for the metadata to use in the form of the <varname>BPV</varname> variable, for use in file:// search paths (<varname>FILESPATH</varname>).</para>
</section>
</section>
<section>
<title>Dependency Handling</title>
@@ -258,16 +281,18 @@ of the event and the content of the <varname>FILE</varname> variable.</para>
<title>Parsing</title>
<section>
<title>Configuration Files</title>
<para>The first of the classifications of metadata in BitBake is configuration metadata. This metadata is global, and therefore affects <emphasis>all</emphasis> packages and tasks which are executed. Currently, BitBake has hardcoded knowledge of a single configuration file. It expects to find 'conf/bitbake.conf' somewhere in the user specified <envar>BBPATH</envar>. That configuration file generally has include directives to pull in any other metadata (generally files specific to architecture, machine, <emphasis>local</emphasis> and so on.</para>
<para>The first of the classifications of metadata in BitBake is configuration metadata. This metadata is global, and therefore affects <emphasis>all</emphasis> packages and tasks which are executed.</para>
<para>Bitbake will first search the current working directory for an optional "conf/bblayers.conf" configuration file. This file is expected to contain a BBLAYERS variable which is a space delimited list of 'layer' directories. For each directory in this list a "conf/layer.conf" file will be searched for and parsed with the LAYERDIR variable being set to the directory where the layer was found. The idea is these files will setup BBPATH and other variables correctly for a given build directory automatically for the user.</para>
<para>Bitbake will then expect to find 'conf/bitbake.conf' somewhere in the user specified <envar>BBPATH</envar>. That configuration file generally has include directives to pull in any other metadata (generally files specific to architecture, machine, <emphasis>local</emphasis> and so on.</para>
<para>Only variable definitions and include directives are allowed in .conf files.</para>
</section>
<section>
<title>Classes</title>
<para>BitBake classes are our rudamentary inheritence mechanism. As briefly mentioned in the metadata introduction, they're parsed when an <literal>inherit</literal> directive is encountered, and they are located in classes/ relative to the dirs in <envar>BBPATH</envar>.</para>
<para>BitBake classes are our rudimentary inheritance mechanism. As briefly mentioned in the metadata introduction, they're parsed when an <literal>inherit</literal> directive is encountered, and they are located in classes/ relative to the dirs in <envar>BBPATH</envar>.</para>
</section>
<section>
<title>.bb Files</title>
<para>A BitBake (.bb) file is a logical unit of tasks to be executed. Normally this is a package to be built. Inter-.bb dependencies are obeyed. The files themselves are located via the <varname>BBFILES</varname> variable, which is set to a space seperated list of .bb files, and does handle wildcards.</para>
<para>A BitBake (.bb) file is a logical unit of tasks to be executed. Normally this is a package to be built. Inter-.bb dependencies are obeyed. The files themselves are located via the <varname>BBFILES</varname> variable, which is set to a space separated list of .bb files, and does handle wildcards.</para>
</section>
</section>
</chapter>
@@ -352,15 +377,7 @@ will be tried first when fetching a file if that fails the actual file will be t
<chapter>
<title>Commands</title>
<section>
<title>bbread</title>
<para>bbread is a command for displaying BitBake metadata. When run with no arguments, it has the core parse 'conf/bitbake.conf', as located in BBPATH, and displays that. If you supply a file on the commandline, such as a .bb, then it parses that afterwards, using the aforementioned configuration metadata.</para>
<para><emphasis>NOTE: the stand a lone bbread command was removed. Instead of bbread use bitbake -e.
</emphasis></para>
</section>
<section>
<title>bitbake</title>
<title>The bitbake command</title>
<section>
<title>Introduction</title>
<para>bitbake is the primary command in the system. It facilitates executing tasks in a single .bb file, or executing a given task on a set of multiple .bb files, accounting for interdependencies amongst them.</para>
@@ -372,7 +389,7 @@ will be tried first when fetching a file if that fails the actual file will be t
usage: bitbake [options] [package ...]
Executes the specified task (default is 'build') for a given set of BitBake files.
It expects that BBFILES is defined, which is a space seperated list of files to
It expects that BBFILES is defined, which is a space separated list of files to
be executed. BBFILES does support wildcards.
Default BBFILES are the .bb files in the current directory.
@@ -394,7 +411,7 @@ options:
it depends on, i.e. 'compile' does not implicitly call
stage for the dependencies (IOW: use only if you know
what you are doing). Depending on the base.bbclass a
listtasks tasks is defined and will show available
listtasks task is defined and will show available
tasks
-r FILE, --read=FILE read the specified file before bitbake.conf
-v, --verbose output more chit-chat to the terminal
@@ -417,6 +434,7 @@ options:
Show debug logging for the specified logging domains
-P, --profile profile the command and print a report
</screen>
</para>
<para>
@@ -462,12 +480,12 @@ Two files will be written into the current working directory, <emphasis>depends.
</section>
<section>
<title>Metadata</title>
<para>As you may have seen in the usage information, or in the information about .bb files, the BBFILES variable is how the bitbake tool locates its files. This variable is a space seperated list of files that are available, and supports wildcards.
<para>As you may have seen in the usage information, or in the information about .bb files, the BBFILES variable is how the bitbake tool locates its files. This variable is a space separated list of files that are available, and supports wildcards.
<example>
<title>Setting BBFILES</title>
<programlisting><varname>BBFILES</varname> = "/path/to/bbfiles/*.bb"</programlisting>
</example></para>
<para>With regard to dependencies, it expects the .bb to define a <varname>DEPENDS</varname> variable, which contains a space seperated list of <quote>package names</quote>, which themselves are the <varname>PN</varname> variable. The <varname>PN</varname> variable is, in general, by default, set to a component of the .bb filename.</para>
<para>With regard to dependencies, it expects the .bb to define a <varname>DEPENDS</varname> variable, which contains a space separated list of <quote>package names</quote>, which themselves are the <varname>PN</varname> variable. The <varname>PN</varname> variable is, in general, by default, set to a component of the .bb filename.</para>
<example>
<title>Depending on another .bb</title>
<para>a.bb:
@@ -514,6 +532,5 @@ BBFILE_PRIORITY_upstream = "5"
BBFILE_PRIORITY_local = "10"</screen>
</example>
</section>
</section>
</chapter>
</book>

View File

@@ -23,8 +23,6 @@
# Assign a file to __warn__ to get warnings about slow operations.
#
from inspect import getmro
import copy
import types
types.ImmutableTypes = tuple([ \

File diff suppressed because it is too large Load Diff

View File

@@ -25,8 +25,8 @@
#
#Based on functions from the base bb module, Copyright 2003 Holger Schurig
from bb import data, fetch, event, mkdirhier, utils
import bb, os
from bb import data, event, mkdirhier, utils
import bb, os, sys
# When we execute a python function we'd like certain things
# in all namespaces, hence we add them to __builtins__
@@ -37,7 +37,11 @@ __builtins__['os'] = os
# events
class FuncFailed(Exception):
"""Executed function failed"""
"""
Executed function failed
First parameter a message
Second paramter is a logfile (optional)
"""
class EventException(Exception):
"""Exception which is associated with an Event."""
@@ -50,7 +54,9 @@ class TaskBase(event.Event):
def __init__(self, t, d ):
self._task = t
event.Event.__init__(self, d)
self._package = bb.data.getVar("PF", d, 1)
event.Event.__init__(self)
self._message = "package %s: task %s: %s" % (bb.data.getVar("PF", d, 1), t, bb.event.getName(self)[4:])
def getTask(self):
return self._task
@@ -68,6 +74,10 @@ class TaskSucceeded(TaskBase):
class TaskFailed(TaskBase):
"""Task execution failed"""
def __init__(self, msg, logfile, t, d ):
self.logfile = logfile
self.msg = msg
TaskBase.__init__(self, t, d)
class InvalidTask(TaskBase):
"""Invalid Task"""
@@ -104,42 +114,114 @@ def exec_func(func, d, dirs = None):
else:
adir = data.getVar('B', d, 1)
# Save current directory
try:
prevdir = os.getcwd()
except OSError:
prevdir = data.getVar('TOPDIR', d, True)
# Setup logfiles
t = data.getVar('T', d, 1)
if not t:
bb.msg.fatal(bb.msg.domain.Build, "T not set")
mkdirhier(t)
logfile = "%s/log.%s.%s" % (t, func, str(os.getpid()))
runfile = "%s/run.%s.%s" % (t, func, str(os.getpid()))
# Change to correct directory (if specified)
if adir and os.access(adir, os.F_OK):
os.chdir(adir)
# Handle logfiles
si = file('/dev/null', 'r')
try:
if bb.msg.debug_level['default'] > 0 or ispython:
so = os.popen("tee \"%s\"" % logfile, "w")
else:
so = file(logfile, 'w')
except OSError, e:
bb.msg.error(bb.msg.domain.Build, "opening log file: %s" % e)
pass
se = so
# Dup the existing fds so we dont lose them
osi = [os.dup(sys.stdin.fileno()), sys.stdin.fileno()]
oso = [os.dup(sys.stdout.fileno()), sys.stdout.fileno()]
ose = [os.dup(sys.stderr.fileno()), sys.stderr.fileno()]
# Replace those fds with our own
os.dup2(si.fileno(), osi[1])
os.dup2(so.fileno(), oso[1])
os.dup2(se.fileno(), ose[1])
locks = []
lockfiles = (data.expand(flags['lockfiles'], d) or "").split()
for lock in lockfiles:
locks.append(bb.utils.lockfile(lock))
if flags['python']:
exec_func_python(func, d)
else:
exec_func_shell(func, d, flags)
try:
# Run the function
if ispython:
exec_func_python(func, d, runfile, logfile)
else:
exec_func_shell(func, d, runfile, logfile, flags)
for lock in locks:
bb.utils.unlockfile(lock)
# Restore original directory
try:
os.chdir(prevdir)
except:
pass
if os.path.exists(prevdir):
os.chdir(prevdir)
finally:
def exec_func_python(func, d):
# Unlock any lockfiles
for lock in locks:
bb.utils.unlockfile(lock)
# Restore the backup fds
os.dup2(osi[0], osi[1])
os.dup2(oso[0], oso[1])
os.dup2(ose[0], ose[1])
# Close our logs
si.close()
so.close()
se.close()
if os.path.exists(logfile) and os.path.getsize(logfile) == 0:
bb.msg.debug(2, bb.msg.domain.Build, "Zero size logfile %s, removing" % logfile)
os.remove(logfile)
# Close the backup fds
os.close(osi[0])
os.close(oso[0])
os.close(ose[0])
def exec_func_python(func, d, runfile, logfile):
"""Execute a python BB 'function'"""
import re
import re, os
bbfile = bb.data.getVar('FILE', d, 1)
tmp = "def " + func + "():\n%s" % data.getVar(func, d)
tmp += '\n' + func + '()'
f = open(runfile, "w")
f.write(tmp)
comp = utils.better_compile(tmp, func, bbfile)
g = {} # globals
g['d'] = d
utils.better_exec(comp, g, tmp, bbfile)
try:
utils.better_exec(comp, g, tmp, bbfile)
except:
(t,value,tb) = sys.exc_info()
def exec_func_shell(func, d, flags):
if t in [bb.parse.SkipPackage, bb.build.FuncFailed]:
raise
bb.msg.error(bb.msg.domain.Build, "Function %s failed" % func)
raise FuncFailed("function %s failed" % func, logfile)
def exec_func_shell(func, d, runfile, logfile, flags):
"""Execute a shell BB 'function' Returns true if execution was successful.
For this, it creates a bash shell script in the tmp dectory, writes the local
@@ -149,23 +231,13 @@ def exec_func_shell(func, d, flags):
of the directories you need created prior to execution. The last
item in the list is where we will chdir/cd to.
"""
import sys
deps = flags['deps']
check = flags['check']
interact = flags['interactive']
if check in globals():
if globals()[check](func, deps):
return
global logfile
t = data.getVar('T', d, 1)
if not t:
return 0
mkdirhier(t)
logfile = "%s/log.%s.%s" % (t, func, str(os.getpid()))
runfile = "%s/run.%s.%s" % (t, func, str(os.getpid()))
f = open(runfile, "w")
f.write("#!/bin/sh -e\n")
if bb.msg.debug_level['default'] > 0: f.write("set -x\n")
@@ -177,89 +249,21 @@ def exec_func_shell(func, d, flags):
os.chmod(runfile, 0775)
if not func:
bb.msg.error(bb.msg.domain.Build, "Function not specified")
raise FuncFailed()
# open logs
si = file('/dev/null', 'r')
try:
if bb.msg.debug_level['default'] > 0:
so = os.popen("tee \"%s\"" % logfile, "w")
else:
so = file(logfile, 'w')
except OSError, e:
bb.msg.error(bb.msg.domain.Build, "opening log file: %s" % e)
pass
se = so
if not interact:
# dup the existing fds so we dont lose them
osi = [os.dup(sys.stdin.fileno()), sys.stdin.fileno()]
oso = [os.dup(sys.stdout.fileno()), sys.stdout.fileno()]
ose = [os.dup(sys.stderr.fileno()), sys.stderr.fileno()]
# replace those fds with our own
os.dup2(si.fileno(), osi[1])
os.dup2(so.fileno(), oso[1])
os.dup2(se.fileno(), ose[1])
raise FuncFailed("Function not specified for exec_func_shell")
# execute function
prevdir = os.getcwd()
if flags['fakeroot']:
maybe_fakeroot = "PATH=\"%s\" fakeroot " % bb.data.getVar("PATH", d, 1)
else:
maybe_fakeroot = ''
lang_environment = "LC_ALL=C "
ret = os.system('%s%ssh -e %s' % (lang_environment, maybe_fakeroot, runfile))
try:
os.chdir(prevdir)
except:
pass
if not interact:
# restore the backups
os.dup2(osi[0], osi[1])
os.dup2(oso[0], oso[1])
os.dup2(ose[0], ose[1])
# close our logs
si.close()
so.close()
se.close()
if os.path.getsize(logfile) == 0:
bb.msg.debug(2, bb.msg.domain.Build, "Zero size logfile %s, removing" % logfile)
os.remove(logfile)
# close the backup fds
os.close(osi[0])
os.close(oso[0])
os.close(ose[0])
if ret==0:
if bb.msg.debug_level['default'] > 0:
os.remove(runfile)
# os.remove(logfile)
if ret == 0:
return
else:
bb.msg.error(bb.msg.domain.Build, "function %s failed" % func)
if data.getVar("BBINCLUDELOGS", d):
bb.msg.error(bb.msg.domain.Build, "log data follows (%s)" % logfile)
number_of_lines = data.getVar("BBINCLUDELOGS_LINES", d)
if number_of_lines:
os.system('tail -n%s %s' % (number_of_lines, logfile))
else:
f = open(logfile, "r")
while True:
l = f.readline()
if l == '':
break
l = l.rstrip()
print '| %s' % l
f.close()
else:
bb.msg.error(bb.msg.domain.Build, "see log in %s" % logfile)
raise FuncFailed( logfile )
bb.msg.error(bb.msg.domain.Build, "Function %s failed" % func)
raise FuncFailed("function %s failed" % func, logfile)
def exec_task(task, d):
@@ -280,14 +284,20 @@ def exec_task(task, d):
data.setVar('OVERRIDES', 'task-%s:%s' % (task[3:], old_overrides), localdata)
data.update_data(localdata)
data.expandKeys(localdata)
event.fire(TaskStarted(task, localdata))
event.fire(TaskStarted(task, localdata), localdata)
exec_func(task, localdata)
event.fire(TaskSucceeded(task, localdata))
except FuncFailed, reason:
bb.msg.note(1, bb.msg.domain.Build, "Task failed: %s" % reason )
failedevent = TaskFailed(task, d)
event.fire(failedevent)
raise EventException("Function failed in task: %s" % reason, failedevent)
event.fire(TaskSucceeded(task, localdata), localdata)
except FuncFailed, message:
# Try to extract the optional logfile
try:
(msg, logfile) = message
except:
logfile = None
msg = message
bb.msg.note(1, bb.msg.domain.Build, "Task failed: %s" % message )
failedevent = TaskFailed(msg, logfile, task, d)
event.fire(failedevent, d)
raise EventException("Function failed in task: %s" % message, failedevent)
# make stamp, or cause event and raise exception
if not data.getVarFlag(task, 'nostamp', d) and not data.getVarFlag(task, 'selfstamp', d):

View File

@@ -38,7 +38,7 @@ except ImportError:
import pickle
bb.msg.note(1, bb.msg.domain.Cache, "Importing cPickle failed. Falling back to a very slow implementation.")
__cache_version__ = "130"
__cache_version__ = "131"
class Cache:
"""
@@ -134,7 +134,18 @@ class Cache:
self.data = data
# Make sure __depends makes the depends_cache
self.getVar("__depends", virtualfn, True)
# If we're a virtual class we need to make sure all our depends are appended
# to the depends of fn.
depends = self.getVar("__depends", virtualfn, True) or []
if "__depends" not in self.depends_cache[fn] or not self.depends_cache[fn]["__depends"]:
self.depends_cache[fn]["__depends"] = depends
for dep in depends:
if dep not in self.depends_cache[fn]["__depends"]:
self.depends_cache[fn]["__depends"].append(dep)
# Make sure the variants always make it into the cache too
self.getVar('__VARIANTS', virtualfn, True)
self.depends_cache[virtualfn]["CACHETIMESTAMP"] = bb.parse.cached_mtime(fn)
def virtualfn2realfn(self, virtualfn):
@@ -170,11 +181,8 @@ class Cache:
bb.msg.debug(1, bb.msg.domain.Cache, "Parsing %s (full)" % fn)
bb_data, skipped = self.load_bbfile(fn, cfgData)
if isinstance(bb_data, dict):
return bb_data[cls]
return bb_data
bb_data = self.load_bbfile(fn, cfgData)
return bb_data[cls]
def loadData(self, fn, cfgData, cacheData):
"""
@@ -184,42 +192,39 @@ class Cache:
to record the variables accessed.
Return the cache status and whether the file was skipped when parsed
"""
skipped = 0
virtuals = 0
if fn not in self.checked:
self.cacheValidUpdate(fn)
if self.cacheValid(fn):
if "SKIPPED" in self.depends_cache[fn]:
return True, True
self.handle_data(fn, cacheData)
multi = self.getVar('BBCLASSEXTEND', fn, True)
if multi:
for cls in multi.split():
virtualfn = self.realfn2virtual(fn, cls)
# Pretend we're clean so getVar works
self.clean[virtualfn] = ""
self.handle_data(virtualfn, cacheData)
return True, False
multi = self.getVar('__VARIANTS', fn, True)
for cls in (multi or "").split() + [""]:
virtualfn = self.realfn2virtual(fn, cls)
if self.depends_cache[virtualfn]["__SKIPPED"]:
skipped += 1
bb.msg.debug(1, bb.msg.domain.Cache, "Skipping %s" % virtualfn)
continue
self.handle_data(virtualfn, cacheData)
virtuals += 1
return True, skipped, virtuals
bb.msg.debug(1, bb.msg.domain.Cache, "Parsing %s" % fn)
bb_data, skipped = self.load_bbfile(fn, cfgData)
bb_data = self.load_bbfile(fn, cfgData)
if skipped:
if isinstance(bb_data, dict):
self.setData(fn, fn, bb_data[""])
else:
self.setData(fn, fn, bb_data)
return False, skipped
if isinstance(bb_data, dict):
for data in bb_data:
virtualfn = self.realfn2virtual(fn, data)
self.setData(virtualfn, fn, bb_data[data])
for data in bb_data:
virtualfn = self.realfn2virtual(fn, data)
self.setData(virtualfn, fn, bb_data[data])
if self.getVar("__SKIPPED", virtualfn, True):
skipped += 1
bb.msg.debug(1, bb.msg.domain.Cache, "Skipping %s" % virtualfn)
else:
self.handle_data(virtualfn, cacheData)
return False, skipped
virtuals += 1
return False, skipped, virtuals
self.setData(fn, fn, bb_data)
self.handle_data(fn, cacheData)
return False, skipped
def cacheValid(self, fn):
"""
@@ -273,7 +278,7 @@ class Cache:
for f,old_mtime in depends:
fmtime = bb.parse.cached_mtime_noerror(f)
# Check if file still exists
if fmtime == 0:
if old_mtime != 0 and fmtime == 0:
self.remove(fn)
return False
@@ -286,16 +291,13 @@ class Cache:
if not fn in self.clean:
self.clean[fn] = ""
return True
# Mark extended class data as clean too
multi = self.getVar('__VARIANTS', fn, True)
for cls in (multi or "").split():
virtualfn = self.realfn2virtual(fn, cls)
self.clean[virtualfn] = ""
def skip(self, fn):
"""
Mark a fn as skipped
Called from the parser
"""
if not fn in self.depends_cache:
self.depends_cache[fn] = {}
self.depends_cache[fn]["SKIPPED"] = "1"
return True
def remove(self, fn):
"""
@@ -326,7 +328,7 @@ class Cache:
version_data['CACHE_VER'] = __cache_version__
version_data['BITBAKE_VER'] = bb.__version__
cache_data = copy.deepcopy(self.depends_cache)
cache_data = copy.copy(self.depends_cache)
for fn in self.depends_cache:
if '__BB_DONT_CACHE' in self.depends_cache[fn] and self.depends_cache[fn]['__BB_DONT_CACHE']:
bb.msg.debug(2, bb.msg.domain.Cache, "Not caching %s, marked as not cacheable" % fn)
@@ -441,7 +443,7 @@ class Cache:
# Touch this to make sure its in the cache
self.getVar('__BB_DONT_CACHE', file_name, True)
self.getVar('BBCLASSEXTEND', file_name, True)
self.getVar('__VARIANTS', file_name, True)
def load_bbfile( self, bbfile , config):
"""
@@ -462,10 +464,7 @@ class Cache:
try:
bb_data = parse.handle(bbfile, bb_data) # read .bb data
os.chdir(oldpath)
return bb_data, False
except bb.parse.SkipPackage:
os.chdir(oldpath)
return bb_data, True
return bb_data
except:
os.chdir(oldpath)
raise

View File

@@ -28,7 +28,9 @@ and must not trigger events, directly or indirectly.
Commands are queued in a CommandQueue
"""
import bb
import bb.event
import bb.cooker
import bb.data
async_cmds = {}
sync_cmds = {}
@@ -57,7 +59,6 @@ class Command:
async_cmds[command] = (method)
def runCommand(self, commandline):
bb.debug("Running command %s" % commandline)
try:
command = commandline.pop(0)
if command in CommandsSync.__dict__:
@@ -95,9 +96,9 @@ class Command:
def finishAsyncCommand(self, error = None):
if error:
bb.event.fire(bb.command.CookerCommandFailed(self.cooker.configuration.event_data, error))
bb.event.fire(CookerCommandFailed(error), self.cooker.configuration.event_data)
else:
bb.event.fire(bb.command.CookerCommandCompleted(self.cooker.configuration.event_data))
bb.event.fire(CookerCommandCompleted(), self.cooker.configuration.event_data)
self.currentAsyncCommand = None
@@ -248,24 +249,24 @@ class CookerCommandCompleted(bb.event.Event):
"""
Cooker command completed
"""
def __init__(self, data):
bb.event.Event.__init__(self, data)
def __init__(self):
bb.event.Event.__init__(self)
class CookerCommandFailed(bb.event.Event):
"""
Cooker command completed
"""
def __init__(self, data, error):
bb.event.Event.__init__(self, data)
def __init__(self, error):
bb.event.Event.__init__(self)
self.error = error
class CookerCommandSetExitCode(bb.event.Event):
"""
Set the exit code for a cooker command
"""
def __init__(self, data, exitcode):
bb.event.Event.__init__(self, data)
def __init__(self, exitcode):
bb.event.Event.__init__(self)
self.exitcode = int(exitcode)

File diff suppressed because it is too large Load Diff

View File

@@ -37,7 +37,7 @@ the speed is more critical here.
#
#Based on functions from the base bb module, Copyright 2003 Holger Schurig
import sys, os, re, time, types
import sys, os, re, types
if sys.argv[0][-5:] == "pydoc":
path = os.path.dirname(os.path.dirname(sys.argv[1]))
else:
@@ -47,6 +47,9 @@ sys.path.insert(0,path)
from bb import data_smart
import bb
class VarExpandError(Exception):
pass
_dict_type = data_smart.DataSmart
def init():

View File

@@ -39,6 +39,11 @@ __setvar_keyword__ = ["_append","_prepend"]
__setvar_regexp__ = re.compile('(?P<base>.*?)(?P<keyword>_append|_prepend)(_(?P<add>.*))?')
__expand_var_regexp__ = re.compile(r"\${[^{}]+}")
__expand_python_regexp__ = re.compile(r"\${@.+?}")
_expand_globals = {
"os": os,
"bb": bb,
"time": time,
}
class DataSmart:
@@ -50,6 +55,7 @@ class DataSmart:
self._seen_overrides = seen
self.expand_cache = {}
self.expand_locals = {"d": self}
def expand(self,s, varname):
def var_sub(match):
@@ -66,8 +72,7 @@ class DataSmart:
def python_sub(match):
import bb
code = match.group()[3:-1]
locals()['d'] = self
s = eval(code)
s = eval(code, _expand_globals, self.expand_locals)
if type(s) == types.IntType: s = str(s)
return s
@@ -171,14 +176,15 @@ class DataSmart:
Rename the variable key to newkey
"""
val = self.getVar(key, 0)
if val is None:
return
self.setVar(newkey, val)
if val is not None:
self.setVar(newkey, val)
for i in ('_append', '_prepend'):
src = self.getVarFlag(key, i)
if src is None:
continue
dest = self.getVarFlag(newkey, i) or []
src = self.getVarFlag(key, i) or []
dest.extend(src)
self.setVarFlag(newkey, i, dest)
@@ -218,7 +224,7 @@ class DataSmart:
if not var in self.dict:
self._makeShadowCopy(var)
for i in flags.keys():
for i in flags:
if i == "content":
continue
self.dict[var][i] = flags[i]
@@ -228,7 +234,7 @@ class DataSmart:
flags = {}
if local_var:
for i in local_var.keys():
for i in local_var:
if i == "content":
continue
flags[i] = local_var[i]

View File

@@ -22,23 +22,20 @@ BitBake build tools.
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os, re
import os, re, sys
import bb.utils
import pickle
# This is the pid for which we should generate the event. This is set when
# the runqueue forks off.
worker_pid = 0
worker_pipe = None
class Event:
"""Base class for events"""
type = "Event"
def __init__(self, d):
self._data = d
def getData(self):
return self._data
def setData(self, data):
self._data = data
data = property(getData, setData, None, "data property")
def __init__(self):
self.pid = worker_pid
NotHandled = 0
Handled = 1
@@ -47,75 +44,95 @@ Registered = 10
AlreadyRegistered = 14
# Internal
_handlers = []
_handlers_dict = {}
_handlers = {}
_ui_handlers = {}
_ui_handler_seq = 0
def tmpHandler(event):
"""Default handler for code events"""
return NotHandled
def defaultTmpHandler():
tmp = "def tmpHandler(e):\n\t\"\"\"heh\"\"\"\n\treturn NotHandled"
comp = bb.utils.better_compile(tmp, "tmpHandler(e)", "bb.event.defaultTmpHandler")
return comp
def fire(event):
"""Fire off an Event"""
for h in _handlers:
def fire_class_handlers(event, d):
for handler in _handlers:
h = _handlers[handler]
event.data = d
if type(h).__name__ == "code":
exec(h)
if tmpHandler(event) == Handled:
return Handled
tmpHandler(event)
else:
if h(event) == Handled:
return Handled
return NotHandled
h(event)
del event.data
def fire_ui_handlers(event, d):
errors = []
for h in _ui_handlers:
#print "Sending event %s" % event
try:
# We use pickle here since it better handles object instances
# which xmlrpc's marshaller does not. Events *must* be serializable
# by pickle.
_ui_handlers[h].event.send((pickle.dumps(event)))
except:
errors.append(h)
for h in errors:
del _ui_handlers[h]
def fire(event, d):
"""Fire off an Event"""
# We can fire class handlers in the worker process context and this is
# desired so they get the task based datastore.
# UI handlers need to be fired in the server context so we defer this. They
# don't have a datastore so the datastore context isn't a problem.
fire_class_handlers(event, d)
if worker_pid != 0:
worker_fire(event, d)
else:
fire_ui_handlers(event, d)
def worker_fire(event, d):
data = "<event>" + pickle.dumps(event) + "</event>"
try:
if os.write(worker_pipe, data) != len (data):
print "Error sending event to server (short write)"
except OSError:
sys.exit(1)
def fire_from_worker(event, d):
if not event.startswith("<event>") or not event.endswith("</event>"):
print "Error, not an event"
return
event = pickle.loads(event[7:-8])
fire_ui_handlers(event, d)
def register(name, handler):
"""Register an Event handler"""
# already registered
if name in _handlers_dict:
if name in _handlers:
return AlreadyRegistered
if handler is not None:
# handle string containing python code
# handle string containing python code
if type(handler).__name__ == "str":
_registerCode(handler)
tmp = "def tmpHandler(e):\n%s" % handler
comp = bb.utils.better_compile(tmp, "tmpHandler(e)", "bb.event._registerCode")
_handlers[name] = comp
else:
_handlers.append(handler)
_handlers[name] = handler
_handlers_dict[name] = 1
return Registered
def _registerCode(handlerStr):
"""Register a 'code' Event.
Deprecated interface; call register instead.
Expects to be passed python code as a string, which will
be passed in turn to compile() and then exec(). Note that
the code will be within a function, so should have had
appropriate tabbing put in place."""
tmp = "def tmpHandler(e):\n%s" % handlerStr
comp = bb.utils.better_compile(tmp, "tmpHandler(e)", "bb.event._registerCode")
# prevent duplicate registration
_handlers.append(comp)
def remove(name, handler):
"""Remove an Event handler"""
_handlers.pop(name)
_handlers_dict.pop(name)
if type(handler).__name__ == "str":
return _removeCode(handler)
else:
_handlers.remove(handler)
def register_UIHhandler(handler):
bb.event._ui_handler_seq = bb.event._ui_handler_seq + 1
_ui_handlers[_ui_handler_seq] = handler
return _ui_handler_seq
def _removeCode(handlerStr):
"""Remove a 'code' Event handler
Deprecated interface; call remove instead."""
tmp = "def tmpHandler(e):\n%s" % handlerStr
comp = bb.utils.better_compile(tmp, "tmpHandler(e)", "bb.event._removeCode")
_handlers.remove(comp)
def unregister_UIHhandler(handlerNum):
if handlerNum in _ui_handlers:
del _ui_handlers[handlerNum]
return
def getName(e):
"""Returns the name of a class or class instance"""
@@ -127,13 +144,20 @@ def getName(e):
class ConfigParsed(Event):
"""Configuration Parsing Complete"""
class RecipeParsed(Event):
""" Recipe Parsing Complete """
def __init__(self, fn):
self.fn = fn
Event.__init__(self)
class StampUpdate(Event):
"""Trigger for any adjustment of the stamp files to happen"""
def __init__(self, targets, stampfns, d):
def __init__(self, targets, stampfns):
self._targets = targets
self._stampfns = stampfns
Event.__init__(self, d)
Event.__init__(self)
def getStampPrefix(self):
return self._stampfns
@@ -144,29 +168,13 @@ class StampUpdate(Event):
stampPrefix = property(getStampPrefix)
targets = property(getTargets)
class PkgBase(Event):
"""Base class for package events"""
def __init__(self, t, d):
self._pkg = t
Event.__init__(self, d)
def getPkg(self):
return self._pkg
def setPkg(self, pkg):
self._pkg = pkg
pkg = property(getPkg, setPkg, None, "pkg property")
class BuildBase(Event):
"""Base class for bbmake run events"""
def __init__(self, n, p, c, failures = 0):
def __init__(self, n, p, failures = 0):
self._name = n
self._pkgs = p
Event.__init__(self, c)
Event.__init__(self)
self._failures = failures
def getPkgs(self):
@@ -198,32 +206,7 @@ class BuildBase(Event):
cfg = property(getCfg, setCfg, None, "cfg property")
class DepBase(PkgBase):
"""Base class for dependency events"""
def __init__(self, t, data, d):
self._dep = d
PkgBase.__init__(self, t, data)
def getDep(self):
return self._dep
def setDep(self, dep):
self._dep = dep
dep = property(getDep, setDep, None, "dep property")
class PkgStarted(PkgBase):
"""Package build started"""
class PkgFailed(PkgBase):
"""Package build failed"""
class PkgSucceeded(PkgBase):
"""Package build completed"""
class BuildStarted(BuildBase):
@@ -234,18 +217,13 @@ class BuildCompleted(BuildBase):
"""bbmake build run completed"""
class UnsatisfiedDep(DepBase):
"""Unsatisfied Dependency"""
class RecursiveDep(DepBase):
"""Recursive Dependency"""
class NoProvider(Event):
"""No Provider for an Event"""
def __init__(self, item, data,runtime=False):
Event.__init__(self, data)
def __init__(self, item, runtime=False):
Event.__init__(self)
self._item = item
self._runtime = runtime
@@ -258,8 +236,8 @@ class NoProvider(Event):
class MultipleProviders(Event):
"""Multiple Providers"""
def __init__(self, item, candidates, data, runtime = False):
Event.__init__(self, data)
def __init__(self, item, candidates, runtime = False):
Event.__init__(self)
self._item = item
self._candidates = candidates
self._is_runtime = runtime
@@ -281,3 +259,29 @@ class MultipleProviders(Event):
Get the possible Candidates for a PROVIDER.
"""
return self._candidates
class ParseProgress(Event):
"""
Parsing Progress Event
"""
def __init__(self, cached, parsed, skipped, masked, virtuals, errors, total):
Event.__init__(self)
self.cached = cached
self.parsed = parsed
self.skipped = skipped
self.virtuals = virtuals
self.masked = masked
self.errors = errors
self.sofar = cached + parsed
self.total = total
class DepTreeGenerated(Event):
"""
Event when a dependency tree has been generated
"""
def __init__(self, depgraph):
Event.__init__(self)
self._depgraph = depgraph

View File

@@ -24,15 +24,13 @@ BitBake build tools.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os, re, fcntl
import os, re
import bb
from bb import data
from bb import persist_data
try:
import cPickle as pickle
except ImportError:
import pickle
class MalformedUrl(Exception):
"""Exception raised when encountering an invalid url"""
class FetchError(Exception):
"""Exception raised when a download fails"""
@@ -52,6 +50,103 @@ class MD5SumError(Exception):
class InvalidSRCREV(Exception):
"""Exception raised when an invalid SRCREV is encountered"""
def decodeurl(url):
"""Decodes an URL into the tokens (scheme, network location, path,
user, password, parameters).
>>> decodeurl("http://www.google.com/index.html")
('http', 'www.google.com', '/index.html', '', '', {})
>>> decodeurl("file://gas/COPYING")
('file', '', 'gas/COPYING', '', '', {})
CVS url with username, host and cvsroot. The cvs module to check out is in the
parameters:
>>> decodeurl("cvs://anoncvs@cvs.handhelds.org/cvs;module=familiar/dist/ipkg")
('cvs', 'cvs.handhelds.org', '/cvs', 'anoncvs', '', {'module': 'familiar/dist/ipkg'})
Dito, but this time the username has a password part. And we also request a special tag
to check out.
>>> decodeurl("cvs://anoncvs:anonymous@cvs.handhelds.org/cvs;module=familiar/dist/ipkg;tag=V0-99-81")
('cvs', 'cvs.handhelds.org', '/cvs', 'anoncvs', 'anonymous', {'tag': 'V0-99-81', 'module': 'familiar/dist/ipkg'})
"""
m = re.compile('(?P<type>[^:]*)://((?P<user>.+)@)?(?P<location>[^;]+)(;(?P<parm>.*))?').match(url)
if not m:
raise MalformedUrl(url)
type = m.group('type')
location = m.group('location')
if not location:
raise MalformedUrl(url)
user = m.group('user')
parm = m.group('parm')
locidx = location.find('/')
if locidx != -1 and type.lower() != 'file':
host = location[:locidx]
path = location[locidx:]
else:
host = ""
path = location
if user:
m = re.compile('(?P<user>[^:]+)(:?(?P<pswd>.*))').match(user)
if m:
user = m.group('user')
pswd = m.group('pswd')
else:
user = ''
pswd = ''
p = {}
if parm:
for s in parm.split(';'):
s1,s2 = s.split('=')
p[s1] = s2
return (type, host, path, user, pswd, p)
def encodeurl(decoded):
"""Encodes a URL from tokens (scheme, network location, path,
user, password, parameters).
>>> encodeurl(['http', 'www.google.com', '/index.html', '', '', {}])
'http://www.google.com/index.html'
CVS with username, host and cvsroot. The cvs module to check out is in the
parameters:
>>> encodeurl(['cvs', 'cvs.handhelds.org', '/cvs', 'anoncvs', '', {'module': 'familiar/dist/ipkg'}])
'cvs://anoncvs@cvs.handhelds.org/cvs;module=familiar/dist/ipkg'
Dito, but this time the username has a password part. And we also request a special tag
to check out.
>>> encodeurl(['cvs', 'cvs.handhelds.org', '/cvs', 'anoncvs', 'anonymous', {'tag': 'V0-99-81', 'module': 'familiar/dist/ipkg'}])
'cvs://anoncvs:anonymous@cvs.handhelds.org/cvs;tag=V0-99-81;module=familiar/dist/ipkg'
"""
(type, host, path, user, pswd, p) = decoded
if not type or not path:
bb.msg.fatal(bb.msg.domain.Fetcher, "invalid or missing parameters for url encoding")
url = '%s://' % type
if user:
url += "%s" % user
if pswd:
url += ":%s" % pswd
url += "@"
if host:
url += "%s" % host
url += "%s" % path
if p:
for parm in p:
url += ";%s=%s" % (parm, p[parm])
return url
def uri_replace(uri, uri_find, uri_replace, d):
# bb.msg.note(1, bb.msg.domain.Fetcher, "uri_replace: operating on %s" % uri)
if not uri or not uri_find or not uri_replace:
@@ -65,7 +160,6 @@ def uri_replace(uri, uri_find, uri_replace, d):
result_decoded[loc] = uri_decoded[loc]
import types
if type(i) == types.StringType:
import re
if (re.match(i, uri_decoded[loc])):
result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc])
if uri_find_decoded.index(i) == 2:
@@ -78,7 +172,7 @@ def uri_replace(uri, uri_find, uri_replace, d):
# bb.msg.note(1, bb.msg.domain.Fetcher, "uri_replace: no match")
return uri
# else:
# for j in i.keys():
# for j in i:
# FIXME: apply replacements against options
return bb.encodeurl(result_decoded)
@@ -105,6 +199,11 @@ def fetcher_init(d):
pd.delDomain("BB_URI_HEADREVS")
else:
bb.msg.fatal(bb.msg.domain.Fetcher, "Invalid SRCREV cache policy of: %s" % srcrev_policy)
for m in methods:
if hasattr(m, "init"):
m.init(d)
# Make sure our domains exist
pd.addDomain("BB_URI_HEADREVS")
pd.addDomain("BB_URI_LOCALCOUNT")
@@ -153,14 +252,16 @@ def init(urls, d, setup = True):
urldata_cache[fn] = urldata
return urldata
def go(d):
def go(d, urls = None):
"""
Fetch all urls
init must have previously been called
"""
urldata = init([], d, True)
if not urls:
urls = d.getVar("SRC_URI", 1).split()
urldata = init(urls, d, True)
for u in urldata:
for u in urls:
ud = urldata[u]
m = ud.method
if ud.localfile:
@@ -184,7 +285,23 @@ def go(d):
pass
bb.utils.unlockfile(lf)
continue
m.go(u, ud, d)
# First try fetching uri, u, from PREMIRRORS
mirrors = [ i.split() for i in (bb.data.getVar('PREMIRRORS', d, 1) or "").split('\n') if i ]
localpath = try_mirrors(d, u, mirrors)
if not localpath:
# Next try fetching from the original uri, u
try:
m.go(u, ud, d)
localpath = ud.localpath
except:
# Finally, try fetching uri, u, from MIRRORS
mirrors = [ i.split() for i in (bb.data.getVar('MIRRORS', d, 1) or "").split('\n') if i ]
localpath = try_mirrors (d, u, mirrors)
if localpath:
ud.localpath = localpath
if ud.localfile:
if not m.forcefetch(u, ud, d):
Fetch.write_md5sum(u, ud, d)
@@ -202,9 +319,20 @@ def checkstatus(d):
ud = urldata[u]
m = ud.method
bb.msg.note(1, bb.msg.domain.Fetcher, "Testing URL %s" % u)
ret = m.checkstatus(u, ud, d)
# First try checking uri, u, from PREMIRRORS
mirrors = [ i.split() for i in (bb.data.getVar('PREMIRRORS', d, 1) or "").split('\n') if i ]
ret = try_mirrors(d, u, mirrors, True)
if not ret:
bb.msg.fatal(bb.msg.domain.Fetcher, "URL %s doesn't work" % u)
# Next try checking from the original uri, u
try:
ret = m.checkstatus(u, ud, d)
except:
# Finally, try checking uri, u, from MIRRORS
mirrors = [ i.split() for i in (bb.data.getVar('MIRRORS', d, 1) or "").split('\n') if i ]
ret = try_mirrors (d, u, mirrors, True)
if not ret:
bb.msg.error(bb.msg.domain.Fetcher, "URL %s doesn't work" % u)
def localpaths(d):
"""
@@ -331,6 +459,48 @@ def runfetchcmd(cmd, d, quiet = False):
return output
def try_mirrors(d, uri, mirrors, check = False):
"""
Try to use a mirrored version of the sources.
This method will be automatically called before the fetchers go.
d Is a bb.data instance
uri is the original uri we're trying to download
mirrors is the list of mirrors we're going to try
"""
fpath = os.path.join(data.getVar("DL_DIR", d, 1), os.path.basename(uri))
if not check and os.access(fpath, os.R_OK):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists, skipping checkout." % fpath)
return fpath
ld = d.createCopy()
for (find, replace) in mirrors:
newuri = uri_replace(uri, find, replace, ld)
if newuri != uri:
try:
ud = FetchData(newuri, ld)
except bb.fetch.NoMethodError:
bb.msg.debug(1, bb.msg.domain.Fetcher, "No method for %s" % uri)
continue
ud.setup_localpath(ld)
try:
if check:
ud.method.checkstatus(newuri, ud, ld)
else:
ud.method.go(newuri, ud, ld)
return ud.localpath
except (bb.fetch.MissingParameterError,
bb.fetch.FetchError,
bb.fetch.MD5SumError):
import sys
(type, value, traceback) = sys.exc_info()
bb.msg.debug(2, bb.msg.domain.Fetcher, "Mirror fetch failure: %s" % value)
continue
return None
class FetchData(object):
"""
A class which represents the fetcher state for a given URI.
@@ -357,16 +527,33 @@ class FetchData(object):
# if user sets localpath for file, use it instead.
self.localpath = self.parm["localpath"]
else:
try:
bb.fetch.srcrev_internal_call = True
self.localpath = self.method.localpath(self.url, self, d)
finally:
bb.fetch.srcrev_internal_call = False
# We have to clear data's internal caches since the cached value of SRCREV is now wrong.
# Horrible...
bb.data.delVar("ISHOULDNEVEREXIST", d)
self.md5 = self.localpath + '.md5'
self.lockfile = self.localpath + '.lock'
premirrors = bb.data.getVar('PREMIRRORS', d, True)
local = ""
if premirrors and self.url:
aurl = self.url.split(";")[0]
mirrors = [ i.split() for i in (premirrors or "").split('\n') if i ]
for (find, replace) in mirrors:
if replace.startswith("file://"):
path = aurl.split("://")[1]
path = path.split(";")[0]
local = replace.split("://")[1] + os.path.basename(path)
if local == aurl or not os.path.exists(local) or os.path.isdir(local):
local = ""
self.localpath = local
if not local:
try:
bb.fetch.srcrev_internal_call = True
self.localpath = self.method.localpath(self.url, self, d)
finally:
bb.fetch.srcrev_internal_call = False
# We have to clear data's internal caches since the cached value of SRCREV is now wrong.
# Horrible...
bb.data.delVar("ISHOULDNEVEREXIST", d)
# Note: These files should always be in DL_DIR whereas localpath may not be.
basepath = bb.data.expand("${DL_DIR}/%s" % os.path.basename(self.localpath), d)
self.md5 = basepath + '.md5'
self.lockfile = basepath + '.lock'
class Fetch(object):
@@ -471,43 +658,22 @@ class Fetch(object):
srcrev_internal_helper = staticmethod(srcrev_internal_helper)
def try_mirror(d, tarfn):
def localcount_internal_helper(ud, d):
"""
Try to use a mirrored version of the sources. We do this
to avoid massive loads on foreign cvs and svn servers.
This method will be used by the different fetcher
implementations.
d Is a bb.data instance
tarfn is the name of the tarball
Return:
a) a locked localcount if specified
b) None otherwise
"""
tarpath = os.path.join(data.getVar("DL_DIR", d, 1), tarfn)
if os.access(tarpath, os.R_OK):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists, skipping checkout." % tarfn)
return True
pn = data.getVar('PN', d, True)
src_tarball_stash = None
if pn:
src_tarball_stash = (data.getVar('SRC_TARBALL_STASH_%s' % pn, d, True) or data.getVar('CVS_TARBALL_STASH_%s' % pn, d, True) or data.getVar('SRC_TARBALL_STASH', d, True) or data.getVar('CVS_TARBALL_STASH', d, True) or "").split()
localcount= None
if 'name' in ud.parm:
pn = data.getVar("PN", d, 1)
localcount = data.getVar("LOCALCOUNT_" + ud.parm['name'], d, 1)
if not localcount:
localcount = data.getVar("LOCALCOUNT", d, 1)
return localcount
for stash in src_tarball_stash:
fetchcmd = data.getVar("FETCHCOMMAND_mirror", d, True) or data.getVar("FETCHCOMMAND_wget", d, True)
uri = stash + tarfn
bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri)
fetchcmd = fetchcmd.replace("${URI}", uri)
httpproxy = data.getVar("http_proxy", d, True)
ftpproxy = data.getVar("ftp_proxy", d, True)
if httpproxy:
fetchcmd = "http_proxy=" + httpproxy + " " + fetchcmd
if ftpproxy:
fetchcmd = "ftp_proxy=" + ftpproxy + " " + fetchcmd
ret = os.system(fetchcmd)
if ret == 0:
bb.msg.note(1, bb.msg.domain.Fetcher, "Fetched %s from tarball stash, skipping checkout" % tarfn)
return True
return False
try_mirror = staticmethod(try_mirror)
localcount_internal_helper = staticmethod(localcount_internal_helper)
def verify_md5sum(ud, got_sum):
"""
@@ -554,8 +720,7 @@ class Fetch(object):
"""
"""
has_sortable = hasattr(self, "_sortable_revision")
if has_sortable:
if hasattr(self, "_sortable_revision"):
return self._sortable_revision(url, ud, d)
pd = persist_data.PersistData(d)
@@ -563,13 +728,24 @@ class Fetch(object):
latest_rev = self._build_revision(url, ud, d)
last_rev = pd.getValue("BB_URI_LOCALCOUNT", key + "_rev")
count = pd.getValue("BB_URI_LOCALCOUNT", key + "_count")
uselocalcount = bb.data.getVar("BB_LOCALCOUNT_OVERRIDE", d, True) or False
count = None
if uselocalcount:
count = Fetch.localcount_internal_helper(ud, d)
if count is None:
count = pd.getValue("BB_URI_LOCALCOUNT", key + "_count")
if last_rev == latest_rev:
return str(count + "+" + latest_rev)
buildindex_provided = hasattr(self, "_sortable_buildindex")
if buildindex_provided:
count = self._sortable_buildindex(url, ud, d, latest_rev)
if count is None:
count = "0"
elif uselocalcount or buildindex_provided:
count = str(count)
else:
count = str(int(count) + 1)
@@ -593,6 +769,7 @@ import perforce
import bzr
import hg
import osc
import repo
methods.append(local.Local())
methods.append(wget.Wget())
@@ -605,3 +782,4 @@ methods.append(perforce.Perforce())
methods.append(bzr.Bzr())
methods.append(hg.Hg())
methods.append(osc.Osc())
methods.append(repo.Repo())

View File

@@ -29,7 +29,6 @@ import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import MissingParameterError
from bb.fetch import runfetchcmd
class Bzr(Fetch):
@@ -92,11 +91,6 @@ class Bzr(Fetch):
def go(self, loc, ud, d):
"""Fetch url"""
# try to use the tarball stash
if Fetch.try_mirror(d, ud.localfile):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists or was mirrored, skipping bzr checkout." % ud.localpath)
return
if os.access(os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir), '.bzr'), os.R_OK):
bzrcmd = self._buildbzrcommand(ud, d, "update")
bb.msg.debug(1, bb.msg.domain.Fetcher, "BZR Update %s" % loc)

View File

@@ -26,7 +26,7 @@ BitBake build tools.
#Based on functions from the base bb module, Copyright 2003 Holger Schurig
#
import os, re
import os
import bb
from bb import data
from bb.fetch import Fetch
@@ -41,7 +41,7 @@ class Cvs(Fetch):
"""
Check to see if a given url can be fetched with cvs.
"""
return ud.type in ['cvs', 'pserver']
return ud.type in ['cvs']
def localpath(self, url, ud, d):
if not "module" in ud.parm:
@@ -77,11 +77,6 @@ class Cvs(Fetch):
def go(self, loc, ud, d):
# try to use the tarball stash
if not self.forcefetch(loc, ud, d) and Fetch.try_mirror(d, ud.localfile):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists or was mirrored, skipping cvs checkout." % ud.localpath)
return
method = "pserver"
if "method" in ud.parm:
method = ud.parm["method"]

View File

@@ -20,15 +20,20 @@ BitBake 'Fetch' git implementation
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os, re
import os
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import runfetchcmd
class Git(Fetch):
"""Class to fetch a module or modules from git repositories"""
def init(self, d):
#
# Only enable _sortable revision if the key is set
#
if bb.data.getVar("BB_GIT_CLONE_FOR_SRCREV", d, True):
self._sortable_buildindex = self._sortable_buildindex_disabled
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with git.
@@ -46,6 +51,10 @@ class Git(Fetch):
ud.branch = ud.parm.get("branch", "master")
gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.'))
ud.mirrortarball = 'git_%s.tar.gz' % (gitsrcname)
ud.clonedir = os.path.join(data.expand('${GITDIR}', d), gitsrcname)
tag = Fetch.srcrev_internal_helper(ud, d)
if tag is True:
ud.tag = self.latest_revision(url, ud, d)
@@ -55,74 +64,101 @@ class Git(Fetch):
if not ud.tag or ud.tag == "master":
ud.tag = self.latest_revision(url, ud, d)
ud.localfile = data.expand('git_%s%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.tag), d)
subdir = ud.parm.get("subpath", "")
if subdir != "":
if subdir.endswith("/"):
subdir = subdir[:-1]
subdirpath = os.path.join(ud.path, subdir);
else:
subdirpath = ud.path;
if 'fullclone' in ud.parm:
ud.localfile = ud.mirrortarball
else:
ud.localfile = data.expand('git_%s%s_%s.tar.gz' % (ud.host, subdirpath.replace('/', '.'), ud.tag), d)
ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def go(self, loc, ud, d):
"""Fetch url"""
if Fetch.try_mirror(d, ud.localfile):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists (or was stashed). Skipping git checkout." % ud.localpath)
return
if ud.user:
username = ud.user + '@'
else:
username = ""
gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.'))
repofilename = 'git_%s.tar.gz' % (gitsrcname)
repofile = os.path.join(data.getVar("DL_DIR", d, 1), repofilename)
repodir = os.path.join(data.expand('${GITDIR}', d), gitsrcname)
repofile = os.path.join(data.getVar("DL_DIR", d, 1), ud.mirrortarball)
coname = '%s' % (ud.tag)
codir = os.path.join(repodir, coname)
codir = os.path.join(ud.clonedir, coname)
if not os.path.exists(repodir):
if Fetch.try_mirror(d, repofilename):
bb.mkdirhier(repodir)
os.chdir(repodir)
if not os.path.exists(ud.clonedir):
try:
Fetch.try_mirrors(ud.mirrortarball)
bb.mkdirhier(ud.clonedir)
os.chdir(ud.clonedir)
runfetchcmd("tar -xzf %s" % (repofile), d)
else:
runfetchcmd("git clone -n %s://%s%s%s %s" % (ud.proto, username, ud.host, ud.path, repodir), d)
except:
runfetchcmd("%s clone -n %s://%s%s%s %s" % (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.clonedir), d)
os.chdir(repodir)
os.chdir(ud.clonedir)
# Remove all but the .git directory
if not self._contains_ref(ud.tag, d):
runfetchcmd("rm * -Rf", d)
runfetchcmd("git fetch %s://%s%s%s %s" % (ud.proto, username, ud.host, ud.path, ud.branch), d)
runfetchcmd("git fetch --tags %s://%s%s%s" % (ud.proto, username, ud.host, ud.path), d)
runfetchcmd("git prune-packed", d)
runfetchcmd("git pack-redundant --all | xargs -r rm", d)
runfetchcmd("%s fetch %s://%s%s%s %s" % (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.branch), d)
runfetchcmd("%s fetch --tags %s://%s%s%s" % (ud.basecmd, ud.proto, username, ud.host, ud.path), d)
runfetchcmd("%s prune-packed" % ud.basecmd, d)
runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d)
os.chdir(repodir)
os.chdir(ud.clonedir)
mirror_tarballs = data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True)
if mirror_tarballs != "0":
if mirror_tarballs != "0" or 'fullclone' in ud.parm:
bb.msg.note(1, bb.msg.domain.Fetcher, "Creating tarball of git repository")
runfetchcmd("tar -czf %s %s" % (repofile, os.path.join(".", ".git", "*") ), d)
if 'fullclone' in ud.parm:
return
if os.path.exists(codir):
bb.utils.prunedir(codir)
subdir = ud.parm.get("subpath", "")
if subdir != "":
if subdir.endswith("/"):
subdirbase = os.path.basename(subdir[:-1])
else:
subdirbase = os.path.basename(subdir)
else:
subdirbase = ""
if subdir != "":
readpathspec = ":%s" % (subdir)
codir = os.path.join(codir, "git")
coprefix = os.path.join(codir, subdirbase, "")
else:
readpathspec = ""
coprefix = os.path.join(codir, "git", "")
bb.mkdirhier(codir)
os.chdir(repodir)
runfetchcmd("git read-tree %s" % (ud.tag), d)
runfetchcmd("git checkout-index -q -f --prefix=%s -a" % (os.path.join(codir, "git", "")), d)
os.chdir(ud.clonedir)
runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.tag, readpathspec), d)
runfetchcmd("%s checkout-index -q -f --prefix=%s -a" % (ud.basecmd, coprefix), d)
os.chdir(codir)
bb.msg.note(1, bb.msg.domain.Fetcher, "Creating tarball of git checkout")
runfetchcmd("tar -czf %s %s" % (ud.localpath, os.path.join(".", "*") ), d)
os.chdir(repodir)
os.chdir(ud.clonedir)
bb.utils.prunedir(codir)
def suppports_srcrev(self):
return True
def _contains_ref(self, tag, d):
output = runfetchcmd("git log --pretty=oneline -n 1 %s -- 2> /dev/null | wc -l" % tag, d, quiet=True)
basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
output = runfetchcmd("%s log --pretty=oneline -n 1 %s -- 2> /dev/null | wc -l" % (basecmd, tag), d, quiet=True)
return output.split()[0] != "0"
def _revision_key(self, url, ud, d):
@@ -140,50 +176,42 @@ class Git(Fetch):
else:
username = ""
output = runfetchcmd("git ls-remote %s://%s%s%s %s" % (ud.proto, username, ud.host, ud.path, ud.branch), d, True)
basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
cmd = "%s ls-remote %s://%s%s%s %s" % (basecmd, ud.proto, username, ud.host, ud.path, ud.branch)
output = runfetchcmd(cmd, d, True)
if not output:
raise bb.fetch.FetchError("Fetch command %s gave empty output\n" % (cmd))
return output.split()[0]
def _build_revision(self, url, ud, d):
return ud.tag
def _want_sortable_revision(self, url, ud, d):
return bb.data.getVar("BB_GIT_CLONE_FOR_SRCREV", d, True) or False
def _sortable_revision_disabled(self, url, ud, d):
def _sortable_buildindex_disabled(self, url, ud, d, rev):
"""
This is only called when _want_sortable_revision called true
We will have to get the updated revision.
Return a suitable buildindex for the revision specified. This is done by counting revisions
using "git rev-list" which may or may not work in different circumstances.
"""
gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.'))
repodir = os.path.join(data.expand('${GITDIR}', d), gitsrcname)
key = "GIT_CACHED_REVISION-%s-%s" % (gitsrcname, ud.tag)
if bb.data.getVar(key, d):
return bb.data.getVar(key, d)
# Runtime warning on wrongly configured sources
if ud.tag == "1":
bb.msg.error(1, bb.msg.domain.Fetcher, "SRCREV is '1'. This indicates a configuration error of %s" % url)
return "0+1"
cwd = os.getcwd()
# Check if we have the rev already
if not os.path.exists(repodir):
if not os.path.exists(ud.clonedir):
print "no repo"
self.go(None, ud, d)
if not os.path.exists(ud.clonedir):
bb.msg.error(bb.msg.domain.Fetcher, "GIT repository for %s doesn't exist in %s, cannot get sortable buildnumber, using old value" % (url, ud.clonedir))
return None
os.chdir(repodir)
if not self._contains_ref(ud.tag, d):
os.chdir(ud.clonedir)
if not self._contains_ref(rev, d):
self.go(None, ud, d)
output = runfetchcmd("git rev-list %s -- 2> /dev/null | wc -l" % ud.tag, d, quiet=True)
output = runfetchcmd("%s rev-list %s -- 2> /dev/null | wc -l" % (ud.basecmd, rev), d, quiet=True)
os.chdir(cwd)
sortable_revision = "%s+%s" % (output.split()[0], ud.tag)
bb.data.setVar(key, sortable_revision, d)
return sortable_revision
buildindex = "%s" % output.split()[0]
bb.msg.debug(1, bb.msg.domain.Fetcher, "GIT repository for %s in %s is returning %s revisions in rev-list before %s" % (url, ud.clonedir, buildindex, rev))
return buildindex

View File

@@ -24,7 +24,7 @@ BitBake 'Fetch' implementation for mercurial DRCS (hg).
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os, re
import os
import sys
import bb
from bb import data
@@ -116,11 +116,6 @@ class Hg(Fetch):
def go(self, loc, ud, d):
"""Fetch url"""
# try to use the tarball stash
if Fetch.try_mirror(d, ud.localfile):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists or was mirrored, skipping hg checkout." % ud.localpath)
return
bb.msg.debug(2, bb.msg.domain.Fetcher, "Fetch: checking for module directory '" + ud.moddir + "'")
if os.access(os.path.join(ud.moddir, '.hg'), os.R_OK):

View File

@@ -25,7 +25,7 @@ BitBake build tools.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os, re
import os
import bb
from bb import data
from bb.fetch import Fetch
@@ -33,9 +33,9 @@ from bb.fetch import Fetch
class Local(Fetch):
def supports(self, url, urldata, d):
"""
Check to see if a given url can be fetched with cvs.
Check to see if a given url represents a local fetch.
"""
return urldata.type in ['file','patch']
return urldata.type in ['file']
def localpath(self, url, urldata, d):
"""

View File

@@ -91,11 +91,6 @@ class Osc(Fetch):
Fetch url
"""
# Try to use the tarball stash
if Fetch.try_mirror(d, ud.localfile):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists or was mirrored, skipping osc checkout." % ud.localpath)
return
bb.msg.debug(2, bb.msg.domain.Fetcher, "Fetch: checking for module directory '" + ud.moddir + "'")
if os.access(os.path.join(data.expand('${OSCDIR}', d), ud.path, ud.module), os.R_OK):

View File

@@ -25,12 +25,11 @@ BitBake build tools.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os, re
import os
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import MissingParameterError
class Perforce(Fetch):
def supports(self, url, ud, d):
@@ -125,11 +124,6 @@ class Perforce(Fetch):
Fetch urls
"""
# try to use the tarball stash
if Fetch.try_mirror(d, ud.localfile):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists or was mirrored, skipping perforce checkout." % ud.localpath)
return
(host,depot,user,pswd,parm) = Perforce.doparse(loc, d)
if depot.find('/...') != -1:

View File

@@ -0,0 +1,106 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake "Fetch" repo (git) implementation
"""
# Copyright (C) 2009 Tom Rini <trini@embeddedalley.com>
#
# Based on git.py which is:
#Copyright (C) 2005 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os, re
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import runfetchcmd
class Repo(Fetch):
"""Class to fetch a module or modules from repo (git) repositories"""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with repo.
"""
return ud.type in ["repo"]
def localpath(self, url, ud, d):
"""
We don"t care about the git rev of the manifests repository, but
we do care about the manifest to use. The default is "default".
We also care about the branch or tag to be used. The default is
"master".
"""
if "protocol" in ud.parm:
ud.proto = ud.parm["protocol"]
else:
ud.proto = "git"
if "branch" in ud.parm:
ud.branch = ud.parm["branch"]
else:
ud.branch = "master"
if "manifest" in ud.parm:
manifest = ud.parm["manifest"]
if manifest.endswith(".xml"):
ud.manifest = manifest
else:
ud.manifest = manifest + ".xml"
else:
ud.manifest = "default.xml"
ud.localfile = data.expand("repo_%s%s_%s_%s.tar.gz" % (ud.host, ud.path.replace("/", "."), ud.manifest, ud.branch), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def go(self, loc, ud, d):
"""Fetch url"""
if os.access(os.path.join(data.getVar("DL_DIR", d, True), ud.localfile), os.R_OK):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists (or was stashed). Skipping repo init / sync." % ud.localpath)
return
gitsrcname = "%s%s" % (ud.host, ud.path.replace("/", "."))
repodir = data.getVar("REPODIR", d, True) or os.path.join(data.getVar("DL_DIR", d, True), "repo")
codir = os.path.join(repodir, gitsrcname, ud.manifest)
if ud.user:
username = ud.user + "@"
else:
username = ""
bb.mkdirhier(os.path.join(codir, "repo"))
os.chdir(os.path.join(codir, "repo"))
if not os.path.exists(os.path.join(codir, "repo", ".repo")):
runfetchcmd("repo init -m %s -b %s -u %s://%s%s%s" % (ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), d)
runfetchcmd("repo sync", d)
os.chdir(codir)
# Create a cache
runfetchcmd("tar --exclude=.repo --exclude=.git -czf %s %s" % (ud.localpath, os.path.join(".", "*") ), d)
def suppports_srcrev(self):
return False
def _build_revision(self, url, ud, d):
return ud.manifest
def _want_sortable_revision(self, url, ud, d):
return False

View File

@@ -37,11 +37,9 @@ IETF secsh internet draft:
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import re, os
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import MissingParameterError
__pattern__ = re.compile(r'''

View File

@@ -36,7 +36,7 @@ class Svk(Fetch):
"""Class to fetch a module or modules from svk repositories"""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with cvs.
Check to see if a given url can be fetched with svk.
"""
return ud.type in ['svk']
@@ -62,9 +62,6 @@ class Svk(Fetch):
def go(self, loc, ud, d):
"""Fetch urls"""
if not self.forcefetch(loc, ud, d) and Fetch.try_mirror(d, ud.localfile):
return
svkroot = ud.host + ud.path
svkcmd = "svk co -r {%s} %s/%s" % (ud.date, svkroot, ud.module)

View File

@@ -23,7 +23,7 @@ BitBake 'Fetch' implementation for svn.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os, re
import os
import sys
import bb
from bb import data
@@ -136,11 +136,6 @@ class Svn(Fetch):
def go(self, loc, ud, d):
"""Fetch url"""
# try to use the tarball stash
if Fetch.try_mirror(d, ud.localfile):
bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists or was mirrored, skipping svn checkout." % ud.localpath)
return
bb.msg.debug(2, bb.msg.domain.Fetcher, "Fetch: checking for module directory '" + ud.moddir + "'")
if os.access(os.path.join(ud.moddir, '.svn'), os.R_OK):

View File

@@ -25,18 +25,17 @@ BitBake build tools.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os, re
import os
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import uri_replace
class Wget(Fetch):
"""Class to fetch urls via 'wget'"""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with cvs.
Check to see if a given url can be fetched with wget.
"""
return ud.type in ['http','https','ftp']
@@ -105,24 +104,9 @@ class Wget(Fetch):
data.setVar('OVERRIDES', "wget:" + data.getVar('OVERRIDES', localdata), localdata)
data.update_data(localdata)
premirrors = [ i.split() for i in (data.getVar('PREMIRRORS', localdata, 1) or "").split('\n') if i ]
for (find, replace) in premirrors:
newuri = uri_replace(uri, find, replace, d)
if newuri != uri:
if fetch_uri(newuri, ud, localdata):
return True
if fetch_uri(uri, ud, localdata):
return True
# try mirrors
mirrors = [ i.split() for i in (data.getVar('MIRRORS', localdata, 1) or "").split('\n') if i ]
for (find, replace) in mirrors:
newuri = uri_replace(uri, find, replace, d)
if newuri != uri:
if fetch_uri(newuri, ud, localdata):
return True
raise FetchError(uri)

View File

@@ -1,144 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os, sys
import bb, bb.data
def getfields(line):
fields = {}
fieldmap = ( "pkg", "src", "dest", "type", "mode", "uid", "gid", "major", "minor", "start", "inc", "count" )
for f in xrange(len(fieldmap)):
fields[fieldmap[f]] = None
if not line:
return None
splitline = line.split()
if not len(splitline):
return None
try:
for f in xrange(len(fieldmap)):
if splitline[f] == '-':
continue
fields[fieldmap[f]] = splitline[f]
except IndexError:
pass
return fields
def parse (mfile, d):
manifest = []
while 1:
line = mfile.readline()
if not line:
break
if line.startswith("#"):
continue
fields = getfields(line)
if not fields:
continue
manifest.append(fields)
return manifest
def emit (func, manifest, d):
#str = "%s () {\n" % func
str = ""
for line in manifest:
emittedline = emit_line(func, line, d)
if not emittedline:
continue
str += emittedline + "\n"
# str += "}\n"
return str
def mangle (func, line, d):
import copy
newline = copy.copy(line)
src = bb.data.expand(newline["src"], d)
if src:
if not os.path.isabs(src):
src = "${WORKDIR}/" + src
dest = newline["dest"]
if not dest:
return
if dest.startswith("/"):
dest = dest[1:]
if func is "do_install":
dest = "${D}/" + dest
elif func is "do_populate":
dest = "${WORKDIR}/install/" + newline["pkg"] + "/" + dest
elif func is "do_stage":
varmap = {}
varmap["${bindir}"] = "${STAGING_DIR}/${HOST_SYS}/bin"
varmap["${libdir}"] = "${STAGING_DIR}/${HOST_SYS}/lib"
varmap["${includedir}"] = "${STAGING_DIR}/${HOST_SYS}/include"
varmap["${datadir}"] = "${STAGING_DATADIR}"
matched = 0
for key in varmap.keys():
if dest.startswith(key):
dest = varmap[key] + "/" + dest[len(key):]
matched = 1
if not matched:
newline = None
return
else:
newline = None
return
newline["src"] = src
newline["dest"] = dest
return newline
def emit_line (func, line, d):
import copy
newline = copy.deepcopy(line)
newline = mangle(func, newline, d)
if not newline:
return None
str = ""
type = newline["type"]
mode = newline["mode"]
src = newline["src"]
dest = newline["dest"]
if type is "d":
str = "install -d "
if mode:
str += "-m %s " % mode
str += dest
elif type is "f":
if not src:
return None
if dest.endswith("/"):
str = "install -d "
str += dest + "\n"
str += "install "
else:
str = "install -D "
if mode:
str += "-m %s " % mode
str += src + " " + dest
del newline
return str

View File

@@ -22,8 +22,8 @@ Message handling infrastructure for bitbake
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import sys, os, re, bb
from bb import utils, event
import sys, bb
from bb import event
debug_level = {}
@@ -47,9 +47,9 @@ domain = bb.utils.Enum(
class MsgBase(bb.event.Event):
"""Base class for messages"""
def __init__(self, msg, d ):
def __init__(self, msg):
self._message = msg
event.Event.__init__(self, d)
event.Event.__init__(self)
class MsgDebug(MsgBase):
"""Debug Message"""
@@ -97,33 +97,29 @@ def set_debug_domains(domains):
#
def debug(level, domain, msg, fn = None):
bb.event.fire(MsgDebug(msg, None))
if not domain:
domain = 'default'
if debug_level[domain] >= level:
print 'DEBUG: ' + msg
bb.event.fire(MsgDebug(msg), None)
def note(level, domain, msg, fn = None):
bb.event.fire(MsgNote(msg, None))
if not domain:
domain = 'default'
if level == 1 or verbose or debug_level[domain] >= 1:
print 'NOTE: ' + msg
bb.event.fire(MsgNote(msg), None)
def warn(domain, msg, fn = None):
bb.event.fire(MsgWarn(msg, None))
print 'WARNING: ' + msg
bb.event.fire(MsgWarn(msg), None)
def error(domain, msg, fn = None):
bb.event.fire(MsgError(msg, None))
bb.event.fire(MsgError(msg), None)
print 'ERROR: ' + msg
def fatal(domain, msg, fn = None):
bb.event.fire(MsgFatal(msg, None))
print 'ERROR: ' + msg
bb.event.fire(MsgFatal(msg), None)
print 'FATAL: ' + msg
sys.exit(1)
def plain(msg, fn = None):
bb.event.fire(MsgPlain(msg, None))
print msg
bb.event.fire(MsgPlain(msg), None)

View File

@@ -80,5 +80,34 @@ def init(fn, data):
if h['supports'](fn):
return h['init'](data)
def resolve_file(fn, d):
if not os.path.isabs(fn):
fn = bb.which(bb.data.getVar("BBPATH", d, 1), fn)
if not fn:
raise IOError("file %s not found" % fn)
from parse_py import __version__, ConfHandler, BBHandler
bb.msg.debug(2, bb.msg.domain.Parsing, "LOAD %s" % fn)
return fn
# Used by OpenEmbedded metadata
__pkgsplit_cache__={}
def vars_from_file(mypkg, d):
if not mypkg:
return (None, None, None)
if mypkg in __pkgsplit_cache__:
return __pkgsplit_cache__[mypkg]
myfile = os.path.splitext(os.path.basename(mypkg))
parts = myfile[0].split('_')
__pkgsplit_cache__[mypkg] = parts
if len(parts) > 3:
raise ParseError("Unable to generate default variables from the filename: %s (too many underscores)" % mypkg)
exp = 3 - len(parts)
tmplist = []
while exp != 0:
exp -= 1
tmplist.append(None)
parts.extend(tmplist)
return parts
from bb.parse.parse_py import __version__, ConfHandler, BBHandler

451
bitbake/lib/bb/parse/ast.py Normal file
View File

@@ -0,0 +1,451 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
AbstractSyntaxTree classes for the Bitbake language
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2003, 2004 Phil Blundell
# Copyright (C) 2009 Holger Hans Peter Freyther
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import bb, re, string
from itertools import chain
__word__ = re.compile(r"\S+")
__parsed_methods__ = bb.methodpool.get_parsed_dict()
_bbversions_re = re.compile(r"\[(?P<from>[0-9]+)-(?P<to>[0-9]+)\]")
class StatementGroup(list):
def eval(self, data):
map(lambda x: x.eval(data), self)
class AstNode(object):
pass
class IncludeNode(AstNode):
def __init__(self, what_file, fn, lineno, force):
self.what_file = what_file
self.from_fn = fn
self.from_lineno = lineno
self.force = force
def eval(self, data):
"""
Include the file and evaluate the statements
"""
s = bb.data.expand(self.what_file, data)
bb.msg.debug(3, bb.msg.domain.Parsing, "CONF %s:%d: including %s" % (self.from_fn, self.from_lineno, s))
# TODO: Cache those includes... maybe not here though
if self.force:
bb.parse.ConfHandler.include(self.from_fn, s, data, "include required")
else:
bb.parse.ConfHandler.include(self.from_fn, s, data, False)
class ExportNode(AstNode):
def __init__(self, var):
self.var = var
def eval(self, data):
bb.data.setVarFlag(self.var, "export", 1, data)
class DataNode(AstNode):
"""
Various data related updates. For the sake of sanity
we have one class doing all this. This means that all
this need to be re-evaluated... we might be able to do
that faster with multiple classes.
"""
def __init__(self, groupd):
self.groupd = groupd
def getFunc(self, key, data):
if 'flag' in self.groupd and self.groupd['flag'] != None:
return bb.data.getVarFlag(key, self.groupd['flag'], data)
else:
return bb.data.getVar(key, data)
def eval(self, data):
groupd = self.groupd
key = groupd["var"]
if "exp" in groupd and groupd["exp"] != None:
bb.data.setVarFlag(key, "export", 1, data)
if "ques" in groupd and groupd["ques"] != None:
val = self.getFunc(key, data)
if val == None:
val = groupd["value"]
elif "colon" in groupd and groupd["colon"] != None:
e = data.createCopy()
bb.data.update_data(e)
val = bb.data.expand(groupd["value"], e)
elif "append" in groupd and groupd["append"] != None:
val = "%s %s" % ((self.getFunc(key, data) or ""), groupd["value"])
elif "prepend" in groupd and groupd["prepend"] != None:
val = "%s %s" % (groupd["value"], (self.getFunc(key, data) or ""))
elif "postdot" in groupd and groupd["postdot"] != None:
val = "%s%s" % ((self.getFunc(key, data) or ""), groupd["value"])
elif "predot" in groupd and groupd["predot"] != None:
val = "%s%s" % (groupd["value"], (self.getFunc(key, data) or ""))
else:
val = groupd["value"]
if 'flag' in groupd and groupd['flag'] != None:
bb.msg.debug(3, bb.msg.domain.Parsing, "setVarFlag(%s, %s, %s, data)" % (key, groupd['flag'], val))
bb.data.setVarFlag(key, groupd['flag'], val, data)
elif groupd["lazyques"]:
assigned = bb.data.getVar("__lazy_assigned", data) or []
assigned.append(key)
bb.data.setVar("__lazy_assigned", assigned, data)
bb.data.setVarFlag(key, "defaultval", val, data)
else:
bb.data.setVar(key, val, data)
class MethodNode:
def __init__(self, func_name, body, lineno, fn):
self.func_name = func_name
self.body = body
self.fn = fn
self.lineno = lineno
def eval(self, data):
if self.func_name == "__anonymous":
funcname = ("__anon_%s_%s" % (self.lineno, self.fn.translate(string.maketrans('/.+-', '____'))))
if not funcname in bb.methodpool._parsed_fns:
text = "def %s(d):\n" % (funcname) + '\n'.join(self.body)
bb.methodpool.insert_method(funcname, text, self.fn)
anonfuncs = bb.data.getVar('__BBANONFUNCS', data) or []
anonfuncs.append(funcname)
bb.data.setVar('__BBANONFUNCS', anonfuncs, data)
else:
bb.data.setVarFlag(self.func_name, "func", 1, data)
bb.data.setVar(self.func_name, '\n'.join(self.body), data)
class PythonMethodNode(AstNode):
def __init__(self, root, body, fn):
self.root = root
self.body = body
self.fn = fn
def eval(self, data):
# Note we will add root to parsedmethods after having parse
# 'this' file. This means we will not parse methods from
# bb classes twice
if not self.root in __parsed_methods__:
text = '\n'.join(self.body)
bb.methodpool.insert_method(self.root, text, self.fn)
class MethodFlagsNode(AstNode):
def __init__(self, key, m):
self.key = key
self.m = m
def eval(self, data):
if bb.data.getVar(self.key, data):
# clean up old version of this piece of metadata, as its
# flags could cause problems
bb.data.setVarFlag(self.key, 'python', None, data)
bb.data.setVarFlag(self.key, 'fakeroot', None, data)
if self.m.group("py") is not None:
bb.data.setVarFlag(self.key, "python", "1", data)
else:
bb.data.delVarFlag(self.key, "python", data)
if self.m.group("fr") is not None:
bb.data.setVarFlag(self.key, "fakeroot", "1", data)
else:
bb.data.delVarFlag(self.key, "fakeroot", data)
class ExportFuncsNode(AstNode):
def __init__(self, fns, classes):
self.n = __word__.findall(fns)
self.classes = classes
def eval(self, data):
for f in self.n:
allvars = []
allvars.append(f)
allvars.append(self.classes[-1] + "_" + f)
vars = [[ allvars[0], allvars[1] ]]
if len(self.classes) > 1 and self.classes[-2] is not None:
allvars.append(self.classes[-2] + "_" + f)
vars = []
vars.append([allvars[2], allvars[1]])
vars.append([allvars[0], allvars[2]])
for (var, calledvar) in vars:
if bb.data.getVar(var, data) and not bb.data.getVarFlag(var, 'export_func', data):
continue
if bb.data.getVar(var, data):
bb.data.setVarFlag(var, 'python', None, data)
bb.data.setVarFlag(var, 'func', None, data)
for flag in [ "func", "python" ]:
if bb.data.getVarFlag(calledvar, flag, data):
bb.data.setVarFlag(var, flag, bb.data.getVarFlag(calledvar, flag, data), data)
for flag in [ "dirs" ]:
if bb.data.getVarFlag(var, flag, data):
bb.data.setVarFlag(calledvar, flag, bb.data.getVarFlag(var, flag, data), data)
if bb.data.getVarFlag(calledvar, "python", data):
bb.data.setVar(var, "\tbb.build.exec_func('" + calledvar + "', d)\n", data)
else:
bb.data.setVar(var, "\t" + calledvar + "\n", data)
bb.data.setVarFlag(var, 'export_func', '1', data)
class AddTaskNode(AstNode):
def __init__(self, func, before, after):
self.func = func
self.before = before
self.after = after
def eval(self, data):
var = self.func
if self.func[:3] != "do_":
var = "do_" + self.func
bb.data.setVarFlag(var, "task", 1, data)
bbtasks = bb.data.getVar('__BBTASKS', data) or []
if not var in bbtasks:
bbtasks.append(var)
bb.data.setVar('__BBTASKS', bbtasks, data)
existing = bb.data.getVarFlag(var, "deps", data) or []
if self.after is not None:
# set up deps for function
for entry in self.after.split():
if entry not in existing:
existing.append(entry)
bb.data.setVarFlag(var, "deps", existing, data)
if self.before is not None:
# set up things that depend on this func
for entry in self.before.split():
existing = bb.data.getVarFlag(entry, "deps", data) or []
if var not in existing:
bb.data.setVarFlag(entry, "deps", [var] + existing, data)
class BBHandlerNode(AstNode):
def __init__(self, fns):
self.hs = __word__.findall(fns)
def eval(self, data):
bbhands = bb.data.getVar('__BBHANDLERS', data) or []
for h in self.hs:
bbhands.append(h)
bb.data.setVarFlag(h, "handler", 1, data)
bb.data.setVar('__BBHANDLERS', bbhands, data)
class InheritNode(AstNode):
def __init__(self, files):
self.n = __word__.findall(files)
def eval(self, data):
bb.parse.BBHandler.inherit(self.n, data)
def handleInclude(statements, m, fn, lineno, force):
statements.append(IncludeNode(m.group(1), fn, lineno, force))
def handleExport(statements, m):
statements.append(ExportNode(m.group(1)))
def handleData(statements, groupd):
statements.append(DataNode(groupd))
def handleMethod(statements, func_name, lineno, fn, body):
statements.append(MethodNode(func_name, body, lineno, fn))
def handlePythonMethod(statements, root, body, fn):
statements.append(PythonMethodNode(root, body, fn))
def handleMethodFlags(statements, key, m):
statements.append(MethodFlagsNode(key, m))
def handleExportFuncs(statements, m, classes):
statements.append(ExportFuncsNode(m.group(1), classes))
def handleAddTask(statements, m):
func = m.group("func")
before = m.group("before")
after = m.group("after")
if func is None:
return
statements.append(AddTaskNode(func, before, after))
def handleBBHandlers(statements, m):
statements.append(BBHandlerNode(m.group(1)))
def handleInherit(statements, m):
files = m.group(1)
n = __word__.findall(files)
statements.append(InheritNode(m.group(1)))
def finalise(fn, d):
for lazykey in bb.data.getVar("__lazy_assigned", d) or ():
if bb.data.getVar(lazykey, d) is None:
val = bb.data.getVarFlag(lazykey, "defaultval", d)
bb.data.setVar(lazykey, val, d)
bb.data.expandKeys(d)
bb.data.update_data(d)
anonqueue = bb.data.getVar("__anonqueue", d, 1) or []
body = [x['content'] for x in anonqueue]
flag = { 'python' : 1, 'func' : 1 }
bb.data.setVar("__anonfunc", "\n".join(body), d)
bb.data.setVarFlags("__anonfunc", flag, d)
from bb import build
try:
t = bb.data.getVar('T', d)
bb.data.setVar('T', '${TMPDIR}/anonfunc/', d)
anonfuncs = bb.data.getVar('__BBANONFUNCS', d) or []
code = ""
for f in anonfuncs:
code = code + " %s(d)\n" % f
bb.data.setVar("__anonfunc", code, d)
build.exec_func("__anonfunc", d)
bb.data.delVar('T', d)
if t:
bb.data.setVar('T', t, d)
except Exception, e:
bb.msg.debug(1, bb.msg.domain.Parsing, "Exception when executing anonymous function: %s" % e)
raise
bb.data.delVar("__anonqueue", d)
bb.data.delVar("__anonfunc", d)
bb.data.update_data(d)
all_handlers = {}
for var in bb.data.getVar('__BBHANDLERS', d) or []:
# try to add the handler
handler = bb.data.getVar(var,d)
bb.event.register(var, handler)
tasklist = bb.data.getVar('__BBTASKS', d) or []
bb.build.add_tasks(tasklist, d)
bb.event.fire(bb.event.RecipeParsed(fn), d)
def _create_variants(datastores, names, function):
def create_variant(name, orig_d, arg = None):
new_d = bb.data.createCopy(orig_d)
function(arg or name, new_d)
datastores[name] = new_d
for variant, variant_d in datastores.items():
for name in names:
if not variant:
# Based on main recipe
create_variant(name, variant_d)
else:
create_variant("%s-%s" % (variant, name), variant_d, name)
def _expand_versions(versions):
def expand_one(version, start, end):
for i in xrange(start, end + 1):
ver = _bbversions_re.sub(str(i), version, 1)
yield ver
versions = iter(versions)
while True:
try:
version = versions.next()
except StopIteration:
break
range_ver = _bbversions_re.search(version)
if not range_ver:
yield version
else:
newversions = expand_one(version, int(range_ver.group("from")),
int(range_ver.group("to")))
versions = chain(newversions, versions)
def multi_finalize(fn, d):
safe_d = d
d = bb.data.createCopy(safe_d)
try:
finalise(fn, d)
except bb.parse.SkipPackage:
bb.data.setVar("__SKIPPED", True, d)
datastores = {"": safe_d}
versions = (d.getVar("BBVERSIONS", True) or "").split()
if versions:
pv = orig_pv = d.getVar("PV", True)
baseversions = {}
def verfunc(ver, d, pv_d = None):
if pv_d is None:
pv_d = d
overrides = d.getVar("OVERRIDES", True).split(":")
pv_d.setVar("PV", ver)
overrides.append(ver)
bpv = baseversions.get(ver) or orig_pv
pv_d.setVar("BPV", bpv)
overrides.append(bpv)
d.setVar("OVERRIDES", ":".join(overrides))
versions = list(_expand_versions(versions))
for pos, version in enumerate(list(versions)):
try:
pv, bpv = version.split(":", 2)
except ValueError:
pass
else:
versions[pos] = pv
baseversions[pv] = bpv
if pv in versions and not baseversions.get(pv):
versions.remove(pv)
else:
pv = versions.pop()
# This is necessary because our existing main datastore
# has already been finalized with the old PV, we need one
# that's been finalized with the new PV.
d = bb.data.createCopy(safe_d)
verfunc(pv, d, safe_d)
try:
finalise(fn, d)
except bb.parse.SkipPackage:
bb.data.setVar("__SKIPPED", True, d)
_create_variants(datastores, versions, verfunc)
extended = d.getVar("BBCLASSEXTEND", True) or ""
if extended:
pn = d.getVar("PN", True)
def extendfunc(name, d):
d.setVar("PN", "%s-%s" % (pn, name))
bb.parse.BBHandler.inherit([name], d)
safe_d.setVar("BBCLASSEXTEND", extended)
_create_variants(datastores, extended.split(), extendfunc)
for variant, variant_d in datastores.items():
if variant:
try:
finalise(fn, variant_d)
except bb.parse.SkipPackage:
bb.data.setVar("__SKIPPED", True, variant_d)
if len(datastores) > 1:
variants = filter(None, datastores.keys())
safe_d.setVar("__VARIANTS", " ".join(variants))
datastores[""] = d
return datastores

View File

@@ -27,10 +27,13 @@
import re, bb, os, sys, time, string
import bb.fetch, bb.build, bb.utils
from bb import data, fetch, methodpool
from bb import data, fetch
from ConfHandler import include, localpath, obtain, init
from bb.parse import ParseError
from ConfHandler import include, init
from bb.parse import ParseError, resolve_file, ast
# For compatibility
from bb.parse import vars_from_file
__func_start_regexp__ = re.compile( r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>[\w\.\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" )
__inherit_regexp__ = re.compile( r"inherit\s+(.+)" )
@@ -39,7 +42,7 @@ __addtask_regexp__ = re.compile("addtask\s+(?P<func>\w+)\s*((before\s*(?P<
__addhandler_regexp__ = re.compile( r"addhandler\s+(.+)" )
__def_regexp__ = re.compile( r"def\s+(\w+).*:" )
__python_func_regexp__ = re.compile( r"(\s+.*)|(^$)" )
__word__ = re.compile(r"\S+")
__infunc__ = ""
__inpython__ = False
@@ -47,6 +50,8 @@ __body__ = []
__classname__ = ""
classes = [ None, ]
cached_statements = {}
# We need to indicate EOF to the feeder. This code is so messy that
# factoring it out to a close_parse_file method is out of question.
# We will use the IN_PYTHON_EOF as an indicator to just close the method
@@ -54,11 +59,10 @@ classes = [ None, ]
# The two parts using it are tightly integrated anyway
IN_PYTHON_EOF = -9999999999999
__parsed_methods__ = methodpool.get_parsed_dict()
def supports(fn, d):
localfn = localpath(fn, d)
return localfn[-3:] == ".bb" or localfn[-8:] == ".bbclass" or localfn[-4:] == ".inc"
return fn[-3:] == ".bb" or fn[-8:] == ".bbclass" or fn[-4:] == ".inc"
def inherit(files, d):
__inherit_cache = data.getVar('__inherit_cache', d) or []
@@ -76,52 +80,38 @@ def inherit(files, d):
include(fn, file, d, "inherit")
__inherit_cache = data.getVar('__inherit_cache', d) or []
def get_statements(filename, absolsute_filename, base_name):
global cached_statements
def finalise(fn, d):
data.expandKeys(d)
data.update_data(d)
anonqueue = data.getVar("__anonqueue", d, 1) or []
body = [x['content'] for x in anonqueue]
flag = { 'python' : 1, 'func' : 1 }
data.setVar("__anonfunc", "\n".join(body), d)
data.setVarFlags("__anonfunc", flag, d)
from bb import build
try:
t = data.getVar('T', d)
data.setVar('T', '${TMPDIR}/', d)
anonfuncs = data.getVar('__BBANONFUNCS', d) or []
code = ""
for f in anonfuncs:
code = code + " %s(d)\n" % f
data.setVar("__anonfunc", code, d)
build.exec_func_python("__anonfunc", d)
data.delVar('T', d)
if t:
data.setVar('T', t, d)
except Exception, e:
bb.msg.debug(1, bb.msg.domain.Parsing, "Exception when executing anonymous function: %s" % e)
raise
data.delVar("__anonqueue", d)
data.delVar("__anonfunc", d)
data.update_data(d)
return cached_statements[absolsute_filename]
except KeyError:
file = open(absolsute_filename, 'r')
statements = ast.StatementGroup()
all_handlers = {}
for var in data.getVar('__BBHANDLERS', d) or []:
# try to add the handler
handler = data.getVar(var,d)
bb.event.register(var, handler)
lineno = 0
while 1:
lineno = lineno + 1
s = file.readline()
if not s: break
s = s.rstrip()
feeder(lineno, s, filename, base_name, statements)
if __inpython__:
# add a blank line to close out any python definition
feeder(IN_PYTHON_EOF, "", filename, base_name, statements)
tasklist = data.getVar('__BBTASKS', d) or []
bb.build.add_tasks(tasklist, d)
if filename.endswith(".bbclass") or filename.endswith(".inc"):
cached_statements[absolsute_filename] = statements
return statements
def handle(fn, d, include = 0):
def handle(fn, d, include):
global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __infunc__, __body__, __residue__
__body__ = []
__infunc__ = ""
__classname__ = ""
__residue__ = []
if include == 0:
bb.msg.debug(2, bb.msg.domain.Parsing, "BB " + fn + ": handle(data)")
else:
@@ -144,83 +134,41 @@ def handle(fn, d, include = 0):
else:
oldfile = None
fn = obtain(fn, d)
bbpath = (data.getVar('BBPATH', d, 1) or '').split(':')
if not os.path.isabs(fn):
f = None
for p in bbpath:
j = os.path.join(p, fn)
if os.access(j, os.R_OK):
abs_fn = j
f = open(j, 'r')
break
if f is None:
raise IOError("file %s not found" % fn)
else:
f = open(fn,'r')
abs_fn = fn
abs_fn = resolve_file(fn, d)
if include:
bb.parse.mark_dependency(d, abs_fn)
# actual loading
statements = get_statements(fn, abs_fn, base_name)
# DONE WITH PARSING... time to evaluate
if ext != ".bbclass":
data.setVar('FILE', fn, d)
lineno = 0
while 1:
lineno = lineno + 1
s = f.readline()
if not s: break
s = s.rstrip()
feeder(lineno, s, fn, base_name, d)
if __inpython__:
# add a blank line to close out any python definition
feeder(IN_PYTHON_EOF, "", fn, base_name, d)
statements.eval(d)
if ext == ".bbclass":
classes.remove(__classname__)
else:
if include == 0:
multi = data.getVar('BBCLASSEXTEND', d, 1)
if multi:
based = bb.data.createCopy(d)
finalise(fn, based)
darray = {"": based}
for cls in multi.split():
pn = data.getVar('PN', d, True)
based = bb.data.createCopy(d)
data.setVar('PN', pn + '-' + cls, based)
inherit([cls], based)
finalise(fn, based)
darray[cls] = based
return darray
else:
finalise(fn, d)
bbpath.pop(0)
return ast.multi_finalize(fn, d)
if oldfile:
bb.data.setVar("FILE", oldfile, d)
# we have parsed the bb class now
if ext == ".bbclass" or ext == ".inc":
__parsed_methods__[base_name] = 1
bb.methodpool.get_parsed_dict()[base_name] = 1
return d
def feeder(lineno, s, fn, root, d):
def feeder(lineno, s, fn, root, statements):
global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __def_regexp__, __python_func_regexp__, __inpython__,__infunc__, __body__, classes, bb, __residue__
if __infunc__:
if s == '}':
__body__.append('')
if __infunc__ == "__anonymous":
funcname = ("__anon_%s_%s" % (lineno, fn.translate(string.maketrans('/.+-', '____'))))
if not funcname in methodpool._parsed_fns:
text = "def %s(d):\n" % (funcname) + '\n'.join(__body__)
methodpool.insert_method(funcname, text, fn)
anonfuncs = data.getVar('__BBANONFUNCS', d) or []
anonfuncs.append(funcname)
data.setVar('__BBANONFUNCS', anonfuncs, d)
else:
data.setVarFlag(__infunc__, "func", 1, d)
data.setVar(__infunc__, '\n'.join(__body__), d)
ast.handleMethod(statements, __infunc__, lineno, fn, __body__)
__infunc__ = ""
__body__ = []
else:
@@ -233,12 +181,7 @@ def feeder(lineno, s, fn, root, d):
__body__.append(s)
return
else:
# Note we will add root to parsedmethods after having parse
# 'this' file. This means we will not parse methods from
# bb classes twice
if not root in __parsed_methods__:
text = '\n'.join(__body__)
methodpool.insert_method( root, text, fn )
ast.handlePythonMethod(statements, root, __body__, fn)
__body__ = []
__inpython__ = False
@@ -259,20 +202,7 @@ def feeder(lineno, s, fn, root, d):
m = __func_start_regexp__.match(s)
if m:
__infunc__ = m.group("func") or "__anonymous"
key = __infunc__
if data.getVar(key, d):
# clean up old version of this piece of metadata, as its
# flags could cause problems
data.setVarFlag(key, 'python', None, d)
data.setVarFlag(key, 'fakeroot', None, d)
if m.group("py") is not None:
data.setVarFlag(key, "python", "1", d)
else:
data.delVarFlag(key, "python", d)
if m.group("fr") is not None:
data.setVarFlag(key, "fakeroot", "1", d)
else:
data.delVarFlag(key, "fakeroot", d)
ast.handleMethodFlags(statements, __infunc__, m)
return
m = __def_regexp__.match(s)
@@ -283,115 +213,26 @@ def feeder(lineno, s, fn, root, d):
m = __export_func_regexp__.match(s)
if m:
fns = m.group(1)
n = __word__.findall(fns)
for f in n:
allvars = []
allvars.append(f)
allvars.append(classes[-1] + "_" + f)
vars = [[ allvars[0], allvars[1] ]]
if len(classes) > 1 and classes[-2] is not None:
allvars.append(classes[-2] + "_" + f)
vars = []
vars.append([allvars[2], allvars[1]])
vars.append([allvars[0], allvars[2]])
for (var, calledvar) in vars:
if data.getVar(var, d) and not data.getVarFlag(var, 'export_func', d):
continue
if data.getVar(var, d):
data.setVarFlag(var, 'python', None, d)
data.setVarFlag(var, 'func', None, d)
for flag in [ "func", "python" ]:
if data.getVarFlag(calledvar, flag, d):
data.setVarFlag(var, flag, data.getVarFlag(calledvar, flag, d), d)
for flag in [ "dirs" ]:
if data.getVarFlag(var, flag, d):
data.setVarFlag(calledvar, flag, data.getVarFlag(var, flag, d), d)
if data.getVarFlag(calledvar, "python", d):
data.setVar(var, "\tbb.build.exec_func('" + calledvar + "', d)\n", d)
else:
data.setVar(var, "\t" + calledvar + "\n", d)
data.setVarFlag(var, 'export_func', '1', d)
ast.handleExportFuncs(statements, m, classes)
return
m = __addtask_regexp__.match(s)
if m:
func = m.group("func")
before = m.group("before")
after = m.group("after")
if func is None:
return
var = "do_" + func
data.setVarFlag(var, "task", 1, d)
bbtasks = data.getVar('__BBTASKS', d) or []
if not var in bbtasks:
bbtasks.append(var)
data.setVar('__BBTASKS', bbtasks, d)
existing = data.getVarFlag(var, "deps", d) or []
if after is not None:
# set up deps for function
for entry in after.split():
if entry not in existing:
existing.append(entry)
data.setVarFlag(var, "deps", existing, d)
if before is not None:
# set up things that depend on this func
for entry in before.split():
existing = data.getVarFlag(entry, "deps", d) or []
if var not in existing:
data.setVarFlag(entry, "deps", [var] + existing, d)
ast.handleAddTask(statements, m)
return
m = __addhandler_regexp__.match(s)
if m:
fns = m.group(1)
hs = __word__.findall(fns)
bbhands = data.getVar('__BBHANDLERS', d) or []
for h in hs:
bbhands.append(h)
data.setVarFlag(h, "handler", 1, d)
data.setVar('__BBHANDLERS', bbhands, d)
ast.handleBBHandlers(statements, m)
return
m = __inherit_regexp__.match(s)
if m:
files = m.group(1)
n = __word__.findall(files)
inherit(n, d)
ast.handleInherit(statements, m)
return
from bb.parse import ConfHandler
return ConfHandler.feeder(lineno, s, fn, d)
__pkgsplit_cache__={}
def vars_from_file(mypkg, d):
if not mypkg:
return (None, None, None)
if mypkg in __pkgsplit_cache__:
return __pkgsplit_cache__[mypkg]
myfile = os.path.splitext(os.path.basename(mypkg))
parts = myfile[0].split('_')
__pkgsplit_cache__[mypkg] = parts
if len(parts) > 3:
raise ParseError("Unable to generate default variables from the filename: %s (too many underscores)" % mypkg)
exp = 3 - len(parts)
tmplist = []
while exp != 0:
exp -= 1
tmplist.append(None)
parts.extend(tmplist)
return parts
return ConfHandler.feeder(lineno, s, fn, statements)
# Add us to the handlers list
from bb.parse import handlers

View File

@@ -25,70 +25,25 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import re, bb.data, os, sys
from bb.parse import ParseError
from bb.parse import ParseError, resolve_file, ast
#__config_regexp__ = re.compile( r"(?P<exp>export\s*)?(?P<var>[a-zA-Z0-9\-_+.${}]+)\s*(?P<colon>:)?(?P<ques>\?)?=\s*(?P<apo>['\"]?)(?P<value>.*)(?P=apo)$")
__config_regexp__ = re.compile( r"(?P<exp>export\s*)?(?P<var>[a-zA-Z0-9\-_+.${}/]+)(\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])?\s*((?P<colon>:=)|(?P<ques>\?=)|(?P<append>\+=)|(?P<prepend>=\+)|(?P<predot>=\.)|(?P<postdot>\.=)|=)\s*(?P<apo>['\"]?)(?P<value>.*)(?P=apo)$")
__config_regexp__ = re.compile( r"(?P<exp>export\s*)?(?P<var>[a-zA-Z0-9\-_+.${}/]+)(\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])?\s*((?P<colon>:=)|(?P<lazyques>\?\?=)|(?P<ques>\?=)|(?P<append>\+=)|(?P<prepend>=\+)|(?P<predot>=\.)|(?P<postdot>\.=)|=)\s*(?P<apo>['\"]?)(?P<value>.*)(?P=apo)$")
__include_regexp__ = re.compile( r"include\s+(.+)" )
__require_regexp__ = re.compile( r"require\s+(.+)" )
__export_regexp__ = re.compile( r"export\s+(.+)" )
def init(data):
if not bb.data.getVar('TOPDIR', data):
bb.data.setVar('TOPDIR', os.getcwd(), data)
topdir = bb.data.getVar('TOPDIR', data)
if not topdir:
topdir = os.getcwd()
bb.data.setVar('TOPDIR', topdir, data)
if not bb.data.getVar('BBPATH', data):
bb.data.setVar('BBPATH', os.path.join(sys.prefix, 'share', 'bitbake'), data)
bb.fatal("The BBPATH environment variable must be set")
def supports(fn, d):
return localpath(fn, d)[-5:] == ".conf"
def localpath(fn, d):
if os.path.exists(fn):
return fn
if "://" not in fn:
return fn
localfn = None
try:
localfn = bb.fetch.localpath(fn, d, False)
except bb.MalformedUrl:
pass
if not localfn:
return fn
return localfn
def obtain(fn, data):
import sys, bb
fn = bb.data.expand(fn, data)
localfn = bb.data.expand(localpath(fn, data), data)
if localfn != fn:
dldir = bb.data.getVar('DL_DIR', data, 1)
if not dldir:
bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: DL_DIR not defined")
return localfn
bb.mkdirhier(dldir)
try:
bb.fetch.init([fn], data)
except bb.fetch.NoMethodError:
(type, value, traceback) = sys.exc_info()
bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: no method: %s" % value)
return localfn
try:
bb.fetch.go(data)
except bb.fetch.MissingParameterError:
(type, value, traceback) = sys.exc_info()
bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: missing parameters: %s" % value)
return localfn
except bb.fetch.FetchError:
(type, value, traceback) = sys.exc_info()
bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: failed: %s" % value)
return localfn
return localfn
return fn[-5:] == ".conf"
def include(oldfn, fn, data, error_out):
"""
@@ -117,11 +72,7 @@ def include(oldfn, fn, data, error_out):
raise ParseError("Could not %(error_out)s file %(fn)s" % vars() )
bb.msg.debug(2, bb.msg.domain.Parsing, "CONF file '%s' not found" % fn)
def handle(fn, data, include = 0):
if include:
inc_string = "including"
else:
inc_string = "reading"
def handle(fn, data, include):
init(data)
if include == 0:
@@ -129,29 +80,14 @@ def handle(fn, data, include = 0):
else:
oldfile = bb.data.getVar('FILE', data)
fn = obtain(fn, data)
if not os.path.isabs(fn):
f = None
bbpath = bb.data.getVar("BBPATH", data, 1) or []
for p in bbpath.split(":"):
currname = os.path.join(p, fn)
if os.access(currname, os.R_OK):
f = open(currname, 'r')
abs_fn = currname
bb.msg.debug(2, bb.msg.domain.Parsing, "CONF %s %s" % (inc_string, currname))
break
if f is None:
raise IOError("file '%s' not found" % fn)
else:
f = open(fn,'r')
bb.msg.debug(1, bb.msg.domain.Parsing, "CONF %s %s" % (inc_string,fn))
abs_fn = fn
abs_fn = resolve_file(fn, data)
f = open(abs_fn, 'r')
if include:
bb.parse.mark_dependency(data, abs_fn)
statements = ast.StatementGroup()
lineno = 0
bb.data.setVar('FILE', fn, data)
while 1:
lineno = lineno + 1
s = f.readline()
@@ -164,66 +100,36 @@ def handle(fn, data, include = 0):
s2 = f.readline()[:-1].strip()
lineno = lineno + 1
s = s[:-1] + s2
feeder(lineno, s, fn, data)
feeder(lineno, s, fn, statements)
# DONE WITH PARSING... time to evaluate
bb.data.setVar('FILE', fn, data)
statements.eval(data)
if oldfile:
bb.data.setVar('FILE', oldfile, data)
return data
def feeder(lineno, s, fn, data):
def getFunc(groupd, key, data):
if 'flag' in groupd and groupd['flag'] != None:
return bb.data.getVarFlag(key, groupd['flag'], data)
else:
return bb.data.getVar(key, data)
def feeder(lineno, s, fn, statements):
m = __config_regexp__.match(s)
if m:
groupd = m.groupdict()
key = groupd["var"]
if "exp" in groupd and groupd["exp"] != None:
bb.data.setVarFlag(key, "export", 1, data)
if "ques" in groupd and groupd["ques"] != None:
val = getFunc(groupd, key, data)
if val == None:
val = groupd["value"]
elif "colon" in groupd and groupd["colon"] != None:
e = data.createCopy()
bb.data.update_data(e)
val = bb.data.expand(groupd["value"], e)
elif "append" in groupd and groupd["append"] != None:
val = "%s %s" % ((getFunc(groupd, key, data) or ""), groupd["value"])
elif "prepend" in groupd and groupd["prepend"] != None:
val = "%s %s" % (groupd["value"], (getFunc(groupd, key, data) or ""))
elif "postdot" in groupd and groupd["postdot"] != None:
val = "%s%s" % ((getFunc(groupd, key, data) or ""), groupd["value"])
elif "predot" in groupd and groupd["predot"] != None:
val = "%s%s" % (groupd["value"], (getFunc(groupd, key, data) or ""))
else:
val = groupd["value"]
if 'flag' in groupd and groupd['flag'] != None:
bb.msg.debug(3, bb.msg.domain.Parsing, "setVarFlag(%s, %s, %s, data)" % (key, groupd['flag'], val))
bb.data.setVarFlag(key, groupd['flag'], val, data)
else:
bb.data.setVar(key, val, data)
ast.handleData(statements, groupd)
return
m = __include_regexp__.match(s)
if m:
s = bb.data.expand(m.group(1), data)
bb.msg.debug(3, bb.msg.domain.Parsing, "CONF %s:%d: including %s" % (fn, lineno, s))
include(fn, s, data, False)
ast.handleInclude(statements, m, fn, lineno, False)
return
m = __require_regexp__.match(s)
if m:
s = bb.data.expand(m.group(1), data)
include(fn, s, data, "include required")
ast.handleInclude(statements, m, fn, lineno, True)
return
m = __export_regexp__.match(s)
if m:
bb.data.setVarFlag(m.group(1), "export", 1, data)
ast.handleExport(statements, m)
return
raise ParseError("%s:%d: unparsed line: '%s'" % (fn, lineno, s));

View File

@@ -21,7 +21,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os, re
import re
from bb import data, utils
import bb
@@ -50,19 +50,27 @@ def sortPriorities(pn, dataCache, pkg_pn = None):
if preference not in priorities[priority]:
priorities[priority][preference] = []
priorities[priority][preference].append(f)
pri_list = priorities.keys()
pri_list.sort(lambda a, b: a - b)
tmp_pn = []
for pri in pri_list:
pref_list = priorities[pri].keys()
pref_list.sort(lambda a, b: b - a)
for pri in sorted(priorities, lambda a, b: a - b):
tmp_pref = []
for pref in pref_list:
for pref in sorted(priorities[pri], lambda a, b: b - a):
tmp_pref.extend(priorities[pri][pref])
tmp_pn = [tmp_pref] + tmp_pn
return tmp_pn
def preferredVersionMatch(pe, pv, pr, preferred_e, preferred_v, preferred_r):
"""
Check if the version pe,pv,pr is the preferred one.
If there is preferred version defined and ends with '%', then pv has to start with that version after removing the '%'
"""
if (pr == preferred_r or preferred_r == None):
if (pe == preferred_e or preferred_e == None):
if preferred_v == pv:
return True
if preferred_v != None and preferred_v.endswith('%') and pv.startswith(preferred_v[:len(preferred_v)-1]):
return True
return False
def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
"""
@@ -96,7 +104,7 @@ def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
for file_set in pkg_pn:
for f in file_set:
pe,pv,pr = dataCache.pkg_pepvpr[f]
if preferred_v == pv and (preferred_r == pr or preferred_r == None) and (preferred_e == pe or preferred_e == None):
if preferredVersionMatch(pe, pv, pr, preferred_e, preferred_v, preferred_r):
preferred_file = f
preferred_ver = (pe, pv, pr)
break
@@ -184,14 +192,14 @@ def _filterProviders(providers, item, cfgData, dataCache):
bb.msg.debug(1, bb.msg.domain.Provider, "providers for %s are: %s" % (item, pkg_pn.keys()))
# First add PREFERRED_VERSIONS
for pn in pkg_pn.keys():
for pn in pkg_pn:
sortpkg_pn[pn] = sortPriorities(pn, dataCache, pkg_pn)
preferred_versions[pn] = findPreferredProvider(pn, cfgData, dataCache, sortpkg_pn[pn], item)
if preferred_versions[pn][1]:
eligible.append(preferred_versions[pn][1])
# Now add latest verisons
for pn in pkg_pn.keys():
for pn in sortpkg_pn:
if pn in preferred_versions and preferred_versions[pn][1]:
continue
preferred_versions[pn] = findLatestProvider(pn, cfgData, dataCache, sortpkg_pn[pn][0])

View File

@@ -26,6 +26,7 @@ from bb import msg, data, event, mkdirhier, utils
import bb, os, sys
import signal
import stat
import fcntl
class TaskFailure(Exception):
"""Exception raised when a task in a runqueue fails"""
@@ -37,20 +38,38 @@ class RunQueueStats:
"""
Holds statistics on the tasks handled by the associated runQueue
"""
def __init__(self):
def __init__(self, total):
self.completed = 0
self.skipped = 0
self.failed = 0
self.active = 0
self.total = total
def taskFailed(self):
self.active = self.active - 1
self.failed = self.failed + 1
def taskCompleted(self, number = 1):
self.active = self.active - number
self.completed = self.completed + number
def taskSkipped(self, number = 1):
self.active = self.active + number
self.skipped = self.skipped + number
def taskActive(self):
self.active = self.active + 1
# These values indicate the next step due to be run in the
# runQueue state machine
runQueuePrepare = 2
runQueueRunInit = 3
runQueueRunning = 4
runQueueFailed = 6
runQueueCleanUp = 7
runQueueComplete = 8
runQueueChildProcess = 9
class RunQueueScheduler:
"""
Control the order tasks are scheduled in.
@@ -142,9 +161,9 @@ class RunQueue:
self.cooker = cooker
self.dataCache = dataCache
self.taskData = taskData
self.cfgData = cfgData
self.targets = targets
self.cfgdata = cfgData
self.number_tasks = int(bb.data.getVar("BB_NUMBER_THREADS", cfgData, 1) or 1)
self.multi_provider_whitelist = (bb.data.getVar("MULTI_PROVIDER_WHITELIST", cfgData, 1) or "").split()
self.scheduler = bb.data.getVar("BB_SCHEDULER", cfgData, 1) or "speed"
@@ -152,11 +171,20 @@ class RunQueue:
self.stampwhitelist = bb.data.getVar("BB_STAMP_WHITELIST", cfgData, 1) or ""
def reset_runqueue(self):
self.runq_fnid = []
self.runq_task = []
self.runq_depends = []
self.runq_revdeps = []
self.state = runQueuePrepare
def runq_depends_names(self, ids):
import re
ret = []
for id in self.runq_depends[ids]:
nam = os.path.basename(self.get_user_idstring(id))
nam = re.sub("_[^,]*,", ",", nam)
ret.extend([nam])
return ret
def get_user_idstring(self, task):
fn = self.taskData.fn_index[self.runq_fnid[task]]
@@ -228,7 +256,7 @@ class RunQueue:
valid_chains.append(new_chain)
msgs.append("Dependency loop #%d found:\n" % len(valid_chains))
for dep in new_chain:
msgs.append(" Task %s (%s) (depends: %s)\n" % (dep, self.get_user_idstring(dep), self.runq_depends[dep]))
msgs.append(" Task %s (%s) (dependent Tasks %s)\n" % (dep, self.get_user_idstring(dep), self.runq_depends_names(dep)))
msgs.append("\n")
if len(valid_chains) > 10:
msgs.append("Aborted dependency loops search after 10 matches.\n")
@@ -653,6 +681,8 @@ class RunQueue:
#self.dump_data(taskData)
self.state = runQueueRunInit
def check_stamps(self):
unchecked = {}
current = []
@@ -796,39 +826,51 @@ class RunQueue:
(if the abort on failure configuration option isn't set)
"""
failures = 0
while 1:
failed_fnids = []
try:
self.execute_runqueue_internal()
finally:
if self.master_process:
failed_fnids = self.finish_runqueue()
if len(failed_fnids) == 0:
return failures
if not self.taskData.tryaltconfigs:
raise bb.runqueue.TaskFailure(failed_fnids)
for fnid in failed_fnids:
#print "Failure: %s %s %s" % (fnid, self.taskData.fn_index[fnid], self.runq_task[fnid])
self.taskData.fail_fnid(fnid)
failures = failures + 1
self.reset_runqueue()
if self.state is runQueuePrepare:
self.prepare_runqueue()
if self.state is runQueueRunInit:
bb.msg.note(1, bb.msg.domain.RunQueue, "Executing runqueue")
self.execute_runqueue_initVars()
if self.state is runQueueRunning:
self.execute_runqueue_internal()
if self.state is runQueueCleanUp:
self.finish_runqueue()
if self.state is runQueueFailed:
if not self.taskData.tryaltconfigs:
raise bb.runqueue.TaskFailure(self.failed_fnids)
for fnid in self.failed_fnids:
self.taskData.fail_fnid(fnid)
self.reset_runqueue()
if self.state is runQueueComplete:
# All done
bb.msg.note(1, bb.msg.domain.RunQueue, "Tasks Summary: Attempted %d tasks of which %d didn't need to be rerun and %d failed." % (self.stats.completed, self.stats.skipped, self.stats.failed))
return False
if self.state is runQueueChildProcess:
print "Child process"
return False
# Loop
return True
def execute_runqueue_initVars(self):
self.stats = RunQueueStats()
self.stats = RunQueueStats(len(self.runq_fnid))
self.active_builds = 0
self.runq_buildable = []
self.runq_running = []
self.runq_complete = []
self.build_pids = {}
self.build_pipes = {}
self.failed_fnids = []
self.master_process = True
# Mark initial buildable tasks
for task in range(len(self.runq_fnid)):
for task in range(self.stats.total):
self.runq_running.append(0)
self.runq_complete.append(0)
if len(self.runq_depends[task]) == 0:
@@ -836,6 +878,10 @@ class RunQueue:
else:
self.runq_buildable.append(0)
self.state = runQueueRunning
event.fire(bb.event.StampUpdate(self.target_pairs, self.dataCache.stamp), self.cfgData)
def task_complete(self, task):
"""
Mark a task as completed
@@ -858,26 +904,32 @@ class RunQueue:
taskname = self.runq_task[revdep]
bb.msg.debug(1, bb.msg.domain.RunQueue, "Marking task %s (%s, %s) as buildable" % (revdep, fn, taskname))
def task_fail(self, task, exitcode):
"""
Called when a task has failed
Updates the state engine with the failure
"""
bb.msg.error(bb.msg.domain.RunQueue, "Task %s (%s) failed with %s" % (task, self.get_user_idstring(task), exitcode))
self.stats.taskFailed()
fnid = self.runq_fnid[task]
self.failed_fnids.append(fnid)
bb.event.fire(runQueueTaskFailed(task, self.stats, self), self.cfgData)
if self.taskData.abort:
self.state = runQueueCleanUp
def execute_runqueue_internal(self):
"""
Run the tasks in a queue prepared by prepare_runqueue
"""
bb.msg.note(1, bb.msg.domain.RunQueue, "Executing runqueue")
self.execute_runqueue_initVars()
if len(self.runq_fnid) == 0:
if self.stats.total == 0:
# nothing to do
return []
def sigint_handler(signum, frame):
raise KeyboardInterrupt
event.fire(bb.event.StampUpdate(self.target_pairs, self.dataCache.stamp, self.cfgdata))
self.state = runQueueCleanUp
while True:
task = self.sched.next()
task = None
if self.stats.active < self.number_tasks:
task = self.sched.next()
if task is not None:
fn = self.taskData.fn_index[self.runq_fnid[task]]
@@ -885,107 +937,154 @@ class RunQueue:
if self.check_stamp_task(task):
bb.msg.debug(2, bb.msg.domain.RunQueue, "Stamp current task %s (%s)" % (task, self.get_user_idstring(task)))
self.runq_running[task] = 1
self.runq_buildable[task] = 1
self.task_complete(task)
self.stats.taskCompleted()
self.stats.taskSkipped()
continue
bb.msg.note(1, bb.msg.domain.RunQueue, "Running task %d of %d (ID: %s, %s)" % (self.stats.completed + self.active_builds + 1, len(self.runq_fnid), task, self.get_user_idstring(task)))
sys.stdout.flush()
sys.stderr.flush()
try:
try:
pipein, pipeout = os.pipe()
pid = os.fork()
except OSError, e:
bb.msg.fatal(bb.msg.domain.RunQueue, "fork failed: %d (%s)" % (e.errno, e.strerror))
if pid == 0:
# Bypass master process' handling
self.master_process = False
# Stop Ctrl+C being sent to children
# signal.signal(signal.SIGINT, signal.SIG_IGN)
os.close(pipein)
# Save out the PID so that the event can include it the
# events
bb.event.worker_pid = os.getpid()
bb.event.worker_pipe = pipeout
self.state = runQueueChildProcess
# Make the child the process group leader
os.setpgid(0, 0)
# No stdin
newsi = os.open('/dev/null', os.O_RDWR)
os.dup2(newsi, sys.stdin.fileno())
self.cooker.configuration.cmd = taskname[3:]
# Stdout to a logfile
#logout = data.expand("${TMPDIR}/log/stdout.%s" % os.getpid(), self.cfgData, True)
#mkdirhier(os.path.dirname(logout))
#newso = open(logout, 'w')
#os.dup2(newso.fileno(), sys.stdout.fileno())
#os.dup2(newso.fileno(), sys.stderr.fileno())
bb.event.fire(runQueueTaskStarted(task, self.stats, self), self.cfgData)
bb.msg.note(1, bb.msg.domain.RunQueue,
"Running task %d of %d (ID: %s, %s)" % (self.stats.completed + self.stats.active + 1,
self.stats.total,
task,
self.get_user_idstring(task)))
bb.data.setVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY", self, self.cooker.configuration.data)
bb.data.setVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY2", fn, self.cooker.configuration.data)
try:
self.cooker.tryBuild(fn)
self.cooker.tryBuild(fn, taskname[3:])
except bb.build.EventException:
bb.msg.error(bb.msg.domain.Build, "Build of " + fn + " " + taskname + " failed")
sys.exit(1)
os._exit(1)
except:
bb.msg.error(bb.msg.domain.Build, "Build of " + fn + " " + taskname + " failed")
raise
sys.exit(0)
os._exit(1)
os._exit(0)
self.build_pids[pid] = task
self.build_pipes[pid] = runQueuePipe(pipein, pipeout, self.cfgData)
self.runq_running[task] = 1
self.active_builds = self.active_builds + 1
if self.active_builds < self.number_tasks:
self.stats.taskActive()
if self.stats.active < self.number_tasks:
continue
if self.active_builds > 0:
result = os.waitpid(-1, 0)
self.active_builds = self.active_builds - 1
for pipe in self.build_pipes:
self.build_pipes[pipe].read()
if self.stats.active > 0:
result = os.waitpid(-1, os.WNOHANG)
if result[0] is 0 and result[1] is 0:
return
task = self.build_pids[result[0]]
del self.build_pids[result[0]]
self.build_pipes[result[0]].close()
del self.build_pipes[result[0]]
if result[1] != 0:
del self.build_pids[result[0]]
bb.msg.error(bb.msg.domain.RunQueue, "Task %s (%s) failed" % (task, self.get_user_idstring(task)))
self.failed_fnids.append(self.runq_fnid[task])
self.stats.taskFailed()
if not self.taskData.abort:
continue
break
self.task_fail(task, result[1])
return
self.task_complete(task)
self.stats.taskCompleted()
del self.build_pids[result[0]]
bb.event.fire(runQueueTaskCompleted(task, self.stats, self), self.cfgData)
continue
if len(self.failed_fnids) != 0:
self.state = runQueueFailed
return
# Sanity Checks
for task in range(self.stats.total):
if self.runq_buildable[task] == 0:
bb.msg.error(bb.msg.domain.RunQueue, "Task %s never buildable!" % task)
if self.runq_running[task] == 0:
bb.msg.error(bb.msg.domain.RunQueue, "Task %s never ran!" % task)
if self.runq_complete[task] == 0:
bb.msg.error(bb.msg.domain.RunQueue, "Task %s never completed!" % task)
self.state = runQueueComplete
return
def finish_runqueue(self):
def finish_runqueue_now(self):
bb.msg.note(1, bb.msg.domain.RunQueue, "Sending SIGINT to remaining %s tasks" % self.stats.active)
for k, v in self.build_pids.iteritems():
try:
os.kill(-k, signal.SIGINT)
except:
pass
for pipe in self.build_pipes:
self.build_pipes[pipe].read()
def finish_runqueue(self, now = False):
self.state = runQueueCleanUp
for pipe in self.build_pipes:
self.build_pipes[pipe].read()
if now:
self.finish_runqueue_now()
try:
while self.active_builds > 0:
bb.msg.note(1, bb.msg.domain.RunQueue, "Waiting for %s active tasks to finish" % self.active_builds)
tasknum = 1
for k, v in self.build_pids.iteritems():
bb.msg.note(1, bb.msg.domain.RunQueue, "%s: %s (%s)" % (tasknum, self.get_user_idstring(v), k))
tasknum = tasknum + 1
result = os.waitpid(-1, 0)
while self.stats.active > 0:
bb.event.fire(runQueueExitWait(self.stats.active), self.cfgData)
#bb.msg.note(1, bb.msg.domain.RunQueue, "Waiting for %s active tasks to finish" % self.stats.active)
#tasknum = 1
#for k, v in self.build_pids.iteritems():
# bb.msg.note(1, bb.msg.domain.RunQueue, "%s: %s (pid %s)" % (tasknum, self.get_user_idstring(v), k))
# tasknum = tasknum + 1
result = os.waitpid(-1, os.WNOHANG)
if result[0] is 0 and result[1] is 0:
return
task = self.build_pids[result[0]]
if result[1] != 0:
bb.msg.error(bb.msg.domain.RunQueue, "Task %s (%s) failed" % (task, self.get_user_idstring(task)))
self.failed_fnids.append(self.runq_fnid[task])
self.stats.taskFailed()
del self.build_pids[result[0]]
self.active_builds = self.active_builds - 1
bb.msg.note(1, bb.msg.domain.RunQueue, "Tasks Summary: Attempted %d tasks of which %d didn't need to be rerun and %d failed." % (self.stats.completed, self.stats.skipped, self.stats.failed))
return self.failed_fnids
except KeyboardInterrupt:
bb.msg.note(1, bb.msg.domain.RunQueue, "Sending SIGINT to remaining %s tasks" % self.active_builds)
for k, v in self.build_pids.iteritems():
try:
os.kill(-k, signal.SIGINT)
except:
pass
self.build_pipes[result[0]].close()
del self.build_pipes[result[0]]
if result[1] != 0:
self.task_fail(task, result[1])
else:
self.stats.taskCompleted()
bb.event.fire(runQueueTaskCompleted(task, self.stats, self), self.cfgData)
except:
self.finish_runqueue_now()
raise
# Sanity Checks
for task in range(len(self.runq_fnid)):
if self.runq_buildable[task] == 0:
bb.msg.error(bb.msg.domain.RunQueue, "Task %s never buildable!" % task)
if self.runq_running[task] == 0:
bb.msg.error(bb.msg.domain.RunQueue, "Task %s never ran!" % task)
if self.runq_complete[task] == 0:
bb.msg.error(bb.msg.domain.RunQueue, "Task %s never completed!" % task)
if len(self.failed_fnids) != 0:
self.state = runQueueFailed
return
bb.msg.note(1, bb.msg.domain.RunQueue, "Tasks Summary: Attempted %d tasks of which %d didn't need to be rerun and %d failed." % (self.stats.completed, self.stats.skipped, self.stats.failed))
return self.failed_fnids
self.state = runQueueComplete
return
def dump_data(self, taskQueue):
"""
Dump some debug information on the internal data structures
"""
bb.msg.debug(3, bb.msg.domain.RunQueue, "run_tasks:")
for task in range(len(self.runq_fnid)):
for task in range(len(self.runq_task)):
bb.msg.debug(3, bb.msg.domain.RunQueue, " (%s)%s - %s: %s Deps %s RevDeps %s" % (task,
taskQueue.fn_index[self.runq_fnid[task]],
self.runq_task[task],
@@ -994,7 +1093,7 @@ class RunQueue:
self.runq_revdeps[task]))
bb.msg.debug(3, bb.msg.domain.RunQueue, "sorted_tasks:")
for task1 in range(len(self.runq_fnid)):
for task1 in range(len(self.runq_task)):
if task1 in self.prio_map:
task = self.prio_map[task1]
bb.msg.debug(3, bb.msg.domain.RunQueue, " (%s)%s - %s: %s Deps %s RevDeps %s" % (task,
@@ -1005,11 +1104,96 @@ class RunQueue:
self.runq_revdeps[task]))
class TaskFailure(Exception):
"""
Exception raised when a task in a runqueue fails
"""
def __init__(self, x):
self.args = x
class runQueueExitWait(bb.event.Event):
"""
Event when waiting for task processes to exit
"""
def __init__(self, remain):
self.remain = remain
self.message = "Waiting for %s active tasks to finish" % remain
bb.event.Event.__init__(self)
class runQueueEvent(bb.event.Event):
"""
Base runQueue event class
"""
def __init__(self, task, stats, rq):
self.taskid = task
self.taskstring = rq.get_user_idstring(task)
self.stats = stats
bb.event.Event.__init__(self)
class runQueueTaskStarted(runQueueEvent):
"""
Event notifing a task was started
"""
def __init__(self, task, stats, rq):
runQueueEvent.__init__(self, task, stats, rq)
self.message = "Running task %s (%d of %d) (%s)" % (task, stats.completed + stats.active + 1, self.stats.total, self.taskstring)
class runQueueTaskFailed(runQueueEvent):
"""
Event notifing a task failed
"""
def __init__(self, task, stats, rq):
runQueueEvent.__init__(self, task, stats, rq)
self.message = "Task %s failed (%s)" % (task, self.taskstring)
class runQueueTaskCompleted(runQueueEvent):
"""
Event notifing a task completed
"""
def __init__(self, task, stats, rq):
runQueueEvent.__init__(self, task, stats, rq)
self.message = "Task %s completed (%s)" % (task, self.taskstring)
def check_stamp_fn(fn, taskname, d):
rq = bb.data.getVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY", d)
fn = bb.data.getVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY2", d)
fnid = rq.taskData.getfn_id(fn)
taskid = rq.get_task_id(fnid, taskname)
if taskid is not None:
return rq.check_stamp_task(taskid)
return None
class runQueuePipe():
"""
Abstraction for a pipe between a worker thread and the server
"""
def __init__(self, pipein, pipeout, d):
self.fd = pipein
os.close(pipeout)
fcntl.fcntl(self.fd, fcntl.F_SETFL, fcntl.fcntl(self.fd, fcntl.F_GETFL) | os.O_NONBLOCK)
self.queue = ""
self.d = d
def read(self):
start = len(self.queue)
try:
self.queue = self.queue + os.read(self.fd, 1024)
except OSError:
pass
end = len(self.queue)
index = self.queue.find("</event>")
while index != -1:
bb.event.fire_from_worker(self.queue[:index+8], self.d)
self.queue = self.queue[index+8:]
index = self.queue.find("</event>")
return (end > start)
def close(self):
while self.read():
continue
if len(self.queue) > 0:
print "Warning, worker left partial message"
os.close(self.fd)

View File

@@ -0,0 +1,181 @@
#
# BitBake 'dummy' Passthrough Server
#
# Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer
# Copyright (C) 2006 - 2008 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
This module implements an xmlrpc server for BitBake.
Use this by deriving a class from BitBakeXMLRPCServer and then adding
methods which you want to "export" via XMLRPC. If the methods have the
prefix xmlrpc_, then registering those function will happen automatically,
if not, you need to call register_function.
Use register_idle_function() to add a function which the xmlrpc server
calls from within server_forever when no requests are pending. Make sure
that those functions are non-blocking or else you will introduce latency
in the server's main loop.
"""
import time
import bb
from bb.ui import uievent
import xmlrpclib
import pickle
DEBUG = False
from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
import inspect, select
class BitBakeServerCommands():
def __init__(self, server, cooker):
self.cooker = cooker
self.server = server
def runCommand(self, command):
"""
Run a cooker command on the server
"""
#print "Running Command %s" % command
return self.cooker.command.runCommand(command)
def terminateServer(self):
"""
Trigger the server to quit
"""
self.server.server_exit()
#print "Server (cooker) exitting"
return
def ping(self):
"""
Dummy method which can be used to check the server is still alive
"""
return True
eventQueue = []
class BBUIEventQueue:
class event:
def __init__(self, parent):
self.parent = parent
@staticmethod
def send(event):
bb.server.none.eventQueue.append(pickle.loads(event))
@staticmethod
def quit():
return
def __init__(self, BBServer):
self.eventQueue = bb.server.none.eventQueue
self.BBServer = BBServer
self.EventHandle = bb.event.register_UIHhandler(self)
def getEvent(self):
if len(self.eventQueue) == 0:
return None
return self.eventQueue.pop(0)
def waitEvent(self, delay):
event = self.getEvent()
if event:
return event
self.BBServer.idle_commands(delay)
return self.getEvent()
def queue_event(self, event):
self.eventQueue.append(event)
def system_quit( self ):
bb.event.unregister_UIHhandler(self.EventHandle)
class BitBakeServer():
# remove this when you're done with debugging
# allow_reuse_address = True
def __init__(self, cooker):
self._idlefuns = {}
self.commands = BitBakeServerCommands(self, cooker)
def register_idle_function(self, function, data):
"""Register a function to be called while the server is idle"""
assert callable(function)
self._idlefuns[function] = data
def idle_commands(self, delay):
#print "Idle queue length %s" % len(self._idlefuns)
#print "Idle timeout, running idle functions"
#if len(self._idlefuns) == 0:
nextsleep = delay
for function, data in self._idlefuns.items():
try:
retval = function(self, data, False)
#print "Idle function returned %s" % (retval)
if retval is False:
del self._idlefuns[function]
elif retval is True:
nextsleep = None
elif nextsleep is None:
continue
elif retval < nextsleep:
nextsleep = retval
except SystemExit:
raise
except:
import traceback
traceback.print_exc()
pass
if nextsleep is not None:
#print "Sleeping for %s (%s)" % (nextsleep, delay)
time.sleep(nextsleep)
def server_exit(self):
# Tell idle functions we're exiting
for function, data in self._idlefuns.items():
try:
retval = function(self, data, True)
except:
pass
class BitbakeServerInfo():
def __init__(self, server):
self.server = server
self.commands = server.commands
class BitBakeServerFork():
def __init__(self, serverinfo, command, logfile):
serverinfo.forkCommand = command
serverinfo.logfile = logfile
class BitBakeServerConnection():
def __init__(self, serverinfo):
self.server = serverinfo.server
self.connection = serverinfo.commands
self.events = bb.server.none.BBUIEventQueue(self.server)
def terminate(self):
try:
self.events.system_quit()
except:
pass
try:
self.connection.terminateServer()
except:
pass

View File

@@ -32,13 +32,19 @@
"""
import bb
import xmlrpclib
import xmlrpclib, sys
from bb import daemonize
from bb.ui import uievent
DEBUG = False
from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
import inspect, select
if sys.hexversion < 0x020600F0:
print "Sorry, python 2.6 or later is required for bitbake's XMLRPC mode"
sys.exit(1)
class BitBakeServerCommands():
def __init__(self, server, cooker):
self.cooker = cooker
@@ -77,7 +83,7 @@ class BitBakeServerCommands():
"""
return True
class BitBakeXMLRPCServer(SimpleXMLRPCServer):
class BitBakeServer(SimpleXMLRPCServer):
# remove this when you're done with debugging
# allow_reuse_address = True
@@ -114,26 +120,34 @@ class BitBakeXMLRPCServer(SimpleXMLRPCServer):
Serve Requests. Overloaded to honor a quit command
"""
self.quit = False
self.timeout = 0 # Run Idle calls for our first callback
while not self.quit:
#print "Idle queue length %s" % len(self._idlefuns)
if len(self._idlefuns) == 0:
self.timeout = None
else:
self.timeout = 0
self.handle_request()
#print "Idle timeout, running idle functions"
nextsleep = None
for function, data in self._idlefuns.items():
try:
retval = function(self, data, False)
if not retval:
if retval is False:
del self._idlefuns[function]
elif retval is True:
nextsleep = 0
elif nextsleep is 0:
continue
elif nextsleep is None:
nextsleep = retval
elif retval < nextsleep:
nextsleep = retval
except SystemExit:
raise
except:
import traceback
traceback.print_exc()
pass
if nextsleep is None and len(self._idlefuns) > 0:
nextsleep = 0
self.timeout = nextsleep
# Tell idle functions we're exiting
for function, data in self._idlefuns.items():
try:
@@ -143,3 +157,31 @@ class BitBakeXMLRPCServer(SimpleXMLRPCServer):
self.server_close()
return
class BitbakeServerInfo():
def __init__(self, server):
self.host = server.host
self.port = server.port
class BitBakeServerFork():
def __init__(self, serverinfo, command, logfile):
daemonize.createDaemon(command, logfile)
class BitBakeServerConnection():
def __init__(self, serverinfo):
self.connection = xmlrpclib.Server("http://%s:%s" % (serverinfo.host, serverinfo.port), allow_none=True)
self.events = uievent.BBUIEventQueue(self.connection)
def terminate(self):
# Don't wait for server indefinitely
import socket
socket.setdefaulttimeout(2)
try:
self.events.system_quit()
except:
pass
try:
self.connection.terminateServer()
except:
pass

View File

@@ -147,13 +147,10 @@ class BitBakeShellCommands:
global last_exception
globexpr = params[0]
self._checkParsed()
names = globfilter( cooker.status.pkg_pn.keys(), globexpr )
names = globfilter( cooker.status.pkg_pn, globexpr )
if len( names ) == 0: names = [ globexpr ]
print "SHELL: Building %s" % ' '.join( names )
oldcmd = cooker.configuration.cmd
cooker.configuration.cmd = cmd
td = taskdata.TaskData(cooker.configuration.abort)
localdata = data.createCopy(cooker.configuration.data)
data.update_data(localdata)
@@ -168,7 +165,7 @@ class BitBakeShellCommands:
if len(providers) == 0:
raise Providers.NoProvider
tasks.append([name, "do_%s" % cooker.configuration.cmd])
tasks.append([name, "do_%s" % cmd])
td.add_unresolved(localdata, cooker.status)
@@ -189,7 +186,6 @@ class BitBakeShellCommands:
print "ERROR: Couldn't build '%s'" % names
last_exception = e
cooker.configuration.cmd = oldcmd
build.usage = "<providee>"
@@ -208,6 +204,11 @@ class BitBakeShellCommands:
self.build( params, "configure" )
configure.usage = "<providee>"
def install( self, params ):
"""Execute 'install' on a providee"""
self.build( params, "install" )
install.usage = "<providee>"
def edit( self, params ):
"""Call $EDITOR on a providee"""
name = params[0]
@@ -240,18 +241,14 @@ class BitBakeShellCommands:
bf = completeFilePath( name )
print "SHELL: Calling '%s' on '%s'" % ( cmd, bf )
oldcmd = cooker.configuration.cmd
cooker.configuration.cmd = cmd
try:
cooker.buildFile(bf)
cooker.buildFile(bf, cmd)
except parse.ParseError:
print "ERROR: Unable to open or parse '%s'" % bf
except build.EventException, e:
print "ERROR: Couldn't build '%s'" % name
last_exception = e
cooker.configuration.cmd = oldcmd
fileBuild.usage = "<bbfile>"
def fileClean( self, params ):
@@ -297,9 +294,7 @@ class BitBakeShellCommands:
def help( self, params ):
"""Show a comprehensive list of commands and their purpose"""
print "="*30, "Available Commands", "="*30
allcmds = cmds.keys()
allcmds.sort()
for cmd in allcmds:
for cmd in sorted(cmds):
function,numparams,usage,helptext = cmds[cmd]
print "| %s | %s" % (usage.ljust(30), helptext)
print "="*78
@@ -325,10 +320,10 @@ class BitBakeShellCommands:
what, globexpr = params
if what == "files":
self._checkParsed()
for key in globfilter( cooker.status.pkg_fn.keys(), globexpr ): print key
for key in globfilter( cooker.status.pkg_fn, globexpr ): print key
elif what == "providers":
self._checkParsed()
for key in globfilter( cooker.status.pkg_pn.keys(), globexpr ): print key
for key in globfilter( cooker.status.pkg_pn, globexpr ): print key
else:
print "Usage: match %s" % self.print_.usage
match.usage = "<files|providers> <glob>"
@@ -476,10 +471,10 @@ SRC_URI = ""
what = params[0]
if what == "files":
self._checkParsed()
for key in cooker.status.pkg_fn.keys(): print key
for key in cooker.status.pkg_fn: print key
elif what == "providers":
self._checkParsed()
for key in cooker.status.providers.keys(): print key
for key in cooker.status.providers: print key
else:
print "Usage: print %s" % self.print_.usage
print_.usage = "<files|providers>"
@@ -493,7 +488,7 @@ SRC_URI = ""
interpreter.interact( "SHELL: Expert Mode - BitBake Python %s\nType 'help' for more information, press CTRL-D to switch back to BBSHELL." % sys.version )
def showdata( self, params ):
"""Show the parsed metadata for a given providee"""
"""Execute 'showdata' on a providee"""
cooker.showEnvironment(None, params)
showdata.usage = "<providee>"
@@ -574,7 +569,7 @@ def completeFilePath( bbfile ):
"""Get the complete bbfile path"""
if not cooker.status: return bbfile
if not cooker.status.pkg_fn: return bbfile
for key in cooker.status.pkg_fn.keys():
for key in cooker.status.pkg_fn:
if key.endswith( bbfile ):
return key
return bbfile
@@ -618,7 +613,7 @@ def completer( text, state ):
allmatches = cooker.configuration.data.keys()
elif u == "<bbfile>":
if cooker.status.pkg_fn is None: allmatches = [ "(No Matches Available. Parsed yet?)" ]
else: allmatches = [ x.split("/")[-1] for x in cooker.status.pkg_fn.keys() ]
else: allmatches = [ x.split("/")[-1] for x in cooker.status.pkg_fn ]
elif u == "<providee>":
if cooker.status.pkg_fn is None: allmatches = [ "(No Matches Available. Parsed yet?)" ]
else: allmatches = cooker.status.providers.iterkeys()

View File

@@ -23,8 +23,20 @@ Task data collection and handling
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from bb import data, event, mkdirhier, utils
import bb, os
import bb
def re_match_strings(target, strings):
"""
Whether or not the string 'target' matches
any one string of the strings which can be regular expression string
"""
import re
for name in strings:
if (name==target or
re.search(name,target)!=None):
return True
return False
class TaskData:
"""
@@ -161,6 +173,8 @@ class TaskData:
ids = []
for dep in task_deps['depends'][task].split():
if dep:
if ":" not in dep:
bb.msg.fatal(bb.msg.domain.TaskData, "Error, dependency %s does not contain ':' character\n. Task 'depends' should be specified in the form 'packagename:task'" % (dep, fn))
ids.append(((self.getbuild_id(dep.split(":")[0])), dep.split(":")[1]))
self.tasks_idepends[taskid].extend(ids)
@@ -262,7 +276,7 @@ class TaskData:
"""
unresolved = []
for target in self.build_names_index:
if target in dataCache.ignored_dependencies:
if re_match_strings(target, dataCache.ignored_dependencies):
continue
if self.build_names_index.index(target) in self.failed_deps:
continue
@@ -277,7 +291,7 @@ class TaskData:
"""
unresolved = []
for target in self.run_names_index:
if target in dataCache.ignored_dependencies:
if re_match_strings(target, dataCache.ignored_dependencies):
continue
if self.run_names_index.index(target) in self.failed_rdeps:
continue
@@ -357,7 +371,7 @@ class TaskData:
added internally during dependency resolution
"""
if item in dataCache.ignored_dependencies:
if re_match_strings(item, dataCache.ignored_dependencies):
return
if not item in dataCache.providers:
@@ -365,7 +379,7 @@ class TaskData:
bb.msg.note(2, bb.msg.domain.Provider, "Nothing PROVIDES '%s' (but '%s' DEPENDS on or otherwise requires it)" % (item, self.get_dependees_str(item)))
else:
bb.msg.note(2, bb.msg.domain.Provider, "Nothing PROVIDES '%s'" % (item))
bb.event.fire(bb.event.NoProvider(item, cfgData))
bb.event.fire(bb.event.NoProvider(item), cfgData)
raise bb.providers.NoProvider(item)
if self.have_build_target(item):
@@ -374,15 +388,11 @@ class TaskData:
all_p = dataCache.providers[item]
eligible, foundUnique = bb.providers.filterProviders(all_p, item, cfgData, dataCache)
for p in eligible:
fnid = self.getfn_id(p)
if fnid in self.failed_fnids:
eligible.remove(p)
eligible = [p for p in eligible if not self.getfn_id(p) in self.failed_fnids]
if not eligible:
bb.msg.note(2, bb.msg.domain.Provider, "No buildable provider PROVIDES '%s' but '%s' DEPENDS on or otherwise requires it. Enable debugging and see earlier logs to find unbuildable providers." % (item, self.get_dependees_str(item)))
bb.event.fire(bb.event.NoProvider(item, cfgData))
bb.event.fire(bb.event.NoProvider(item), cfgData)
raise bb.providers.NoProvider(item)
if len(eligible) > 1 and foundUnique == False:
@@ -392,7 +402,7 @@ class TaskData:
providers_list.append(dataCache.pkg_fn[fn])
bb.msg.note(1, bb.msg.domain.Provider, "multiple providers are available for %s (%s);" % (item, ", ".join(providers_list)))
bb.msg.note(1, bb.msg.domain.Provider, "consider defining PREFERRED_PROVIDER_%s" % item)
bb.event.fire(bb.event.MultipleProviders(item, providers_list, cfgData))
bb.event.fire(bb.event.MultipleProviders(item, providers_list), cfgData)
self.consider_msgs_cache.append(item)
for fn in eligible:
@@ -412,7 +422,7 @@ class TaskData:
(takes item names from RDEPENDS/PACKAGES namespace)
"""
if item in dataCache.ignored_dependencies:
if re_match_strings(item, dataCache.ignored_dependencies):
return
if self.have_runtime_target(item):
@@ -422,19 +432,15 @@ class TaskData:
if not all_p:
bb.msg.error(bb.msg.domain.Provider, "'%s' RDEPENDS/RRECOMMENDS or otherwise requires the runtime entity '%s' but it wasn't found in any PACKAGE or RPROVIDES variables" % (self.get_rdependees_str(item), item))
bb.event.fire(bb.event.NoProvider(item, cfgData, runtime=True))
bb.event.fire(bb.event.NoProvider(item, runtime=True), cfgData)
raise bb.providers.NoRProvider(item)
eligible, numberPreferred = bb.providers.filterProvidersRunTime(all_p, item, cfgData, dataCache)
for p in eligible:
fnid = self.getfn_id(p)
if fnid in self.failed_fnids:
eligible.remove(p)
eligible = [p for p in eligible if not self.getfn_id(p) in self.failed_fnids]
if not eligible:
bb.msg.error(bb.msg.domain.Provider, "'%s' RDEPENDS/RRECOMMENDS or otherwise requires the runtime entity '%s' but it wasn't found in any PACKAGE or RPROVIDES variables of any buildable targets.\nEnable debugging and see earlier logs to find unbuildable targets." % (self.get_rdependees_str(item), item))
bb.event.fire(bb.event.NoProvider(item, cfgData, runtime=True))
bb.event.fire(bb.event.NoProvider(item, runtime=True), cfgData)
raise bb.providers.NoRProvider(item)
if len(eligible) > 1 and numberPreferred == 0:
@@ -444,7 +450,7 @@ class TaskData:
providers_list.append(dataCache.pkg_fn[fn])
bb.msg.note(2, bb.msg.domain.Provider, "multiple providers are available for runtime %s (%s);" % (item, ", ".join(providers_list)))
bb.msg.note(2, bb.msg.domain.Provider, "consider defining a PREFERRED_PROVIDER entry to match runtime %s" % item)
bb.event.fire(bb.event.MultipleProviders(item,providers_list, cfgData, runtime=True))
bb.event.fire(bb.event.MultipleProviders(item,providers_list, runtime=True), cfgData)
self.consider_msgs_cache.append(item)
if numberPreferred > 1:
@@ -454,7 +460,7 @@ class TaskData:
providers_list.append(dataCache.pkg_fn[fn])
bb.msg.note(2, bb.msg.domain.Provider, "multiple providers are available for runtime %s (top %s entries preferred) (%s);" % (item, numberPreferred, ", ".join(providers_list)))
bb.msg.note(2, bb.msg.domain.Provider, "consider defining only one PREFERRED_PROVIDER entry to match runtime %s" % item)
bb.event.fire(bb.event.MultipleProviders(item,providers_list, cfgData, runtime=True))
bb.event.fire(bb.event.MultipleProviders(item,providers_list, runtime=True), cfgData)
self.consider_msgs_cache.append(item)
# run through the list until we find one that we can build
@@ -554,7 +560,7 @@ class TaskData:
added = added + 1
except bb.providers.NoRProvider:
self.remove_runtarget(self.getrun_id(target))
bb.msg.debug(1, bb.msg.domain.TaskData, "Resolved " + str(added) + " extra dependecies")
bb.msg.debug(1, bb.msg.domain.TaskData, "Resolved " + str(added) + " extra dependencies")
if added == 0:
break
# self.dump_data()

View File

@@ -61,36 +61,36 @@ class RunningBuild (gobject.GObject):
# If we have a pid attached to this message/event try and get the
# (package, task) pair for it. If we get that then get the parent iter
# for the message.
if event[1].has_key ('pid'):
pid = event[1]['pid']
if hasattr(event, 'pid'):
pid = event.pid
if self.pids_to_task.has_key(pid):
(package, task) = self.pids_to_task[pid]
parent = self.tasks_to_iter[(package, task)]
if event[0].startswith('bb.msg.Msg'):
if isinstance(event, bb.msg.Msg):
# Set a pretty icon for the message based on it's type.
if (event[0].startswith ('bb.msg.MsgWarn')):
if isinstance(event, bb.msg.MsgWarn):
icon = "dialog-warning"
elif (event[0].startswith ('bb.msg.MsgErr')):
elif isinstance(event, bb.msg.MsgErr):
icon = "dialog-error"
else:
icon = None
# Ignore the "Running task i of n .." messages
if (event[1]['_message'].startswith ("Running task")):
if (event._message.startswith ("Running task")):
return
# Add the message to the tree either at the top level if parent is
# None otherwise as a descendent of a task.
self.model.append (parent,
(event[0].split()[-1], # e.g. MsgWarn, MsgError
(event.__name__.split()[-1], # e.g. MsgWarn, MsgError
package,
task,
event[1]['_message'],
event._message,
icon,
False))
elif event[0].startswith('bb.build.TaskStarted'):
(package, task) = (event[1]['_package'], event[1]['_task'])
elif isinstance(event, bb.build.TaskStarted):
(package, task) = (event._package, event._task)
# Save out this PID.
self.pids_to_task[pid] = (package,task)
@@ -128,9 +128,9 @@ class RunningBuild (gobject.GObject):
# Mark this task as active.
self.model.set(i, self.model.COL_ICON, "gtk-execute")
elif event[0].startswith('bb.build.Task'):
elif isinstance(event, bb.build.Task):
if event[0].startswith('bb.build.TaskFailed'):
if isinstance(event, bb.build.TaskFailed):
# Mark the task as failed
i = self.tasks_to_iter[(package, task)]
self.model.set(i, self.model.COL_ICON, "dialog-error")
@@ -153,8 +153,8 @@ class RunningBuild (gobject.GObject):
del self.tasks_to_iter[(package, task)]
del self.pids_to_task[pid]
elif event[0].startswith('bb.event.BuildCompleted'):
failures = int (event[1]['_failures'])
elif isinstance(event, bb.event.BuildCompleted):
failures = int (event._failures)
# Emit the appropriate signal depending on the number of failures
if (failures > 1):

View File

@@ -229,12 +229,12 @@ def init(server, eventHandler):
if event is None:
continue
if event[0].startswith('bb.event.ParseProgress'):
x = event[1]['sofar']
y = event[1]['total']
if isinstance(event, bb.event.ParseProgress):
x = event.sofar
y = event.total
if x == y:
print("\nParsing finished. %d cached, %d parsed, %d skipped, %d masked, %d errors."
% ( event[1]['cached'], event[1]['parsed'], event[1]['skipped'], event[1]['masked'], event[1]['errors']))
% ( event.cached, event.parsed, event.skipped, event.masked, event.errors))
pbar.hide()
gtk.gdk.threads_enter()
pbar.progress.set_fraction(float(x)/float(y))
@@ -242,17 +242,17 @@ def init(server, eventHandler):
gtk.gdk.threads_leave()
continue
if event[0] == "bb.event.DepTreeGenerated":
if isinstance(event, bb.event.DepTreeGenerated):
gtk.gdk.threads_enter()
parse(event[1]['_depgraph'], dep.pkg_model, dep.depends_model)
parse(event._depgraph, dep.pkg_model, dep.depends_model)
gtk.gdk.threads_leave()
if event[0] == 'bb.command.CookerCommandCompleted':
if isinstance(event, bb.command.CookerCommandCompleted):
continue
if event[0] == 'bb.command.CookerCommandFailed':
print "Command execution failed: %s" % event[1]['error']
if isinstance(event, bb.command.CookerCommandFailed):
print "Command execution failed: %s" % event.error
break
if event[0] == 'bb.cooker.CookerExit':
if isinstance(event, bb.cooker.CookerExit):
break
continue

View File

@@ -23,6 +23,9 @@ import os
import sys
import itertools
import xmlrpclib
from bb import ui
from bb.ui import uihelper
parsespin = itertools.cycle( r'|/-\\' )
@@ -32,6 +35,8 @@ def init(server, eventHandler):
includelogs = server.runCommand(["getVariable", "BBINCLUDELOGS"])
loglines = server.runCommand(["getVariable", "BBINCLUDELOGS_LINES"])
helper = uihelper.BBUIHelper()
try:
cmdline = server.runCommand(["getCmdLineAction"])
#print cmdline
@@ -53,31 +58,44 @@ def init(server, eventHandler):
if event is None:
continue
#print event
if event[0].startswith('bb.msg.MsgPlain'):
print event[1]['_message']
helper.eventHandler(event)
if isinstance(event, bb.runqueue.runQueueExitWait):
if not shutdown:
shutdown = 1
if shutdown and helper.needUpdate:
activetasks, failedtasks = helper.getTasks()
if activetasks:
print "Waiting for %s active tasks to finish:" % len(activetasks)
tasknum = 1
for task in activetasks:
print "%s: %s (pid %s)" % (tasknum, activetasks[task]["title"], task)
tasknum = tasknum + 1
if isinstance(event, bb.msg.MsgPlain):
print event._message
continue
if event[0].startswith('bb.msg.MsgDebug'):
print 'DEBUG: ' + event[1]['_message']
if isinstance(event, bb.msg.MsgDebug):
print 'DEBUG: ' + event._message
continue
if event[0].startswith('bb.msg.MsgNote'):
print 'NOTE: ' + event[1]['_message']
if isinstance(event, bb.msg.MsgNote):
print 'NOTE: ' + event._message
continue
if event[0].startswith('bb.msg.MsgWarn'):
print 'WARNING: ' + event[1]['_message']
if isinstance(event, bb.msg.MsgWarn):
print 'WARNING: ' + event._message
continue
if event[0].startswith('bb.msg.MsgError'):
if isinstance(event, bb.msg.MsgError):
return_value = 1
print 'ERROR: ' + event[1]['_message']
print 'ERROR: ' + event._message
continue
if event[0].startswith('bb.msg.MsgFatal'):
if isinstance(event, bb.msg.MsgFatal):
return_value = 1
print 'FATAL: ' + event[1]['_message']
print 'FATAL: ' + event._message
break
if event[0].startswith('bb.build.TaskFailed'):
if isinstance(event, bb.build.TaskFailed):
return_value = 1
logfile = event[1]['logfile']
logfile = event.logfile
if logfile:
print "ERROR: Logfile of failure stored in %s." % logfile
print "ERROR: Logfile of failure stored in: %s" % logfile
if 1 or includelogs:
print "Log data follows:"
f = open(logfile, "r")
@@ -97,12 +115,12 @@ def init(server, eventHandler):
if lines:
for line in lines:
print line
if event[0].startswith('bb.build.Task'):
print "NOTE: %s" % event[1]['_message']
if isinstance(event, bb.build.TaskBase):
print "NOTE: %s" % event._message
continue
if event[0].startswith('bb.event.ParseProgress'):
x = event[1]['sofar']
y = event[1]['total']
if isinstance(event, bb.event.ParseProgress):
x = event.sofar
y = event.total
if os.isatty(sys.stdout.fileno()):
sys.stdout.write("\rNOTE: Handling BitBake files: %s (%04d/%04d) [%2d %%]" % ( parsespin.next(), x, y, x*100/y ) )
sys.stdout.flush()
@@ -114,36 +132,38 @@ def init(server, eventHandler):
sys.stdout.write("done.")
sys.stdout.flush()
if x == y:
print("\nParsing finished. %d cached, %d parsed, %d skipped, %d masked, %d errors."
% ( event[1]['cached'], event[1]['parsed'], event[1]['skipped'], event[1]['masked'], event[1]['errors']))
print("\nParsing of %d .bb files complete (%d cached, %d parsed). %d targets, %d skipped, %d masked, %d errors."
% ( event.total, event.cached, event.parsed, event.virtuals, event.skipped, event.masked, event.errors))
continue
if event[0] == 'bb.command.CookerCommandCompleted':
if isinstance(event, bb.command.CookerCommandCompleted):
break
if event[0] == 'bb.command.CookerCommandSetExitCode':
return_value = event[1]['exitcode']
if isinstance(event, bb.command.CookerCommandSetExitCode):
return_value = event.exitcode
continue
if event[0] == 'bb.command.CookerCommandFailed':
if isinstance(event, bb.command.CookerCommandFailed):
return_value = 1
print "Command execution failed: %s" % event[1]['error']
print "Command execution failed: %s" % event.error
break
if event[0] == 'bb.cooker.CookerExit':
if isinstance(event, bb.cooker.CookerExit):
break
# ignore
if event[0].startswith('bb.event.BuildStarted'):
if isinstance(event, bb.event.BuildStarted):
continue
if event[0].startswith('bb.event.BuildCompleted'):
if isinstance(event, bb.event.BuildCompleted):
continue
if event[0].startswith('bb.event.MultipleProviders'):
if isinstance(event, bb.event.MultipleProviders):
continue
if event[0].startswith('bb.runqueue.runQueue'):
if isinstance(event, bb.runqueue.runQueueEvent):
continue
if event[0].startswith('bb.event.StampUpdate'):
if isinstance(event, bb.runqueue.runQueueExitWait):
continue
if event[0].startswith('bb.event.ConfigParsed'):
if isinstance(event, bb.event.StampUpdate):
continue
if event[0].startswith('bb.event.RecipeParsed'):
if isinstance(event, bb.event.ConfigParsed):
continue
if isinstance(event, bb.event.RecipeParsed):
continue
print "Unknown Event: %s" % event

View File

@@ -246,29 +246,29 @@ class NCursesUI:
continue
helper.eventHandler(event)
#mw.appendText("%s\n" % event[0])
if event[0].startswith('bb.build.Task'):
mw.appendText("NOTE: %s\n" % event[1]['_message'])
if event[0].startswith('bb.msg.MsgDebug'):
mw.appendText('DEBUG: ' + event[1]['_message'] + '\n')
if event[0].startswith('bb.msg.MsgNote'):
mw.appendText('NOTE: ' + event[1]['_message'] + '\n')
if event[0].startswith('bb.msg.MsgWarn'):
mw.appendText('WARNING: ' + event[1]['_message'] + '\n')
if event[0].startswith('bb.msg.MsgError'):
mw.appendText('ERROR: ' + event[1]['_message'] + '\n')
if event[0].startswith('bb.msg.MsgFatal'):
mw.appendText('FATAL: ' + event[1]['_message'] + '\n')
if event[0].startswith('bb.event.ParseProgress'):
x = event[1]['sofar']
y = event[1]['total']
if isinstance(event, bb.build.Task):
mw.appendText("NOTE: %s\n" % event._message)
if isinstance(event, bb.msg.MsgDebug):
mw.appendText('DEBUG: ' + event._message + '\n')
if isinstance(event, bb.msg.MsgNote):
mw.appendText('NOTE: ' + event._message + '\n')
if isinstance(event, bb.msg.MsgWarn):
mw.appendText('WARNING: ' + event._message + '\n')
if isinstance(event, bb.msg.MsgError):
mw.appendText('ERROR: ' + event._message + '\n')
if isinstance(event, bb.msg.MsgFatal):
mw.appendText('FATAL: ' + event._message + '\n')
if isinstance(event, bb.event.ParseProgress):
x = event.sofar
y = event.total
if x == y:
mw.setStatus("Idle")
mw.appendText("Parsing finished. %d cached, %d parsed, %d skipped, %d masked."
% ( event[1]['cached'], event[1]['parsed'], event[1]['skipped'], event[1]['masked'] ))
% ( event.cached, event.parsed, event.skipped, event.masked ))
else:
mw.setStatus("Parsing: %s (%04d/%04d) [%2d %%]" % ( parsespin.next(), x, y, x*100/y ) )
# if event[0].startswith('bb.build.TaskFailed'):
# if event[1]['logfile']:
# if isinstance(event, bb.build.TaskFailed):
# if event.logfile:
# if data.getVar("BBINCLUDELOGS", d):
# bb.msg.error(bb.msg.domain.Build, "log data follows (%s)" % logfile)
# number_of_lines = data.getVar("BBINCLUDELOGS_LINES", d)
@@ -286,13 +286,13 @@ class NCursesUI:
# else:
# bb.msg.error(bb.msg.domain.Build, "see log in %s" % logfile)
if event[0] == 'bb.command.CookerCommandCompleted':
if isinstance(event, bb.command.CookerCommandCompleted):
exitflag = True
if event[0] == 'bb.command.CookerCommandFailed':
mw.appendText("Command execution failed: %s" % event[1]['error'])
if isinstance(event, bb.command.CookerCommandFailed):
mw.appendText("Command execution failed: %s" % event.error)
time.sleep(2)
exitflag = True
if event[0] == 'bb.cooker.CookerExit':
if isinstance(event, bb.cooker.CookerExit):
exitflag = True
if helper.needUpdate:

View File

@@ -24,7 +24,7 @@ server and queue them for the UI to process. This process must be used to avoid
client/server deadlocks.
"""
import socket, threading
import socket, threading, pickle
from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
class BBUIEventQueue:
@@ -37,8 +37,8 @@ class BBUIEventQueue:
self.BBServer = BBServer
self.t = threading.Thread()
self.t.setDaemon(True)
self.t.run = self.startCallbackHandler
self.t.setDaemon(True)
self.t.run = self.startCallbackHandler
self.t.start()
def getEvent(self):
@@ -55,7 +55,6 @@ class BBUIEventQueue:
self.eventQueueNotify.clear()
self.eventQueueLock.release()
return item
def waitEvent(self, delay):
@@ -63,16 +62,15 @@ class BBUIEventQueue:
return self.getEvent()
def queue_event(self, event):
self.eventQueueLock.acquire()
self.eventQueue.append(event)
self.eventQueue.append(pickle.loads(event))
self.eventQueueNotify.set()
self.eventQueueLock.release()
def startCallbackHandler(self):
server = UIXMLRPCServer()
self.host, self.port = server.socket.getsockname()
self.host, self.port = server.socket.getsockname()
server.register_function( self.system_quit, "event.quit" )
server.register_function( self.queue_event, "event.send" )
@@ -85,7 +83,7 @@ class BBUIEventQueue:
server.handle_request()
server.server_close()
def system_quit( self ):
def system_quit( self ):
"""
Shut down the callback thread
"""
@@ -97,11 +95,11 @@ class BBUIEventQueue:
class UIXMLRPCServer (SimpleXMLRPCServer):
def __init__( self, interface = ("localhost", 0) ):
def __init__( self, interface = ("localhost", 0) ):
self.quit = False
SimpleXMLRPCServer.__init__( self,
interface,
requestHandler=SimpleXMLRPCRequestHandler,
SimpleXMLRPCServer.__init__( self,
interface,
requestHandler=SimpleXMLRPCRequestHandler,
logRequests=False, allow_none=True)
def get_request(self):
@@ -123,5 +121,5 @@ class UIXMLRPCServer (SimpleXMLRPCServer):
if request is None:
return
SimpleXMLRPCServer.process_request(self, request, client_address)

View File

@@ -21,29 +21,30 @@ class BBUIHelper:
def __init__(self):
self.needUpdate = False
self.running_tasks = {}
self.failed_tasks = {}
self.failed_tasks = []
def eventHandler(self, event):
if event[0].startswith('bb.build.TaskStarted'):
self.running_tasks["%s %s\n" % (event[1]['_package'], event[1]['_task'])] = ""
if isinstance(event, bb.build.TaskStarted):
self.running_tasks[event.pid] = { 'title' : "%s %s" % (event._package, event._task) }
self.needUpdate = True
if event[0].startswith('bb.build.TaskSucceeded'):
del self.running_tasks["%s %s\n" % (event[1]['_package'], event[1]['_task'])]
if isinstance(event, bb.build.TaskSucceeded):
del self.running_tasks[event.pid]
self.needUpdate = True
if event[0].startswith('bb.build.TaskFailed'):
del self.running_tasks["%s %s\n" % (event[1]['_package'], event[1]['_task'])]
self.failed_tasks["%s %s\n" % (event[1]['_package'], event[1]['_task'])] = ""
if isinstance(event, bb.build.TaskFailed):
del self.running_tasks[event.pid]
self.failed_tasks.append( { 'title' : "%s %s" % (event._package, event._task)})
self.needUpdate = True
# Add runqueue event handling
#if event[0].startswith('bb.runqueue.runQueueTaskCompleted'):
#if isinstance(event, bb.runqueue.runQueueTaskCompleted):
# a = 1
#if event[0].startswith('bb.runqueue.runQueueTaskStarted'):
#if isinstance(event, bb.runqueue.runQueueTaskStarted):
# a = 1
#if event[0].startswith('bb.runqueue.runQueueTaskFailed'):
#if isinstance(event, bb.runqueue.runQueueTaskFailed):
# a = 1
#if event[0].startswith('bb.runqueue.runQueueExitWait'):
#if isinstance(event, bb.runqueue.runQueueExitWait):
# a = 1
def getTasks(self):
self.needUpdate = False
return (self.running_tasks, self.failed_tasks)

View File

@@ -19,32 +19,35 @@ BitBake Utility Functions
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
digits = "0123456789"
ascii_letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
separators = ".-"
import re, fcntl, os
import re, fcntl, os, types, bb, string, stat, shutil
from commands import getstatusoutput
def explode_version(s):
r = []
alpha_regexp = re.compile('^([a-zA-Z]+)(.*)$')
numeric_regexp = re.compile('^(\d+)(.*)$')
while (s != ''):
if s[0] in digits:
if s[0] in string.digits:
m = numeric_regexp.match(s)
r.append(int(m.group(1)))
s = m.group(2)
continue
if s[0] in ascii_letters:
if s[0] in string.letters:
m = alpha_regexp.match(s)
r.append(m.group(1))
s = m.group(2)
continue
r.append(s[0])
s = s[1:]
return r
def vercmp_part(a, b):
va = explode_version(a)
vb = explode_version(b)
sa = False
sb = False
while True:
if va == []:
ca = None
@@ -56,6 +59,16 @@ def vercmp_part(a, b):
cb = vb.pop(0)
if ca == None and cb == None:
return 0
if type(ca) is types.StringType:
sa = ca in separators
if type(cb) is types.StringType:
sb = cb in separators
if sa and not sb:
return -1
if not sa and sb:
return 1
if ca > cb:
return 1
if ca < cb:
@@ -151,8 +164,8 @@ def better_compile(text, file, realfile):
# split the text into lines again
body = text.split('\n')
bb.msg.error(bb.msg.domain.Util, "Error in compiling: ", realfile)
bb.msg.error(bb.msg.domain.Util, "The lines resulting into this error were:")
bb.msg.error(bb.msg.domain.Util, "Error in compiling python function in: ", realfile)
bb.msg.error(bb.msg.domain.Util, "The lines leading to this error were:")
bb.msg.error(bb.msg.domain.Util, "\t%d:%s:'%s'" % (e.lineno, e.__class__.__name__, body[e.lineno-1]))
_print_trace(body, e.lineno)
@@ -176,7 +189,7 @@ def better_exec(code, context, text, realfile):
raise
# print the Header of the Error Message
bb.msg.error(bb.msg.domain.Util, "Error in executing: %s" % realfile)
bb.msg.error(bb.msg.domain.Util, "Error in executing python function in: %s" % realfile)
bb.msg.error(bb.msg.domain.Util, "Exception:%s Message:%s" % (t,value) )
# let us find the line number now
@@ -389,7 +402,7 @@ def build_environment(d):
for var in bb.data.keys(d):
export = bb.data.getVarFlag(var, "export", d)
if export:
os.environ[var] = bb.data.getVar(var, d, True)
os.environ[var] = bb.data.getVar(var, d, True) or ""
def prunedir(topdir):
# Delete everything reachable from the directory named in 'topdir'.
@@ -415,3 +428,189 @@ def prune_suffix(var, suffixes, d):
if var.endswith(suffix):
return var.replace(suffix, "")
return var
def mkdirhier(dir):
"""Create a directory like 'mkdir -p', but does not complain if
directory already exists like os.makedirs
"""
bb.debug(3, "mkdirhier(%s)" % dir)
try:
os.makedirs(dir)
bb.debug(2, "created " + dir)
except OSError, e:
if e.errno != 17: raise e
import stat
def movefile(src,dest,newmtime=None,sstat=None):
"""Moves a file from src to dest, preserving all permissions and
attributes; mtime will be preserved even when moving across
filesystems. Returns true on success and false on failure. Move is
atomic.
"""
#print "movefile("+src+","+dest+","+str(newmtime)+","+str(sstat)+")"
try:
if not sstat:
sstat=os.lstat(src)
except Exception, e:
print "movefile: Stating source file failed...", e
return None
destexists=1
try:
dstat=os.lstat(dest)
except:
dstat=os.lstat(os.path.dirname(dest))
destexists=0
if destexists:
if stat.S_ISLNK(dstat[stat.ST_MODE]):
try:
os.unlink(dest)
destexists=0
except Exception, e:
pass
if stat.S_ISLNK(sstat[stat.ST_MODE]):
try:
target=os.readlink(src)
if destexists and not stat.S_ISDIR(dstat[stat.ST_MODE]):
os.unlink(dest)
os.symlink(target,dest)
#os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
os.unlink(src)
return os.lstat(dest)
except Exception, e:
print "movefile: failed to properly create symlink:", dest, "->", target, e
return None
renamefailed=1
if sstat[stat.ST_DEV]==dstat[stat.ST_DEV]:
try:
ret=os.rename(src,dest)
renamefailed=0
except Exception, e:
import errno
if e[0]!=errno.EXDEV:
# Some random error.
print "movefile: Failed to move", src, "to", dest, e
return None
# Invalid cross-device-link 'bind' mounted or actually Cross-Device
if renamefailed:
didcopy=0
if stat.S_ISREG(sstat[stat.ST_MODE]):
try: # For safety copy then move it over.
shutil.copyfile(src,dest+"#new")
os.rename(dest+"#new",dest)
didcopy=1
except Exception, e:
print 'movefile: copy', src, '->', dest, 'failed.', e
return None
else:
#we don't yet handle special, so we need to fall back to /bin/mv
a=getstatusoutput("/bin/mv -f "+"'"+src+"' '"+dest+"'")
if a[0]!=0:
print "movefile: Failed to move special file:" + src + "' to '" + dest + "'", a
return None # failure
try:
if didcopy:
os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown
os.unlink(src)
except Exception, e:
print "movefile: Failed to chown/chmod/unlink", dest, e
return None
if newmtime:
os.utime(dest,(newmtime,newmtime))
else:
os.utime(dest, (sstat[stat.ST_ATIME], sstat[stat.ST_MTIME]))
newmtime=sstat[stat.ST_MTIME]
return newmtime
def copyfile(src,dest,newmtime=None,sstat=None):
"""
Copies a file from src to dest, preserving all permissions and
attributes; mtime will be preserved even when moving across
filesystems. Returns true on success and false on failure.
"""
#print "copyfile("+src+","+dest+","+str(newmtime)+","+str(sstat)+")"
try:
if not sstat:
sstat=os.lstat(src)
except Exception, e:
print "copyfile: Stating source file failed...", e
return False
destexists=1
try:
dstat=os.lstat(dest)
except:
dstat=os.lstat(os.path.dirname(dest))
destexists=0
if destexists:
if stat.S_ISLNK(dstat[stat.ST_MODE]):
try:
os.unlink(dest)
destexists=0
except Exception, e:
pass
if stat.S_ISLNK(sstat[stat.ST_MODE]):
try:
target=os.readlink(src)
if destexists and not stat.S_ISDIR(dstat[stat.ST_MODE]):
os.unlink(dest)
os.symlink(target,dest)
#os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
return os.lstat(dest)
except Exception, e:
print "copyfile: failed to properly create symlink:", dest, "->", target, e
return False
if stat.S_ISREG(sstat[stat.ST_MODE]):
try: # For safety copy then move it over.
shutil.copyfile(src,dest+"#new")
os.rename(dest+"#new",dest)
except Exception, e:
print 'copyfile: copy', src, '->', dest, 'failed.', e
return False
else:
#we don't yet handle special, so we need to fall back to /bin/mv
a=getstatusoutput("/bin/cp -f "+"'"+src+"' '"+dest+"'")
if a[0]!=0:
print "copyfile: Failed to copy special file:" + src + "' to '" + dest + "'", a
return False # failure
try:
os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown
except Exception, e:
print "copyfile: Failed to chown/chmod/unlink", dest, e
return False
if newmtime:
os.utime(dest,(newmtime,newmtime))
else:
os.utime(dest, (sstat[stat.ST_ATIME], sstat[stat.ST_MTIME]))
newmtime=sstat[stat.ST_MTIME]
return newmtime
def which(path, item, direction = 0):
"""
Locate a file in a PATH
"""
paths = (path or "").split(':')
if direction != 0:
paths.reverse()
for p in paths:
next = os.path.join(p, item)
if os.path.exists(next):
return next
return ""

View File

@@ -0,0 +1,9 @@
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "1"
BBFILES ?= ""
BBLAYERS = " \
${OEROOT}/meta \
${OEROOT}/meta-moblin \
"

View File

@@ -1,15 +1,10 @@
# CONF_VERSION is increased each time build/conf/ changes incompatibly
CONF_VERSION = "1"
# Where to cache the files Poky downloads
DL_DIR ?= "${OEROOT}/sources"
BBFILES += "\
${OEROOT}/meta/packages/*/*.bb \
${OEROOT}/meta-moblin/packages/*/*.bb"
BBFILE_COLLECTIONS = "normal moblin"
BBFILE_PATTERN_normal = "^${OEROOT}/meta/"
BBFILE_PATTERN_moblin = "^${OEROOT}/meta-moblin/"
BBFILE_PRIORITY_normal = "5"
BBFILE_PRIORITY_moblin = "5"
# Where to cache Poky's built staging output
PSTAGE_DIR ?= "${OEROOT}/pstage"
# Uncomment and set to allow bitbake to execute multiple tasks at once.
# For a quadcore, BB_NUMBER_THREADS = "4", PARALLEL_MAKE = "-j 4" would
@@ -19,11 +14,11 @@ BBFILE_PRIORITY_moblin = "5"
# PARALLEL_MAKE = "-j 4"
# The machine to target
MACHINE ?= "netbook"
MACHINE ?= "qemux86"
# Other supported machines
#MACHINE ?= "qemux86"
#MACHINE ?= "qemuarm"
#MACHINE ?= "netbook"
#MACHINE ?= "c7x0"
#MACHINE ?= "akita"
#MACHINE ?= "spitz"
@@ -139,11 +134,6 @@ TMPDIR = "${OEROOT}/build/tmp"
# Uncomment this if you want BitBake to emit the log if a build fails.
BBINCLUDELOGS = "yes"
# Specifies a location to search for pre-generated tarballs when fetching
# a cvs:// or svn:// URI. Uncomment this, if you do not want to pull directly
# from CVS or Subversion
SRC_TARBALL_STASH = "http://pokylinux.org/sources/"
# Set this if you wish to make pkgconfig libraries from your system available
# for native builds. Combined with extra ASSUME_PROVIDEDs this can allow
# native builds of applications like oprofileui-native (unsupported feature).
@@ -151,3 +141,13 @@ SRC_TARBALL_STASH = "http://pokylinux.org/sources/"
#ASSUME_PROVIDED += "gtk+-native libglade-native"
ENABLE_BINARY_LOCALE_GENERATION = "1"
# The architecture to build SDK items for, by setting this you can build SDK
# packages for architectures other than the host i.e. building i586 packages
# on an x86_64 host.
# Supported values are i586 and x86_64
#SDKMACHINE="i586"
# Poky can try and fetch packaged-staging packages from a http, https or ftp
# mirror. Set this variable to the root of a pstage directory on a server.
#PSTAGE_MIRROR ?= "http://someserver.tld/share/pstage"

View File

@@ -2,6 +2,9 @@
# local.conf covers user settings, site.conf covers site specific information
# such as proxy server addresses and optionally any shared download location
#
# SITE_CONF_VERSION is increased each time build/conf/site.conf
# changes incompatibly
SCONF_VERSION = "1"
# Uncomment to cause CVS to use the proxy host specified
#CVS_PROXY_HOST = "proxy.example.com"

Some files were not shown because too many files have changed in this diff Show More