[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#852210: marked as done (Normalize VCS-Browser and VCS-Git URLs)



Your message dated Tue, 5 Dec 2017 00:17:52 +0100
with message-id <20171204231752.GA24062@home.ouaza.com>
and subject line Re: Bug#852210: Normalize VCS-Browser and VCS-Git URLs
has caused the Debian Bug report #852210,
regarding Normalize VCS-Browser and VCS-Git URLs
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
852210: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=852210
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: tracker.debian.org
Severity: normal
Tags: patch

Looking at the discussion on d-d@l.d.o
  https://lists.debian.org/debian-devel/2017/01/thrd2.html#00573
  https://lists.debian.org/debian-devel/2017/01/msg00573.html

I realize this kind of new URL is best spread by using lintian and
popular web service ;-)

Since I like python more, I wrote a proof-of-concept patch to convert
URLs to preferred ones for tracker.

Maybe we need to do the same for https://packages.qa.debian.org and
lintian.  (But they are Perl  ... )

Code is simple but as of now, untested ... but intent should be clear.

Osamu
>From 25b5789b72669ca34d8adccac23b683659ad5a3b Mon Sep 17 00:00:00 2001
From: Osamu Aoki <osamu@debian.org>
Date: Sun, 22 Jan 2017 22:22:34 +0900
Subject: [PATCH] normalize URLs for alioth git

---
 distro_tracker/core/utils/packages.py | 38 +++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/distro_tracker/core/utils/packages.py b/distro_tracker/core/utils/packages.py
index abceb59..f92a555 100644
--- a/distro_tracker/core/utils/packages.py
+++ b/distro_tracker/core/utils/packages.py
@@ -67,6 +67,44 @@ def extract_vcs_information(stanza):
         elif key.startswith('vcs-'):
             vcs['type'] = key[4:]
             vcs['url'] = value
+    # Normalize old alioth git browser URLs for git (https:// -> https://)
+    #   OLD: https://anonscm.debian.org/gitweb/?p=<repository>.git
+    #   OLD: https://anonscm.debian.org/cgit/<repository>.git
+    #   NEW: https://anonscm.debian.org/git/<repository>.git
+    if   vcs['browser'][:36] == 'http://anonscm.debian.org/gitweb/?p=':
+        vcs['browser'] = 'https://anonscm.debian.org/git/' + vcs['browser'][36:]
+    elif vcs['browser'][:37] == 'https://anonscm.debian.org/gitweb/?p=':
+        vcs['browser'] = 'https://anonscm.debian.org/git/' + vcs['browser'][37:]
+    elif vcs['browser'][:31] == 'http://anonscm.debian.org/cgit/':
+        vcs['browser'] = 'https://anonscm.debian.org/git/' + vcs['browser'][31:]
+    elif vcs['browser'][:32] == 'https://anonscm.debian.org/cgit/':
+        vcs['browser'] = 'https://anonscm.debian.org/git/' + vcs['browser'][32:]
+    elif vcs['browser'][:30] == 'http://anonscm.debian.org/git/':
+        vcs['browser'] = 'https://anonscm.debian.org/git/' + vcs['browser'][30:]
+    # Normalize old git clone URLs to new URL accessible by anyone
+    #   OLD: http://anonscm.debian.org/git/<repository>.git
+    #   OLD: git://anonscm.debian.org/git/<repository>.git
+    #   OLD: ssh+git://anonscm.debian.org/git/<repository>.git
+    #   OLD: git+ssh://anonscm.debian.org/git/<repository>.git
+    #   OLD: ssh://git.debian.org/<repository>.git
+    #   OLD: ssh+git://git.debian.org/<repository>.git
+    #   OLD: git+ssh://git.debian.org/<repository>.git
+    #   NEW: https://anonscm.debian.org/git/<repository>.git
+    if vcs['type'] == 'git':
+        if   vcs['url'][:30] == 'http://anonscm.debian.org/git/':
+            vcs['url'] = 'https://anonscm.debian.org/git/' + vcs['url'][30:]
+        elif vcs['url'][:29] == 'git://anonscm.debian.org/git/':
+            vcs['url'] = 'https://anonscm.debian.org/git/' + vcs['url'][29:]
+        elif vcs['url'][:33] == 'git+ssh://anonscm.debian.org/git/':
+            vcs['url'] = 'https://anonscm.debian.org/git/' + vcs['url'][33:]
+        elif vcs['url'][:33] == 'ssh+git://anonscm.debian.org/git/':
+            vcs['url'] = 'https://anonscm.debian.org/git/' + vcs['url'][33:]
+        elif vcs['url'][:21] == 'ssh://git.debian.org/':
+            vcs['url'] = 'https://anonscm.debian.org/git/' + vcs['url'][21:]
+        elif vcs['url'][:25] == 'git+ssh://git.debian.org/':
+            vcs['url'] = 'https://anonscm.debian.org/git/' + vcs['url'][25:]
+        elif vcs['url'][:25] == 'ssh+git://git.debian.org/':
+            vcs['url'] = 'https://anonscm.debian.org/git/' + vcs['url'][25:]
     return vcs
 
 
-- 
2.11.0


--- End Message ---
--- Begin Message ---
Hi Osamu,

On Sun, 22 Jan 2017, Osamu Aoki wrote:
> Looking at the discussion on d-d@l.d.o
>   https://lists.debian.org/debian-devel/2017/01/thrd2.html#00573
>   https://lists.debian.org/debian-devel/2017/01/msg00573.html
> 
> I realize this kind of new URL is best spread by using lintian and
> popular web service ;-)
> 
> Since I like python more, I wrote a proof-of-concept patch to convert
> URLs to preferred ones for tracker.

Thanks for patch but IMO the package tracker should not munge URL that it
extracts from source packages. We can report when the provided URLs are
broken (we already do this via vcswatch) but we should not do display
different URLs.

Thus I'm closing this ticket.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: https://www.freexian.com/services/debian-lts.html
Learn to master Debian: https://debian-handbook.info/get/

--- End Message ---

Reply to: