From 0ae129a7794716459a829052487fcadfb23955f0 Mon Sep 17 00:00:00 2001 From: Willy Sudiarto Raharjo Date: Sun, 26 Oct 2014 00:14:17 +0700 Subject: [PATCH] Fix build script. Signed-off-by: Willy Sudiarto Raharjo --- mate-build-base.sh | 8 ++++---- mate-build-deps.sh | 8 ++++---- mate-build-extra.sh | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mate-build-base.sh b/mate-build-base.sh index 84e8a06..3679400 100755 --- a/mate-build-base.sh +++ b/mate-build-base.sh @@ -68,7 +68,7 @@ for dir in \ cd $MSBROOT/$dir || exit 1 # Get the version - version=$(cat ${package}.SlackBuild | grep "VERSION:" | cut -d "-" -f2 | rev | cut -c 2- | rev) + version=$(cat ${package}.SlackBuild | grep "VERSION:" | head -n1 | cut -d "-" -f2 | rev | cut -c 2- | rev) # Get the build build=$(cat ${package}.SlackBuild | grep "BUILD:" | cut -d "-" -f2 | rev | cut -c 2- | rev) @@ -85,9 +85,9 @@ for dir in \ # The real build starts here sh ${package}.SlackBuild || exit 1 if [ "$INST" = "1" ]; then - PACKAGE="${package}-$version-*-${build}*.txz" - if [ -f $TMP/$PACKAGE ]; then - upgradepkg --install-new --reinstall $TMP/$PACKAGE + PACKAGE=`ls $TMP/${package}-${version}-*-${build}*.txz` + if [ -f "$PACKAGE" ]; then + upgradepkg --install-new --reinstall "$PACKAGE" else echo "Error: package to upgrade "$PACKAGE" not found in $TMP" exit 1 diff --git a/mate-build-deps.sh b/mate-build-deps.sh index d22101a..076c0e9 100755 --- a/mate-build-deps.sh +++ b/mate-build-deps.sh @@ -74,7 +74,7 @@ for dir in \ cd $MSBROOT/$dir || exit 1 # Get the version - version=$(cat ${package}.SlackBuild | grep "VERSION:" | cut -d "-" -f2 | rev | cut -c 2- | rev) + version=$(cat ${package}.SlackBuild | grep "VERSION:" | head -n1 | cut -d "-" -f2 | rev | cut -c 2- | rev) # Get the build build=$(cat ${package}.SlackBuild | grep "BUILD:" | cut -d "-" -f2 | rev | cut -c 2- | rev) @@ -91,9 +91,9 @@ for dir in \ # The real build starts here sh ${package}.SlackBuild || exit 1 if [ "$INST" = "1" ]; then - PACKAGE="${package}-$version-*-${build}*.txz" - if [ -f $TMP/$PACKAGE ]; then - upgradepkg --install-new --reinstall $TMP/$PACKAGE + PACKAGE=`ls $TMP/${package}-${version}-*-${build}*.txz` + if [ -f "$PACKAGE" ]; then + upgradepkg --install-new --reinstall "$PACKAGE" else echo "Error: package to upgrade "$PACKAGE" not found in $TMP" exit 1 diff --git a/mate-build-extra.sh b/mate-build-extra.sh index a7da56d..2208e9c 100755 --- a/mate-build-extra.sh +++ b/mate-build-extra.sh @@ -61,7 +61,7 @@ for dir in \ cd $MSBROOT/$dir || exit 1 # Get the version - version=$(cat ${package}.SlackBuild | grep "VERSION:" | cut -d "-" -f2 | rev | cut -c 2- | rev) + version=$(cat ${package}.SlackBuild | grep "VERSION:" | head -n1 | cut -d "-" -f2 | rev | cut -c 2- | rev) # Get the build build=$(cat ${package}.SlackBuild | grep "BUILD:" | cut -d "-" -f2 | rev | cut -c 2- | rev) @@ -78,9 +78,9 @@ for dir in \ # The real build starts here sh ${package}.SlackBuild || exit 1 if [ "$INST" = "1" ]; then - PACKAGE="${package}-$version-*-${build}*.txz" - if [ -f $TMP/$PACKAGE ]; then - upgradepkg --install-new --reinstall $TMP/$PACKAGE + PACKAGE=`ls $TMP/${package}-${version}-*-${build}*.txz` + if [ -f "$PACKAGE" ]; then + upgradepkg --install-new --reinstall "$PACKAGE" else echo "Error: package to upgrade "$PACKAGE" not found in $TMP" exit 1