bugfix in SCRIPT_PATH re-ordering

This commit is contained in:
2016-09-06 16:00:53 +02:00
parent 93191ffd75
commit d5215e0a9d
+6 -8
View File
@@ -599,7 +599,11 @@ void registerModule(const char* module, const char* version, const char* locatio
putenvprintf("MODULE=%s", module);
putenvprintf("%s_VERSION=%s", module, version);
if (location) putenvprintf("%s_DIR=%s", module, m->content+lm+lv);
if (location)
{
putenvprintf("%s_DIR=%s", module, m->content+lm+lv);
insertDirIntoPath("SCRIPT_PATH", m->content+lm+lv);
}
/* only do registration register stuff at init */
if (interruptAccept) return;
@@ -681,10 +685,7 @@ static int findLibRelease (
*p=0; symname++; /* get "<module>" from "_<module>LibRelease" */
if ((p = strstr(name, "/" LIBDIR)) != NULL) p[1]=0; /* cut "<location>" before LIBDIR */
if (getLibVersion(symname) == NULL)
{
registerModule(symname, version, location);
insertDirIntoPath("SCRIPT_PATH", location);
}
}
dlclose(handle);
return 0;
@@ -733,10 +734,7 @@ static void registerExternalModules()
*p=0; symname++; /* get "<module>" from "_<module>LibRelease" */
if ((p = strstr(name, "\\" LIBDIR)) != NULL) p[1]=0; /* cut "<location>" before LIBDIR */
if (getLibVersion(symname) == NULL)
{
registerModule(symname, version, location);
insertDirIntoPath("SCRIPT_PATH", location);
}
}
}
}
@@ -1270,6 +1268,7 @@ static int require_priv(const char* module, const char* version, const char* arg
printf("require: library found in %s\n", dirname);
snprintf(filename, sizeof(filename), "%s%n", dirname, &releasediroffs);
putenvprintf("MODULE=%s", module);
insertDirIntoPath("SCRIPT_PATH", dirname);
}
else
{
@@ -1555,7 +1554,6 @@ loadlib:
filename[releasediroffs] = 0;
registerModule(module, found, filename);
}
insertDirIntoPath("SCRIPT_PATH", filename);
status = 0;