From 087bbbe1e1bf612ce2dcd34ada7305369bcd20d3 Mon Sep 17 00:00:00 2001 From: emmett1 Date: Mon, 18 Sep 2017 00:02:57 +0800 Subject: [PATCH] updated --- buildpkg | 4 ++-- installpkg | 17 +++++++---------- removepkg | 6 +++--- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/buildpkg b/buildpkg index 2f17733..8bfd218 100755 --- a/buildpkg +++ b/buildpkg @@ -686,8 +686,8 @@ main() { ### CHECK FOR LOCK FILE ### if [ -f /tmp/spkg.$name.lock ]; then - msg "Cant build same package simultaneously." - msg "remove ${color_yellow}/tmp/spkg.$name.lock${color_reset} if no build process for ${color_yellow}$name.${color_reset}" + msgerr "Cant build same package simultaneously." + msgerr "remove ${color_yellow}/tmp/spkg.$name.lock${color_reset} if no build process for ${color_yellow}$name.${color_reset}" exit 1 fi diff --git a/installpkg b/installpkg index 6a18434..a0cee17 100755 --- a/installpkg +++ b/installpkg @@ -453,7 +453,7 @@ main() { ### CHECK FOR ROOT ACCESS ### if [ "$UID" != "0" ]; then - msg "${color_red}Installing package need root access!${color_reset}" + msgerr "${color_red}Installing package need root access!${color_reset}" exit 1 fi @@ -461,14 +461,14 @@ main() { ### CHECK FOR LOCK FILE ### if [ -f /tmp/spkg.lock ]; then - msg "Cant install/remove package simultaneously." - msg "remove /tmp/spkg.lock if no install/remove package process running." + msgerr "Cant install/remove package simultaneously." + msgerr "remove ${color_yellow}/tmp/spkg.lock${color_reset} if no install/remove package process running." exit 1 fi ### NOT STATED PACKAGE ### if [ -z $PKGNAME ]; then - msg "${color_red}Please state the package to install.${color_reset}" + msgerr "${color_red}Please state the package to install.${color_reset}" exit 1 fi @@ -512,12 +512,9 @@ main() { updatesystemdb ### UPDATE INFO PAGES ### - for file in $(cat $INDEX_DIR/$name/.files); do - if [ $file = usr/share/info/ ]; then - updateinfopages - break - fi - done + if [ "$(grep -w usr/share/info/ $INDEX_DIR/$name/.files)" ]; then + updateinfopages + fi exit 0 } diff --git a/removepkg b/removepkg index b529ed3..cfdf6b9 100755 --- a/removepkg +++ b/removepkg @@ -283,7 +283,7 @@ main() { ### CHECK FOR ROOT ACCESS ### if [ "$UID" != "0" ]; then - msg "${color_red}Removing package need root access.${color_reset}" + msgerr "${color_red}Removing package need root access.${color_reset}" exit 1 fi @@ -291,8 +291,8 @@ main() { ### CHECK FOR LOCK FILE ### if [ -f /tmp/spkg.lock ]; then - msg "Cant install/remove package simultaneously." - msg "remove /tmp/spkg.lock if no install/remove package process running." + msgerr "Cant install/remove package simultaneously." + msgerr "remove ${color_yellow}/tmp/spkg.lock${color_reset} if no install/remove package process running." exit 1 fi