|
@@ -49,6 +49,8 @@ local NT = {}
|
|
-- Local path to URI mapping. For linking between newly created resources.
|
|
-- Local path to URI mapping. For linking between newly created resources.
|
|
local path_to_uri
|
|
local path_to_uri
|
|
|
|
|
|
|
|
+-- SIP processing directory.
|
|
|
|
+local proc_dir = path.join(sip.root_path, "proc")
|
|
|
|
|
|
-- Initialize libmagic database.
|
|
-- Initialize libmagic database.
|
|
local magic = libmagic.open(libmagic.MIME_TYPE, libmagic.NO_CHECK_COMPRESS )
|
|
local magic = libmagic.open(libmagic.MIME_TYPE, libmagic.NO_CHECK_COMPRESS )
|
|
@@ -82,7 +84,7 @@ local function generate_sip(ll_path)
|
|
local sip = {root_path = path.dirname(ll_path)}
|
|
local sip = {root_path = path.dirname(ll_path)}
|
|
path_to_uri = {}
|
|
path_to_uri = {}
|
|
|
|
|
|
- local tn_dir = path.join(sip.root_path, "proc", "tn")
|
|
|
|
|
|
+ local tn_dir = path.join(proc_dir, "tn")
|
|
dir.makepath(tn_dir)
|
|
dir.makepath(tn_dir)
|
|
|
|
|
|
local prev_path
|
|
local prev_path
|
|
@@ -392,7 +394,7 @@ M.deposit = function(ll_path, cleanup)
|
|
end
|
|
end
|
|
|
|
|
|
-- Remove processing directory.
|
|
-- Remove processing directory.
|
|
- dir.rmtree(path.join(sip.root_path, "proc"))
|
|
|
|
|
|
+ if path.isdir(proc_dir) then dir.rmtree(proc_dir) end
|
|
|
|
|
|
if cleanup then
|
|
if cleanup then
|
|
-- Gather all top-level directories and delete them.
|
|
-- Gather all top-level directories and delete them.
|