GNU bug report logs -
#67009
[PATCH] build: minetest-build-system: Improve white space handling in mod name field.
Previous Next
Reported by: Tristan Cottam <tristan <at> cott.am>
Date: Thu, 9 Nov 2023 05:43:01 UTC
Severity: normal
Tags: patch
Done: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 67009 in the body.
You can then email your comments to 67009 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
liliana.prikler <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org
:
bug#67009
; Package
guix-patches
.
(Thu, 09 Nov 2023 05:43:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Tristan Cottam <tristan <at> cott.am>
:
New bug report received and forwarded. Copy sent to
liliana.prikler <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org
.
(Thu, 09 Nov 2023 05:43:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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
Information forwarded
to
guix-patches <at> gnu.org
:
bug#67009
; Package
guix-patches
.
(Thu, 09 Nov 2023 06:07:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 67009 <at> debbugs.gnu.org (full text, mbox):
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
Information forwarded
to
guix-patches <at> gnu.org
:
bug#67009
; Package
guix-patches
.
(Thu, 09 Nov 2023 06:08:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 67009 <at> debbugs.gnu.org (full text, mbox):
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.
Information forwarded
to
liliana.prikler <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org
:
bug#67009
; Package
guix-patches
.
(Thu, 09 Nov 2023 10:50:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 67009 <at> debbugs.gnu.org (full text, mbox):
On Thursday, November 9th, 2023 at 7:06 AM, Liliana Marie Prikler <liliana.prikler <at> 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
Information forwarded
to
guix-patches <at> gnu.org
:
bug#67009
; Package
guix-patches
.
(Thu, 09 Nov 2023 11:20:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 67009 <at> debbugs.gnu.org (full text, mbox):
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 <at> 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
Information forwarded
to
liliana.prikler <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org
:
bug#67009
; Package
guix-patches
.
(Thu, 09 Nov 2023 12:32:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 67009 <at> debbugs.gnu.org (full text, mbox):
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
Information forwarded
to
guix-patches <at> gnu.org
:
bug#67009
; Package
guix-patches
.
(Thu, 09 Nov 2023 13:08:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 67009 <at> debbugs.gnu.org (full text, mbox):
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
Information forwarded
to
guix-patches <at> gnu.org
:
bug#67009
; Package
guix-patches
.
(Fri, 10 Nov 2023 01:01:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 67009 <at> debbugs.gnu.org (full text, mbox):
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?
Information forwarded
to
guix-patches <at> gnu.org
:
bug#67009
; Package
guix-patches
.
(Fri, 10 Nov 2023 17:56:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 67009 <at> debbugs.gnu.org (full text, mbox):
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
Information forwarded
to
liliana.prikler <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org
:
bug#67009
; Package
guix-patches
.
(Sat, 11 Nov 2023 01:10:02 GMT)
Full text and
rfc822 format available.
Message #32 received at 67009 <at> debbugs.gnu.org (full text, mbox):
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
Reply sent
to
Liliana Marie Prikler <liliana.prikler <at> gmail.com>
:
You have taken responsibility.
(Sat, 11 Nov 2023 06:15:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Tristan Cottam <tristan <at> cott.am>
:
bug acknowledged by developer.
(Sat, 11 Nov 2023 06:15:02 GMT)
Full text and
rfc822 format available.
Message #37 received at 67009-done <at> debbugs.gnu.org (full text, mbox):
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
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 09 Dec 2023 12:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 152 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.