From f84eb6097fde3de5b9899731e0d4176f8d910b6c Mon Sep 17 00:00:00 2001 From: emmett1 Date: Mon, 31 Jul 2017 16:34:27 +0800 Subject: [PATCH] fix getpkginfo --- buildpkg | 2 +- functions | 3 --- installpkg | 2 +- scratch | 2 ++ 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/buildpkg b/buildpkg index e300da4..f370064 100755 --- a/buildpkg +++ b/buildpkg @@ -134,8 +134,8 @@ preparesource() { loadspkgbuild() { if [ -f $BUILD_SCRIPT ]; then - . $BUILD_SCRIPT getpkginfo + . $BUILD_SCRIPT else msg "${color_red}Error no $BUILD_SCRIPT found.${color_reset}" exitscript1 diff --git a/functions b/functions index 66872c2..5c028bd 100644 --- a/functions +++ b/functions @@ -117,9 +117,6 @@ updatesystemdb() { getpkginfo() { - name=$(cat $BUILD_SCRIPT | grep ^name | cut -d '=' -f 2) - version=$(cat $BUILD_SCRIPT | grep ^version | cut -d '=' -f 2) - release=$(cat $BUILD_SCRIPT | grep ^release | cut -d '=' -f 2) description=$(cat $BUILD_SCRIPT | grep ^'# description' | tr -d ':' | cut -d ' ' -f 3-) homepage=$(cat $BUILD_SCRIPT | grep ^'# homepage' | tr -d ':' | cut -d ' ' -f 3-) maintainer=$(cat $BUILD_SCRIPT | grep ^'# maintainer' | tr -d ':' | cut -d ' ' -f 3-) diff --git a/installpkg b/installpkg index fc37477..c32190d 100755 --- a/installpkg +++ b/installpkg @@ -119,7 +119,7 @@ checkconflict() { while IFS=' ' read -r line; do pushd $ROOT_DIR if [ -f "$line" ] || [ -L "$line" ]; then - msg "Conflict file!: ${color_yellow}/${line}${color_reset}" + msg "Conflict file!: ${color_yellow}${line}${color_reset}" CONFLICT=yes fi popd diff --git a/scratch b/scratch index 19c872f..9868b14 100755 --- a/scratch +++ b/scratch @@ -101,6 +101,7 @@ searchpkg() { if [ -f $PORT_DIR/$port/$out/$BUILD_SCRIPT ]; then pushd $PORT_DIR/$port/$out getpkginfo + . $BUILD_SCRIPT popd if [ ! -z "$name" ] && [ ! -z "$version" ] && [ ! -z "$release" ]; then if [ -d $INDEX_DIR/$name ]; then @@ -205,6 +206,7 @@ showdepends() { if [ -f $PORT_DIR/$portdepends/$PACKAGE_DEPENDS/$BUILD_SCRIPT ]; then pushd $PORT_DIR/$portdepends/$PACKAGE_DEPENDS getpkginfo + . $BUILD_SCRIPT popd break fi