]> err.no Git - sope/commitdiff
improved the script, prevent an error from happening
authorznek <znek@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Wed, 21 Feb 2007 07:27:14 +0000 (07:27 +0000)
committerznek <znek@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Wed, 21 Feb 2007 07:27:14 +0000 (07:27 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1435 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

maintenance/ChangeLog
maintenance/syncXcodeVersions.sh

index c0ef835d9a6ebefc68f6aefcfec3abfbc5f974f9..af2adca0525cf290893e0dbf56bb8acbccdc60d3 100644 (file)
@@ -1,3 +1,9 @@
+2007-02-21  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * syncXcodeVersions.sh: fixed substitution bug in case of
+         SUBMINOR_VERSION overflow (>255) - also check if resulting plist
+         is syntactically correct, abort on error
+
 2005-10-09  Helge Hess  <helge.hess@opengroupware.org>
 
        * make-osxmpkg.sh, make-osxpkg.sh: improved versioning support
index d40f63be5c9886330cb50234a0d29625e9ff93cd..de2b2678570fa48c7a5dc9edd45b07a43996a1a5 100755 (executable)
@@ -15,7 +15,13 @@ set_dylib_version() {
 
   # magic happens here
   sed "s/\(^[  ]*DYLIB_CURRENT_VERSION =[      ]*\)\(.*\)\(;.*$\)/\1${DYLIB_VERSION}\3/" "${PROJECT}" > "${PROJECT}.new"
-  mv ${PROJECT}.new ${PROJECT}
+  OK=`/usr/bin/plutil -lint ${PROJECT}.new | grep OK`
+  if [ "${OK}" != "" ]; then
+    mv ${PROJECT}.new ${PROJECT}
+  else
+    echo "ERROR: couldn't set version ($2) on $1!"
+    exit 6
+  fi
 }
 
 set_sope_versions() {
@@ -84,7 +90,7 @@ read_version_from_version_file() {
     MINOR_VERSION=${_MINOR_VERSION}
   fi
   # this is always set
-  SUBMINOR_VERSION=`sed -n 's/^SUBMINOR_VERSION.*=\(.*\)/\1/p' "${VERS_FILE}"`
+  SUBMINOR_VERSION=`sed -n 's/^SUBMINOR_VERSION.*=\(.*\)/\1/p' "${VERS_FILE}"|tail -1l`
 #  echo "${VERS_FILE} -> ${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION}"
 }