unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#67009] [PATCH] build: minetest-build-system: Improve white space handling in mod name field.
@ 2023-11-09  1:33 Tristan Cottam via Guix-patches via
  2023-11-09  6:06 ` Liliana Marie Prikler
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Tristan Cottam via Guix-patches via @ 2023-11-09  1:33 UTC (permalink / raw)
  To: 67009; +Cc: Tristan Cottam, Liliana Marie Prikler, 宋文武

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





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#67009] [PATCH] build: minetest-build-system: Improve white space handling in mod name field.
  2023-11-09  1:33 [bug#67009] [PATCH] build: minetest-build-system: Improve white space handling in mod name field Tristan Cottam via Guix-patches via
@ 2023-11-09  6:06 ` Liliana Marie Prikler
  2023-11-09  6:06   ` Liliana Marie Prikler
  2023-11-09 10:43 ` [bug#67009] [PATCH v2] " Tristan Cottam via Guix-patches via
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Liliana Marie Prikler @ 2023-11-09  6:06 UTC (permalink / raw)
  To: Tristan Cottam, 67009; +Cc: 宋文武

Am Donnerstag, dem 09.11.2023 um 02:33 +0100 schrieb Tristan Cottam:
> 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:]]+)"))
The new regexp is missing a terminator ($).  Should we add [[:space:]]$
at the end?

Cheers




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#67009] [PATCH] build: minetest-build-system: Improve white space handling in mod name field.
  2023-11-09  6:06 ` Liliana Marie Prikler
@ 2023-11-09  6:06   ` Liliana Marie Prikler
  0 siblings, 0 replies; 11+ messages in thread
From: Liliana Marie Prikler @ 2023-11-09  6:06 UTC (permalink / raw)
  To: Tristan Cottam, 67009; +Cc: 宋文武

