]> err.no Git - sope/blobdiff - maintenance/syncXcodeVersions.sh
improved the script, prevent an error from happening
[sope] / maintenance / syncXcodeVersions.sh
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}"
 }