]> err.no Git - sope/commitdiff
adjusted script to new Xcode versioning scheme
authorznek <znek@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Fri, 20 Jul 2007 18:01:37 +0000 (18:01 +0000)
committerznek <znek@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Fri, 20 Jul 2007 18:01:37 +0000 (18:01 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1514 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

maintenance/syncXcodeVersions.sh

index de2b2678570fa48c7a5dc9edd45b07a43996a1a5..80a512dda1705882ec356e1d168ba5fbcd87fb72 100755 (executable)
@@ -14,7 +14,7 @@ set_dylib_version() {
   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}
@@ -50,9 +50,8 @@ get_dylib_version () {
   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}"
 }
 
@@ -61,10 +60,6 @@ get_make_version() {
   # $1 project dir
   PROJECT=$1
 
-  # defaults
-  MAJOR_VERSION=$GLOBAL_MAJOR_VERSION
-  MINOR_VERSION=$GLOBAL_MINOR_VERSION
-
   CURRENT_PATH=""
   # split path
   IFS=/
@@ -73,7 +68,7 @@ get_make_version() {
     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() {
@@ -81,17 +76,11 @@ 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
 }
 
 
@@ -102,8 +91,9 @@ update_project_if_necessary() {
   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}"
@@ -122,11 +112,6 @@ update_project_if_necessary() {
 
 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