From ab21823ca2e3ecbaba0337d979b75704ae29ce6a Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Sun, 18 Feb 2018 18:00:31 -0700 Subject: [PATCH] devops: Punt redundant file-first-line. Use read-first-line. --- src/devops/build.scm | 7 ------- src/devops/devops.scm | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) 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)))) -- 2.25.1