subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1660013 - in /subversion/trunk/tools/buildbot/slaves/svn-x64-macosx: mkramdisk.sh rmramdisk.sh
Date Mon, 16 Feb 2015 01:41:17 GMT
Author: brane
Date: Mon Feb 16 01:41:16 2015
New Revision: 1660013

URL: http://svn.apache.org/r1660013
Log:
Don't insist in having a RAMdisk config file if the RAMdisk isn't mounted.

* tools/buildbot/slaves/svn-x64-macosx/mkramdisk.sh,
  tools/buildbot/slaves/svn-x64-macosx/rmramdisk.sh:
   Make mount/unmount conditions less strict.

Modified:
    subversion/trunk/tools/buildbot/slaves/svn-x64-macosx/mkramdisk.sh
    subversion/trunk/tools/buildbot/slaves/svn-x64-macosx/rmramdisk.sh

Modified: subversion/trunk/tools/buildbot/slaves/svn-x64-macosx/mkramdisk.sh
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/buildbot/slaves/svn-x64-macosx/mkramdisk.sh?rev=1660013&r1=1660012&r2=1660013&view=diff
==============================================================================
--- subversion/trunk/tools/buildbot/slaves/svn-x64-macosx/mkramdisk.sh (original)
+++ subversion/trunk/tools/buildbot/slaves/svn-x64-macosx/mkramdisk.sh Mon Feb 16 01:41:16
2015
@@ -25,7 +25,7 @@ if [ -z "$1" ]; then
 fi
 
 if [ -z "$2" ]; then
-    echo "Missing parameter: device name file"
+    echo "Missing parameter: RAMdisk config file"
     exit 1
 fi
 
@@ -34,11 +34,11 @@ ramconf="$2"
 
 ramconfpath=$(dirname "${ramconf}")
 if [ ! -d "${ramconfpath}" ]; then
-    echo "Missing device name parent: ${ramconfpath}"
+    echo "Missing RAMdisk config file path: ${ramconfpath}"
     exit 1
 fi
 if [ -f "${ramconf}" ]; then
-    echo "Device name file exists: ${ramconf}"
+    echo "RAMdisk config file exists: ${ramconf}"
     exit 1
 fi
 
@@ -47,21 +47,17 @@ if [ -d "${volume}" ]; then
     exit 1
 fi
 
-mount | grep "^/dev/disk[0-9]* on ${volume} (hfs" >/dev/null && {
-    mountpoint=$(mount | grep "^/dev/disk[0-9]* on ${volume} (hfs")
-    echo "Already mounted: ${mountpoint}"
-    exit 1
-}
-
-set -e
-echo -n "" > "${ramconf}"
+mount | grep "^/dev/disk[0-9][0-9]* on ${volume} (hfs" >/dev/null || {
+    set -e
+    echo -n "" > "${ramconf}"
+
+    # Make sure we strip trailing spaces from the result of older
+    # versions of hduitil.
+    device=$(echo $(hdiutil attach -nomount ram://900000))
+    newfs_hfs -M 0700 -v "$1" "${device}"
+    hdiutil mountvol "${device}"
 
-# Make sure we strip trailing spaces from the result of older
-# versions of hduitil.
-device=$(echo $(hdiutil attach -nomount ram://900000))
-newfs_hfs -M 0700 -v "$1" "${device}"
-hdiutil mountvol "${device}"
-
-echo -n "${device}" > "${ramconf}"
+    echo -n "${device}" > "${ramconf}"
+}
 
 exit 0

Modified: subversion/trunk/tools/buildbot/slaves/svn-x64-macosx/rmramdisk.sh
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/buildbot/slaves/svn-x64-macosx/rmramdisk.sh?rev=1660013&r1=1660012&r2=1660013&view=diff
==============================================================================
--- subversion/trunk/tools/buildbot/slaves/svn-x64-macosx/rmramdisk.sh (original)
+++ subversion/trunk/tools/buildbot/slaves/svn-x64-macosx/rmramdisk.sh Mon Feb 16 01:41:16
2015
@@ -25,7 +25,7 @@ if [ -z "$1" ]; then
 fi
 
 if [ -z "$2" ]; then
-    echo "Missing parameter: device name file"
+    echo "Missing parameter: RAMdisk config file"
     exit 1
 fi
 
@@ -33,7 +33,11 @@ volume="/Volumes/$1"
 ramconf="$2"
 
 if [ ! -f "${ramconf}" ]; then
-    echo "Device name missing: ${ramconf}"
+    mount | grep "^/dev/disk[0-9][0-9]* on ${volume} (hfs" || {
+        echo "Not mounted: ${volume}"
+        exit 0
+    }
+    echo "Missing RAMdisk config file: ${ramconf}"
     exit 1
 fi
 
@@ -49,13 +53,10 @@ if [ "${device}" != "${devfmt}" ]; then
     exit 1
 fi
 
-mount | grep "^${device} on ${volume} (hfs" >/dev/null || {
-    echo "Not mounted: ${device} on ${volume}"
-    exit 1
+mount | grep "^${device} on ${volume} (hfs" >/dev/null && {
+    set -e
+    rm "${ramconf}"
+    hdiutil detach "${device}" -force
 }
 
-set -e
-rm "${ramconf}"
-hdiutil detach "${device}" -force
-
 exit 0



Mime
View raw message