From 71b27a1d024bb668defbcf10b10dec6c016bd264 Mon Sep 17 00:00:00 2001 From: emmett1 Date: Tue, 3 Apr 2018 21:09:45 +0800 Subject: [PATCH] updated --- buildpkg | 16 ++++++++++++---- installpkg | 21 +++++++++++++-------- scratch | 2 +- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/buildpkg b/buildpkg index 5ecaa1d..88b3ae2 100755 --- a/buildpkg +++ b/buildpkg @@ -341,15 +341,21 @@ checkdeps() { for dep in ${depends[@]}; do if [ ! -d $INDEX_DIR/$dep ]; then - scratch -i -p $dep --no-orphan-check || exit 1 - #MSDEP+=($dep) + if [ "$INSTALL_PKG" ]; then + scratch -i -p $dep --no-orphan-check || exit 1 + else + MSDEP+=($dep) + fi fi done for makedep in ${makedepends[@]}; do if [ ! -d $INDEX_DIR/$makedep ]; then - scratch -i -p $makedep --no-orphan-check || exit 1 - #MSMKDEP+=($makedep) + if [ "$INSTALL_PKG" ]; then + scratch -i -p $makedep --no-orphan-check || exit 1 + else + MSMKDEP+=($makedep) + fi fi done @@ -479,6 +485,7 @@ Options: --no-postupgrade skip postupgrade script after upgrade package --no-color disable color --no-backup skip backup when upgrading package + --dep install missing dependencies -fr, --force-rebuild rebuild package -im, --ignore-mdsum skip md5sum checking -um, --update-mdsum update md5sum @@ -517,6 +524,7 @@ parse_options() { -v | --verbose) OPTS+=($1) ;; --no-color) NOCOLOR=yes; OPTS+=($1) ;; --no-backup) OPTS+=($1) ;; + --dep) OPTS+=($1) ;; --no-orphan-check) NO_ORPHAN_CHECK=yes; OPTS+=($1) ;; -fr | --force-rebuild) FORCE_REBUILD=yes ;; -im | --ignore-mdsum) IGNORE_MDSUM=yes ;; diff --git a/installpkg b/installpkg index 22d9d48..e557835 100755 --- a/installpkg +++ b/installpkg @@ -15,6 +15,12 @@ spkglock() { installpkg() { + #ignore dependency check + if [ ! "$IGNORE_DEP" ]; then + #msg2 "Checking package dependencies..." + checkdeps + fi + msg "Installing ${color_green}$name-$version-$release${color_reset}..." # noextract file into system @@ -22,12 +28,6 @@ installpkg() { excludefile+=(--exclude=$noextr) done - #ignore dependency check - if [ ! "$IGNORE_DEP" ]; then - msg2 "Checking package dependencies..." - checkdeps - fi - #ignore conflict if [ ! "$IGNORE_CONFLICT" ]; then msg2 "Checking package/file conflict..." @@ -184,8 +184,11 @@ checkdeps() { for dep in ${depends[@]}; do if [ ! -d $INDEX_DIR/$dep ]; then - scratch -i -p $dep --no-orphan-check || exit 1 - #MSGDEP+=($dep) + if [ "$DEP_INSTALL" ]; then + scratch -i -p $dep --no-orphan-check || exit 1 + else + MSGDEP+=($dep) + fi fi done @@ -433,6 +436,7 @@ Options: --no-backup skip backup when upgrading package --no-orphan-check skip orphaned package check after install package --no-color disable colour for output + --dep install missing dependencies -h, --help show this help message Example: @@ -449,6 +453,7 @@ parse_options() { else while [ "$1" ]; do case $1 in + --dep) DEP_INSTALL=yes ;; -u | --upgrade) UPGRADE_PKG=yes ;; -r | --reinstall) REINSTALL_PKG=yes ;; -id | --ignore-dependency) IGNORE_DEP=yes ;; diff --git a/scratch b/scratch index 3b87bd2..9df3aea 100755 --- a/scratch +++ b/scratch @@ -513,7 +513,7 @@ portinstall() { for pkg in "${INSTALLPKG[@]}"; do if getportpath $pkg >/dev/null; then pushd "$(getportpath $pkg)" - buildpkg ${OPTS[@]} || exit 1 + buildpkg --dep ${OPTS[@]} || exit 1 popd else msgerr "Port '$pkg' not found."