Am Donnerstag, dem 09.11.2023 um 07:06 +0100 schrieb Liliana Marie
Prikler:
> Am Donnerstag, dem 09.11.2023 um 02:33 +0100 schrieb Tristan Cottam:
> > 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:]]+)"))
> The new regexp is missing a terminator ($).  Should we add
> [[:space:]]$ at the end?
Ahem, [[:space:]]*$ of course.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#67009] [PATCH v2] build: minetest-build-system: Improve white space handling in mod name field.
  2023-11-09  1:33 [bug#67009] [PATCH] build: minetest-build-system: Improve white space handling in mod name field Tristan Cottam via Guix-patches via
  2023-11-09  6:06 ` Liliana Marie Prikler
@ 2023-11-09 10:43 ` Tristan Cottam via Guix-patches via
  2023-11-09 11:19   ` Liliana Marie Prikler
  2023-11-09 12:18 ` [bug#67009] [PATCH v3] " Tristan Cottam via Guix-patches via
  2023-11-11  1:05 ` [bug#67009] [PATCH v4] " Tristan Cottam via Guix-patches via
  3 siblings, 1 reply; 11+ messages in thread
From: Tristan Cottam via Guix-patches via @ 2023-11-09 10:43 UTC (permalink / raw)
  To: 67009; +Cc: Tristan Cottam, Liliana Marie Prikler, 宋文武

On Thursday, November 9th, 2023 at 7:06 AM, Liliana Marie Prikler <liliana.prikler@gmail.com> wrote:

> > The new regexp is missing a terminator ($). Should we add
> > [[:space:]]$ at the end?
> 
> Ahem, [[:space:]]*$ of course.

I didn't include [[:space:]]*$ in case someone decided to append a
comment to the same line. However, since Minetest doesn't officially
support comments in mod.conf, I think it's safe to include [[:space:]]*$
for clarity.

* 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..cfeca7d18f 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:]]+)[[:space:]]*$"))
 
 (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





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#67009] [PATCH v2] build: minetest-build-system: Improve white space handling in mod name field.
  2023-11-09 10:43 ` [bug#67009] [PATCH v2] " Tristan Cottam via Guix-patches via
@ 2023-11-09 11:19   ` Liliana Marie Prikler
  0 siblings, 0 replies; 11+ messages in thread
From: Liliana Marie Prikler @ 2023-11-09 11:19 UTC (permalink / raw)
  To: Tristan Cottam, 67009; +Cc: 宋文武

Am Donnerstag, dem 09.11.2023 um 11:43 +0100 schrieb Tristan Cottam:
> On Thursday, November 9th, 2023 at 7:06 AM, Liliana Marie Prikler
> <liliana.prikler@gmail.com> wrote:
> 
> > > The new regexp is missing a terminator ($). Should we add
> > > [[:space:]]$ at the end?
> > 
> > Ahem, [[:space:]]*$ of course.
> 
> I didn't include [[:space:]]*$ in case someone decided to append a
> comment to the same line. However, since Minetest doesn't officially
> support comments in mod.conf, I think it's safe to include
> [[:space:]]*$ for clarity.
Note: comments that aren't for the commit itself should go below the
dashed (---) line.

> * 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..cfeca7d18f 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:]]+)[[:space:]]*$"))
LGTM, but I'd do a line break + indentation before make-regexp. 
Applied locally with exactly that change; will push unless there's
other comments in the next few days.

Cheers




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#67009] [PATCH v3] build: minetest-build-system: Improve white space handling in mod name field.
  2023-11-09  1:33 [bug#67009] [PATCH] build: minetest-build-system: Improve white space handling in mod name field Tristan Cottam via Guix-patches via
  2023-11-09  6:06 ` Liliana Marie Prikler
  2023-11-09 10:43 ` [bug#67009] [PATCH v2] " Tristan Cottam via Guix-patches via
@ 2023-11-09 12:18 ` Tristan Cottam via Guix-patches via
  2023-11-09 13:06   ` Liliana Marie Prikler
  2023-11-11  1:05 ` [bug#67009] [PATCH v4] " Tristan Cottam via Guix-patches via
  3 siblings, 1 reply; 11+ messages in thread
From: Tristan Cottam via Guix-patches via @ 2023-11-09 12:18 UTC (permalink / raw)
  To: 67009; +Cc: Tristan Cottam, Liliana Marie Prikler, 宋文武

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
---

I added the relevant line break and indentation. Can you confirm this
patch is formatted properly this time?

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

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

base-commit: b0bfddd7f937fcefdaeb1de4ccafd415c1df4122
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#67009] [PATCH v3] build: minetest-build-system: Improve white space handling in mod name field.
  2023-11-09 12:18 ` [bug#67009] [PATCH v3] " Tristan Cottam via Guix-patches via
@ 2023-11-09 13:06   ` Liliana Marie Prikler
       [not found]     ` <Mw3bYJJXHCFsjOsi55NNrXMbnVGn8S8dqIzUwDUcpTaOrojg_PH0ZA6cyFHFdvg3DYyD7xeC2qYfwRAMpIGH993rnCvDDdr9-Q0yGtE-r3c=@cott.am>
  0 siblings, 1 reply; 11+ messages in thread
From: Liliana Marie Prikler @ 2023-11-09 13:06 UTC (permalink / raw)
  To: Tristan Cottam, 67009; +Cc: 宋文武

Am Donnerstag, dem 09.11.2023 um 13:18 +0100 schrieb Tristan Cottam:
> Fixes certain Minetest mods being stored with a terminating
> carriage return in their directory base name.
Instead of "certain", you might want to name those mods ;)

> * guix/build/minetest-build-system.scm (name-regexp): Improve white
> space handling.
Perhaps describe the actual effect instead of just saying "improve". 
That is: "Only match graphical characters in the name sub-match."

> Change-Id: I95f4c201724991a10efba5c859bfef99779ea495
> ---
> 
> I added the relevant line break and indentation. Can you confirm this
> patch is formatted properly this time?
Yep, it looks properly formatted.

Cheers




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#67009] [PATCH] build: minetest-build-system: Improve white space handling in mod name field.
       [not found]     ` <Mw3bYJJXHCFsjOsi55NNrXMbnVGn8S8dqIzUwDUcpTaOrojg_PH0ZA6cyFHFdvg3DYyD7xeC2qYfwRAMpIGH993rnCvDDdr9-Q0yGtE-r3c=@cott.am>
@ 2023-11-10  0:59       ` Tristan Cottam via Guix-patches via
  2023-11-10 17:54         ` Liliana Marie Prikler
  0 siblings, 1 reply; 11+ messages in thread
From: Tristan Cottam via Guix-patches via @ 2023-11-10  0:59 UTC (permalink / raw)
  To: 67009@debbugs.gnu.org

The only mods I encountered with this problem aren't packaged upstream yet, I only have them in my own channel. Should I contribute them first in order to refer to them by package name?




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#67009] [PATCH] build: minetest-build-system: Improve white space handling in mod name field.
  2023-11-10  0:59       ` [bug#67009] [PATCH] " Tristan Cottam via Guix-patches via
@ 2023-11-10 17:54         ` Liliana Marie Prikler
  0 siblings, 0 replies; 11+ messages in thread
From: Liliana Marie Prikler @ 2023-11-10 17:54 UTC (permalink / raw)
  To: Tristan Cottam, 67009@debbugs.gnu.org

Am Freitag, dem 10.11.2023 um 00:59 +0000 schrieb Tristan Cottam:
> The only mods I encountered with this problem aren't packaged
> upstream yet, I only have them in my own channel. Should I contribute
> them first in order to refer to them by package name?
In that case it would be helpful to follow this improvement up with one
of these mods :)

As long as we're talking free software, upstreaming some minetest mods
shouldn't be too difficult.

Cheers





^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#67009] [PATCH v4] build: minetest-build-system: Improve white space handling in mod name field.
  2023-11-09  1:33 [bug#67009] [PATCH] build: minetest-build-system: Improve white space handling in mod name field Tristan Cottam via Guix-patches via
                   ` (2 preceding siblings ...)
  2023-11-09 12:18 ` [bug#67009] [PATCH v3] " Tristan Cottam via Guix-patches via
@ 2023-11-11  1:05 ` Tristan Cottam via Guix-patches via
  2023-11-11  6:13   ` bug#67009: " Liliana Marie Prikler
  3 siblings, 1 reply; 11+ messages in thread
From: Tristan Cottam via Guix-patches via @ 2023-11-11  1:05 UTC (permalink / raw)
  To: 67009; +Cc: Tristan Cottam, Liliana Marie Prikler, 宋文武

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(-)

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

base-commit: b0bfddd7f937fcefdaeb1de4ccafd415c1df4122
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#67009: [PATCH v4] build: minetest-build-system: Improve white space handling in mod name field.
  2023-11-11  1:05 ` [bug#67009] [PATCH v4] " Tristan Cottam via Guix-patches via
@ 2023-11-11  6:13   ` Liliana Marie Prikler
  0 siblings, 0 replies; 11+ messages in thread
From: Liliana Marie Prikler @ 2023-11-11  6:13 UTC (permalink / raw)
  To: Tristan Cottam, 67009-done; +Cc: 宋文武

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




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-11-11  6:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-09  1:33 [bug#67009] [PATCH] build: minetest-build-system: Improve white space handling in mod name field Tristan Cottam via Guix-patches via
2023-11-09  6:06 ` Liliana Marie Prikler
2023-11-09  6:06   ` Liliana Marie Prikler
2023-11-09 10:43 ` [bug#67009] [PATCH v2] " Tristan Cottam via Guix-patches via
2023-11-09 11:19   ` Liliana Marie Prikler
2023-11-09 12:18 ` [bug#67009] [PATCH v3] " Tristan Cottam via Guix-patches via
2023-11-09 13:06   ` Liliana Marie Prikler
     [not found]     ` <Mw3bYJJXHCFsjOsi55NNrXMbnVGn8S8dqIzUwDUcpTaOrojg_PH0ZA6cyFHFdvg3DYyD7xeC2qYfwRAMpIGH993rnCvDDdr9-Q0yGtE-r3c=@cott.am>
2023-11-10  0:59       ` [bug#67009] [PATCH] " Tristan Cottam via Guix-patches via
2023-11-10 17:54         ` Liliana Marie Prikler
2023-11-11  1:05 ` [bug#67009] [PATCH v4] " Tristan Cottam via Guix-patches via
2023-11-11  6:13   ` bug#67009: " Liliana Marie Prikler

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).