Проверка версий зависимостей
Добавил проверку версий установленных зависимостей паков.
This commit is contained in:
@@ -181,8 +181,9 @@ function check_dependencies(packinfo)
|
||||
return
|
||||
end
|
||||
for i,dep in ipairs(packinfo.dependencies) do
|
||||
local depid = dep:sub(2,-1)
|
||||
if dep:sub(1,1) == '!' then
|
||||
local depid, depver = unpack(string.split(dep:sub(2,-1), "@"))
|
||||
|
||||
if dep:sub(1,1) == '!' then
|
||||
if not table.has(packs_all, depid) then
|
||||
return string.format(
|
||||
"%s (%s)", gui.str("error.dependency-not-found"), depid
|
||||
@@ -192,6 +193,14 @@ function check_dependencies(packinfo)
|
||||
table.insert(required, depid)
|
||||
end
|
||||
end
|
||||
|
||||
local dep_pack = pack.get_info(depid);
|
||||
|
||||
if depver ~= "*" or depver ~= dep_pack.version then
|
||||
return string.format("%s (%s@%s != %s)", gui.str("error.dependency-version-not-met"), depid, dep_pack.version, depver);
|
||||
end
|
||||
|
||||
debug.print(packinfo);
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
@@ -7,6 +7,7 @@ world.convert-block-layouts=Blocks fields have changes! Convert world files?
|
||||
pack.remove-confirm=Do you want to erase all pack(s) content from the world forever?
|
||||
error.pack-not-found=Could not to find pack
|
||||
error.dependency-not-found=Dependency pack is not found
|
||||
error.dependency-version-not-met=Dependency pack version is not met.
|
||||
world.delete-confirm=Do you want to delete world forever?
|
||||
world.generators.default=Default
|
||||
world.generators.flat=Flat
|
||||
|
||||
@@ -32,6 +32,7 @@ devtools.output=Вывод
|
||||
|
||||
error.pack-not-found=Не удалось найти пакет
|
||||
error.dependency-not-found=Используемая зависимость не найдена
|
||||
error.dependency-version-not-met=Версия зависимости не соответствует необходимой
|
||||
pack.remove-confirm=Удалить весь поставляемый паком/паками контент из мира (безвозвратно)?
|
||||
|
||||
# Подсказки
|
||||
|
||||
Reference in New Issue
Block a user