@@ -7,10 +7,15 @@ inherit dpkg-base
DPKG_SOURCE_EXTRA_ARGS ?= "-I"
+DEBIAN_SOURCE ?= "${BPN}"
+
do_dpkg_source() {
# Create a .dsc file from source directory to use it with sbuild
DEB_SOURCE_NAME=$(dpkg-parsechangelog --show-field Source --file ${WORKDIR}/${PPS}/debian/changelog)
- find ${WORKDIR} -name "${DEB_SOURCE_NAME}*.dsc" -maxdepth 1 -delete
+ if [ "${DEB_SOURCE_NAME}" != "${DEBIAN_SOURCE}" ]; then
+ bbfatal "DEBIAN_SOURCE (${DEBIAN_SOURCE}) not aligned with source name used in control files (${DEB_SOURCE_NAME})"
+ fi
+ find ${WORKDIR} -maxdepth 1 -name "${DEBIAN_SOURCE}_*.dsc" -delete
sh -c "cd ${WORKDIR}; dpkg-source ${DPKG_SOURCE_EXTRA_ARGS} -b ${PPS}"
}
addtask dpkg_source after do_prepare_build before do_dpkg_build
@@ -20,12 +25,13 @@ do_deploy_source[lockfiles] = "${REPO_ISAR_DIR}/isar.lock"
do_deploy_source[dirs] = "${S}"
do_deploy_source() {
repo_del_srcpackage "${REPO_ISAR_DIR}"/"${DISTRO}" \
- "${REPO_ISAR_DB_DIR}"/"${DISTRO}" "${DEBDISTRONAME}" "${BPN}"
- find "${S}/../" -name '*\.dsc' -maxdepth 1 | while read package; do
+ "${REPO_ISAR_DB_DIR}"/"${DISTRO}" "${DEBDISTRONAME}" "${DEBIAN_SOURCE}"
+ DSC_FILE=$(find ${WORKDIR} -maxdepth 1 -name "${DEBIAN_SOURCE}_*.dsc")
+ if [ -n "${DSC_FILE}" ]; then
repo_add_srcpackage "${REPO_ISAR_DIR}"/"${DISTRO}" \
"${REPO_ISAR_DB_DIR}"/"${DISTRO}" \
"${DEBDISTRONAME}" \
- "${package}"
- done
+ "${DSC_FILE}"
+ fi
}
addtask deploy_source after do_dpkg_source before do_dpkg_build
@@ -108,8 +108,7 @@ dpkg_runbuild() {
echo '$apt_keep_downloaded_packages = 1;' >> ${SBUILD_CONFIG}
echo '$stalled_pkg_timeout = ${DPKG_BUILD_TIMEOUT};' >> ${SBUILD_CONFIG}
- DEB_SOURCE_NAME=$(dpkg-parsechangelog --show-field Source --file ${WORKDIR}/${PPS}/debian/changelog)
- DSC_FILE=$(find ${WORKDIR} -name "${DEB_SOURCE_NAME}*.dsc" -maxdepth 1 -print)
+ DSC_FILE=$(find ${WORKDIR} -maxdepth 1 -name "${DEBIAN_SOURCE}_*.dsc" -print)
sbuild -A -n -c ${SBUILD_CHROOT} \
--host=${PACKAGE_ARCH} --build=${BUILD_ARCH} ${profiles} \