Skip to content

Commit

Permalink
Add previous made fixes (TRAC-6079, TRAC-5867, etc.)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedld committed Jan 2, 2017
1 parent c6b2bdd commit 314a94b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions updateminiupnpcstrings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
# project miniupnp : http://miniupnp.free.fr/
# (c) 2009 Thomas Bernard

FILE=miniupnpcstrings.h
TMPFILE=miniupnpcstrings.h.tmp
TEMPLATE_FILE=${FILE}.in
VERSION_FILE="$1"
TEMPLATE_FILE="$2"
FILE="$3"
TMPFILE="$3.tmp"

# detecting the OS name and version
OS_NAME=`uname -s`
Expand Down Expand Up @@ -37,17 +38,17 @@ if [ "$OS_NAME" = "AmigaOS" ]; then
fi

echo "Detected OS [$OS_NAME] version [$OS_VERSION]"
MINIUPNPC_VERSION=`cat VERSION`
MINIUPNPC_VERSION=`cat "${VERSION_FILE}"`
echo "MiniUPnPc version [${MINIUPNPC_VERSION}]"

EXPR="s|OS_STRING \".*\"|OS_STRING \"${OS_NAME}/${OS_VERSION}\"|"
#echo $EXPR
test -f ${FILE}.in
test -f "${FILE}.in"
echo "setting OS_STRING macro value to ${OS_NAME}/${OS_VERSION} in $FILE."
sed -e "$EXPR" < $TEMPLATE_FILE > $TMPFILE
sed -e "$EXPR" < "$TEMPLATE_FILE" > "$TMPFILE"

EXPR="s|MINIUPNPC_VERSION_STRING \".*\"|MINIUPNPC_VERSION_STRING \"${MINIUPNPC_VERSION}\"|"
echo "setting MINIUPNPC_VERSION_STRING macro value to ${MINIUPNPC_VERSION} in $FILE."
sed -e "$EXPR" < $TMPFILE > $FILE
rm $TMPFILE
sed -e "$EXPR" < "$TMPFILE" > "$FILE"
rm "$TMPFILE"

0 comments on commit 314a94b

Please sign in to comment.