This commit is contained in:
emmett1
2018-04-03 21:09:45 +08:00
parent 9a8e11102a
commit 71b27a1d02
3 changed files with 26 additions and 13 deletions

View File

@@ -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 ;;

View File

@@ -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 ;;

View File

@@ -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."