Compare commits
2 Commits
81cd5c0880
...
25c317c4d0
| Author | SHA1 | Date | |
|---|---|---|---|
| 25c317c4d0 | |||
| 42cbbd43c3 |
@@ -368,7 +368,7 @@ getImageBuilder() {
|
||||
|
||||
echo "Downloading Image Builder archive using $DL_TOOL"
|
||||
debug "$DL_TOOL -o $IB_ARCHIVE $url"
|
||||
"$DL_TOOL" -o "$IB_ARCHIVE" "$url"
|
||||
execute "$DL_TOOL" "-o" "$IB_ARCHIVE" "$url"
|
||||
}
|
||||
|
||||
|
||||
@@ -438,7 +438,7 @@ makeImages() {
|
||||
# Reuse the existing output
|
||||
if [[ -d "$BINDIR" ]]; then
|
||||
if askOk "$BINDIR exists. Rebuild?"; then
|
||||
rm -rf "$BINDIR"
|
||||
execute rm -rf "$BINDIR"
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
@@ -663,10 +663,10 @@ fromSource() {
|
||||
# Generic helpers
|
||||
debug() { (( DEBUG )) && echo "Debug: $*"; }
|
||||
askOk() {
|
||||
local _response
|
||||
read -r -p "$* [y/N]" _response
|
||||
_response=${_response,,}
|
||||
[[ "$_response" =~ ^(yes|y)$ ]]
|
||||
local r
|
||||
read -r -p "$* [y/N]" r
|
||||
r=${r,,}
|
||||
[[ "$r" =~ ^(yes|y)$ ]]
|
||||
}
|
||||
extract() {
|
||||
debug "${FUNCNAME[0]}"
|
||||
@@ -758,12 +758,14 @@ main() {
|
||||
declare -g GITDIR="$BUILDROOT/src/openwrt"
|
||||
|
||||
if (( RESET )); then
|
||||
for d in "$BUILDDIR" "$SOURCEDIR" "$BINDIR"; do
|
||||
askOk "Remove $d?" && execute rm -rf "$d"
|
||||
done
|
||||
if [[ -d $SOURCEDIR ]] && askOk "Remove $SOURCEDIR?"; then
|
||||
execute git worktree remove --force "$SOURCEDIR"
|
||||
execute rm -rf "$SOURCEDIR"
|
||||
fi
|
||||
if [[ -d $BUILDDIR ]] && askOk "Remove $BUILDDIR?"; then
|
||||
execute rm -rf "$BUILDDIR"
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ -d $BUILDDIR ]] || mkdir -p "$BUILDDIR"
|
||||
|
||||
if [[ "$RELEASE" == "snapshot" ]]; then
|
||||
declare url_prefix="https://downloads.openwrt.org/snapshots/targets/$TARGET"
|
||||
@@ -811,6 +813,7 @@ main() {
|
||||
if (( FROM_SOURCE )); then
|
||||
fromSource || return $?
|
||||
else
|
||||
[[ -d $BUILDDIR ]] || mkdir -p "$BUILDDIR"
|
||||
getImageBuilder "$ib_url" &&
|
||||
getImageBuilderChecksum &&
|
||||
verify "$IB_ARCHIVE" "$IB_SHA256_FILE" &&
|
||||
|
||||
Reference in New Issue
Block a user