From a5c96abb935492c33a5f6a119b844c4de583b714 Mon Sep 17 00:00:00 2001 From: "Clea F. Rees" Date: Fri, 8 Nov 2024 06:07:27 +0000 Subject: [PATCH] fix breakage of uniquifying code due to use of fntdir and try to make uniquify do something more reasonable in non-standalone mode anyway --- fontinst.lua | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/fontinst.lua b/fontinst.lua index 96ce11c..7a617c5 100644 --- a/fontinst.lua +++ b/fontinst.lua @@ -1,4 +1,4 @@ --- $Id: fontinst.lua 10585 2024-11-08 03:31:12Z cfrees $ +-- $Id: fontinst.lua 10586 2024-11-08 06:06:22Z cfrees $ -- Build configuration for electrumadf -- l3build.pdf listing 1 tudalen 9 --[[ @@ -255,29 +255,42 @@ function uniquify (tag) local pkgbase = pkgbase or "" if standalone then dir = keepdir - if pkgbase == "" then - print("pkgbase unspecified. Trying to guess ... ") - if ctanpkg ~= module and module ~= "" and module ~= nil then - print("Guessing " .. module) - pkgbase = module - else - pkgbase = string.gsub(ctanpkg, "adf$", "") - if pkgbase ~= "" then - print("Guessing " .. pkgbase) - end - end - end else dir = fntdir - if pkgbase == "" then - local pkglist = filelist(dir,"*.sty") - if #pkglist ~= 0 then - pkgbase = pkglist[1] + end + if pkgbase == "" then + print("pkgbase unspecified. Trying to guess ... ") + if ctanpkg ~= module and module ~= "" and module ~= nil then + print("Guessing " .. module) + pkgbase = module + else + pkgbase = string.gsub(ctanpkg, "adf$", "") + if pkgbase ~= "" then + print("Guessing " .. pkgbase) end end end + if pkgbase == "" then + local pkglist = filelist(dir,"*.sty") + if #pkglist ~= 0 then + pkglist = filelist(unpackdir,"*.sty") + end + if #pkglist ~= 0 then + pkgbase = string.gsub(pkglist[1], "%.sty", "") + print("Guessing " .. pkgbase) + end + end + if pkgbase == "" then + pkgbase = "NotAMatchAtAll" + gwall("Guessing pkgbase ","",1) + end local encs = encs or filelist(dir,"*.enc") local maps = maps or filelist(dir,"*.map") + print("Uniquifying encodings ... ") + for _,i in ipairs(encs) do print(" " .. i) end + print("\nUniquifying maps ... ") + for _,i in ipairs(maps) do print(" " .. i) end + print(" ...\n") if #encs == 0 then return 0 else