[54] | 1 | (perm-space) |
---|
| 2 | |
---|
| 3 | (printy (get_directory ".")) |
---|
| 4 | (break) |
---|
| 5 | |
---|
| 6 | (setq platform (platform)) |
---|
| 7 | |
---|
| 8 | ; Load up the messages for the language we are using |
---|
| 9 | (setq section upgrade_section) |
---|
| 10 | (load "lisp/english.lsp") |
---|
| 11 | |
---|
| 12 | |
---|
| 13 | ; Get the version this game is using so we can compare it later |
---|
| 14 | (load "lisp/version.lsp") |
---|
| 15 | (setq current clive_version) |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | (defun slash () |
---|
| 19 | (select platform |
---|
| 20 | ('WATCOM "\\") |
---|
| 21 | ('UNIX "/"))) |
---|
| 22 | |
---|
| 23 | (defun remove-slash (path) |
---|
| 24 | (if (equal (schar path (- (length path) 1)) (schar (slash) 0)) |
---|
| 25 | (concatenate 'string (hack-string 0 (- (length path) 2) path)) |
---|
| 26 | path)) |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | (defun hack-string (x1 x2 st) |
---|
| 30 | (if (<= x1 x2) |
---|
| 31 | (cons (schar st x1) (hack-string (+ x1 1) x2 st)) |
---|
| 32 | nil)) |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | (defun append-slash (path) |
---|
| 36 | (if (equal (schar path (- (length path) 1)) (schar (slash) 0)) |
---|
| 37 | path |
---|
| 38 | (concatenate 'string path (slash)))) |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | (defun sf (filename) (convert_slashes (concatenate 'string source_dir (slash) filename) (slash))) |
---|
| 42 | (defun tf (filename) (convert_slashes (concatenate 'string target_dir filename) (slash))) |
---|
| 43 | |
---|
| 44 | |
---|
| 45 | |
---|
| 46 | (defun go_there (path) |
---|
| 47 | (select platform |
---|
| 48 | ('WATCOM |
---|
| 49 | (if (and (< 2 (length path)) (eq (schar path 1) #\:)) |
---|
| 50 | (system (concatenate 'string (list (schar path 0) #\:)))) |
---|
| 51 | (chdir (remove-slash path))) |
---|
| 52 | ('UNIX (chdir path)))) |
---|
| 53 | |
---|
| 54 | |
---|
| 55 | (setq target_dir (get_cwd)) |
---|
| 56 | |
---|
| 57 | (setq error nil) |
---|
| 58 | |
---|
| 59 | |
---|
| 60 | (let ((source_dir (append-slash (nice_input enter_old_dir |
---|
| 61 | "dir>" |
---|
| 62 | (if (equal (platform) 'WATCOM) |
---|
| 63 | "c:\\abuse" |
---|
| 64 | "~/abuse")))) |
---|
| 65 | (start_dir (get_cwd))) |
---|
| 66 | (if (not (dir_exsist (remove-slash source_dir))) |
---|
| 67 | (print (concatenate 'string dir_not_here source_dir)) |
---|
| 68 | (progn |
---|
| 69 | (go_there source_dir) |
---|
| 70 | |
---|
| 71 | (if (and (load "lisp/version.lsp") (<= clive_version current)) |
---|
| 72 | (progn |
---|
| 73 | (print (concatenate 'string already_updated)) |
---|
| 74 | (print current) |
---|
| 75 | (print clive_version)) |
---|
| 76 | (progn |
---|
| 77 | (for i in '("levels/level05.spe" |
---|
| 78 | "levels/level06.spe" |
---|
| 79 | "levels/level07.spe" |
---|
| 80 | "levels/level08.spe" |
---|
| 81 | "levels/level09.spe" |
---|
| 82 | "levels/level10.spe" |
---|
| 83 | "levels/level11.spe" |
---|
| 84 | "levels/level12.spe" |
---|
| 85 | "levels/level13.spe" |
---|
| 86 | "levels/level14.spe" |
---|
| 87 | "levels/level15.spe" |
---|
| 88 | "levels/level16.spe" |
---|
| 89 | "levels/level17.spe" |
---|
| 90 | "levels/level18.spe" |
---|
| 91 | "register/alien.spe" |
---|
| 92 | "register/alienb.spe" |
---|
| 93 | "register/ant.lsp" |
---|
| 94 | "register/boss.spe" |
---|
| 95 | "register/english.lsp" |
---|
| 96 | "register/flyer.lsp" |
---|
| 97 | "register/galien.spe" |
---|
| 98 | "register/green2.spe" |
---|
| 99 | "register/micron.vcd" |
---|
| 100 | "register/people.lsp" |
---|
| 101 | "register/powerup.lsp" |
---|
| 102 | "register/readme.txt" |
---|
| 103 | "register/tiles.lsp" |
---|
| 104 | "register/trees.spe" |
---|
| 105 | "register/trees2.spe" |
---|
| 106 | "register/weapons.lsp") do |
---|
| 107 | (if (and (not error) |
---|
| 108 | (not (nice_copy updating |
---|
| 109 | (sf i) |
---|
| 110 | (tf i))) |
---|
| 111 | (setq error T) |
---|
| 112 | |
---|
| 113 | ))) |
---|
| 114 | (if (and (not error) |
---|
| 115 | (show_yes_no complete_title remove_old_reg yes-key no-key)) |
---|
| 116 | (print "delete stuff")) |
---|
| 117 | |
---|
| 118 | |
---|
| 119 | ))))) |
---|
| 120 | |
---|
| 121 | |
---|
| 122 | (go_there source_dir) |
---|
| 123 | |
---|