fix getpkginfo

This commit is contained in:
emmett1
2017-07-31 16:34:27 +08:00
parent 7882f5cf6a
commit f84eb6097f
4 changed files with 4 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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