tweak the logic to determine ARCH; modify some evals and conditionals for ARCH (including removing an unset ARCH) in check_for_updates and info_item; thanks to slakmagik for his help and suggestions with the patch, including adding the redirects to /dev/null

This commit is contained in:
chess.griffin 2010-05-20 18:03:55 +00:00
parent 29f3ec72eb
commit a314a8d37d
2 changed files with 22 additions and 7 deletions

View file

@ -18,5 +18,7 @@ enhancements:
* Added an option to print the version of sbopkg. We try not to change the * Added an option to print the version of sbopkg. We try not to change the
meaning of flags but note that this does change what was the '-v' flag to meaning of flags but note that this does change what was the '-v' flag to
'-V' and now uses '-v' for its customary 'version' purpose. '-V' and now uses '-v' for its customary 'version' purpose.
* Tweak the logic re determining ARCH and modify some ARCH-related
evals and conditionals in check_for_updates and info_item.
+--------------------------+ +--------------------------+

View file

@ -704,9 +704,12 @@ check_for_updates() {
# Extract the new package version # Extract the new package version
if [[ ! -z $NEWSB ]]; then if [[ ! -z $NEWSB ]]; then
unset ARCH BUILD unset BUILD
eval NEW$(grep -m1 ^ARCH= $NEWSB) eval NEW$(grep -m1 ^ARCH= $NEWSB) 2>/dev/null
eval NEW$(grep -m1 ^BUILD= $NEWSB) if [[ $NEWARCH != "noarch" ]]; then
NEWARCH=$ARCH
fi
eval NEW$(grep -m1 ^BUILD= $NEWSB) 2>/dev/null
[[ -z $NEWARCH ]] && NEWARCH=unknown [[ -z $NEWARCH ]] && NEWARCH=unknown
# Step 1 - find the version expression # Step 1 - find the version expression
@ -1133,7 +1136,10 @@ info_item() {
SHORTPATH=$REPO_DIR/$CATEGORY/$APP SHORTPATH=$REPO_DIR/$CATEGORY/$APP
CURVERSION=$(grep VERSION $SHORTPATH/$APP.info | CURVERSION=$(grep VERSION $SHORTPATH/$APP.info |
cut -d= -f2 | sed s/\"//g) cut -d= -f2 | sed s/\"//g)
eval CUR$(grep -m1 ^ARCH= $SHORTPATH/$APP.SlackBuild) eval CUR$(grep -m1 ^ARCH= $SHORTPATH/$APP.SlackBuild) 2>/dev/null
if [[ $CURARCH != "noarch" ]]; then
CURARCH=$ARCH
fi
eval CUR$(grep -m1 ^BUILD= $SHORTPATH/$APP.SlackBuild) eval CUR$(grep -m1 ^BUILD= $SHORTPATH/$APP.SlackBuild)
[[ -z $CURARCH ]] && CURARCH=unknown [[ -z $CURARCH ]] && CURARCH=unknown
while :; do while :; do
@ -4385,9 +4391,16 @@ if [[ $(id -u) != 0 ]]; then
exit 1 exit 1
fi fi
# Set up ARCH # Set up ARCH - borrowed from SBo SlackBuild template
if [[ ! $(uname -m) =~ i.86 ]]; then # Automatically determine the architecture we're building on:
export ARCH=${ARCH:-$(uname -m)} if [[ -z "$ARCH" ]]; then
case "$( uname -m )" in
i?86) export ARCH=i486 ;;
arm*) export ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other
# archs:
*) export ARCH=$( uname -m ) ;;
esac
fi fi
# Set up BACKTITLE # Set up BACKTITLE