aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/package_rpm.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-17 08:57:17 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-17 22:31:29 +0000
commit721ef058b37604e100021ec7a90ad2f745d83916 (patch)
treefa45976e7c3653df338a701661cdeb1502bcc230 /meta/classes/package_rpm.bbclass
parent24cbe88429ba021d7c461e0271b67106d11d5eb2 (diff)
downloadopenembedded-core-721ef058b37604e100021ec7a90ad2f745d83916.tar.gz
package_rpm/deb/ipk: Error if we don't find packages when creating the package index
If for whatever reason the package directory is empty of packages, it makes sense to error early rather than later in what become much more obtuse errors. This adds in a sanity check to each of the packaging backends. It also removes the duplicate createrepo call since the core index creation function now uses this directly after the switch to smart. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r--meta/classes/package_rpm.bbclass9
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 8ea2bbedb2..8eb93ce15d 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -20,7 +20,7 @@ python package_rpm_install () {
# Update the packages indexes ${DEPLOY_DIR_RPM}
#
package_update_index_rpm () {
- if [ ! -z "${DEPLOY_KEEP_PACKAGES}" -o ! -e "${DEPLOY_DIR_RPM}" ]; then
+ if [ ! -z "${DEPLOY_KEEP_PACKAGES}" ]; then
return
fi
@@ -45,11 +45,16 @@ package_update_index_rpm () {
echo $arch
done | sort | uniq`
+ found=0
for arch in $archs; do
if [ -d ${DEPLOY_DIR_RPM}/$arch ] ; then
createrepo --update -q ${DEPLOY_DIR_RPM}/$arch
+ found=1
fi
done
+ if [ "$found" != "1" ]; then
+ bbfatal "There are no packages in ${DEPLOY_DIR_RPM}!"
+ fi
}
rpm_log_check() {
@@ -1129,6 +1134,6 @@ do_package_write_rpm[cleandirs] = "${PKGWRITEDIRRPM}"
do_package_write_rpm[umask] = "022"
addtask package_write_rpm before do_package_write after do_packagedata do_package
-PACKAGEINDEXES += "package_update_index_rpm; [ ! -e ${DEPLOY_DIR_RPM} ] || createrepo ${DEPLOY_DIR_RPM};"
+PACKAGEINDEXES += "[ ! -e ${DEPLOY_DIR_RPM} ] || package_update_index_rpm;"
PACKAGEINDEXDEPS += "rpm-native:do_populate_sysroot"
PACKAGEINDEXDEPS += "createrepo-native:do_populate_sysroot"