source: project/maintenance/make-branch.scm @ 7762

Last change on this file since 7762 was 7762, checked in by felix winkelmann, 12 years ago

make-branch generates egg list

File size: 2.0 KB
Line 
1;;;; make-branch.scm - Copy egg directories into release branch - felix
2;
3; (call without arguments for usage information)
4
5
6(use utils runcmd miscmacros srfi-1)
7
8
9(run-verbose #t)
10
11(define *repository*
12  "https://galinha.ucpel.tche.br/svn/chicken-eggs")
13
14(define *ignore*
15  '("maintenance"
16    "release"
17    "doc-indices"
18    "wiki"
19    "salmonella-custom-feeds"
20    "chicken") )
21
22(define *release* #f)
23(define *eggs* #f)
24
25(let loop ((args (command-line-arguments)))
26  (match args
27    (() #f)
28    (("--dry-run" . more)
29     (dry-run #t)
30     (loop more) )
31    ((x . more)
32     (cond (*release*
33            (push! x *eggs*)
34            (loop more) )
35           (else
36            (set! *release* (make-pathname "release" x))
37            (loop more) ) ) ) ) )
38
39(unless *release*
40  (print "usage: make-branch.scm [--dry-run] RELEASE [FILENAME ...]")
41  (exit 1))
42
43(unless (file-exists? *release*)
44  (error "no such release or invalid working directory" *release*))
45
46(unless *eggs*
47  (set! *eggs*
48    (lset-difference 
49     string=?
50     (filter directory? (directory "."))
51     *ignore*)))
52
53(unless (dry-run)
54  (print* "\nCopying " (length *eggs*) " eggs into release branch " *release*
55          ".\n\n  Do you want to continue? ")
56  (unless (string=? "yes" (read-line))
57    (print "aborted.")
58    (exit) ) )
59
60(define *eggfile* (open-output-file "egg.list"))
61
62(for-each
63 (lambda (egg)
64   (cond ((file-exists? (make-pathname *release* egg))
65          (print egg ": branch already exists") )
66         (else
67          (when (and (not (null? (directory egg)))
68                     (or (file-exists? (make-pathname egg "trunk"))
69                         (file-exists? (make-pathname egg egg "setup")) 
70                         (begin
71                           (print* "\n`" egg "' doesn't seem to be an egg. Copy? ")
72                           (string=? "yes" 
73                                     (if (dry-run) "no" (read-line)))) ) )
74                (fprintf *eggfile* "~a~%" egg)
75                (run (svn cp 
76                      -m ,(conc "\"creating branch " *release* "\"")
77                      ,(make-pathname *repository* egg)
78                      ,(make-pathname (list *repository* *release*) egg) ) ) ) ) ) )
79 (reverse *eggs*))
80
81(close-output-port *eggfile*)
Note: See TracBrowser for help on using the repository browser.