PageRenderTime 47ms CodeModel.GetById 44ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/core/packaging/macfuse/Install_resources/InstallationCheck

http://macfuse.googlecode.com/
Shell | 40 lines | 22 code | 6 blank | 12 comment | 4 complexity | e26b96b3e2a7e6f34e6c5626e87bfd86 MD5 | raw file
 1#!/bin/sh
 2#
 3# Copyright (C) 2008 Google. All Rights Reserved.
 4#
 5
 6PACKAGE_PATH=$1
 7# INSTALL_PATH=$2   <-- NOTE: This is always set to '/'
 8# INSTALL_VOLUME=$3 <-- NOTE: This is always set to '/'
 9# SYSTEM_ROOT=$4    <-- NOTE: This is always set to '/'
10
11VERSION_PATH="/System/Library/CoreServices/SystemVersion"
12if [ ! -f "/${VERSION_PATH}.plist" ]
13then
14  # Doesn't appear to have OS X installed.
15  exit 112
16fi
17
18VERSION=`/usr/bin/defaults read "$VOLUME/$VERSION_PATH" ProductVersion`
19if [ x"$VERSION" = x"" ]
20then
21  # Unable to get OS X version.
22  exit 113
23fi
24
25MAJOR=`echo "$VERSION" | /usr/bin/awk -F. '{ print $1 }'`
26MINOR=`echo "$VERSION" | /usr/bin/awk -F. '{ print $2 }'`
27if [ \( x"$MAJOR" = x"" \) -o \( x"$MINOR" = x"" \) ]
28then
29  # Unable to parse OS X version obtained from volume.
30  exit 114
31fi
32
33if [ \( $MAJOR -lt 10 \) -o \( $MINOR -lt 4 \) ]
34then
35  # Requires Mac OS X 10.4 or greater.
36  exit 115
37fi
38
39# Success!
40exit 0