source: trunk/third-party/miniupnp/updateminiupnpcstrings.sh @ 10046

Last change on this file since 10046 was 10046, checked in by charles, 13 years ago

(trunk) #2795 "non-GUI compilation issues on OS X 10.4" -- fixed for 1.90

  • Property svn:executable set to *
File size: 995 bytes
Line 
1#! /bin/sh
2# $Id: updateminiupnpcstrings.sh,v 1.4 2009/07/29 08:34:01 nanard Exp $
3
4TEMPLATE_FILE=$1
5OUTPUT_FILE=$2
6
7# detecting the OS name and version
8OS_NAME=`uname -s`
9OS_VERSION=`uname -r`
10if [ -f /etc/debian_version ]; then
11        OS_NAME=Debian
12        OS_VERSION=`cat /etc/debian_version`
13fi
14# use lsb_release (Linux Standard Base) when available
15LSB_RELEASE=`which lsb_release`
16if [ 0 -eq $? -a -x "${LSB_RELEASE}" ]; then
17        OS_NAME=`${LSB_RELEASE} -i -s`
18        OS_VERSION=`${LSB_RELEASE} -r -s`
19        case $OS_NAME in
20                Debian)
21                        #OS_VERSION=`${LSB_RELEASE} -c -s`
22                        ;;
23                Ubuntu)
24                        #OS_VERSION=`${LSB_RELEASE} -c -s`
25                        ;;
26        esac
27fi
28
29echo "Detected OS [$OS_NAME] version [$OS_VERSION]"
30
31EXPR="s|OS_STRING \".*\"|OS_STRING \"${OS_NAME}/${OS_VERSION}\"|"
32#echo $EXPR
33#echo "Backing up $OUTPUT_FILE to $OUTPUT_FILE.bak."
34#cp $OUTPUT_FILE $OUTPUT_FILE.bak
35test -f ${TEMPLATE_FILE}
36echo "setting OS_STRING macro value to ${OS_NAME}/${OS_VERSION} in $OUTPUT_FILE."
37sed -e "$EXPR" < $TEMPLATE_FILE > $OUTPUT_FILE
38
Note: See TracBrowser for help on using the repository browser.