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>
fi
done
+ found=0
for arch in $debarchs; do
if [ ! -d ${DEPLOY_DIR_DEB}/$arch ]; then
continue;
cd ${DEPLOY_DIR_DEB}/$arch
dpkg-scanpackages . | gzip > Packages.gz
echo "Label: $arch" > Release
+ found=1
done
+ if [ "$found" != "1" ]; then
+ bbfatal "There are no packages in ${DEPLOY_DIR_DEB}!"
+ fi
}
#
addtask package_write_deb before do_package_write after do_packagedata do_package
-PACKAGEINDEXES += "package_update_index_deb;"
+PACKAGEINDEXES += "[ ! -e ${DEPLOY_DIR_DEB} ] || package_update_index_deb;"
PACKAGEINDEXDEPS += "dpkg-native:do_populate_sysroot"
PACKAGEINDEXDEPS += "apt-native:do_populate_sysroot"
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
}
#
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"
# 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
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() {
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"