Paste number 339589: Unbound variable

Paste number 339589: Unbound variable
Pasted by: Apteryx
When:4 years, 9 months ago
Share:Tweet this! |
Paste contents:
Raw Source | XML | Display As
;;; Evaluating this yield:
;;; warning: possibly unbound variable `all-interfaces-minus-loop-loopback'
;;; Running it as a service fails with "unbound variable" message.

(eval-when (expand load eval)
  (set! %load-path (cons "/gnu/store/lb0vykjz6rnppk45qicnhlzhvpps6c0k-module-import" %load-path))
  (set! %load-compiled-path (cons "/gnu/store/xhzgngs3p14izb1zzild6wx0cc71yab5-module-import-compiled" %load-compiled-path)))
(begin (use-modules (shepherd service) (oop goops) (guix build utils) (guix build syscalls) (srfi srfi-1) (ice-9 regex))
       (make <service>
	 #:docstring (quote "Set up networking via DHCP.")
	 #:provides (quote (networking))
	 #:requires (quote ())
	 #:respawn? (quote #t)
	 #:start (lambda _
		   (define all-interfaces-minus-loopback
		     (remove loopback-network-interface? (all-network-interface-names)))
		   (define selected-interfaces
		     (delete-duplicates (map (lambda (iface-pattern)
					       (filter (lambda (iface) (string-match iface-pattern iface))
						       all-interfaces-minus-loop-loopback)) (quote ("")))))
		   (when all-interfaces-minus-loopback
		     (unless selected-interfaces (error "No interface selected! Available interfaces: "
							all-interfaces-minus-loopback " Interface regexps: "
							(quote ("")))))
		   (for-each set-network-interface-up selected-interfaces)
		   (let ((pid (fork+exec-command
			       (append (quote
					("/gnu/store/jd0w65dwqv11psmzk1pajwr5jswg73v6-isc-dhcp-4.3.5/sbin/dhclient" "-6" "-nw" "-pf" "/var/run/"))
		     (zero? (cdr (waitpid pid)))))
	 #:stop (make-kill-destructor)))

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.