unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* adding unencoded space character check to guix lint
@ 2020-02-29 15:26 Vincent Legoll
  2020-02-29 19:21 ` Leo Famulari
  0 siblings, 1 reply; 4+ messages in thread
From: Vincent Legoll @ 2020-02-29 15:26 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 675 bytes --]

The attached (crude, WIP, RFC) patch allowed to find the following
packages that have unecoded space characters in their URIs:

gnu/packages/games.scm:3668:12: chromium-bsu@0.9.16.1
gnu/packages/games.scm:3920:5: tintin++@2.02.00
gnu/packages/haskell-web.scm:1252:5: ghc-hxt-unicode@9.0.2.4
gnu/packages/libusb.scm:109:5: libusb@0.1.12
gnu/packages/networking.scm:2208:5: asio@1.12.2
gnu/packages/squirrel.scm:34:12: squirrel@3.1
gnu/packages/text-editors.scm:172:5: joe@4.6

Is this worth checking / fixing ?
Is there a reason not to bother about that ?

If this is deemed interesting, I would certainly appreciate help in
polishing the patch...

Thanks

-- 
Vincent Legoll

[-- Attachment #2: 0001-WIP-RFC-check-package-URIs-don-t-have-unencoded-spac.patch --]
[-- Type: text/x-patch, Size: 1632 bytes --]

From e24f8527be1ef1fe6c7e6609e5bfe0818f26d593 Mon Sep 17 00:00:00 2001
From: Vincent Legoll <vincent.legoll@gmail.com>
Date: Sat, 29 Feb 2020 16:06:19 +0100
Subject: [PATCH] WIP,RFC: check package URIs don't have unencoded space
 characters

---
 guix/lint.scm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/guix/lint.scm b/guix/lint.scm
index 24fbf05202..b46d0805d3 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -177,7 +177,6 @@
                        (G_ "description should not be empty")
                        #:field 'description))
         '()))
-
   (define (check-texinfo-markup description)
     "Check that DESCRIPTION can be parsed as a Texinfo fragment.  If the
 markup is valid return a plain-text version of DESCRIPTION, otherwise #f."
@@ -547,6 +546,12 @@ for connections to complete; when TIMEOUT is #f, wait as long as needed."
 (define (validate-uri uri package field)
   "Return #t if the given URI can be reached, otherwise return a warning for
 PACKAGE mentioning the FIELD."
+  (let ((url (uri->string uri)))
+    (if (string-index url #\space)
+      (make-warning package
+        (G_ "URI ~a contains unencoded space character(s)")
+        (list url)
+        #:field field)
   (let-values (((status argument)
                 (probe-uri uri #:timeout 3)))     ;wait at most 3 seconds
     (case status
@@ -620,7 +625,7 @@ from ~a")
        #f)
       (else
        (error "internal linter error" status)))))
-
+))
 (define (check-home-page package)
   "Emit a warning if PACKAGE has an invalid 'home-page' field, or if that
 'home-page' is not reachable."
-- 
2.25.1


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

* Re: adding unencoded space character check to guix lint
  2020-02-29 15:26 adding unencoded space character check to guix lint Vincent Legoll
@ 2020-02-29 19:21 ` Leo Famulari
  2020-03-02 17:45   ` zimoun
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Famulari @ 2020-02-29 19:21 UTC (permalink / raw)
  To: Vincent Legoll; +Cc: guix-devel

On Sat, Feb 29, 2020 at 04:26:57PM +0100, Vincent Legoll wrote:
> The attached (crude, WIP, RFC) patch allowed to find the following
> packages that have unecoded space characters in their URIs:

Can you explain a little more about these characters and why we want to
avoid them?

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

* Re: adding unencoded space character check to guix lint
  2020-02-29 19:21 ` Leo Famulari
@ 2020-03-02 17:45   ` zimoun
  2020-03-02 18:38     ` Vincent Legoll
  0 siblings, 1 reply; 4+ messages in thread
From: zimoun @ 2020-03-02 17:45 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Hi Vincent,

On Sat, 29 Feb 2020 at 20:21, Leo Famulari <leo@famulari.name> wrote:
>
> On Sat, Feb 29, 2020 at 04:26:57PM +0100, Vincent Legoll wrote:
> > The attached (crude, WIP, RFC) patch allowed to find the following
> > packages that have unecoded space characters in their URIs:
>
> Can you explain a little more about these characters and why we want to
> avoid them?

What do you mean by "unencoded" space characters?
Because they are replaced by '%20', isn't?


All the best,
simon

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

* Re: adding unencoded space character check to guix lint
  2020-03-02 17:45   ` zimoun
@ 2020-03-02 18:38     ` Vincent Legoll
  0 siblings, 0 replies; 4+ messages in thread
From: Vincent Legoll @ 2020-03-02 18:38 UTC (permalink / raw)
  To: zimoun; +Cc: guix-devel

Hello,

I retract that WIP,RFC,PATCH, it was mistakenly created after
seeing a warning about such unencoded (%20) space characters
in url on repology, but since I've been unable to find them again
(the warnings).

They were temporarily activated on repology, and triggered me
into doing something about that... Now the maintainer of that
site explained me they were not real warnings to act upon, and
should be deactivated by now.

Sorry for the noise...

--
Vincent Legoll

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

end of thread, other threads:[~2020-03-02 18:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-29 15:26 adding unencoded space character check to guix lint Vincent Legoll
2020-02-29 19:21 ` Leo Famulari
2020-03-02 17:45   ` zimoun
2020-03-02 18:38     ` Vincent Legoll

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