summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_deb.bbclass
AgeCommit message (Collapse)Author
2018-01-10package_deb: Handle / in dependency nameRichard Purdie
We can end up with / in dependency names from file dependencies but the deb format doesn't allow this. Filter the names to allow such dependencies to work. Names have to start with an alphanumeric digit so also handle this. This allows for future handling of "per file" dependencies similarly to the rpm backend, bring parity to the functionality of the backends. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11package_[deb|ipk]: improve multiprocess logic when creating deb/ipk packagesLeonardo Sandoval
Current implementation does not handle possible exceptions coming from child processes, the latter responsible for creating packages. With the aim to have more control, use pipes to communicate exceptions and stop package creation in case of failure. Helps to debug [YOCTO #12012]. Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-11package_deb, ipk: improve subprocess output on package manager commandLeonardo Sandoval
Redirecting stderr to stdout helps debugging issues, i.e instead of just getting the return code, get also the error log from the pkg manger This commit is in the way to figure out the root cause of [YOCTO #12012], where dpkg-deb fails with a 2 return code and according to the man page, there are multiple issues leading to the same code. Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-01package_deb.bbclass: Handle colons in dependenciesPeter Kjellerstedt
Perl dependencies may look as "Perl(Foo::Bar)", but dpkg does not support the non-alphanumeric characters. There was already special handling present for turning '(' and ')' into '__'. This change does the same for ':'. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-16package_deb: Drop obsolete comments/variablesRichard Purdie
These comments/variables appear to be long dead, remove them. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-16package_deb: Enable multithreaded package creationRichard Purdie
Allow the creation of debs to happen in parallel, making best use of resources on multiprocessor systems. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-11package_ipk/deb: Tweak functions for better cleanup and layoutRichard Purdie
This uses more modern formatting to handle the lockfiles and control file cleanup with try/finally, taking advantage of the previous extra indentation. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-11package_deb: Split do_package_write_deb into two functionsRichard Purdie
This prepares the way to parallelise deb generation and splits the iteration over packages and the package generation into separate functions. Whitespace indentation is unchanged deliberately and is fixed in a followup patch. There should be no functional change. Some checks on variables are removed as they were pointless when you looked at the code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-29package_deb.bbclass: Avoid writing empty custom fieldsAndreas Oberritter
Avoids parser errors if PACKAGE_ADD_METADATA_DEB is set to an empty value. Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-29package_deb.bbclass: Fix multi-line package descriptionsAndreas Oberritter
In deb control files, each line of a long description starts with a single space. Empty lines are represented by a single space followed by a single full stop character. Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15package_deb.bbclass: Ignore file paths in RPROVIDESAmarnath Valluri
Unlike rpm, debian packaging does not allow file paths in 'Provides:' field. When 'usrmerge' distro feature enabled bash/busybox packages adds '/bin/sh' to it's RPROVIDES to satisfy build dependencies, this entry should be filtered out. Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-15classes: Drop now unneeded update_data callsRichard Purdie
Now that the datastore works dynamically we don't need the update_data calls so we can just remove them. They're not actually done anything at all for a while. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31package_deb: handle allarch when mapping tune to dpkg architecturesRoss Burton
It was discovered that buildtools-tarball can't be built with Debian packaging: E: Unable to locate package nativesdk-buildtools-perl-dummy The package exists but dpkg doesn't see it because the Architecture field isn't valid: for this package the Architecture field is 'allarch' which isn't in the list of valid architectures we define. package_deb already has a mapping of OE architectures (PACKAGE_ARCH) to dpkg architectures (DPKG_ARCH), for example our x86_64 is amd64 in dpkg. However allarch.bbclass sets an invalid TARGET_ARCH of 'allarch' (to break anything which attempts to use the target architecture) and package_deb relied on the PACKAGE_ARCH check later turning the Architecture field into 'all'. This usually works, but nativesdk-buildtools-perl-dummy inherits allarch but then changes PACKAGE_ARCH to buildtools-dummy-nativesdk to isolate the packages in a separate feed. We can handle this by explictly checking for allarch in the TARGET_ARCH check, as that everything that inherits allarch will want to have Architecture: all in their packages. [ YOCTO #10700 ] Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22package_deb: Clean up pointless exception handlingRichard Purdie
The exception handling in this function seemed mildly crazy. Python will given perfectly good or in several cases better information if we let its standard traceback/exception handling happen. Remove the pointless code along with the duplicated key checking which was broken in the inner loop by usage of the wrong variable. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22package_deb: Improve failure debug outputRichard Purdie
Currently if the dpkg-deb command fails you see an error message like this: ERROR: nss-3.27.1-r0 do_package_write_deb: dpkg-deb execution failed ERROR: nss-3.27.1-r0 do_package_write_deb: Function failed: do_package_deb which is pretty much useless. If we use subprocess.check_output, we see a traceback and then: Exception: subprocess.CalledProcessError: Command '<cmd>' returned non-zero exit status 1 Subprocess output: <output> which is much easier to debug from. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19classes/package*: Add support for PACKAGE_WRITE_DEPSRichard Purdie
Add a new variable to allow markup of postinstall (and preinst) script dependnecies on native/cross tools. If your postinstall can execute at rootfs creation time rather than on target but depends on a native tool in order to execute, you need to list that tool in PACKAGE_WRITE_DEPENDS. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16meta: remove True option to getVar callsJoshua Lock
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-10-03package_deb.bbclass: Use bb.fatal() instead of raising FuncFailedUlf Magnusson
This sets a good example and avoids unnecessarily contributing to perceived complexity and cargo culting. Motivating quote below: < kergoth> the *original* intent was for the function/task to error via whatever appropriate means, bb.fatal, whatever, and funcfailed was what you'd catch if you were calling exec_func/exec_task. that is, it's what those functions raise, not what metadata functions should be raising < kergoth> it didn't end up being used that way < kergoth> but there's really never a reason to raise it yourself FuncFailed.__init__ takes a 'name' argument rather than a 'msg' argument, which also shows that the original purpose got lost. Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-25package_deb.bbclass/package_ipk.bbclass: sort RPROVIDESRobert Yang
The dict.fromkeys() creates a dict without order, there might be a problem when build the same recipe again, for example: - First build of make: Provides: es-translation, make-locale - Second build of acl: Provides: make-locale, es-translation They are exactly the same Provides, but tools like "diff" doesn't think so. Sort RPROVIDES will fix the problem. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-25package_deb.bbclass: fix Python 3 errorMatt Madison
Don't modify an OrderedDict while walking its keys. Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-06-16package_deb: Avoid chdir warnings and restore cwd after packagingRichard Purdie
dpkg-build needs to be executed in the root of the package, so save and restore the current directory so this task doesn't modify the state. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Update to use python3 command pipeline decodingRichard Purdie
In python3, strings are unicode by default. We need to encode/decode from command pipelines and other places where we interface with the real world using the correct locales. This patch updates various call sites to use the correct encoding/decodings. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Convert to use python3 octal syntaxRichard Purdie
The syntax for octal values changed in python3, adapt to it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-12package-deb: Ignore circular dependenciesRicardo Ribalda Delgado
If a package depends on itself apt-get fails to install it with the error attached to this patch. This patch checks for this conditions and notifies the user so the recipe maintainer can fix his RDEPENDS variable. root@qt5022:~# apt-get install perl-module-cpan Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: perl-module-cpan 0 upgraded, 640 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/5964 kB of archives. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] E: Internal error: MaxLoopCount reached in SmartUnPack (2) for perl-module-cpan:amd64, aborting E: Internal error, packages left unconfigured. perl-module-cpan:amd64 root@qt5022:~# apt-get install perl-modules Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-03-12package_deb: Fix python runtime errorRicardo Ribalda Delgado
The dictionary cannot be used for iteration if its size may change during the loop. ERROR: Error executing a python function in /home/ricardo/curro/qt5022/build-qt5022/repo/yocto/meta/recipes-devtools/perl/perl_5.22.0.bb: Exception: RuntimeError: dictionary changed size during iteration Acked-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-02-10package_deb: Ensure allarch deb packages aren't target specificRichard Purdie
The use of TUNE_FEATURES was making do_package_write_deb of allarch packages target specific. To avoid this, only use the end value of DPKG_ARCH for its checksum, not intermediate values or variables. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11package_deb.bbclass: add 'Multi-Arch: foreign' tag to allarch packagesMatt Madison
This tells APT that it can use such packages to resolve dependencies from packages of any architecture in a multilib build. Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-11package_deb.bbclass, cross-canadian.bbclass: DPKG_ARCH mapping functionMatt Madison
Have DPKG_ARCH set by directly invoking a mapping function, rather than using an anonymous Python function modify the variable under the hood, so we can have proper handling of overrides. Also bring in some additional mappings to Debian architecture names that weren't being handled. Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-11-24bbclass: fix spelling mistakesMaxin B. John
Fix some spelling mistakes in bbclass files Signed-off-by: Maxin B. John <maxin.john@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-30package_*.bbclass: Ensure OVERRIDES doesn't change sstate signatureRichard Purdie
Changes to OVERRIDES (e.g. from changing MACHINE) should not change the sstate signatures of do_package_write_*. Exclude the variable explicitly in the package classes to avoid this. (From OE-Core rev: 5826a9260138c437f87ba1a9f84d5c08442b997d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19package_deb.bbclass: Allow UTF-8 characters on control filesLeonardo Sandoval
Allow UTF-8 characters on control files. Also handle an expection in case of invalid characters (non UTF-8). [YOCTO #6693] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-20package_ipk/deb: Drop version information from RPROVIDESRichard Purdie
In some scenarios rpm needs version information from RPROVIDES. We can add this to the metadata where needed however we need to stop it entering the ipk/deb packages. This data is not needed due to the way opkg/dpkg handle the data. This patch ensures that data isn't used. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-23meta: Add explict getVar param for (non) expansionRichard Purdie
Rather than just use d.getVar(X), use the more explict d.getVar(X, False) since at some point in the future, having the default of expansion would be nice. This is the first step towards that. This patch was mostly made using the command: sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11package_ipk/deb/rpm: Improve OVERRIDES handlingRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-19packaging: allow globs in CONFFILESChen Qi
Allow globs in CONFFILES. This patch changes the way of CONFFILES handling. After this change, the CONFFILES can take the same form as FILES. That means, we don't have to list a bunch of files for CONFFILES. It will just be expanded like the FILES variable. We don't assume default value for CONFFILES in OE. But distro vendors could provide a default value for CONFFILES in their distro configuration file like below. CONFFILES = "${sysconfdir}" In this way, files under /etc are treated as configuration files by default. Of course, setting CONFFILES in recipes take precedence over the CONFFILES. For example, if the recipe author decides that package A should only treat files under ${sysconfdir}/default/ as config files, he/she can write like this. CONFFILES_A = "${sysconfdir}/default" [YOCTO #5200] Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-11package_deb: skip pre/postrm scripts on upgrade, write only one shebangAndreas Oberritter
Trying to upgrade busybox removing symlinks but update-alternatives need these links (sed, cut, tail, etc) in order to work. Adding test to avoid this scripts on upgrade fix the problem, same solution are found in package_rpm class. [YOCTO #6768] Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-28package_*.bbclass: Simplify addtaskRichard Purdie
The package_write task was previously removed. Remove a remaining superfluous reference to it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-11package_deb: Map TARGET_ARCH x86_64 to DPKG_ARCH amd64Ricardo Ribalda Delgado
Without this patch packages are generated as x86_64. Which cannot be installed by default. root@qt5022:~# dpkg -i alsa-utils_1.0.27.2-r0_x86-64.deb dpkg: error processing alsa-utils_1.0.27.2-r0_x86-64.deb (--install): package architecture (x86-64) does not match system (amd64) Errors were encountered while processing: alsa-utils_1.0.27.2-r0_x86-64.deb Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-24package: Drop do_package_write taskRichard Purdie
The reasons this task was introduced are lost in the mists of time. It allowed for the a single "package_write" task instead of spelling out the explicit package backends, however in all but one case we do that anyway. As such as might as well give in and delete the task, converting that single reference into explicit dependencies. This gives bitbake a bit less work to to when processing the runqueue since there are less tasks (but more dependencies in some cases). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-14package_*.bbclass: remove references to the old bash indexing routinesLaurentiu Palcu
Package indexing is done in python and package-index.bb uses the new routines. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11conf/bitbake.conf: default HOMEPAGE to blank instead of unknownPaul Eggleton
The default value for HOMEPAGE of "unknown" has been in place since the early OE-Classic days, but it doesn't really make sense - "unknown" is not a valid URL and it just means we have to explicitly check for this hardcoded string if we're displaying the value in some form of UI, such as Toaster. This has required some changes to the packaging classes as they previously did not expect the value to be blank. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11package_(deb|ipk).bbclass: remove the stamp when creating package from cacheLaurentiu Palcu
If the packages are created from cache, we need to remove the stamp so that we re-generate the index files at do_rootfs time. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2014-02-11Activate the new python rootfs/image creation routinesLaurentiu Palcu
This commit will: * remove old bash code common to all backends; * create a new do_rootfs() python function that will use the new rootfs/image creation routines; * allow creation of dpkg based images; * fail for rpm/opkg (not implemented yet); Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2014-01-28package_{ipk, deb, rpm}.bbclass: support additional user-defined metadataLeonid Borisenko
Additional metadata from user-defined variable is written into control/spec file of binary package. Three variables are searched for adiitional package metadata: * PACKAGE_ADD_METADATA_<PKGTYPE>_<PN> * PACKAGE_ADD_METADATA_<PKGTYPE> * PACKAGE_ADD_METADATA First found variable with defined value wins. <PN> is a package name. <PKGTYPE> is a distinct name of specific package type: * IPK for .ipk packages * DEB for .deb packages * RPM for .rpm packages Variable can contain multiple [one-line] metadata fields separated by literal sequence '\n'. Separator can be redefined through variable flag 'separator'. In package control/spec file separator is replaced by newline character. Signed-off-by: Leonid Borisenko <ive.found@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-12-18sstate: Get rid of crazy name mappingRichard Purdie
When originally developed, it was thought a task may have more than one associated sstate archive. The way the code has grown that idea is now not possible or needed. We can therefore assume one sstate archive per task and drop the crazy name mapping code. Simpler is better in this case. The downside is that various sstate archives will change name so this forces a cache rebuild. Given the other sstate changes going in at this time, this isn't really a bad thing as things would rebuild anyway. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-06package_deb/package_ipk: Cleanup control file handling/racesRichard Purdie
If you Ctrl+C ppackage_write_{deb/ipk} control files can get left lying around and make it into another packaging format. This ensures we cleanup all known control files before starting packaging. We can simplify some of the globbing as a result. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-24package_deb, apt.conf: fix apt failure in do_rootfs()Laurentiu Palcu
The changes in this commit, dc5f6c3898555b59f16bf809ae4c5418656e6ac9, moved apt config directory from native SYSROOT to WORKDIR. Unfortunately, Dir::Etc in apt.conf was not changed accordingly and sources.list file could not be found during do_rootfs(). This commit fixes this issue. [YOCTO #5241] Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01meta: Don't use deprecated bitbake APIRichard Purdie
These have been deprecated for a long time, convert the remaining references to the correct modules and prepare for removal of the compatibility support from bitbake. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-22package_deb: Add support for NO_RECOMMENDATIONS and PACKAGE_EXCLUDEMark Hatle
Add support for NO_RECOMMENDATIONS and PACKAGE_EXCLUDE. Also add a warning that ensures users know that BAD_RECOMMENDATIONS support is not implemented in the debian package/rootfs classes. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-08-22package_deb.bbclass: Use the WORKDIR not SYSROOT for temp filesMark Hatle
Previous debian APT configuration was using the sysroot directory. This not only polluted the sysroot, but violates the expectation that the sysroot is not modified by the rootfs installation. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>