[libconfig-model-dpkg-perl] 02/02: warn (and fix) if Vcs-* field is not a recommended URL (and fix tests) (Closes: #735309)

dod at debian.org dod at debian.org
Thu Jan 16 20:18:51 UTC 2014


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 75edad61d3a48fda019bb4812d844945ca426b96
Author: Dominique Dumont <dod at debian.org>
Date:   Thu Jan 16 21:18:41 2014 +0100

    warn (and fix) if Vcs-* field is not a recommended URL (and fix tests) (Closes: #735309)
---
 lib/Config/Model/models/Dpkg/Control/Source.pl  | 66 ++++++++++++++++++++++---
 t/model_tests.d/dpkg-control-test-conf.pl       |  8 +--
 t/model_tests.d/dpkg-examples/t0/debian/control |  2 -
 3 files changed, 63 insertions(+), 13 deletions(-)

diff --git a/lib/Config/Model/models/Dpkg/Control/Source.pl b/lib/Config/Model/models/Dpkg/Control/Source.pl
index 62fbe85..9f3eb01 100644
--- a/lib/Config/Model/models/Dpkg/Control/Source.pl
+++ b/lib/Config/Model/models/Dpkg/Control/Source.pl
@@ -200,7 +200,16 @@ The information is meant to be useful for the final user, willing to browse the
         'match' => '^https?://',
         'summary' => 'web-browsable URL of the VCS repository',
         'type' => 'leaf',
-        'value_type' => 'uniline'
+        'value_type' => 'uniline',
+        'warn_unless' => {
+          'debian-uri' => {
+            'code' => '!defined $_ or ! /debian.org/ or m{^https?://anonscm.debian.org/(viewvc|gitweb|loggerhead)} ;',
+            'fix' => 's{https?://svn\\.debian\\.org/\w+svn/}{http://anonscm.debian.org/viewvc/};
+s{http://git.debian.org/?p=}{http://anonscm.debian.org/gitweb/?p=};
+s{http://bzr.debian.org/loggerhead/}{http://anonscm.debian.org/loggerhead/};',
+            'msg' => 'URL to debian system is not the recommended one'
+          }
+        }
       },
       'Vcs-Arch',
       {
@@ -209,7 +218,14 @@ The information is meant to be useful for the final user, willing to browse the
 The information is meant to be useful for a user knowledgeable in the given Version Control System and willing to build the current version of a package from the VCS sources. Other uses of this information might include automatic building of the latest VCS version of the given package. To this end the location pointed to by the field should better be version agnostic and point to the main branch (for VCSs supporting such a concept). Also, the location pointed to should be accessible to t [...]
         'summary' => 'URL of the VCS repository',
         'type' => 'leaf',
-        'value_type' => 'uniline'
+        'value_type' => 'uniline',
+        'warn_unless' => {
+          'debian-uri' => {
+            'code' => '!defined $_ or ! /debian.org/ or m{^http://anonscm.debian.org/arch} ;',
+            'fix' => 's!http://[\\w\\.-]+/(arch/)*!http://anonscm.debian.org/arch/!;',
+            'msg' => 'URL to debian system is not the recommended one'
+          }
+        }
       },
       'Vcs-Bzr',
       {
@@ -218,7 +234,15 @@ The information is meant to be useful for a user knowledgeable in the given Vers
 The information is meant to be useful for a user knowledgeable in the given Version Control System and willing to build the current version of a package from the VCS sources. Other uses of this information might include automatic building of the latest VCS version of the given package. To this end the location pointed to by the field should better be version agnostic and point to the main branch (for VCSs supporting such a concept). Also, the location pointed to should be accessible to t [...]
         'summary' => 'URL of the VCS repository',
         'type' => 'leaf',
-        'value_type' => 'uniline'
+        'value_type' => 'uniline',
+        'warn_unless' => {
+          'debian-uri' => {
+            'code' => '!defined $_ or ! /debian.org/ or m{^http://anonscm.debian.org/bzr/} ;',
+            'fix' => 's{http://\\w+.debian.org/(bzr/)*}{http://anonscm.debian.org/bzr/};
+',
+            'msg' => 'URL to debian system is not the recommended one'
+          }
+        }
       },
       'Vcs-Cvs',
       {
@@ -227,7 +251,15 @@ The information is meant to be useful for a user knowledgeable in the given Vers
 The information is meant to be useful for a user knowledgeable in the given Version Control System and willing to build the current version of a package from the VCS sources. Other uses of this information might include automatic building of the latest VCS version of the given package. To this end the location pointed to by the field should better be version agnostic and point to the main branch (for VCSs supporting such a concept). Also, the location pointed to should be accessible to t [...]
         'summary' => 'URL of the VCS repository',
         'type' => 'leaf',
-        'value_type' => 'uniline'
+        'value_type' => 'uniline',
+        'warn_unless' => {
+          'debian-uri' => {
+            'code' => '!defined $_ or ! /debian.org/ or m{\\@anonscm.debian.org:/cvs/} ;',
+            'fix' => 's{\\@(?:cvs.alioth|anonscm)\\.debian\\.org:/cvsroot/}
+                      {\\@anonscm.debian.org:/cvs/}',
+            'msg' => 'URL to debian system is not the recommended one'
+          }
+        }
       },
       'Vcs-Darcs',
       {
@@ -255,10 +287,16 @@ The information is meant to be useful for a user knowledgeable in the given Vers
         'summary' => 'URL of the VCS repository',
         'type' => 'leaf',
         'value_type' => 'uniline',
+        'warn_if_match' => {
+          '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://anonscm.debian.org/(git/)*!;'
+            'fix' => 's!http://[\\w\\.-]+/(git/)*!http://anonscm.debian.org/git/!; s!git://[\\w\\.-]+/!git://anonscm.debian.org/(git/)*!;',
+            'msg' => 'URL to debian system is not the recommended one'
           }
         }
       },
@@ -269,7 +307,14 @@ The information is meant to be useful for a user knowledgeable in the given Vers
 The information is meant to be useful for a user knowledgeable in the given Version Control System and willing to build the current version of a package from the VCS sources. Other uses of this information might include automatic building of the latest VCS version of the given package. To this end the location pointed to by the field should better be version agnostic and point to the main branch (for VCSs supporting such a concept). Also, the location pointed to should be accessible to t [...]
         'summary' => 'URL of the VCS repository',
         'type' => 'leaf',
-        'value_type' => 'uniline'
+        'value_type' => 'uniline',
+        'warn_unless' => {
+          'debian-uri' => {
+            'code' => '!defined $_ or ! /debian.org/ or m{^http://anonscm.debian.org/hg/};',
+            'fix' => 's{http://\\w+.debian.org/(hg/)*}{http://anonscm.debian.org/hg/};',
+            'msg' => 'URL to debian system is not the recommended one'
+          }
+        }
       },
       'Vcs-Mtn',
       {
@@ -287,7 +332,14 @@ The information is meant to be useful for a user knowledgeable in the given Vers
 The information is meant to be useful for a user knowledgeable in the given Version Control System and willing to build the current version of a package from the VCS sources. Other uses of this information might include automatic building of the latest VCS version of the given package. To this end the location pointed to by the field should better be version agnostic and point to the main branch (for VCSs supporting such a concept). Also, the location pointed to should be accessible to t [...]
         'summary' => 'URL of the VCS repository',
         'type' => 'leaf',
-        'value_type' => 'uniline'
+        'value_type' => 'uniline',
+        'warn_unless' => {
+          'debian-uri' => {
+            'code' => '!defined $_ or ! /debian.org/ or m{^svn://anonscm.debian.org/} ;',
+            'fix' => 's{svn://\\w+.debian.org/(svn/)*}{svn://anonscm.debian.org/};',
+            'msg' => 'URL to debian system is not the recommended one'
+          }
+        }
       },
       'DM-Upload-Allowed',
       {
diff --git a/t/model_tests.d/dpkg-control-test-conf.pl b/t/model_tests.d/dpkg-control-test-conf.pl
index 1d4dc07..6f5f519 100644
--- a/t/model_tests.d/dpkg-control-test-conf.pl
+++ b/t/model_tests.d/dpkg-control-test-conf.pl
@@ -41,7 +41,7 @@ providing the following file:
 
         # t1
         check => { 'binary:seaview Recommends:0', 'clustalw', },
-        load_warnings => [ qr/dependency is deprecated/,qr/standards version/, qr/too long/ ],
+        load_warnings => [ qr/dependency is deprecated/,qr/standards version/, qr/Vcs-Browser/, qr/Vcs-Svn/, qr/too long/ ],
         apply_fix => 1,
         load => 'binary:seaview Synopsis="multiplatform interface for sequence alignment"',
     },
@@ -74,7 +74,7 @@ providing the following file:
               "Release tests for POD spelling",
             'binary:libdist-zilla-plugin-podspellingtests-perl Description' => $t3_description ,
         },
