mirror of
https://github.com/opnsense/tools.git
synced 2026-05-28 04:35:46 -04:00
build/distfiles: clean up subdiretories on manual arguments passed
This eases maintenance when trying to refetch smaller portions of distfiles without losing the others.
This commit is contained in:
parent
c52a19d078
commit
31c3a2bc65
2 changed files with 19 additions and 1 deletions
|
|
@ -641,6 +641,16 @@ setup_distfiles()
|
|||
mkdir -p ${1}${PORTSDIR}
|
||||
rm -rf ${1}${PORTSDIR}/distfiles
|
||||
tar -C ${1}${PORTSDIR} -xpf ${DISTFILESET}
|
||||
|
||||
# clear all additional sub-directories passed
|
||||
for DIR in ${@}; do
|
||||
rm -rf ${1}${PORTSDIR}/distfiles/${DIR}
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -n "${@}" ]; then
|
||||
# in cleanup mode signal that we are done
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,15 @@ setup_base ${STAGEDIR}
|
|||
setup_clone ${STAGEDIR} ${PORTSDIR}
|
||||
setup_clone ${STAGEDIR} ${SRCDIR}
|
||||
setup_chroot ${STAGEDIR}
|
||||
setup_distfiles ${STAGEDIR}
|
||||
|
||||
if ! setup_distfiles ${STAGEDIR} ${@}; then
|
||||
echo -n ">>> Recreating distfiles set... "
|
||||
tar -C ${STAGEDIR}${PORTSDIR} -cf \
|
||||
${SETSDIR}/distfiles-${PRODUCT_VERSION}.tar distfiles
|
||||
echo "done"
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
extract_packages ${STAGEDIR} || true
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue