From: Matt Birkholz Date: Mon, 19 Feb 2018 01:00:31 +0000 (-0700) Subject: devops: Punt redundant file-first-line. Use read-first-line. X-Git-Tag: mit-scheme-pucked-devops-0.5~5 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=ab21823ca2e3ecbaba0337d979b75704ae29ce6a;p=mit-scheme.git devops: Punt redundant file-first-line. Use read-first-line. --- diff --git a/src/devops/build.scm b/src/devops/build.scm index a2a326aca..2403d61a3 100644 --- a/src/devops/build.scm +++ b/src/devops/build.scm @@ -288,13 +288,6 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (define (file-lines . strings) (call-with-input-file (apply string strings) read-lines)) -(define (file-first-line filename) - (call-with-input-file filename - (lambda (in) - (let ((line (read-line in))) - (and (string? line) - line))))) - (define (read-lines port) (let loop ((lines '())) (let ((line (read-line port))) diff --git a/src/devops/devops.scm b/src/devops/devops.scm index c0d3c9731..0ac0b380f 100644 --- a/src/devops/devops.scm +++ b/src/devops/devops.scm @@ -111,7 +111,7 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (define (debian-version dir) (let* ((changelog (string dir"/debian/changelog")) (line (and (file-exists? changelog) - (file-first-line changelog))) + (read-first-line changelog))) (match (and line (regsexp-match-string debian-changelog-version-pattern line))))