|
@@ -457,19 +457,22 @@ 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 [[ ${P_ARR['release']} == "snapshot" ]]; then
|
|
|
- git checkout master
|
|
|
- else
|
|
|
- git checkout "${P_ARR[release]}"
|
|
|
+ if [[ ! -d "$src_dir" ]]; then
|
|
|
+ mkdir -p "$src_dir"
|
|
|
+ if [[ ${P_ARR['release']} == "snapshot" ]]; then
|
|
|
+ git clone --depth=1 -b master "$src_url" "$src_dir"
|
|
|
+ else
|
|
|
+ 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"
|