Changeset 13497


Ignore:
Timestamp:
Sep 17, 2012, 8:32:20 PM (9 years ago)
Author:
livings124
Message:

#5042 potential fix to building from a directory containing spaces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/third-party/miniupnp/updateminiupnpcstrings.sh

    r13332 r13497  
    66FILE=$3
    77TMPFILE=$3.tmp
     8echo "1 $VERSION_FILE"
     9echo "2 $TEMPLATE_FILE"
     10echo "3 $FILE"
     11echo "4 $TMPFILE"
    812
    913
     
    1216OS_VERSION=`uname -r`
    1317if [ -f /etc/debian_version ]; then
    14         OS_NAME=Debian
    15         OS_VERSION=`cat /etc/debian_version`
     18OS_NAME=Debian
     19OS_VERSION=`cat /etc/debian_version`
    1620fi
    1721# use lsb_release (Linux Standard Base) when available
    1822LSB_RELEASE=`which lsb_release`
    1923if [ 0 -eq $? -a -x "${LSB_RELEASE}" ]; then
    20         OS_NAME=`${LSB_RELEASE} -i -s`
    21         OS_VERSION=`${LSB_RELEASE} -r -s`
    22         case $OS_NAME in
    23                 Debian)
    24                         #OS_VERSION=`${LSB_RELEASE} -c -s`
    25                         ;;
    26                 Ubuntu)
    27                         #OS_VERSION=`${LSB_RELEASE} -c -s`
    28                         ;;
    29         esac
     24OS_NAME=`${LSB_RELEASE} -i -s`
     25OS_VERSION=`${LSB_RELEASE} -r -s`
     26case $OS_NAME in
     27Debian)
     28#OS_VERSION=`${LSB_RELEASE} -c -s`
     29;;
     30Ubuntu)
     31#OS_VERSION=`${LSB_RELEASE} -c -s`
     32;;
     33esac
    3034fi
    3135
    3236# on AmigaOS 3, uname -r returns "unknown", so we use uname -v
    3337if [ "$OS_NAME" = "AmigaOS" ]; then
    34         if [ "$OS_VERSION" = "unknown" ]; then
    35                 OS_VERSION=`uname -v`
    36         fi
     38if [ "$OS_VERSION" = "unknown" ]; then
     39OS_VERSION=`uname -v`
     40fi
    3741fi
    3842
    3943echo "Detected OS [$OS_NAME] version [$OS_VERSION]"
    40 MINIUPNPC_VERSION=`cat $VERSION_FILE`
     44MINIUPNPC_VERSION=`cat "$VERSION_FILE"`
    4145echo "MiniUPnPc version [${MINIUPNPC_VERSION}]"
    4246
    4347EXPR="s|OS_STRING \".*\"|OS_STRING \"${OS_NAME}/${OS_VERSION}\"|"
    44 #echo $EXPR
     48echo $EXPR
    4549test -f ${FILE}.in
    4650echo "setting OS_STRING macro value to ${OS_NAME}/${OS_VERSION} in $FILE."
    47 sed -e "$EXPR" < $TEMPLATE_FILE > $TMPFILE
     51sed -e "$EXPR" < "$TEMPLATE_FILE" > "$TMPFILE"
    4852
    4953EXPR="s|MINIUPNPC_VERSION_STRING \".*\"|MINIUPNPC_VERSION_STRING \"${MINIUPNPC_VERSION}\"|"
    5054echo "setting MINIUPNPC_VERSION_STRING macro value to ${MINIUPNPC_VERSION} in $FILE."
    51 sed -e "$EXPR" < $TMPFILE > $FILE
    52 rm $TMPFILE
     55sed -e "$EXPR" < "$TMPFILE" > "$FILE"
     56rm "$TMPFILE"
    5357
Note: See TracChangeset for help on using the changeset viewer.