Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 2.2
Fetching contributors…

Cannot retrieve contributors at this time

57 lines (49 sloc) 1.648 kb
(import irregex)
(use srfi-1 ports files posix)
(define (get-egg-dependencies meta-data #!key with-test-dependencies?
with-versions?)
(define (deps key)
(or (and-let* ((d (assq key meta-data)))
(cdr d))
'()))
(map (lambda (dep)
(if with-versions?
dep
(if (pair? dep)
(car dep)
dep)))
(append (deps 'depends)
(deps 'needs)
(if with-test-dependencies?
(deps 'test-depends)
'()))))
(define (cmd-line-arg option args)
;; Returns the argument associated to the command line option OPTION
;; in ARGS or #f if OPTION is not found in ARGS or doesn't have any
;; argument.
(let ((val (any (lambda (arg)
(irregex-match
`(seq ,(->string option) "=" (submatch (* any)))
arg))
args)))
(and val (irregex-match-substring val 1))))
(define (die . msg)
(with-output-to-port (current-error-port)
(lambda ()
(for-each display msg)
(newline)
(flush-output)))
(exit 1))
(define (mktempdir)
;; For compatibility with older chickens.
;; `create-temporary-directory' has been introduced by 4.6.0
(let loop ()
(let ((dir (make-pathname
(current-directory)
(string-append "salmonella-tmp-"
(number->string (random 1000000) 16)))))
(if (file-exists? dir)
(loop)
(begin
(create-directory dir)
dir)))))
Jump to Line
Something went wrong with that request. Please try again.