Fix archive filename matching, recent regression.

The census test didn't pass anymore because I broke the archive filename
matching in b17383fa90b81408fa08566bc131ea5b02606023, where the special
variable *csv-path-root* stoped being authoritative in the archive case.

To fix, initialize that variable to nil and give its value priority as
soon as it's non-nil, such as the archive case.
This commit is contained in:
Dimitri Fontaine 2014-06-03 10:30:41 +02:00
parent 352a833400
commit b4dac6b684
2 changed files with 5 additions and 3 deletions

View File

@ -57,8 +57,8 @@
(defparameter *state* nil
"State of the current loading.")
(defparameter *csv-path-root*
(merge-pathnames "csv/" (user-homedir-pathname)))
(defparameter *csv-path-root* nil
"Where to load CSV files from, when loading from an archive.")
(defparameter *root-dir*
(make-pathname :directory "/tmp/pgloader/")

View File

@ -189,7 +189,9 @@
(:inline (car part)) ; because of &rest
(:stdin *standard-input*)
(:regex (destructuring-bind (keep regex root) part
(filter-directory regex :keep keep :root root)))
(filter-directory regex
:keep keep
:root (or *csv-path-root* root))))
(:filename (let* ((filename (first part))
(realname
(if (fad:pathname-absolute-p filename) filename