mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 10:31:02 +02:00
Get rid of some lib dependencies.
The charset business isn't worth depending on an AGPL licenced lib which is part of a huge Quicklisp system.
This commit is contained in:
parent
cb20cb7145
commit
35ca4927e9
@ -20,7 +20,6 @@
|
||||
#:drakma ; http client, download archives
|
||||
#:zip ; support for zip archive files
|
||||
#:flexi-streams ; streams
|
||||
#:com.informatimago.clext ; portable character-sets listings
|
||||
#:usocket ; UDP / syslog
|
||||
#:local-time ; UDP date parsing
|
||||
#:command-line-arguments ; for the main function
|
||||
@ -44,8 +43,10 @@
|
||||
"package"
|
||||
"logs"))
|
||||
|
||||
(:file "charsets":depends-on ("package"))
|
||||
(:file "utils" :depends-on ("params"
|
||||
"package"
|
||||
"charsets"
|
||||
"monitor"))
|
||||
|
||||
;; those are one-package-per-file
|
||||
|
||||
@ -1,16 +1,5 @@
|
||||
(in-package #:pgloader)
|
||||
|
||||
(defun list-encodings ()
|
||||
"List known encodings names and aliases from charsets::*lisp-encodings*."
|
||||
(format *standard-output* "Name ~30TAliases~%")
|
||||
(format *standard-output* "--------~30T--------------~%")
|
||||
(loop
|
||||
with encodings = (sort (copy-tree charsets::*lisp-encodings*) #'string<
|
||||
:key #'car)
|
||||
for (name . aliases) in encodings
|
||||
do (format *standard-output* "~a~30T~{~a~^, ~}~%" name aliases))
|
||||
(terpri))
|
||||
|
||||
(defun log-threshold (min-message &key quiet verbose debug)
|
||||
"Return the internal value to use given the script parameters."
|
||||
(cond ((and debug verbose) :data)
|
||||
@ -135,7 +124,7 @@
|
||||
(when (or help version) (uiop:quit))
|
||||
|
||||
(when list-encodings
|
||||
(list-encodings)
|
||||
(show-encodings)
|
||||
(uiop:quit))
|
||||
|
||||
(when upgrade-config
|
||||
|
||||
@ -55,7 +55,10 @@
|
||||
#:with-stats-collection
|
||||
#:slurp-file-into-string
|
||||
#:camelCase-to-colname
|
||||
#:make-kernel))
|
||||
#:make-kernel
|
||||
#:list-encodings-and-aliases
|
||||
#:show-encodings
|
||||
#:make-external-format))
|
||||
|
||||
|
||||
;;;
|
||||
@ -322,6 +325,5 @@
|
||||
(lparallel.queue lq)
|
||||
(simple-date date)
|
||||
(split-sequence sq)
|
||||
(com.informatimago.clext.character-sets charsets)
|
||||
(py-configparser ini))
|
||||
do (rename-package package package nicknames))
|
||||
|
||||
@ -1504,17 +1504,17 @@ load database
|
||||
;;
|
||||
(defun find-encoding-by-name-or-alias (encoding)
|
||||
"charsets::*lisp-encodings* is an a-list of (NAME . ALIASES)..."
|
||||
(loop for (name . aliases) in charsets::*lisp-encodings*
|
||||
for encoding-name = (when (or (string-equal name encoding)
|
||||
(member encoding aliases :test #'string-equal))
|
||||
name)
|
||||
until encoding-name
|
||||
finally (if encoding-name (return encoding-name)
|
||||
(error "The encoding '~a' is unknown" encoding))))
|
||||
(loop :for (name . aliases) :in (list-encodings-and-aliases)
|
||||
:for encoding-name := (when (or (string-equal name encoding)
|
||||
(member encoding aliases :test #'string-equal))
|
||||
name)
|
||||
:until encoding-name
|
||||
:finally (if encoding-name (return encoding-name)
|
||||
(error "The encoding '~a' is unknown" encoding))))
|
||||
|
||||
(defrule encoding (or namestring single-quoted-string)
|
||||
(:lambda (encoding)
|
||||
(charsets:make-external-format (find-encoding-by-name-or-alias encoding))))
|
||||
(make-external-format (find-encoding-by-name-or-alias encoding))))
|
||||
|
||||
(defrule file-encoding (? (and kw-with kw-encoding encoding))
|
||||
(:lambda (enc)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user