From df68358afdcc2883136e8d43cd182ac35f629f55 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 25 Jan 2018 00:09:29 +0100 Subject: [PATCH] Merge run_pkg_command functions Signed-off-by: David Oberhollenzer --- mk.sh | 8 ++++---- util/pkgcmd.sh | 16 ++++------------ 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/mk.sh b/mk.sh index 4cfbeb7..c9d14f9 100755 --- a/mk.sh +++ b/mk.sh @@ -61,8 +61,8 @@ gen_cmake_toolchain_file while read pkg; do include_pkg "tcpkg" "$pkg" - run_tcpkg_command "build" - run_tcpkg_command "deploy" + run_pkg_command "build" "toolchain" + run_pkg_command "deploy" "toolchain" done < "$PACKAGELIST" echo "--- backing up toolchain sysroot ---" @@ -90,8 +90,8 @@ while read pkg; do install_build_deps - run_pkg_command "build" - run_pkg_command "deploy" + run_pkg_command "build" "$PKGNAME" + run_pkg_command "deploy" "$PKGNAME" restore_toolchain done < "$PACKAGELIST" diff --git a/util/pkgcmd.sh b/util/pkgcmd.sh index abf051b..5bb3410 100644 --- a/util/pkgcmd.sh +++ b/util/pkgcmd.sh @@ -1,8 +1,8 @@ -run_pkg_command_common() { +run_pkg_command() { local FUNCTION="$1" local DEPLOYDIR="$PKGDEPLOYDIR/$2" - local OUT="$PKGBUILDDIR/$3" - local CHECKFILE="$PKGLOGDIR/.${4}-${FUNCTION}" + local OUT="$PKGBUILDDIR/${PKGDIR}-${PKGNAME}" + local CHECKFILE="$PKGLOGDIR/.${PKGDIR}-${PKGNAME}-${FUNCTION}" echo "$PKGNAME - $FUNCTION" @@ -10,7 +10,7 @@ run_pkg_command_common() { return fi - local LOGFILE="$PKGLOGDIR/${5}-${FUNCTION}.log" + local LOGFILE="$PKGLOGDIR/${PKGDIR}-${PKGNAME}-${FUNCTION}.log" local SRC="$PKGSRCDIR/$SRCDIR" mkdir -p "$DEPLOYDIR" "$OUT" "${DEPLOYDIR}-dev" @@ -25,11 +25,3 @@ run_pkg_command_common() { touch "$CHECKFILE" } - -run_pkg_command() { - run_pkg_command_common "$1" "$PKGNAME" "$PKGNAME" "$PKGNAME" "$PKGNAME" -} - -run_tcpkg_command() { - run_pkg_command_common "$1" "toolchain" "tc-$PKGNAME" "tc-$PKGNAME" "tc-$PKGNAME" -}