(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)))
(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))))