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

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

added branch-generator script

File size: 1.2 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    "chicken") )
17
18(define *release* #f)
19(define *eggs* #f)
20
21(let loop ((args (command-line-arguments)))
22  (match args
23    (() #f)
24    (("--dry-run" . more)
25     (dry-run #t)
26     (loop more) )
27    ((x . more)
28     (cond (*release*
29            (push! x *eggs*)
30            (loop more) )
31           (else
32            (set! *release* (make-pathname "release" x))
33            (loop more) ) ) ) ) )
34
35(unless *release*
36  (print "usage: make-branch.scm [--dry-run] RELEASE [FILENAME ...]")
37  (exit 1))
38
39(unless (file-exists? *release*)
40  (error "no such release or invalid working directory" *release*))
41
42(unless *eggs*
43  (set! *eggs*
44    (lset-difference 
45     string=?
46     (filter directory? (directory "."))
47     *ignore*)))
48
49(for-each
50 (lambda (egg)
51   (cond ((file-exists? (make-pathname *release* egg))
52          (print egg ": branch already exists") )
53         (else
54          (run (svn cp ,(make-pathname *repository* egg)
55                    ,(make-pathname (list *repository* *release*) egg) ) ) ) ) )
56 (reverse *eggs*))
Note: See TracBrowser for help on using the repository browser.