all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vincent Legoll <vincent.legoll@gmail.com>
To: guix-devel <guix-devel@gnu.org>
Subject: adding unencoded space character check to guix lint
Date: Sat, 29 Feb 2020 16:26:57 +0100	[thread overview]
Message-ID: <CAEwRq=rnWdyR-xkpAHAf5LkizMunJr_gZ6PRjsqPu-bO2+Wj+Q@mail.gmail.com> (raw)

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


             reply	other threads:[~2020-02-29 15:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-29 15:26 Vincent Legoll [this message]
2020-02-29 19:21 ` adding unencoded space character check to guix lint Leo Famulari
2020-03-02 17:45   ` zimoun
2020-03-02 18:38     ` Vincent Legoll

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEwRq=rnWdyR-xkpAHAf5LkizMunJr_gZ6PRjsqPu-bO2+Wj+Q@mail.gmail.com' \
    --to=vincent.legoll@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.