GNU bug report logs - #47898
[PATCH] [core-updates] Add option --xpath0 to xmllint from libxml2

Previous Next

Package: guix-patches;

Reported by: david larsson <david.larsson <at> selfhosted.xyz>

Date: Mon, 19 Apr 2021 18:50:01 UTC

Severity: normal

Tags: patch

Done: Marius Bakke <marius <at> gnu.org>

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 47898 in the body.
You can then email your comments to 47898 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#47898; Package guix-patches. (Mon, 19 Apr 2021 18:50:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to david larsson <david.larsson <at> selfhosted.xyz>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 19 Apr 2021 18:50:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: david larsson <david.larsson <at> selfhosted.xyz>
To: guix-patches <at> gnu.org
Subject: [PATCH] [core-updates] Add option --xpath0 to xmllint from libxml2
Date: Mon, 19 Apr 2021 20:48:47 +0200
[Message part 1 (text/plain, inline)]
Hi!
This patch adds the option to separate xpath results from xmllint by a 
null delimiter when using the --xpath0 option-flag. It is something 
that's been asked for for a long time by users on stackoverflow and 
merge-attempts have been made to upstream without success.

Examples:
  - https://gitlab.gnome.org/GNOME/libxml2/-/issues/227
  - https://gitlab.gnome.org/GNOME/libxml2/-/merge_requests/8

