| 1 | |
| 2 | |
| 3 | @@ -81,9 +81,6 @@
|
| 4 | (("after") :type string :optional t
|
| 5 | :documentation "SQL script to run after loading the data")
|
| 6 |
|
| 7 | - ("self-upgrade" :type string :optional t
|
| 8 | - :documentation "Path to pgloader newer sources")
|
| 9 | -
|
| 10 | ("regress" :type boolean :optional t
|
| 11 | :documentation "Drive regression testing")))
|
| 12 |
|
| 13 | @@ -130,33 +127,6 @@
|
| 14 | (command-line-arguments:show-option-help *opt-spec*)
|
| 15 | (when quit (uiop:quit +os-code-error-usage+)))
|
| 16 |
|
| 17 | -(defvar *self-upgraded-already* nil
|
| 18 | - "Keep track if we did reload our own source code already.")
|
| 19 | -
|
| 20 | -(defun self-upgrade (namestring &optional debug)
|
| 21 | - "Load pgloader sources at PATH-TO-PGLOADER-SOURCES."
|
| 22 | - (let ((pgloader-pathname (uiop:directory-exists-p
|
| 23 | - (uiop:parse-unix-namestring namestring))))
|
| 24 | - (unless pgloader-pathname
|
| 25 | - (format t "No such directory: ~s~%" namestring)
|
| 26 | - (uiop:quit +os-code-error+))
|
| 27 | -
|
| 28 | - ;; now the real thing
|
| 29 | - (handler-case
|
| 30 | - (handler-bind ((warning #'muffle-warning))
|
| 31 | - (let ((asdf:*central-registry* (list* pgloader-pathname
|
| 32 | - asdf:*central-registry*)))
|
| 33 | - (format t "Self-upgrading from sources at ~s~%"
|
| 34 | - (uiop:native-namestring pgloader-pathname))
|
| 35 | - (with-output-to-string (*standard-output*)
|
| 36 | - (asdf:load-system :pgloader
|
| 37 | - :verbose nil
|
| 38 | - :force-not *self-upgrade-immutable-systems*))))
|
| 39 | - (condition (c)
|
| 40 | - (format t "Fatal: ~a~%" c)
|
| 41 | - (format t "~a~%" *self-upgrade-immutable-systems*)
|
| 42 | - (when debug (invoke-debugger c))))))
|
| 43 | -
|
| 44 | (defun parse-summary-filename (summary debug)
|
| 45 | "Return the pathname where to write the summary output."
|
| 46 | (when summary
|
| 47 | @@ -199,7 +169,7 @@
|
| 48 | dry-run on-error-stop context
|
| 49 | ((:load-lisp-file load))
|
| 50 | client-min-messages log-min-messages summary
|
| 51 | - root-dir self-upgrade
|
| 52 | + root-dir
|
| 53 | with set field cast type encoding before after
|
| 54 | no-ssl-cert-verification
|
| 55 | regress)
|
| 56 | @@ -217,13 +187,6 @@
|
| 57 | verbose (member *client-min-messages* '(:info :debug :data))
|
| 58 | debug (member *client-min-messages* '(:debug :data))
|
| 59 | quiet (and (not verbose) (not debug)))
|
| 60 | -
|
| 61 | - ;; First thing: Self Upgrade?
|
| 62 | - (when self-upgrade
|
| 63 | - (unless *self-upgraded-already*
|
| 64 | - (self-upgrade self-upgrade debug)
|
| 65 | - (let ((*self-upgraded-already* t))
|
| 66 | - (main argv))))
|
| 67 |
|
| 68 | ;; --list-encodings, -E
|
| 69 | (when list-encodings
|