From patchwork Sat Jul 4 18:33:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 23048 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 6F99227BBE3; Sat, 4 Jul 2020 19:50:20 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 190FA27BBE1 for ; Sat, 4 Jul 2020 19:50:20 +0100 (BST) Received: from localhost ([::1]:32960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrnEx-0000KH-EN for patchwork@mira.cbaines.net; Sat, 04 Jul 2020 14:50:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrmzC-0001y7-Tb for guix-patches@gnu.org; Sat, 04 Jul 2020 14:34:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48057) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jrmzC-00025L-Ix for guix-patches@gnu.org; Sat, 04 Jul 2020 14:34:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jrmzC-0004kY-Fg for guix-patches@gnu.org; Sat, 04 Jul 2020 14:34:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42192] [PATCH 3/3] import: launchpad: Recognize more URLs. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Jul 2020 18:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42192 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42192@debbugs.gnu.org Cc: Arun Isaac Received: via spool by 42192-submit@debbugs.gnu.org id=B42192.159388762918225 (code B ref 42192); Sat, 04 Jul 2020 18:34:02 +0000 Received: (at 42192) by debbugs.gnu.org; 4 Jul 2020 18:33:49 +0000 Received: from localhost ([127.0.0.1]:59600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jrmyr-0004jd-HF for submit@debbugs.gnu.org; Sat, 04 Jul 2020 14:33:49 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:34722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jrmyp-0004jG-4r for 42192@debbugs.gnu.org; Sat, 04 Jul 2020 14:33:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=v8m9yMJiZ/em8UnHU6jMll5EpQLiM5b4olljWqIPC0E=; b=qNtdUeTgvSoP92D6kF8cFpGKff f2qB6qrxNkDlwHdhmmg2p9BX630SORv9lL7nlueEKaq3BQAA1Lg7CGvdmp3V8MzjKilBoKr4ofz6F Fcxmmeb47sUO10b5ssb+f9qCO97sTt72Itad0Axn/RUep78kF5sBhyp90Q/3nhCtRnI8=; Received: from [192.168.2.1] (helo=localhost.localdomain) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1jrmym-0004Fh-BW; Sun, 05 Jul 2020 00:03:36 +0530 From: Arun Isaac Date: Sun, 5 Jul 2020 00:03:32 +0530 Message-Id: <20200704183332.25445-3-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200704183332.25445-1-arunisaac@systemreboot.net> References: <20200704183332.25445-1-arunisaac@systemreboot.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/import/launchpad.scm (updated-launchpad-url): Recognize more URLs. --- guix/import/launchpad.scm | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/guix/import/launchpad.scm b/guix/import/launchpad.scm index c991ccfe6e..fd3cfa8444 100644 --- a/guix/import/launchpad.scm +++ b/guix/import/launchpad.scm @@ -46,15 +46,35 @@ false if none is recognized" (version (package-version old-package)) (repo (launchpad-repository url))) (cond - ((and - (>= (length (string-split version #\.)) 2) - (string=? (string-append "https://launchpad.net/" - repo "/" (version-major+minor version) - "/" version "/+download/" repo "-" version ext) - url)) + ((< (length (string-split version #\.)) 2) #f) + ((string=? (string-append "https://launchpad.net/" + repo "/" (version-major+minor version) + "/" version "/+download/" repo "-" version ext) + url) (string-append "https://launchpad.net/" repo "/" (version-major+minor new-version) "/" new-version "/+download/" repo "-" new-version ext)) + ((string=? (string-append "https://launchpad.net/" + repo "/" (version-major+minor version) + "/" version "/+download/" repo "_" version ext) + url) + (string-append "https://launchpad.net/" + repo "/" (version-major+minor new-version) + "/" new-version "/+download/" repo "-" new-version ext)) + ((string=? (string-append "https://launchpad.net/" + repo "/trunk/" version "/+download/" + repo "-" version ext) + url) + (string-append "https://launchpad.net/" + repo "/trunk/" new-version + "/+download/" repo "-" new-version ext)) + ((string=? (string-append "https://launchpad.net/" + repo "/trunk/" version "/+download/" + repo "_" version ext) + url) + (string-append "https://launchpad.net/" + repo "/trunk/" new-version + "/+download/" repo "_" new-version ext)) (#t #f))))) ; Some URLs are not recognised. (match (package-source old-package)