aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/archiver.bbclass
AgeCommit message (Collapse)Author
2012-08-28archiver.bbclass: fix the remove errorRobert Yang
* The "tar-package" is used for saving the "Source" list for rpmbuild, there is no such a file when "ARCHIVER_MODE[type] ?= srpm", and there would be errors, it hadn't happen before was becuase that the remove function didn't work. Let the "rpmbuild --rmsource" to remove the Sources, and the remove function will just remove the tar-package file. * Remove several unwanted "try ... exception" sentences, let the error raise rather than ignore them when the error happens. * Remove several un-needed code. [YOCTO #2619] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-08-28archiver.bbclass: remove the "upper()" functionRobert Yang
The configuration value from the conf file is lower case, e.g. srpm, tar, so there is no reason to use the upper case which makes things complicated. [YOCTO #2619] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-08-28archiver.bbclass: fix the fakeroot and other issuesRobert Yang
* Fix the fakeroot issue The archiver.bbclass is used for archiving sources, patches, and logs, it uses the "rpmbuild -bs" from the package_rpm.bbclass to generate the .src.rpm, but it didn't work (it's not easy to explain it clearly): Reason: - It directly used the "fakeroot" command, we don't have such a command in native tools, so it would use the fakeroot from the host, and it would fail when there is no fakeroot on the host. - The "rpmbuild -bs" doesn't need to work under root, but it is in the function do_package_write_rpm which is running under fakeroot, and "rpmbuild" needs to know the source file's user/group name, the source file is the tarball which is created by the postfuncs of do_unpack or do_patch which doesn't use the fakeroot, so the created file's owner would be the real user, e.g.: robert, but there is no such a user under our native tools' fakeroot(pseudo), then the rpmbuild would fail. It worked when use the host's fakeroot in the past was because that the host's fakeroot knows the users on the host. Fix: - Remove the incorrect "fakeroot". - Change the source file's owner to root.root under fakeroot will fix the problem. * Other fixes: - The typo: "do_remove_taball -> do_remove_tarball" which will cause the tarball is not removed. - Add the _sourcedir defination to the rpmbuild command since the the SOURCES would be added to the specfile when archiver.bbclass is inherited, otherwise there would be errors when "rpmbuild -bb", though the build is OK. It only added the defination to "rpmbuild -bs", didn't add to "rpmbuild -bb". [YOCTO #2619] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-08-28archiver.bbclass: fix the coding styleRobert Yang
* Make the comment line under 80 characters. * Use the triple double quotes for the docstring. * Add a whitespace behind the comma (,). * Other minor fixes. [YOCTO #2619] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-08-28archiver.bbclass: indent fixesRobert Yang
Several fixes: * It uses mixed tab and whitespace as the indent in one function, Fix them to use "4 spaces" as the indent. * Remove the unwanted blank, for example, more than one blank lines appeared together. * Remove the tail whitespace. [YOCTO #2619] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-07-19Remove a number of unneeded import os/bb callsRichard Purdie
The bb and os modules are always imported so having these extra import calls are a waste of space/execution time. They also set a bad example for people copy and pasting code so clean them up. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-28archiver.bbclass: Add the function of filtering packagesXiaofeng Yan
This function can miss packages whose license is in "COPYLEFT_LICENSE_EXCLUDE" and tarball packages with license in "COPYLEFT_LICENSE_INCLUDE". [YOCTO #2473] Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
2012-06-08archiver.bbclass: Reduce some duplication for function get_licensesXiaofeng Yan
The content to modify this bbclass is as follow: - Use the existing functions to get license as a directory instead of rewriting it for avoiding code duplication. - Use SPDXLICENSEMAP to map licenses [YOCTO #2473] Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com> Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-05archiver.bbclass: Improve the usability for the archiver classesXiaofeng Yan
The usability of the archiver classes can be improved, beyond the simple addition of default values for the variables. A user could well inherit just archiver rather than the individual useful classes, and not realize it will do nothing. [YOCTO #2472] Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
2012-05-30meta: replace os.system with subprocess.callRobert Yang
Replace os.system with subprocess.call since the older function would fail (more or less) silently if the executed program cannot be found More info: http://docs.python.org/library/subprocess.html#subprocess-replacements [YOCTO #2454] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-17archiver.bbclass: Add two default set for avoiding error when missing assignmentXiaofeng Yan
Add two default set(SOURCE_ARCHIVE_LOG_WITH_SCRIPTS, \ SOURCE_ARCHIVE_PACKAGE_TYPE) to archiver.bbclass for avoiding \ building error when forgetting to assign to them. Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
2012-04-11archiver.bbclass: Amend the problem for moving tarballs in ${DL_DIR} to ↵Xiaofeng Yan
${DEPLOY_DIR}/source when enable archiver When running "bitbake core-imamge-minmal", the error information like the following will appear: ERROR: Error executing a python function in /buildarea2/yzhao-test/poky-test/meta/recipes-core/zlib/zlib_1.2.6.bb: IOError: [Errno 2] No such file or directory: '/buildarea2/yzhao-test/poky-test/build-archive/downloads/zlib-1.2.6.tar.bz2' An absolute path from variable "file" pointed to tarballs in ${DL_DIR} \ cause this problem. So return base-name of "file" for fixing this bug here. [YOCTO #2272] Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-04archiver.bbclass: enhance code readabilityXiaofeng Yan
The modification is as follow: - Modify some codes with more preferable readability and vague description. - Use existed functions instead of custom functions. Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
2012-03-26archiver.bbclass:Xiaofeng Yan
1 Archive sources in ${S} in the different stage (do_unpack,do_patch,do_configure). 2 Archive patches including series 3 Archive logs including scripts (.bb and .inc files) 4 dump environment resources which show all variable and functions used to xxx.showdata.dump when running a task 5 dump all content in 's' including patches to file xxx.diff.gz All archiving packages will be deployed to ${DEPLOY_DIR}/sources/ [YOCTO #1977] Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>