scripts: size_compare: fix support for CONFIG_BINARY_FOLDER

There is no CONFIG_BINARY_DIR, it's CONFIG_BINARY_FOLDER.

While at it, don't parse the shell compatible .config, eval it.

Signed-off-by: Andre Heider <a.heider@gmail.com>
This commit is contained in:
Andre Heider 2023-01-30 18:37:39 +01:00 committed by Paul Spooren
parent f56d5932d2
commit 21242451c2
1 changed files with 11 additions and 8 deletions

View File

@ -21,17 +21,20 @@
### -p --package-size Check IPK package size and not installed size ### -p --package-size Check IPK package size and not installed size
### -h --help This message ### -h --help This message
CONFIG_TARGET=$(sed -n 's/^CONFIG_TARGET_BOARD="\(.*\)"$/\1/p' .config) eval "$(grep \
CONFIG_SUBTARGET=$(sed -n 's/^CONFIG_TARGET_SUBTARGET="\(.*\)"$/\1/p' .config) -e ^CONFIG_TARGET_BOARD= \
CONFIG_ARCH=$(sed -n 's/^CONFIG_TARGET_ARCH_PACKAGES="\(.*\)"$/\1/p' .config) -e ^CONFIG_TARGET_SUBTARGET= \
-e ^CONFIG_TARGET_ARCH_PACKAGES= \
-e ^CONFIG_BINARY_FOLDER= \
.config 2>/dev/null \
)"
CONFIG_PACKAGES=$(sed -n 's/^CONFIG_PACKAGE_\(.*\)=y$/\1/p' .config | tr '\n' ' ') CONFIG_PACKAGES=$(sed -n 's/^CONFIG_PACKAGE_\(.*\)=y$/\1/p' .config | tr '\n' ' ')
CONFIG_BIN_DIR=$(sed -n 's/^CONFIG_BINARY_DIR="\(.*\)"$/\1/p' .config)
TARGET=${TARGET:-$CONFIG_TARGET} TARGET=${TARGET:-$CONFIG_TARGET_BOARD}
SUBTARGET=${SUBTARGET:-$CONFIG_SUBTARGET} SUBTARGET=${SUBTARGET:-$CONFIG_TARGET_SUBTARGET}
ARCH=${ARCH:-$CONFIG_ARCH} ARCH=${ARCH:-$CONFIG_TARGET_ARCH_PACKAGES}
PACKAGES=${PACKAGES:-$CONFIG_PACKAGES} PACKAGES=${PACKAGES:-$CONFIG_PACKAGES}
BIN_DIR=${CONFIG_BIN_DIR:-./bin} BIN_DIR=${CONFIG_BINARY_FOLDER:-./bin}
BASE_URL="${BASE_URL:-https://downloads.openwrt.org/snapshots}" BASE_URL="${BASE_URL:-https://downloads.openwrt.org/snapshots}"
CHECK_INSTALLED="${CHECK_INSTALLED:-y}" CHECK_INSTALLED="${CHECK_INSTALLED:-y}"