From e62b2dc3d4845f4bc09c64380ffcb1f872d07056 Mon Sep 17 00:00:00 2001 From: emmett1 Date: Mon, 5 Mar 2018 06:56:17 +0800 Subject: [PATCH] fix some misstype and SOURCE_PKG and OUTPUT_PKG --- scratch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scratch b/scratch index c48be17..6176991 100755 --- a/scratch +++ b/scratch @@ -92,12 +92,12 @@ searchpkg() { search_result="${color_blue}($portname)${color_reset} ${color_purple}$name${color_reset} ${color_cyan}$version-$release${color_reset}" if [ -d $INDEX_DIR/$name ]; then getinstalledname $name - [ -d $INDEX_DIR/$name/.lock ] && ITSLOCK="[locked]" + [ -f $INDEX_DIR/$name/.lock ] && ITSLOCK="[locked]" if [ "$name-$version-$release" = "$installedname" ]; then - msg3 "$search_result ${color_green}[installed]${color_reset} ${color_blue}[locked]${color_reset}" + msg3 "$search_result ${color_green}[installed]${color_reset} ${color_blue}$ITSLOCK${color_reset}" msg4 "$description" else - msg3 "$search_result ${color_yellow}[installed $iversion-$irelease]${color_reset} ${color_blue}[locked]${color_reset}" + msg3 "$search_result ${color_yellow}[installed $iversion-$irelease]${color_reset} ${color_blue}$ITSLOCK${color_reset}" msg4 "$description" fi else @@ -674,8 +674,8 @@ parse_options() { -s | --search) testinput "$2" && searchpkg "$2" || exit 1; shift 2 ;; -t | --create-template) testinput "$2" && createtemplate "$2" || exit 1; shift 2 ;; -pp | --port-path) testinput "$2" && showportpath "$2" || exit 1; shift 2 ;; - -sd | --source-dir) testinput "$2" && SOURCE_PKG="$2" || exit 1; shift 2 ;; - -pd | --package-dir) testinput "$2" && OUTPUT_PKG="$2" || exit 1; shift 2 ;; + -sd | --source-dir) testinput "$2" && { OPTS+=($1 $2); SOURCE_PKG="$2"; } || exit 1; shift 2 ;; + -pd | --package-dir) testinput "$2" && { OPTS+=($1 $2); OUTPUT_PKG="$2"; } || exit 1; shift 2 ;; -p | --package) testinput "$2" && while [ "$2" ]; do if echo "" $2 | grep -vq "^ -"; then INSTALLPKG+=($2); shift