[libconfig-model-dpkg-perl] 01/01: Source model: cme fix Vcs-Git url will use https://

dod at debian.org dod at debian.org
Thu Jan 28 19:48:53 UTC 2016


This is an automated email from the git hooks/post-receive script.

dod pushed a commit to branch master
in repository libconfig-model-dpkg-perl.

commit 0c453bc0a1a5fe4c2efc5eeff8847adfecd0a033
Author: Dominique Dumont <dod at debian.org>
Date:   Thu Jan 28 20:47:53 2016 +0100

    Source model: cme fix Vcs-Git url will use https://
---
 lib/Config/Model/models/Dpkg/Control/Source.pl | 14 ++++++++-----
 t/dependency-check.t                           | 28 ++++++++++++++------------
 t/model_tests.d/dpkg-control-test-conf.pl      | 16 ++++++++-------
 3 files changed, 33 insertions(+), 25 deletions(-)

diff --git a/lib/Config/Model/models/Dpkg/Control/Source.pl b/lib/Config/Model/models/Dpkg/Control/Source.pl
index 1fb2e03..0380cb0 100644
--- a/lib/Config/Model/models/Dpkg/Control/Source.pl
+++ b/lib/Config/Model/models/Dpkg/Control/Source.pl
@@ -388,8 +388,8 @@ The information is meant to be useful for a user knowledgeable in the given Vers
       {
         'compute' => {
           'allow_override' => '1',
-          'formula' => '  $maintainer =~ /(pkg-perl)/                        ? "git://anonscm.debian.org/$1/packages/$pkgname.git"
-: $maintainer =~ /(pkg-(?:ruby-extras|javascript))/  ? "git://anonscm.debian.org/$1/$pkgname.git"
+          'formula' => '  $maintainer =~ /(pkg-perl)/                        ? "https://anonscm.debian.org/$1/packages/$pkgname.git"
+: $maintainer =~ /(pkg-(?:ruby-extras|javascript))/  ? "https://anonscm.debian.org/$1/$pkgname.git"
 :                                                    \'\' ;',
           'use_eval' => '1',
           'variables' => {
@@ -404,15 +404,19 @@ The information is meant to be useful for a user knowledgeable in the given Vers
         'type' => 'leaf',
         'value_type' => 'uniline',
         'warn_if_match' => {
+          '^git://' => {
+            'fix' => 's/^git:/https:/;',
+            'msg' => 'An unencrypted transport protocol is used for this URI. It is recommended to use a secure transport such as HTTPS for anonymous read-only access.'
+          },
           'debian.org/~' => {
             'msg' => 'URL contains deprecated \'~\' path to user'
           }
         },
         'warn_unless' => {
           'debian-uri' => {
-            'code' => '!defined $_ or ! /debian.org/ or m{^http://anonscm.debian.org/git/(?!git/)} or m{^git://anonscm.debian.org/(?!git/)} ;',
-            'fix' => 's!http://[\\w\\.-]+/(git/)*!http://anonscm.debian.org/git/!;
-s!git://[\\w\\.-]+/(git/)?!git://anonscm.debian.org/!;',
+            'code' => '!defined $_ or ! /debian.org/ or m{^https://anonscm.debian.org/git/(?!git/)};',
+            'fix' => 's!http://[\\w\\.-]+/(git/)*!https://anonscm.debian.org/git/!;
+s!git://[\\w\\.-]+/(git/)?!https://anonscm.debian.org/git/!;',
             'msg' => 'URL to debian system is not the recommended one'
           }
         }
diff --git a/t/dependency-check.t b/t/dependency-check.t
index 6655378..d298083 100644
--- a/t/dependency-check.t
+++ b/t/dependency-check.t
@@ -352,27 +352,29 @@ is($perl_bdi->fetch,"libmodule-build-perl","check fixed B-D-I dependency value")
 print scalar $inst->list_changes,"\n" if $trace ;
 is($inst->c_count, 1,"check that fixes are tracked with notify changes") ;
 
+my $expected_warn = qr/RL to debian system/;
 my @vcs_tests = (
-    [ 'Vcs-Browser', 'http://git.debian.org/?p=debian-med/r-cran-stringr.git;a=summary', 'https://anonscm.debian.org/cgit/debian-med/r-cran-stringr.git'],
-    [ 'Vcs-Browser', 'https://svn.debian.org/yadasvn/','http://anonscm.debian.org/viewvc/'],
-    [ 'Vcs-Browser', 'http://bzr.debian.org/loggerhead/','http://anonscm.debian.org/loggerhead/'],
-    [ 'Vcs-Arch',    'http://foo.debian.org/arch/arch/','http://anonscm.debian.org/arch/'],
-    [ 'Vcs-Bzr',     'http://baz.debian.org/','http://anonscm.debian.org/bzr/'],
-    [ 'Vcs-Cvs',     'svn at cvs.alioth.debian.org:/cvsroot/','svn at anonscm.debian.org:/cvs/'],
-    [ 'Vcs-Git',     'http://foo.debian.org/git/bar.git','http://anonscm.debian.org/git/bar.git'],
-    [ 'Vcs-Git',     'git://foo.debian.org/git/bar.git','git://anonscm.debian.org/bar.git'],
-    [ 'Vcs-Hg',      'http://foo.debian.org/hg/foo','http://anonscm.debian.org/hg/foo'],
-    [ 'Vcs-Svn',     'svn://foo.debian.org/svn/foo','svn://anonscm.debian.org/foo'],
+    [ 'Vcs-Browser', 'http://git.debian.org/?p=debian-med/r-cran-stringr.git;a=summary',
+      'https://anonscm.debian.org/cgit/debian-med/r-cran-stringr.git', $expected_warn ],
+    [ 'Vcs-Browser', 'https://svn.debian.org/yadasvn/','http://anonscm.debian.org/viewvc/', $expected_warn ],
+    [ 'Vcs-Browser', 'http://bzr.debian.org/loggerhead/','http://anonscm.debian.org/loggerhead/', $expected_warn ],
+    [ 'Vcs-Arch',    'http://foo.debian.org/arch/arch/','http://anonscm.debian.org/arch/', $expected_warn ],
+    [ 'Vcs-Bzr',     'http://baz.debian.org/','http://anonscm.debian.org/bzr/', $expected_warn ],
+    [ 'Vcs-Cvs',     'svn at cvs.alioth.debian.org:/cvsroot/','svn at anonscm.debian.org:/cvs/', $expected_warn ],
+    [ 'Vcs-Git',     'http://foo.debian.org/git/bar.git','https://anonscm.debian.org/git/bar.git', $expected_warn ],
+    [ 'Vcs-Git',     'git://foo.debian.org/git/bar.git','https://anonscm.debian.org/git/bar.git', qr/unencrypted/, $expected_warn ],
+    [ 'Vcs-Hg',      'http://foo.debian.org/hg/foo','http://anonscm.debian.org/hg/foo', $expected_warn ],
+    [ 'Vcs-Svn',     'svn://foo.debian.org/svn/foo','svn://anonscm.debian.org/foo', $expected_warn ],
 );
 
 foreach my $vt (@vcs_tests) {
-    my ($elt, $urla, $urlb) = @$vt;
+    my ($elt, $urla, $urlb, @expected_warn) = @$vt;
     my $vcs = $control->grab("source $elt") ;
 
     warning_like {
         $vcs->store($urla) ;
-    }
-    qr/RL to debian system/,"old URL triggers a warning on $elt";
+    } \@expected_warn ,"old URL triggers a warning on $elt";
+
 
     {
         local $Config::Model::Value::nowarning = 1 ;
diff --git a/t/model_tests.d/dpkg-control-test-conf.pl b/t/model_tests.d/dpkg-control-test-conf.pl
index e251e92..3966564 100644
--- a/t/model_tests.d/dpkg-control-test-conf.pl
+++ b/t/model_tests.d/dpkg-control-test-conf.pl
@@ -31,7 +31,7 @@ providing the following file:
             'binary:libdist-zilla-plugins-cjm-perl Depends:0',
             '${misc:Depends}',
             'source Vcs-Browser' ,'https://anonscm.debian.org/cgit/pkg-perl/packages/libdist-zilla-plugins-cjm-perl.git',
-            'source Vcs-Git', 'git://anonscm.debian.org/pkg-perl/packages/libdist-zilla-plugins-cjm-perl.git',
+            'source Vcs-Git', 'https://anonscm.debian.org/git/pkg-perl/packages/libdist-zilla-plugins-cjm-perl.git',
         },
         load_warnings => [ qr/dependency/, qr/dual life/, (qr/dependency/) x 2, 
                           qr/libmodule-build-perl \(>= 0.360000\) \| perl \(>= 5.8.8\)/,
@@ -113,7 +113,7 @@ providing the following file:
     },
     {
         name => 'libpango-perl',
-        load_warnings => [ ( qr/Warning/) x 3 ],
+        load_warnings => [ ( qr/Warning/) x 4 ],
         verify_annotation => {
             'source Build-Depends' => "do NOT add libgtk2-perl to build-deps (see bug #554704)",
             'source Maintainer'    => "what a fine\nteam this one is",
@@ -123,31 +123,32 @@ providing the following file:
     },
     {
         name => 'libwx-scintilla-perl',
-        load_warnings => [ ( qr/Warning/) x 4 ],
+        load_warnings => [ ( qr/Warning/) x 5 ],
         apply_fix => 1,
     },
     {
         # test for #683861
         name => 'libmodule-metadata-perl',
-        load_warnings => [ ( qr/Warning/) x 4 ],
+        load_warnings => [ ( qr/Warning/) x 5 ],
         apply_fix => 1,
     },
     {
         # test for #682730
         name => 'libclass-meta-perl',
-        load_warnings => [ ( qr/Vcs-Git/) ],
+        load_warnings => [ ( qr/Vcs-Git/) x 2 ],
          check => { 'source Build-Depends-Indep:1' => 'libclass-isa-perl | perl (<< 5.10.1-13)' },
         apply_fix => 1,
     },
     {
         # test for #692849, must not warn about missing libfoo dependency
         name => 'dbg-dep',
-        load_warnings => [ qr/DM-Upload/ ],
+        load_warnings => [ ( qr/Vcs-Git/) x 2, qr/DM-Upload/ ],
     },
     {
         # test for #696768, Built-Using field
         name => 'built-using',
-        load_warnings => [ qr/DM-Upload/ ],
+        load_warnings => [ ( qr/Vcs-Git/) x 2, qr/DM-Upload/ ],
+        apply_fix => 1,
     },
     {
         # test for #719753, XS-Autobuild field
@@ -156,6 +157,7 @@ providing the following file:
             'source Section' => 'non-free/libs',
             'source XS-Autobuild' => 'yes',
         },
+        load_warnings => [ ( qr/Vcs-Git/) x 2 ],
     },
     {
         # test for #713053,  XS-Ruby-Versions and XB-Ruby-Versions fields

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libconfig-model-dpkg-perl.git



More information about the Pkg-perl-cvs-commits mailing list