Work on --from-source

This commit is contained in:
2023-01-11 16:07:38 -05:00
parent 2009725f33
commit 4cb4e85e4e

View File

@@ -457,18 +457,21 @@ fromSource() {
debug "${FUNCNAME[0]}"
declare src_url="https://github.com/openwrt/openwrt.git"
declare src_dir="$BUILDDIR/sources/openwrt"
declare -a pkg_list
echo "Building from source is under development"
git clone --depth=1 "$src_url" "$BUILDDIR/sources/openwrt"
pushd "$BUILDDIR/sources/openwrt" || return 1
if [[ ! -d "$src_dir" ]]; then
mkdir -p "$src_dir"
if [[ ${P_ARR['release']} == "snapshot" ]]; then
git checkout master
git clone --depth=1 -b master "$src_url" "$src_dir"
else
git checkout "${P_ARR[release]}"
git clone --depth=1 -b "${P_ARR[release]}" "$src_url" "$src_dir"
fi
fi
pushd "$src_dir" || return 1
./scripts/feeds update -a
./scripts/feeds install -a
@@ -496,6 +499,7 @@ askOk() {
resetAll() {
debug "${FUNCNAME[0]}"
# BUILDDIR may not be set, so fallback to SCRIPTDIR
askOk "Remove ${BUILDDIR:-${SCRIPTDIR:?}}/sources and ${BUILDDIR:-${SCRIPTDIR:?}}/bin?" || exit $?
debug "rm -rf ${BUILDDIR:-${SCRIPTDIR:?}}/sources ${BUILDDIR:-${SCRIPTDIR:?}}/bin"
rm -rf "${BUILDDIR:-${SCRIPTDIR:?}}/sources" "${BUILDDIR:-${SCRIPTDIR:?}}/bin"