diff mbox series

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

Message ID c8fa528e83c95348d0ddac9b63156dc65ae24611.1699664708.git.tristan@cott.am
State New
Headers show
Series [bug#67009,v4] build: minetest-build-system: Improve white space handling in mod name field. | expand

Commit Message

Tristan Cottam Nov. 11, 2023, 1:05 a.m. UTC
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.

 guix/build/minetest-build-system.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


base-commit: b0bfddd7f937fcefdaeb1de4ccafd415c1df4122

Comments

Liliana Marie Prikler Nov. 11, 2023, 6:13 a.m. UTC | #1
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
diff mbox series

Patch

diff --git a/guix/build/minetest-build-system.scm b/guix/build/minetest-build-system.scm
index 4a7a87ab83..3bf083e004 100644
--- a/guix/build/minetest-build-system.scm
+++ b/guix/build/minetest-build-system.scm
@@ -126,7 +126,8 @@  (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:]]+)[[:space:]]*$"))
 
 (define* (read-mod-name mod.conf #:optional not-found)
   "Read the name of a mod from MOD.CONF.  If MOD.CONF