-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmake-archive-lib.rkt
More file actions
33 lines (31 loc) · 1.24 KB
/
Copy pathmake-archive-lib.rkt
File metadata and controls
33 lines (31 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#lang racket/base
(require racket/system
racket/file
"config.rkt"
"archive.rkt"
"path-utils.rkt"
"dirstruct.rkt")
(define (make-archive rev)
(define archive-path (revision-archive rev))
(cond [(file-exists? archive-path)
(printf "r~a is already archived\n" rev)
#t]
[(zero? (modulo rev 100))
(printf "r~a is saved for posterity\n" rev)
#t]
[else
(define tmp-path (make-temporary-file))
(printf "Archiving r~a\n" rev)
(safely-delete-directory (revision-trunk.tgz rev))
(safely-delete-directory (revision-trunk.tar.7z rev))
(create-archive tmp-path (revision-dir rev))
(rename-file-or-directory tmp-path archive-path)
(safely-delete-directory (build-path (revision-dir rev) "test"))
(safely-delete-directory (revision-log-dir rev))
(safely-delete-directory (revision-analyze-dir rev))
(for ([x (in-list '("analyzed" "archiving-done" "checkout-done"
"commit-msg" "integrated" "timing-done"
"recompressing"))])
(safely-delete-directory (build-path (revision-dir rev) x)))
#f]))
(provide make-archive)