From patchwork Thu Jan 10 07:45:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 709 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D3C9016A4C; Thu, 10 Jan 2019 07:57:53 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 41104169CB for ; Thu, 10 Jan 2019 07:57:53 +0000 (GMT) Received: from localhost ([127.0.0.1]:42493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghVDs-0004y8-R5 for patchwork@mira.cbaines.net; Thu, 10 Jan 2019 02:57:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghVDq-0004ju-7w for guix-patches@gnu.org; Thu, 10 Jan 2019 02:57:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghV2R-0007nV-LV for guix-patches@gnu.org; Thu, 10 Jan 2019 02:46:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53619) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ghV2Q-0007nJ-Ey for guix-patches@gnu.org; Thu, 10 Jan 2019 02:46:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ghV2Q-0001LS-5q for guix-patches@gnu.org; Thu, 10 Jan 2019 02:46:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33801] import: github: Support source URIs that redirect to GitHub Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 10 Jan 2019 07:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33801 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 33801-submit@debbugs.gnu.org id=B33801.15471063615161 (code B ref 33801); Thu, 10 Jan 2019 07:46:02 +0000 Received: (at 33801) by debbugs.gnu.org; 10 Jan 2019 07:46:01 +0000 Received: from localhost ([127.0.0.1]:52900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ghV2P-0001L9-3b for submit@debbugs.gnu.org; Thu, 10 Jan 2019 02:46:01 -0500 Received: from vultr.systemreboot.net ([45.77.148.100]:43050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ghV2M-0001Kz-SB for 33801@debbugs.gnu.org; Thu, 10 Jan 2019 02:46:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=sXVqqNO46QAnlKGqPdf/FIw55Y9XnNXL70WIMl4EfRY=; b=dK3Cu9013QFFvVXRJ/5KH0U/v tTAZHxAtGtYQ/XT0cOr8ONU8vnYnJ6nL9N49AIXjlEZwbfuizFZ8I2hXVezcb6r+t4FvugeM79OZN hGtUY0ZWYoXw/JZhHgf5nZCFpafA3eo2D3A++szUPK0ZOHul+FHLgnokTYAshNPaqf2Ic=; Received: from [14.139.128.15] (helo=steel) by systemreboot.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1ghV2D-0003yP-6g; Thu, 10 Jan 2019 13:15:50 +0530 From: Arun Isaac In-Reply-To: <87d0p57wfv.fsf@gnu.org> References: <87d0pxtciz.fsf@gnu.org> <87woo4qxg7.fsf@gnu.org> <87k1k4p3gl.fsf@gnu.org> <877eg2q56k.fsf@gnu.org> <87o98uzo9u.fsf@gnu.org> <87zhsb1r0x.fsf@gnu.org> <87d0p57wfv.fsf@gnu.org> Date: Thu, 10 Jan 2019 13:15:36 +0530 Message-ID: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 33801@debbugs.gnu.org Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches >> gnu/packages/lisp.scm:3806:7: In procedure inputs: >> error: xclip: unbound variable > > Ouch. This is fixed by 804b9b18ac9188ffb6c6891cbb9241c6a80ed7c8. I > think we were just lucky it didn’t bite before. Ok. > You can recheck your patch and push it I guess. Please find attached an updated patch complete with the test case. From 2711c58b8d713bf87e2a01d21a4bc6c77ccc7b7d Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 7 Jan 2019 23:11:58 +0530 Subject: [PATCH] guix: lint: Warn only if GitHub URI is not same as the package URI. * guix/scripts/lint.scm (check-github-url): Warn only if the GitHub URI obtained after following redirects is not same as the original URI. * tests/lint.scm ("github-url: already the correct github url"): New test. --- guix/scripts/lint.scm | 11 ++++++----- tests/lint.scm | 11 ++++++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index 9acec4857..0f315a935 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm @@ -8,7 +8,7 @@ ;;; Copyright © 2017 Alex Kost ;;; Copyright © 2017 Tobias Geerinckx-Rice ;;; Copyright © 2017, 2018 Efraim Flashner -;;; Copyright © 2018 Arun Isaac +;;; Copyright © 2018, 2019 Arun Isaac ;;; ;;; This file is part of GNU Guix. ;;; @@ -820,10 +820,11 @@ descriptions maintained upstream." (lambda (uri) (and=> (follow-redirects-to-github uri) (lambda (github-uri) - (emit-warning - package - (format #f (G_ "URL should be '~a'") github-uri) - 'source)))) + (unless (string=? github-uri uri) + (emit-warning + package + (format #f (G_ "URL should be '~a'") github-uri) + 'source))))) (origin-uris origin))))) (define (check-derivation package) diff --git a/tests/lint.scm b/tests/lint.scm index fe12bebd8..521e9fb40 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -775,7 +775,16 @@ (method url-fetch) (uri (%local-url)) (sha256 %null-sha256)))))))))) - github-url))) + github-url)) + (test-assert "github-url: already the correct github url" + (string-null? + (with-warnings + (check-github-url + (dummy-package "x" (source + (origin + (method url-fetch) + (uri github-url) + (sha256 %null-sha256))))))))) (test-assert "cve" (mock ((guix scripts lint) package-vulnerabilities (const '())) -- 2.19.2