-        load_warnings => [ qr/standards version/, (qr/value/) x 2],
+        load_warnings => [ qr/standards version/, (qr/Vcs/) x 2, (qr/value/) x 2],
         load => 'binary:libdist-zilla-plugin-podspellingtests-perl '.
             'Description="'.$t3_description.'"',
         apply_fix => 1,
@@ -103,7 +103,7 @@ providing the following file:
     {
         name => 'sdlperl',
         load => 'source Uploaders:2="Sam Hocevar (Debian packages) <sam at zoy.org>"',
-        load_warnings => [ ( qr/Warning/) x 9 ],
+        load_warnings => [ ( qr/Warning/) x 11 ],
         load_check => 'skip',
         check => { 'binary:libsdl-perl Depends:2' => '${misc:Depends}' },
         apply_fix => 1,
@@ -171,7 +171,7 @@ providing the following file:
     },
     {
         name => 'gnu-r-stuff',
-        load_warnings => [ qr/standards version/ ],
+        load_warnings => [ qr/standards version/ , (qr/Vcs/) x 2 ],
         apply_fix => 1,
         check => [
             'source Section' => 'gnu-r',
diff --git a/t/model_tests.d/dpkg-examples/t0/debian/control b/t/model_tests.d/dpkg-examples/t0/debian/control
index 58fc5e3..50f183b 100644
--- a/t/model_tests.d/dpkg-examples/t0/debian/control
+++ b/t/model_tests.d/dpkg-examples/t0/debian/control
@@ -10,8 +10,6 @@ Uploaders: Dominique Dumont <domi.dumont at free.fr>,
            Fabrizio Regalli <fabreg at fabreg.it>
 Standards-Version: 3.9.5
 Homepage: http://search.cpan.org/dist/Config-Model-Approx/
-Vcs-Svn: svn://svn.debian.org/svn/pkg-perl/tags/libconfig-model-approx-perl
-Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-perl/trunk/libconfig-model-approx-perl/
 
 Package: libconfig-model-approx-perl
 Architecture: all

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