Subject: bug#67009: closed (Re: [bug#67009] [PATCH v4] build: minetest-build-system: Improve white space handling in mod name field.)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 11 Nov 2023 06:15:02 +0000

Your bug report

#67009: [PATCH] build: minetest-build-system: Improve white space handling in mod name field.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
67009: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67009
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#67009] [PATCH v4] build: minetest-build-system: Improve white space handling in mod name field.
From: Liliana Marie Prikler <[email-masked]>
To: Tristan Cottam <[email-masked]>, [email-masked]
Cc: 宋文武 <[email-masked]>
Date: Sat, 11 Nov 2023 07:13:14 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Am Samstag, dem 11.11.2023 um 02:05 +0100 schrieb Tristan Cottam:
> Fixes certain Minetest mods (such as minetest-ambience) being stored
> with a terminating carriage return in their sub-directory base name.
> 
> * guix/build/minetest-build-system.scm (name-regexp): Only match
> graphical characters in the name sub-match.
> 
> Change-Id: I95f4c201724991a10efba5c859bfef99779ea495
> ---
> 
> I'm unsure exactly how I should refer to a Minetest mod which has yet
> to be packaged for Guix, so I used the would-be package name of one
> such mod, which I will contribute along with many others shortly.
Pushed with some rewordings in the commit message.  Feel free to send
the "would-be" packages.

Cheers

Subject: [PATCH] build: minetest-build-system: Improve white space handling in mod name field.
From: Tristan Cottam <[email-masked]>
To: [email-masked]
Cc: Tristan Cottam <[email-masked]>
Date: Thu, 9 Nov 2023 02:33:01 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

I'm currently developing a Minetest service, with its configuration
including a field specifying the list of mod packages to install and
enable.

However, certain mods' configuration, beind developed on Windows, have a
trailing carriage return before each newline, which is included in the
Guix store mod directory base name. Such mods can't be programmatically
loaded by a Minetest world, since trailing whitespace is ignored by
Minetest's world configuration parser, leading to the wrong mod path
being used.

This patch fixes certain Minetest mods being stored with a terminating
carriage return in their directory base name.

* guix/build/minetest-build-system.scm (name-regexp): Improve white
space handling.

Change-Id: I95f4c201724991a10efba5c859bfef99779ea495
---
 guix/build/minetest-build-system.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/build/minetest-build-system.scm b/guix/build/minetest-build-system.scm
index 4a7a87ab83..8233d56aca 100644
--- a/guix/build/minetest-build-system.scm
+++ b/guix/build/minetest-build-system.scm
@@ -126,7 +126,7 @@ (define* (minimise-png #:key inputs native-inputs #:allow-other-keys)
                    (/ total-old-size (expt 1024 2))
                    (/ total-new-size (expt 1024 2)))))))
 
-(define name-regexp (make-regexp "^name[ ]*=(.+)$"))
+(define name-regexp (make-regexp "^name[[:space:]]*=[[:space:]]*([[:graph:]]+)"))
 
 (define* (read-mod-name mod.conf #:optional not-found)
   "Read the name of a mod from MOD.CONF.  If MOD.CONF

base-commit: b0bfddd7f937fcefdaeb1de4ccafd415c1df4122
-- 
2.41.0