From: Matt Birkholz <matt@birchwood-abbey.net>
Date: Mon, 19 Feb 2018 01:07:43 +0000 (-0700)
Subject: devops: load devops/config.scm
X-Git-Tag: mit-scheme-pucked-devops-0.5~4
X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=9226721059ecea01dc4c6d62fd5bd9f7d995dfcb;p=mit-scheme.git

devops: load devops/config.scm

The configuration file used to be loaded by the user.  Now it is
expected in devops/.

Use string-slice.
---

diff --git a/src/devops/devops.scm b/src/devops/devops.scm
index 0ac0b380f..cd397bc36 100644
--- a/src/devops/devops.scm
+++ b/src/devops/devops.scm
@@ -33,6 +33,7 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 	  (else (error "Unknown developer operation:" cmdl)))))
 
 (define (devops:status #!optional name)
+  (load "devops/config.scm")
   (if (default-object? name)
       (status)
       (plugin-status (->plugin name) (dirt))))
@@ -189,7 +190,7 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 	 (dir-len (string-length dir))
 	 (dir-end (fix:+ 3 dir-len)))
     (and (fix:> (string-length line) dir-end)
-	 (string=? dir (substring line 3 dir-end))
+	 (string=? dir (string-slice line 3 dir-end))
 	 (char=? #\/ (string-ref line dir-end)))))
 
 (define core-version-pattern
@@ -297,7 +298,7 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 		    (filter (let ((excludes (plugin-dir-prefixes)))
 			      (lambda (line)
 				(let* ((i (string-find-next-char line #\tab))
-				       (name (substring line (fix:1+ i))))
+				       (name (string-slice line (fix:1+ i))))
 				  (not (any (lambda (exclude)
 					      (string-prefix? exclude name))
 					    excludes)))))
@@ -372,6 +373,7 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 (define git-tag-create-options "")
 
 (define (devops:release #!optional plugin)
+  (load "devops/config.scm")
   (let ((dirt (shell-lines "git status --porcelain --untracked-files=no")))
     (cond ((default-object? plugin)
 	   (release-core (get-core-version) (get-core-changes) dirt #f))
@@ -505,9 +507,10 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 	  (else
 	   (error "version has not incremented:" version)))))
 
-;;;; Build Status
+;;;; Build
 
 (define (devops:build #!optional hostname)
+  (load "devops/config.scm")
   (let ((srcs (available-sources "devops"))
 	(hosts (hosts)))
     (if (null? hosts)