Changeset 8372 in project


Ignore:
Timestamp:
02/11/08 12:24:32 (12 years ago)
Author:
Ivan Raikov
Message:

Added option --exclude.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/scripts/dpkg-eggs.scm

    r8368 r8372  
    66;;
    77
     8(require-extension srfi-1)
    89(require-extension srfi-13)
    910(require-extension posix)
     
    2526                       (s+ "enable verbose mode")
    2627                       (set! *verbose* #t))
     28    ,(args:make-option (exclude)       (required: "EGGS")   
     29                       (s+ "a comma separated list of eggs to exclude from building"))
    2730    ,(args:make-option (h help)  #:none               "Print help"
    2831                       (usage))
     
    6871  (let ((tags (s+ path dirsep "tags")))
    6972    (cond ((file-exists? tags)
    70            (let ((lst (read-subdirs tags)))
    71              (if (pair? lst) (car (reverse (sort lst version<)))
    72                  (error 'find-latest-tag "no releases found in " tags))))
     73           (let ((lst (filter-map (lambda (x) (and (not (string=? (pathname-strip-directory x) ".svn")) x))
     74                                  (read-subdirs tags)))
     75                 (cmp (lambda (x y) (version< (pathname-strip-directory x) (pathname-strip-directory y)))))
     76             (if (pair? lst) (car (reverse (sort lst cmp))) path)))
    7377          (else path))))
    7478           
     
    8185
    8286(define (build-deb eggdir output-dir path)
    83   (let* ((name     (pathname-file path))
     87  (let* ((name     (pathname-strip-directory path))
    8488         (release  (find-latest-release path))
    8589         (debdir   (find-debian-subdir path release)))
     
    97101
    98102(define (main options operands)
    99   (let ((opt_eggdir (alist-ref 'eggdir options))
     103  (let ((opt_eggdir  (alist-ref 'eggdir options))
     104        (opt_exclude ((lambda (x) (and x (string-split x ","))) (alist-ref 'exclude options)))
    100105        (opt_output-dir (alist-ref 'output-dir options)))
    101106    (if (not (and opt_eggdir opt_output-dir))
     
    110115          (message "Creating directory ~a" opt_output-dir)
    111116          (create-directory opt_output-dir)))
    112     (let ((eggdirs (or (and (pair? operands) (map (lambda (x) (s+ opt_eggdir dirsep (->string x))) operands))
    113                        (read-subdirs opt_eggdir))))
     117    (let ((eggdirs (filter-map
     118                    (lambda (x) (and (not (member (pathname-strip-directory x) opt_exclude)) x))
     119                    (or (and (pair? operands) (map (lambda (x) (s+ opt_eggdir dirsep (->string x))) operands))
     120                        (read-subdirs opt_eggdir)))))
    114121      (if (null? eggdirs)
    115122          (message "No egg directories found in ~a" opt_eggdir)
Note: See TracChangeset for help on using the changeset viewer.