aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/package_ipk.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:32:03 +0000
commit74938e387c19c7b72e1553d4148a58a5a3d1ceff (patch)
treeaf1fb5120dfdcd554942fbc34b56297fd183b71f /meta/classes/package_ipk.bbclass
parent069a332d1cf0778831673ed4ab5dfadbe2758783 (diff)
downloadopenembedded-core-contrib-74938e387c19c7b72e1553d4148a58a5a3d1ceff.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. (From OE-Core rev: 721ef058b37604e100021ec7a90ad2f745d83916) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package_ipk.bbclass')
-rw-r--r--meta/classes/package_ipk.bbclass7
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index e5e76ef278..526c3aecb1 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -216,12 +216,17 @@ package_update_index_ipk () {
packagedirs="$packagedirs ${DEPLOY_DIR_IPK}/$arch"
done
+ found=0
for pkgdir in $packagedirs; do
if [ -e $pkgdir/ ]; then
+ found=1
touch $pkgdir/Packages
flock $pkgdir/Packages.flock -c "opkg-make-index -r $pkgdir/Packages -p $pkgdir/Packages -m $pkgdir/"
fi
done
+ if [ "$found" != "1" ]; then
+ bbfatal "There are no packages in ${DEPLOY_DIR_IPK}!"
+ fi
}
#
@@ -483,6 +488,6 @@ do_package_write_ipk[cleandirs] = "${PKGWRITEDIRIPK}"
do_package_write_ipk[umask] = "022"
addtask package_write_ipk before do_package_write after do_packagedata do_package
-PACKAGEINDEXES += "package_update_index_ipk;"
+PACKAGEINDEXES += "[ ! -e ${DEPLOY_DIR_IPK} ] || package_update_index_ipk;"
PACKAGEINDEXDEPS += "opkg-utils-native:do_populate_sysroot"
PACKAGEINDEXDEPS += "opkg-native:do_populate_sysroot"