/[meta-cvs]/meta-cvs/F-94BF952D29F3DC3FFD457EFFCE570DB2
ViewVC logotype

Diff of /meta-cvs/F-94BF952D29F3DC3FFD457EFFCE570DB2

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8.2.1 by kaz, Sun Aug 25 18:20:44 2002 UTC revision 1.16 by kaz, Tue Nov 28 07:47:22 2006 UTC
# Line 2  Line 2 
2  ;;; which is distributed under the GNU license.  ;;; which is distributed under the GNU license.
3  ;;; Copyright 2002 Kaz Kylheku  ;;; Copyright 2002 Kaz Kylheku
4    
5  (require "mapping")  (in-package :meta-cvs)
 (require "system")  
 (require "print")  
 (require "seqfuncs")  
 (provide "types")  
6    
7  (eval-when (:compile-toplevel :load-toplevel :execute)  (eval-when (:compile-toplevel :load-toplevel :execute)
8    (defconstant *mcvs-types-name* "TYPES"))    (defconstant *types-file* "TYPES"))
9    
10  (eval-when (:compile-toplevel :load-toplevel :execute)  (eval-when (:compile-toplevel :load-toplevel :execute)
11    (defconstant *mcvs-types* #.(path-cat *mcvs-dir* *mcvs-types-name*))    (defconstant *types-path* #.(path-cat *admin-dir* *types-file*))
12    (defconstant *mcvs-new-types* #.(path-cat *mcvs-dir* "TYPES-NEW")))    (defconstant *types-new-path* #.(path-cat *admin-dir* "TYPES-NEW")))
13    
14  (defconstant *types-comments*  (defconstant *types-comments*
15  ";;; For each file suffix that appears in the file set, you can specify  ";;; For each file suffix that appears in the file set, you can specify
# Line 34  Line 30 
30    
31    
32  (defun types-read (filename)  (defun types-read (filename)
33    (with-open-file (file filename :direction :input)    (let ((*read-eval* nil))
34      (read file)))      (with-open-file (file filename :direction :input)
35          (read file))))
36    
37  (defun types-write (types filename &key comments)  (defun types-write (types filename &key comments)
38      (when *dry-run-option*
39        (chatter-debug "not writing to ~a because of -n global option.~%"
40                       *types-path*)
41        (return-from types-write))
42    (with-open-file (file filename :direction :output)    (with-open-file (file filename :direction :output)
43      (let ((sorted-types (sort (copy-list types)      (let ((sorted-types (sort (copy-list types)
44                                #'string-lessp :key #'first)))                                #'string-lessp :key #'first)))
# Line 115  Line 116 
116    (when types    (when types
117      (types-write types filename :comments *types-comments*)      (types-write types filename :comments *types-comments*)
118      (loop      (loop
119          (loop
120            (restart-case
121              (progn
122                (chatter-debug "Editing types.~%")
123                (unless (invoke-editor-on filename)
124                  (error "Failed to invoke text editor."))
125                (return))
126              (retry ()
127                :report "Try invoking editor again.")))
128        (restart-case        (restart-case
129          (progn          (let ((edited-types (types-read filename)))
130            (chatter-debug "Editing types.~%")            (types-sanity-check edited-types)
131            (invoke-editor-on filename)            (types-write edited-types filename)
132            (let ((edited-types (types-read filename)))            (return edited-types))
             (types-sanity-check edited-types)  
             (types-write edited-types filename)  
             (return edited-types)))  
133          (retry ()          (retry ()
134            :report "Correct file type treatment, try again.")            :report "Correct file type treatment, try again.")
135          (restore-types ()          (restore-types ()

Legend:
Removed from v.1.8.2.1  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.5