Best regards,
David
[0001-gnu-libxml2-Add-patch-for-xpath0-option-to-xmllint.patch (text/x-diff, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#47898; Package guix-patches. (Thu, 13 May 2021 12:42:01 GMT) Full text and rfc822 format available.

Message #8 received at 47898 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <marius <at> gnu.org>
To: david larsson <david.larsson <at> selfhosted.xyz>, 47898 <at> debbugs.gnu.org
Subject: Re: [bug#47898] [PATCH] [core-updates] Add option --xpath0 to
 xmllint from libxml2
Date: Thu, 13 May 2021 14:41:46 +0200
[Message part 1 (text/plain, inline)]
david larsson <david.larsson <at> selfhosted.xyz> skriver:

> Hi!
> This patch adds the option to separate xpath results from xmllint by a 
> null delimiter when using the --xpath0 option-flag. It is something 
> that's been asked for for a long time by users on stackoverflow and 
> merge-attempts have been made to upstream without success.
>
> Examples:
>    - https://gitlab.gnome.org/GNOME/libxml2/-/issues/227
>    - https://gitlab.gnome.org/GNOME/libxml2/-/merge_requests/8

I'm reluctant to take a patch that has been rejected upstream,
especially for a core package such as libxml2.  Porting can be
time-consuming which delays security updates, and we'll have situations
where something "works on Guix" but not elsewhere (or vice versa).

Will adding it as a separate package be sufficient?  We could call it
"xmllint-xpath0" or similar and make it clear that it's just libxml2
with a patched xmllint in the description.

Thoughts?
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#47898; Package guix-patches. (Thu, 13 May 2021 13:22:01 GMT) Full text and rfc822 format available.

Message #11 received at 47898 <at> debbugs.gnu.org (full text, mbox):

From: david larsson <david.larsson <at> selfhosted.xyz>
To: Marius Bakke <marius <at> gnu.org>
Cc: 47898 <at> debbugs.gnu.org
Subject: Re: [bug#47898] [PATCH] [core-updates] Add option --xpath0 to xmllint
 from libxml2
Date: Thu, 13 May 2021 15:21:41 +0200
On 2021-05-13 14:41, Marius Bakke wrote:
> david larsson <david.larsson <at> selfhosted.xyz> skriver:
> 
>> Hi!
>> This patch adds the option to separate xpath results from xmllint by a
>> null delimiter when using the --xpath0 option-flag. It is something
>> that's been asked for for a long time by users on stackoverflow and
>> merge-attempts have been made to upstream without success.
>> 
>> Examples:
>>    - https://gitlab.gnome.org/GNOME/libxml2/-/issues/227
>>    - https://gitlab.gnome.org/GNOME/libxml2/-/merge_requests/8
> 
> I'm reluctant to take a patch that has been rejected upstream,
> especially for a core package such as libxml2.  Porting can be
> time-consuming which delays security updates, and we'll have situations
> where something "works on Guix" but not elsewhere (or vice versa).

I understand.

> 
> Will adding it as a separate package be sufficient?  We could call it
> "xmllint-xpath0" or similar and make it clear that it's just libxml2
> with a patched xmllint in the description.
> 
> Thoughts?

Yes, that would be nice. How about calling it libxml2-xpath0 instead? 
That would maintain libxml2 in the name, letting users know it's just a 
version of the original package and should show up when searching for 
libxml2. If calling it xmllint-xpath0, I feel that the package should 
remove other outputs than just the xmllint binary file, which is perhaps 
a good idea though?

Either option is fine for me.

Best regards,
David




Information forwarded to guix-patches <at> gnu.org:
bug#47898; Package guix-patches. (Thu, 13 May 2021 13:31:02 GMT) Full text and rfc822 format available.

Message #14 received at 47898 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <marius <at> gnu.org>
To: david larsson <david.larsson <at> selfhosted.xyz>
Cc: 47898 <at> debbugs.gnu.org
Subject: Re: [bug#47898] [PATCH] [core-updates] Add option --xpath0 to
 xmllint from libxml2
Date: Thu, 13 May 2021 15:29:58 +0200
[Message part 1 (text/plain, inline)]
david larsson <david.larsson <at> selfhosted.xyz> skriver:

> On 2021-05-13 14:41, Marius Bakke wrote:
>> david larsson <david.larsson <at> selfhosted.xyz> skriver:
>> 
>> Will adding it as a separate package be sufficient?  We could call it
>> "xmllint-xpath0" or similar and make it clear that it's just libxml2
>> with a patched xmllint in the description.
>> 
>> Thoughts?
>
> Yes, that would be nice. How about calling it libxml2-xpath0 instead? 
> That would maintain libxml2 in the name, letting users know it's just a 
> version of the original package and should show up when searching for 
> libxml2. If calling it xmllint-xpath0, I feel that the package should 
> remove other outputs than just the xmllint binary file, which is perhaps 
> a good idea though?

libxml2-xpath0 is probably better indeed, I don't have a strong opinion.
Can you send an updated patch?  :-)

Thanks,
Marius
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#47898; Package guix-patches. (Sat, 15 May 2021 12:54:02 GMT) Full text and rfc822 format available.

Message #17 received at 47898 <at> debbugs.gnu.org (full text, mbox):

From: david larsson <david.larsson <at> selfhosted.xyz>
To: 47898 <at> debbugs.gnu.org
Subject: Re: [bug#47898] [PATCH] [core-updates] Add option --xpath0 to xmllint
 from libxml2
Date: Sat, 15 May 2021 14:53:36 +0200
[Message part 1 (text/plain, inline)]
> libxml2-xpath0 is probably better indeed, I don't have a strong 
> opinion.
> Can you send an updated patch?  :-)
> 
> Thanks,
> Marius

Updated patch attached!

Best regards,
David
[0001-gnu-libxml2-xpath0-New-package-with-patch-for-xpath0.patch (text/x-diff, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#47898; Package guix-patches. (Sat, 15 May 2021 16:13:02 GMT) Full text and rfc822 format available.

Message #20 received at 47898 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <marius <at> gnu.org>
To: david larsson <david.larsson <at> selfhosted.xyz>, 47898 <at> debbugs.gnu.org
Subject: Re: [bug#47898] [PATCH] [core-updates] Add option --xpath0 to
 xmllint from libxml2
Date: Sat, 15 May 2021 18:12:19 +0200
[Message part 1 (text/plain, inline)]
david larsson <david.larsson <at> selfhosted.xyz> skriver:

>> libxml2-xpath0 is probably better indeed, I don't have a strong 
>> opinion.
>> Can you send an updated patch?  :-)
>> 
>> Thanks,
>> Marius
>
> Updated patch attached!

Thanks!

[...]

> gnu/packages/patches/libxml2-Add-option-xpath0.patch: New file...
> gnu/packages/xml.scm (libxml2-xpath0) [source]: ...apply it.
> ---
>  .../patches/libxml2-Add-option-xpath0.patch   | 139 ++++++++++++++++++
>  gnu/packages/xml.scm                          |  52 +++++++
>  2 files changed, 191 insertions(+)
>  create mode 100644 gnu/packages/patches/libxml2-Add-option-xpath0.patch

Please also register this patch in gnu/local.mk.  Can you also add your
copyright at the top of xml.scm?

[...]

> +(define-public libxml2-xpath0
> +  (package
> +    (name "libxml2-xpath0")
> +    (version "2.9.10")
> +    (source (origin
> +             (method url-fetch)
> +             (uri (string-append "ftp://xmlsoft.org/libxml2/libxml2-"
> +                                 version ".tar.gz"))
> +             (sha256
> +              (base32
> +               "07xynh8hcxb2yb1fs051xrgszjvj37wnxvxgsj10rzmqzy9y3zma"))
> +             (patches (list (search-patch "libxml2-Add-option-xpath0.patch")))))

You can inherit another record in Scheme to avoid duplicating all the
fields.  Then the package can be shortened to:

  (define-public libxml2-xpath0
    (package/inherit libxml2
      (name "libxml2-xpath0")
      (source (origin
                (inherit (package-source libxml2))
                (patches (append (search-patches "libxml2-Add-option-xpath0.patch")
                                 (origin-patches (package-source libxml2))))))
      (description
       "...")))

We should fill out that description to mention how it differs from the
regular libxml2.  Can you give it a try?  I can make the other changes
on your behalf, but not sure what to write.

Thanks,
Marius
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#47898; Package guix-patches. (Sat, 15 May 2021 17:13:01 GMT) Full text and rfc822 format available.

Message #23 received at 47898 <at> debbugs.gnu.org (full text, mbox):

From: david larsson <david.larsson <at> selfhosted.xyz>
To: Marius Bakke <marius <at> gnu.org>
Cc: 47898 <at> debbugs.gnu.org
Subject: Re: [bug#47898] [PATCH] [core-updates] Add option --xpath0 to xmllint
 from libxml2
Date: Sat, 15 May 2021 19:12:44 +0200
On 2021-05-15 18:12, Marius Bakke wrote:
> david larsson <david.larsson <at> selfhosted.xyz> skriver:
> 
>>> libxml2-xpath0 is probably better indeed, I don't have a strong
>>> opinion.
>>> Can you send an updated patch?  :-)
>>> 
>>> Thanks,
>>> Marius
>> 
>> Updated patch attached!
> 
> Thanks!
> 
> [...]
> 
>> gnu/packages/patches/libxml2-Add-option-xpath0.patch: New file...
>> gnu/packages/xml.scm (libxml2-xpath0) [source]: ...apply it.
>> ---
>>  .../patches/libxml2-Add-option-xpath0.patch   | 139 
>> ++++++++++++++++++
>>  gnu/packages/xml.scm                          |  52 +++++++
>>  2 files changed, 191 insertions(+)
>>  create mode 100644 
>> gnu/packages/patches/libxml2-Add-option-xpath0.patch
> 
> Please also register this patch in gnu/local.mk.  Can you also add your
> copyright at the top of xml.scm?
> 
> [...]
> 
>> +(define-public libxml2-xpath0
>> +  (package
>> +    (name "libxml2-xpath0")
>> +    (version "2.9.10")
>> +    (source (origin
>> +             (method url-fetch)
>> +             (uri (string-append "ftp://xmlsoft.org/libxml2/libxml2-"
>> +                                 version ".tar.gz"))
>> +             (sha256
>> +              (base32
>> +               
>> "07xynh8hcxb2yb1fs051xrgszjvj37wnxvxgsj10rzmqzy9y3zma"))
>> +             (patches (list (search-patch 
>> "libxml2-Add-option-xpath0.patch")))))
> 
> You can inherit another record in Scheme to avoid duplicating all the
> fields.  Then the package can be shortened to:
> 
>   (define-public libxml2-xpath0
>     (package/inherit libxml2
>       (name "libxml2-xpath0")
>       (source (origin
>                 (inherit (package-source libxml2))
>                 (patches (append (search-patches
> "libxml2-Add-option-xpath0.patch")
>                                  (origin-patches (package-source 
> libxml2))))))
>       (description
>        "...")))
> 
> We should fill out that description to mention how it differs from the
> regular libxml2.  Can you give it a try?  I can make the other changes
> on your behalf, but not sure what to write.
> 
> Thanks,
> Marius

I can fix all of it and send an updated patch again.

Best regards,
David




Information forwarded to guix-patches <at> gnu.org:
bug#47898; Package guix-patches. (Sat, 15 May 2021 19:23:02 GMT) Full text and rfc822 format available.

Message #26 received at 47898 <at> debbugs.gnu.org (full text, mbox):

From: david larsson <david.larsson <at> selfhosted.xyz>
To: Marius Bakke <marius <at> gnu.org>
Cc: 47898 <at> debbugs.gnu.org
Subject: Re: [bug#47898] [PATCH] [core-updates] Add option --xpath0 to xmllint
 from libxml2
Date: Sat, 15 May 2021 21:21:50 +0200
[Message part 1 (text/plain, inline)]
> Please also register this patch in gnu/local.mk.  Can you also add your
> copyright at the top of xml.scm?

Done!

> 
> [...]
> 
>> +(define-public libxml2-xpath0
>> +  (package
>> +    (name "libxml2-xpath0")
>> +    (version "2.9.10")
>> +    (source (origin
>> +             (method url-fetch)
>> +             (uri (string-append "ftp://xmlsoft.org/libxml2/libxml2-"
>> +                                 version ".tar.gz"))
>> +             (sha256
>> +              (base32
>> +               
>> "07xynh8hcxb2yb1fs051xrgszjvj37wnxvxgsj10rzmqzy9y3zma"))
>> +             (patches (list (search-patch 
>> "libxml2-Add-option-xpath0.patch")))))
> 
> You can inherit another record in Scheme to avoid duplicating all the
> fields.  Then the package can be shortened to:
> 
>   (define-public libxml2-xpath0
>     (package/inherit libxml2
>       (name "libxml2-xpath0")
>       (source (origin
>                 (inherit (package-source libxml2))
>                 (patches (append (search-patches
> "libxml2-Add-option-xpath0.patch")
>                                  (origin-patches (package-source 
> libxml2))))))
>       (description
>        "...")))
> 
> We should fill out that description to mention how it differs from the
> regular libxml2.  Can you give it a try?  I can make the other changes
> on your behalf, but not sure what to write.
> 
> Thanks,
> Marius

Hi, new patch attached. There's a lint warning though: 
"libxml2-xpath0 <at> 2.9.10: no updater for libxml2-xpath0". I don't know 
what it means, maybe it should be fixed before committing?

Best regards,
David
[0001-gnu-libxml2-xpath0-New-package-with-patch-for-xpath0.patch (text/x-diff, attachment)]

Reply sent to Marius Bakke <marius <at> gnu.org>:
You have taken responsibility. (Tue, 18 May 2021 20:26:01 GMT) Full text and rfc822 format available.

Notification sent to david larsson <david.larsson <at> selfhosted.xyz>:
bug acknowledged by developer. (Tue, 18 May 2021 20:26:02 GMT) Full text and rfc822 format available.

Message #31 received at 47898-done <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <marius <at> gnu.org>
To: david larsson <david.larsson <at> selfhosted.xyz>
Cc: 47898-done <at> debbugs.gnu.org
Subject: Re: [bug#47898] [PATCH] [core-updates] Add option --xpath0 to
 xmllint from libxml2
Date: Tue, 18 May 2021 22:25:46 +0200
[Message part 1 (text/plain, inline)]
david larsson <david.larsson <at> selfhosted.xyz> skriver:

> Hi, new patch attached. There's a lint warning though: 
> "libxml2-xpath0 <at> 2.9.10: no updater for libxml2-xpath0". I don't know 
> what it means, maybe it should be fixed before committing?

That warning is harmless and affects a lot of packages.  I've applied
the patch with a couple minor tweaks:

> +From e1df743329bdfd94fbfdea18303c5c6c6fe13403 Mon Sep 17 00:00:00 2001
> +From: methuselah-0 <david.larsson <at> selfhosted.xyz>
> +Date: Thu, 1 Apr 2021 08:33:56 +0200
> +Subject: [PATCH] Add option --xpath0
> +
> +---
> + doc/xmllint.xml | 16 ++++++++++++++++
> + xmllint.c       | 32 +++++++++++++++++++++++---------
> + 2 files changed, 39 insertions(+), 9 deletions(-)

I replaced this git-style patch header with a short description and an
URL to the upstream issue, like we usually do.

> +(define-public libxml2-xpath0
> +  (package/inherit libxml2
> +    (name "libxml2-xpath0")
> +    (source (origin
> +              (inherit (package-source libxml2))
> +              (patches (append (search-patches
> +                                "libxml2-xpath0-Add-option-xpath0.patch")
> +                               (origin-patches (package-source libxml2))))))
> +    (description
> +     "Libxml2-xpath0 is like libxml2 but with a patch applied that
> +provides an --xpath0 option to xmllint that enables it to output xpath
> +results with a null delimiter")))

...and sprinkled some markup and punctuation into the description.

Pushed as b58efbc6611550ad9234163e198ff71ace5306ea, thank you!
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 16 Jun 2021 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 307 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.