Move 'setvbuf' shim to '(gash compat)'.
* tests/unit/shell.scm: Mode 'setvbuf' shim... * gash/compat.scm: ...here.
This commit is contained in:
parent
2d19d82444
commit
2d46b8b43e
|
@ -56,3 +56,14 @@
|
||||||
(define-public (exact-integer? x)
|
(define-public (exact-integer? x)
|
||||||
(and (integer? x) (exact? x))))
|
(and (integer? x) (exact? x))))
|
||||||
#f)
|
#f)
|
||||||
|
|
||||||
|
(cond-expand
|
||||||
|
((and guile-2 (not guile-2.2))
|
||||||
|
(define* (setvbuf port mode #:optional size)
|
||||||
|
(let ((mode (match mode
|
||||||
|
('none _IONBF)
|
||||||
|
('line _IOLBF)
|
||||||
|
('block _IOFBF))))
|
||||||
|
((@ (guile) setvbuf) port mode size)))
|
||||||
|
(export! setvbuf))
|
||||||
|
(else #f))
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
;;; along with Gash. If not, see <http://www.gnu.org/licenses/>.
|
;;; along with Gash. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
(define-module (test-shell)
|
(define-module (test-shell)
|
||||||
|
#:use-module (gash compat)
|
||||||
#:use-module (gash compat textual-ports)
|
#:use-module (gash compat textual-ports)
|
||||||
#:use-module (gash environment)
|
#:use-module (gash environment)
|
||||||
#:use-module (gash shell)
|
#:use-module (gash shell)
|
||||||
|
@ -64,16 +65,6 @@
|
||||||
(delete-recursively directory)
|
(delete-recursively directory)
|
||||||
result))
|
result))
|
||||||
|
|
||||||
(cond-expand
|
|
||||||
((and guile-2 (not guile-2.2))
|
|
||||||
(define* (setvbuf port mode #:optional size)
|
|
||||||
(let ((mode (match mode
|
|
||||||
('none _IONBF)
|
|
||||||
('line _IOLBF)
|
|
||||||
('block _IOFBF))))
|
|
||||||
((@ (guile) setvbuf) port mode size))))
|
|
||||||
(else #f))
|
|
||||||
|
|
||||||
(define (%make-script object . forms)
|
(define (%make-script object . forms)
|
||||||
(define (write-script port)
|
(define (write-script port)
|
||||||
(chmod port #o755)
|
(chmod port #o755)
|
||||||
|
|
Loading…
Reference in New Issue