build/core: only remove the correct packages on extract

This commit is contained in:
Franco Fichtner 2015-07-16 18:13:34 +02:00
parent 3541703340
commit 48587c6347
2 changed files with 12 additions and 7 deletions

View File

@ -277,12 +277,15 @@ extract_packages()
tar -C ${BASEDIR}${PACKAGESDIR} -xpf ${PACKAGESET}
fi
if [ -n "${PKGLIST}" ]; then
for PKG in ${PKGLIST}; do
# clear out the ports that ought to be rebuilt
rm -f ${BASEDIR}${PACKAGESDIR}/All/${PKG}-*.txz
for PKG in ${PKGLIST}; do
# clear out the ports that ought to be rebuilt
for PKGFILE in ${BASEDIR}${PACKAGESDIR}/All/${PKG}-*.txz; do
PKGINFO=$(pkg info -F ${PKGFILE} | grep ^Name | awk '{ print $3; }')
if [ ${PKG} = ${PKGINFO} ]; then
rm ${PKGFILE}
fi
done
fi
done
}
install_packages()

View File

@ -31,6 +31,8 @@ set -e
git_describe ${COREDIR}
CORE_NAME=$(make -C ${COREDIR} name)
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}
setup_clone ${STAGEDIR} ${COREDIR}
@ -46,7 +48,7 @@ while read PORT_NAME PORT_CAT PORT_TYPE PORT_BROKEN; do
PORT_LIST="${PORT_LIST} ${PORT_NAME}"
done < ${CONFIGDIR}/ports.conf
extract_packages ${STAGEDIR} opnsense
extract_packages ${STAGEDIR} ${CORE_NAME}
install_packages ${STAGEDIR} gettext-tools ${PORT_LIST}
chroot ${STAGEDIR} /bin/sh -es << EOF
@ -84,5 +86,5 @@ sed -i "" -e '/%%REPO_DEPENDS%%/d' ${STAGEDIR}/+MANIFEST
make -C ${COREDIR} DESTDIR=${STAGEDIR} plist > ${STAGEDIR}/plist
EOF
create_packages ${STAGEDIR} ${REPO_NAME}
create_packages ${STAGEDIR} ${CORE_NAME}
bundle_packages ${STAGEDIR}