build/clean: core,plugins only makes sense if packages are there

This commit is contained in:
Franco Fichtner 2020-02-08 19:02:01 +01:00
parent 245fdc5c79
commit f7213f9431
2 changed files with 13 additions and 8 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2014-2019 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2014-2020 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -45,9 +45,10 @@ for ARG in ${@}; do
echo ">>> Removing core from packages set"
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}
extract_packages ${STAGEDIR}
remove_packages ${STAGEDIR} ${PRODUCT_CORES}
bundle_packages ${STAGEDIR} '' core
if extract_packages ${STAGEDIR}; then
remove_packages ${STAGEDIR} ${PRODUCT_CORES}
bundle_packages ${STAGEDIR} '' core
fi
;;
distfiles)
echo ">>> Removing distfiles set"
@ -91,9 +92,10 @@ for ARG in ${@}; do
echo ">>> Removing plugins from packages set"
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}
extract_packages ${STAGEDIR}
remove_packages ${STAGEDIR} ${PRODUCT_PLUGINS}
bundle_packages ${STAGEDIR} '' plugins
if extract_packages ${STAGEDIR}; then
remove_packages ${STAGEDIR} ${PRODUCT_PLUGINS}
bundle_packages ${STAGEDIR} '' plugins
fi
;;
release)
echo ">>> Removing release set"

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2014-2019 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2014-2020 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2010-2011 Scott Ullrich <sullrich@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
@ -696,7 +696,10 @@ extract_packages()
PACKAGESET=$(find ${SETSDIR} -name "packages-*-${PRODUCT_FLAVOUR}-${PRODUCT_ARCH}.tar")
if [ -f "${PACKAGESET}" ]; then
tar -C ${BASEDIR}${PACKAGESDIR} -xpf ${PACKAGESET}
return 0
fi
return 1
}
search_packages()