From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 03 07:54:51 2021 Received: (at 49828) by debbugs.gnu.org; 3 Aug 2021 11:54:51 +0000 Received: from localhost ([127.0.0.1]:39962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAt0V-0000xa-Gm for submit@debbugs.gnu.org; Tue, 03 Aug 2021 07:54:51 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:47990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAt0T-0000xP-JR for 49828@debbugs.gnu.org; Tue, 03 Aug 2021 07:54:50 -0400 Received: from nijino.local (194-118-35-216.adsl.highway.telekom.at [194.118.35.216]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4GfCwP4dLRz1LBRt; Tue, 3 Aug 2021 13:54:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4GfCwP4dLRz1LBRt DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1627991686; bh=UklFGjc63dRK9ry6fJntIctDO33NJR4YK4TygOlyk4o=; h=Subject:From:To:Date:In-Reply-To:References:From; b=EfEebbnFlhRlQ1Xp1BJLonUHN531AJNKfdSvAAPwBtYr4fApaYvSxYBqQ1Fi0Q4PA ZFHlLF/EgbM4F91z8a0Enl/x/0Z78tRd8362EyRhgxODvfRJKBk6Wbjt4OY201P6kE uJNfZL+KOME5wK4N5oL6jQZNmJcIJQ4q1P4l5yRk= Message-ID: Subject: Re: [PATCH 02/20] gnu: minetest: Search for mods in MINETEST_MOD_PATH. From: Leo Prikler To: Maxime Devos , 49828@debbugs.gnu.org Date: Tue, 03 Aug 2021 13:54:44 +0200 In-Reply-To: <52f3bab58e39a8d6cd9db175f2abf883008a69f0.camel@telenet.be> References: <20210802155019.6122-1-maximedevos@telenet.be> <20210802155019.6122-2-maximedevos@telenet.be> <87207455fefb91bb3e12fdb3209f28f11dab92e0.camel@student.tugraz.at> <97f899a616812a0086a68ee97c36d1531e04c2e3.camel@telenet.be> <19c7cec42e57899c62ba6b4ff7f297a3e5bc2be4.camel@student.tugraz.at> <9cc691b6c242e31edcc1215d259eab9306715708.camel@telenet.be> <52f3bab58e39a8d6cd9db175f2abf883008a69f0.camel@telenet.be> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49828 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Am Dienstag, den 03.08.2021, 13:10 +0200 schrieb Maxime Devos: > (patches (search-patches "Add-environment-variable- > MINETEST_MOD_PATH.patch")) This line is a bit long. Even if might look a little weird, I think it's better split in three. > ++ // XXX: for some reason, simply writing > ++ // Strfnd mod_search_paths (std::string(c_modpath)); > ++ // leads to a compilation error: > ++ // > ++ // request for member ‘at_end’ in ‘mod_search_paths’, which is > of > ++ // non-class type ‘Strfnd(std::__cxx11::string) > ++ // {aka BasicStrfnd(std::__cxx11::basic_string)}’ > ++ std::string modpath = std::string(c_modpath); > ++ Strfnd mod_search_paths(modpath); Try Strfnd mod_search_paths{modpath}. The normal bracket style confuses C++, because it can also be parsed as a function declaration. > + * core.get_modpath() (possible in async calls) > +- * returns path to global modpath > ++ * returns path to global modpath, where mods can be installed > ++* core.get_modpaths() (possible in async calls) > ++ * returns list of paths to global modpaths, where mods have > been installed > ++ > ++ The difference with "core.get_modpath" is that no mods should > be installed in these > ++ directories by Minetest -- they might be read-only. This is a somewhat weird interface imo. I think core.get_modpath should be the first element of core.get_modpaths and documented in that way, so that any GUI that deals with "all known mods" needs to simply call the latter, whereas any GUI that deals with installing can comfortably use either the former or whatever Lua has for car. WDYT? Otherwise LGTM.