fi
# magic happens here
- sed "s/\(^[ ]*DYLIB_CURRENT_VERSION =[ ]*\)\(.*\)\(;.*$\)/\1${DYLIB_VERSION}\3/" "${PROJECT}" > "${PROJECT}.new"
+ sed "s/\(^[ ]*DYLIB_CURRENT_VERSION =[ ]*\)\(.*\)\(;.*$\)/\1\"${DYLIB_VERSION}\"\3/" "${PROJECT}" > "${PROJECT}.new"
OK=`/usr/bin/plutil -lint ${PROJECT}.new | grep OK`
if [ "${OK}" != "" ]; then
mv ${PROJECT}.new ${PROJECT}
fi
VERSION_NUM=$(sed -n 's/^[ ]*DYLIB_CURRENT_VERSION =[ ]*\(.*\);.*$/\1/p' "${PROJECT}" | sort | uniq)
- if [ "${VERSION_NUM}" = "" ] ; then
- echo ""
- fi
+ VERSION_NUM=${VERSION_NUM#\"}
+ VERSION_NUM=${VERSION_NUM%\"}
echo "${VERSION_NUM}"
}
# $1 project dir
PROJECT=$1
- # defaults
- MAJOR_VERSION=$GLOBAL_MAJOR_VERSION
- MINOR_VERSION=$GLOBAL_MINOR_VERSION
-
CURRENT_PATH=""
# split path
IFS=/
CURRENT_PATH="${CURRENT_PATH}${p}/"
read_version_from_version_file "${CURRENT_PATH}Version"
done
- echo "${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION}"
+ echo "\$(SOPE_MAJOR_VERSION).\$(SOPE_MINOR_VERSION).${SUBMINOR_VERSION}"
}
read_version_from_version_file() {
if [ ! -r "${VERS_FILE}" ]; then
return
fi
- _MAJOR_VERSION=`sed -n 's/^MAJOR_VERSION=\(.*\)/\1/p' "${VERS_FILE}"`
- if [ "${_MAJOR_VERSION}" != "" ]; then
- MAJOR_VERSION=${_MAJOR_VERSION}
- fi
- _MINOR_VERSION=`sed -n 's/^MINOR_VERSION=\(.*\)/\1/p' "${VERS_FILE}"`
- if [ "${_MINOR_VERSION}" != "" ]; then
- MINOR_VERSION=${_MINOR_VERSION}
- fi
# this is always set
SUBMINOR_VERSION=`sed -n 's/^SUBMINOR_VERSION.*=\(.*\)/\1/p' "${VERS_FILE}"|tail -1l`
-# echo "${VERS_FILE} -> ${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION}"
+ if [ "$SUBMINOR_VERSION" = "" ]; then
+ SUBMINOR_VERSION=0
+ fi
}
PROJECT_NAME=${PROJECT##*/}
PROJECT_NAME=${PROJECT_NAME%%.xcode}
+# echo $PROJECT_NAME
PROJECT_DYLIB_VERSION=`get_dylib_version "${PROJECT}"`
- if [ "${PROJECT_DYLIB_VERSION}" != "" ]; then
+ if [ "${PROJECT_DYLIB_VERSION}" != "" -a "${PROJECT_DYLIB_VERSION#*SOPE_MAJOR_VERSION*}" != "${PROJECT_DYLIB_VERSION}" ]; then
PROJECT_MAKE_VERSION=`get_make_version "${PROJECT}"`
if [ "${PROJECT_DYLIB_VERSION}" != "${PROJECT_MAKE_VERSION}" ]; then
echo "Updating $PROJECT_NAME: ${PROJECT_DYLIB_VERSION} -> ${PROJECT_MAKE_VERSION}"
PROJECT_ROOT=.
-# source in MAJOR_VERSION and MINOR_VERSION
-source ${PROJECT_ROOT}/Version
-GLOBAL_MAJOR_VERSION=$MAJOR_VERSION
-GLOBAL_MINOR_VERSION=$MINOR_VERSION
-
PROJECTS=`find ${PROJECT_ROOT} -type d -name "*.xcodeproj"`
for PROJECT in $PROJECTS
do