From 7319af857e87ee44a15948988147357e12c20bc2 Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 9 Sep 2021 20:09:20 +1000 Subject: Symlink the shini once more. Catches the new shini Sandbox. --- src/sledjchisl/sledjchisl.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index d287007..6c1b5bb 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -1612,6 +1612,22 @@ void simNotFound(simData *simd, char *sim, char *type, int count, int window, in free(path); } +void simNotFoundAndLink(simData *simd, char *sim, char *type, int count, int window, int panes, int pane) +{ + char *link = xmprintf("%s/%s.shini", scBin, sim); + char *newPath = xmprintf("%s/%s.shini", scEtc, sim); + + simNotFound(simd, sim, type, count, window, panes, pane); + I("Symlinking %s to %s", newPath, link); + if (qfile_exist(link)) + { + if (shellMeFail("rm %s", link)) E("rm command failed!"); + } + if (0 != symlink(newPath, link)) + perror_msg("Symlinking %s to %s", newPath, link); + free(newPath); + free(link); +} void freeSimList(simList *sims) { @@ -1924,10 +1940,11 @@ simList *getSims() file = xmprintf("%s/sims.lua", scEtc); ourSims = xzalloc(sizeof(simList)); ourSims->byTab = qtreetbl(0); + ourSims->byUUID = qtreetbl(0); ourSims->unsorted = qtreetbl(0); ourSims->doIt = FALSE; ourSims->simsLua = Lua2tree(file, "sims"); - forEachSim(NULL, NULL, simNotFound); + forEachSim(NULL, NULL, simNotFoundAndLink); // dumpLuaTree(ourSims->simsLua, "simsLua", 0); // dumpLuaTree(ourSims->byTab, "byTab", 0); // dumpLuaTree(ourSims->unsorted, "unsorted", 0); -- cgit v1.1