dep

Package manager for embedded C libraries
git clone git://git.finwo.net/app/dep
Log | Files | Refs | README | LICENSE

commit d17fb4addf06c837547ea13e6b744686a9d6df93
parent 41190dcb5da11d0671e98bcbce4b118b87615208
Author: finwo <finwo@pm.me>
Date:   Sat, 27 Apr 2024 20:30:59 +0200

Fix no tarball download bug

Diffstat:
Mdist/dep | 20+++++++++++---------
Msrc/command/install/index.sh | 22++++++++++++----------
2 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/dist/dep b/dist/dep @@ -345,15 +345,18 @@ function cmd_install_dep { exit 1 fi - # Copy repository's config for the package - local PKG_SRC=$(dirname "${PKGINI}") - local PKG_DIR="${CMD_INSTALL_PKG_DEST}/${PKGNAME}" - mkdir -p "$(dirname "${PKG_DIR}")" - cp -r "${PKG_SRC}" "${PKG_DIR}" - local PKGINI="${PKG_DIR}/package.ini" + if [ -d "${PKG_DIR}" ]; then + # Already installed, just update the pkgini ref + PKGINI="${CMF_INSTALL_PKG_DEST}/${PKGNAME}/package.ini" + else + # Not installed yet, fetch code & run build steps - # Skip if already installed - if [ ! -d "${CMD_INSTALL_PKG_DEST}/${PKGNAME}" ]; then + # Copy repository's config for the package + local PKG_SRC=$(dirname "${PKGINI}") + local PKG_DIR="${CMD_INSTALL_PKG_DEST}/${PKGNAME}" + mkdir -p "$(dirname "${PKG_DIR}")" + cp -r "${PKG_SRC}" "$(dirname ${PKG_DIR})" + PKGINI="${PKG_DIR}/package.ini" # Extended fetching detection local PKG_GH=$(ini_foreach ini_output_value "${PKGINI}" "repository.github") @@ -404,7 +407,6 @@ function cmd_install_dep { echo + $buildcmd bash -c "cd '${PKG_DIR}' ; ${buildcmd}" done < <(ini_foreach ini_output_section "${PKGINI}" "build-$(ostype)." | sort --human-numeric-sort) - fi # Build the package's exports diff --git a/src/command/install/index.sh b/src/command/install/index.sh @@ -94,15 +94,18 @@ function cmd_install_dep { exit 1 fi - # Copy repository's config for the package - local PKG_SRC=$(dirname "${PKGINI}") - local PKG_DIR="${CMD_INSTALL_PKG_DEST}/${PKGNAME}" - mkdir -p "$(dirname "${PKG_DIR}")" - cp -r "${PKG_SRC}" "${PKG_DIR}" - local PKGINI="${PKG_DIR}/package.ini" - - # Skip if already installed - if [ ! -d "${CMD_INSTALL_PKG_DEST}/${PKGNAME}" ]; then + if [ -d "${PKG_DIR}" ]; then + # Already installed, just update the pkgini ref + PKGINI="${CMF_INSTALL_PKG_DEST}/${PKGNAME}/package.ini" + else + # Not installed yet, fetch code & run build steps + + # Copy repository's config for the package + local PKG_SRC=$(dirname "${PKGINI}") + local PKG_DIR="${CMD_INSTALL_PKG_DEST}/${PKGNAME}" + mkdir -p "$(dirname "${PKG_DIR}")" + cp -r "${PKG_SRC}" "$(dirname ${PKG_DIR})" + PKGINI="${PKG_DIR}/package.ini" # Extended fetching detection local PKG_GH=$(ini_foreach ini_output_value "${PKGINI}" "repository.github") @@ -153,7 +156,6 @@ function cmd_install_dep { echo + $buildcmd bash -c "cd '${PKG_DIR}' ; ${buildcmd}" done < <(ini_foreach ini_output_section "${PKGINI}" "build-$(ostype)." | sort --human-numeric-sort) - fi # Build the package's exports