changeset 1732:76872ffc03a3 vext

Update Vext and lock file
author Chris Cannam
date Mon, 10 Jul 2017 13:46:20 +0100
parents 5185ee58c44b
children d6d7c74c7eb7
files vext-lock.json vext.sml
diffstat 2 files changed, 64 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/vext-lock.json	Mon Jul 10 12:55:47 2017 +0100
+++ b/vext-lock.json	Mon Jul 10 13:46:20 2017 +0100
@@ -1,46 +1,46 @@
-{
-  "libraries": {
-    "vamp-plugin-sdk": {
-      "pin": "5d9af3140f05"
-    },
-    "svcore": {
-      "pin": "09751743647e"
-    },
-    "svgui": {
-      "pin": "14dcdc596baf"
-    },
-    "svapp": {
-      "pin": "72b4870f0e6b"
-    },
-    "checker": {
-      "pin": "cf18645ff411"
-    },
-    "piper": {
-      "pin": "169626171d22e6c49c6bc4759283406f4336a5cb"
-    },
-    "piper-cpp": {
-      "pin": "b146634c3686168a9d4bb739986d065b5d2d40a2"
-    },
-    "dataquay": {
-      "pin": "807b55408d9e"
-    },
-    "bqvec": {
-      "pin": "e345a5e32c53"
-    },
-    "bqfft": {
-      "pin": "81b50ec12d9a"
-    },
-    "bqresample": {
-      "pin": "39a30cdbb421"
-    },
-    "bqaudioio": {
-      "pin": "d90244c003be"
-    },
-    "sv-dependency-builds": {
-      "pin": "a69c1527268d"
-    },
-    "icons/scalable": {
-      "pin": "3d2cde3b1ab3"
-    }
-  }
-}
+{
+  "libraries": {
+    "vamp-plugin-sdk": {
+      "pin": "5d9af3140f05"
+    },
+    "svcore": {
+      "pin": "09751743647e"
+    },
+    "svgui": {
+      "pin": "14dcdc596baf"
+    },
+    "svapp": {
+      "pin": "72b4870f0e6b"
+    },
+    "checker": {
+      "pin": "cf18645ff411"
+    },
+    "piper": {
+      "pin": "169626171d22e6c49c6bc4759283406f4336a5cb"
+    },
+    "piper-cpp": {
+      "pin": "b146634c3686168a9d4bb739986d065b5d2d40a2"
+    },
+    "dataquay": {
+      "pin": "807b55408d9e"
+    },
+    "bqvec": {
+      "pin": "e345a5e32c53"
+    },
+    "bqfft": {
+      "pin": "81b50ec12d9a"
+    },
+    "bqresample": {
+      "pin": "39a30cdbb421"
+    },
+    "bqaudioio": {
+      "pin": "d90244c003be"
+    },
+    "sv-dependency-builds": {
+      "pin": "a69c1527268d"
+    },
+    "icons/scalable": {
+      "pin": "3d2cde3b1ab3"
+    }
+  }
+}
--- a/vext.sml	Mon Jul 10 12:55:47 2017 +0100
+++ b/vext.sml	Mon Jul 10 13:46:20 2017 +0100
@@ -889,11 +889,12 @@
           | Json.ERROR e => raise Fail ("Failed to parse file: " ^ e)
 
     fun save_json_to filename json =
+        (* using binary I/O to avoid ever writing CR/LF line endings *)
         let val jstr = Json.serialiseIndented json
-            val stream = TextIO.openOut filename
+            val stream = BinIO.openOut filename
         in
-            TextIO.output (stream, jstr);
-            TextIO.closeOut stream
+            BinIO.output (stream, Byte.stringToBytes jstr);
+            BinIO.closeOut stream
         end
                                   
     fun lookup_optional json kk =
@@ -1435,7 +1436,11 @@
         }
     end
 
-fun load_project (userconfig : userconfig) rootpath use_locks : project =
+datatype pintype =
+         NO_LOCKFILE |
+         USE_LOCKFILE
+        
+fun load_project (userconfig : userconfig) rootpath pintype : project =
     let val spec_file = FileBits.project_spec_path rootpath
         val lock_file = FileBits.project_lock_path rootpath
         val _ = if OS.FileSys.access (spec_file, [OS.FileSys.A_READ])
@@ -1447,7 +1452,7 @@
                                  ".\nPlease ensure the spec file is in the " ^
                                  "project root and run this from there.")
         val spec_json = JsonBits.load_json_from spec_file
-        val lock_json = if use_locks
+        val lock_json = if pintype = USE_LOCKFILE
                         then JsonBits.load_json_from lock_file
                              handle IO.Io _ => Json.OBJECT []
                         else Json.OBJECT []
@@ -1607,15 +1612,15 @@
         return_code
     end
 
-fun load_local_project use_locks =
+fun load_local_project pintype =
     let val userconfig = load_userconfig ()
         val rootpath = OS.FileSys.getDir ()
     in
-        load_project userconfig rootpath use_locks
+        load_project userconfig rootpath pintype
     end    
 
-fun with_local_project use_locks f =
-    let val return_code = f (load_local_project use_locks)
+fun with_local_project pintype f =
+    let val return_code = f (load_local_project pintype)
                           handle e =>
                                  (print ("Failed with exception: " ^
                                          (exnMessage e) ^ "\n");
@@ -1625,10 +1630,10 @@
         return_code
     end
         
-fun review () = with_local_project false review_project
-fun status () = with_local_project false status_of_project
-fun update () = with_local_project false update_project
-fun install () = with_local_project true update_project
+fun review () = with_local_project NO_LOCKFILE review_project
+fun status () = with_local_project NO_LOCKFILE status_of_project
+fun update () = with_local_project NO_LOCKFILE update_project
+fun install () = with_local_project USE_LOCKFILE update_project
 
 fun version () =
     (print ("v" ^ vext_version ^ "\n");