From 40fc035835d2ba1f9436c15810abce39e29ff7c3 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Wed, 2 Nov 2022 23:28:34 -0400 Subject: Updated to not generate needless attributes, and updated build commands to accomodate newer setups. --- README.md | 2 +- build.sh | 2 +- src/lpm.lua | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9ec195c..4644b11 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ If you want to build it quickly, and have the right modules installed, you can do: ``` -./build.sh -larchive -llzma -lz -lssl -lgit2 -lz -lcurl -lcrypto -llua +./build.sh -lz -lssl -lgit2 -lcurl -llua -lcrypto -larchive -llzma ``` CI is enabled on this repository, so you can grab Windows and Linux builds from the diff --git a/build.sh b/build.sh index a468bce..acd52bc 100755 --- a/build.sh +++ b/build.sh @@ -34,7 +34,7 @@ if [[ "$@" != *"-llzma"* ]]; then LDFLAGS="-Llib/liblzma/build -Llib/prefix/lib -l:liblzma.a $LDFLAGS" && CFLAGS="$CFLAGS -Ilib/prefix/include" fi if [[ "$@" != *"-larchive"* ]]; then - [ ! -e "lib/libarchive/build-tmp" ] && cd lib/libarchive && mkdir build-tmp && cd build-tmp && cmake .. -G "Unix Makefiles" $ARCHIVE_CONFIGURE -DZLIB_WINAPI_EXITCODE=0 -DENABLE_TEST=OFF -DZLIB_WINAPI_EXITCODE__TRYRUN_OUTPUT="test" -DENABLE_EXPAT=OFF -DENABLE_ACL=OFF -DENABLE_XATTR=OFF -DCMAKE_INSTALL_PREFIX=`pwd`/../../prefix -DBUILD_SHARED_LIBS=OFF -DENABLE_CAT=OFF -DENABLE_CPIO=OFF -DENABLE_BZip2=OFF -DENABLE_OPENSSL=OFF -DENABLE_LIBXML2=OFF -DENABLE_PCREPOSIX=OFF && $MAKE -j $JOBS && $MAKE install && cd ../../../ + [ ! -e "lib/libarchive/build-tmp" ] && cd lib/libarchive && mkdir build-tmp && cd build-tmp && cmake .. -G "Unix Makefiles" $ARCHIVE_CONFIGURE -DZLIB_WINAPI_EXITCODE=0 -DENABLE_TEST=OFF -DZLIB_WINAPI_EXITCODE__TRYRUN_OUTPUT="test" -DENABLE_EXPAT=OFF -DENABLE_ACL=OFF -DENABLE_XATTR=OFF -DCMAKE_INSTALL_PREFIX=`pwd`/../../prefix -DBUILD_SHARED_LIBS=OFF -DENABLE_CAT=OFF -DENABLE_CPIO=OFF -DENABLE_ZSTD=OFF -DENABLE_BZip2=OFF -DENABLE_OPENSSL=OFF -DENABLE_LIBXML2=OFF -DENABLE_PCREPOSIX=OFF && $MAKE -j $JOBS && $MAKE install && cd ../../../ [ ! -e "lib/prefix/lib/libarchive.a" ] && cp -f lib/prefix/lib/libarchive_static.a lib/prefix/lib/libarchive.a LDFLAGS="-Llib/libarchive/build-tmp -Llib/prefix/lib -l:libarchive.a $LDFLAGS" && CFLAGS="$CFLAGS -Ilib/prefix/include" fi diff --git a/src/lpm.lua b/src/lpm.lua index ef02c58..f8b730e 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -745,7 +745,7 @@ function Repository:generate_manifest() for line in io.lines(path .. PATHSEP .. "README.md") do local _, _, name, path, description = line:find("^%s*%|%s*%[`([%w_]+)%??.-`%]%((.-)%).-%|%s*(.-)%s*%|%s*$") if name then - plugin_map[name] = { name = name, description = description, files = {} } + plugin_map[name] = { name = name, description = description } if path:find("^http") then if path:find("%.lua") then plugin_map[name].url = path @@ -762,12 +762,12 @@ function Repository:generate_manifest() end for i, file in ipairs(system.ls(path .. plugin_dir)) do if file:find("%.lua$") then - local plugin = { description = nil, files = {}, name = common.basename(file):gsub("%.lua$", ""), dependencies = {}, mod_version = 3, version = "1.0", tags = {}, path = plugin_dir .. file } + local plugin = { description = nil, name = common.basename(file):gsub("%.lua$", ""), mod_version = 3, version = "1.0", path = plugin_dir .. file } for line in io.lines(path .. plugin_dir .. file) do local _, _, mod_version = line:find("%-%-.*mod%-version:%s*(%w+)") if mod_version then plugin.mod_version = mod_version end local _, _, required_plugin = line:find("require [\"']plugins.([%w_]+)") - if required_plugin then if required_plugin ~= plugin.name then plugin.dependencies[required_plugin] = ">=1.0" end end + if required_plugin then if required_plugin ~= plugin.name then if not plugin.dependencies then plugin.dependencies = {} end plugin.dependencies[required_plugin] = ">=1.0" end end end if plugin_map[plugin.name] then plugin = common.merge(plugin, plugin_map[plugin.name]) @@ -778,7 +778,7 @@ function Repository:generate_manifest() end for k, v in pairs(plugin_map) do if not v.plugin then - table.insert(plugins, common.merge({ dependencies = {}, mod_version = self.branch == "master" and 2 or 3, version = "1.0", tags = {} }, v)) + table.insert(plugins, common.merge({ mod_version = self.branch == "master" and 2 or 3, version = "1.0" }, v)) end end common.write(path .. PATHSEP .. "manifest.json", json.encode({ plugins = plugins })) -- cgit v1.2.3