File: update.lsp

package info (click to toggle)
audacity 2.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 129,312 kB
  • sloc: ansic: 373,350; cpp: 276,880; sh: 56,060; python: 18,922; makefile: 10,309; lisp: 8,365; xml: 1,888; perl: 1,798; java: 1,551; asm: 545; pascal: 395; sed: 58; awk: 35
file content (79 lines) | stat: -rw-r--r-- 2,145 bytes parent folder | download | duplicates (15)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
;; update.lsp -- script to push changes into source directories

(load "makefile.lsp")    ; just to make sure we got the latest bindings


;; UPDATE-SOURCES -- makes a script to push changes into source directories
;;
(defun update-sources ()
  (let (outf)
    (load "transfiles.lsp") ; just to make sure we're current
    (setf outf (open "script" :direction :output))
    (format outf "#
# source this script file

# Source Paths: nyqsrc, cmtsrc, xlsrc, trnsrc
")
    (format outf "
#
# XLISP SOURCES
#
") 
    (file-update outf xlfiles ".c" "xlsrc")
    (file-update outf xlfiles-h ".h" "xlsrc")
    (file-update outf xlfiles-lsp ".lsp" "xlsrc")

    (format outf "
#
# NYQUIST SOURCES
#
")
    (file-update outf nyqfiles ".c" "nyqsrc")
    (file-update outf (exceptions-filter nyqfiles) ".h" "nyqsrc")
    (file-update outf nyqfiles-h ".h" "nyqsrc")
    (file-update outf nyqfiles-lsp ".lsp" "nyqsrc")
    (file-update outf makefiles "" "nyqsrc")

    (format outf "
#
# CMT SOURCES
#
")
    (file-update outf cmtfiles ".c" "cmtsrc")
    (file-update outf (exceptions-filter cmtfiles) ".h" "cmtsrc")
    (file-update outf cmtfiles-h ".h" "cmtsrc")

; don't write back machine generated trnsrc files
;    (file-update outf transfiles ".c" "trnsrc")
;    (file-update outf transfiles ".h" "trnsrc")

    (close outf)

    (format t "DONE writing script, 'source script' to copy files from~%")
    (format t "this directory to the source directories~%")

))
            

;; EXCEPTIONS-FILTER - remove .h files from list
; the depends-exceptions tells whether a .h file exists for a .c file
;; 
(defun exceptions-filter (files)
  (let (result)
    (dolist (f files)
      (let ((ex (assoc f depends-exceptions :test #'equal)))
        (cond (ex
               (if (and (cdr ex)
                          (string-search (strcat f ".h") (cadr ex)))
                   (push f result)))
              (t (push f result)))))
    result))


;; FILE-UPDATE -- write dependency for source files
;;
(defun file-update (outf files ext dir)
  (dolist (f files)
    (let ((fname (strcat f ext)))
      (format outf "cp -p ~A ~A/~A~%" fname dir fname))))