Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the config-model CPAN distribution.

Report information
The Basics
Id: 65575
Status: resolved
Priority: 0/
Queue: config-model

People
Owner: DDUMONT [...] cpan.org
Requestors: roam [...] ringlet.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Accept DM-Upload-Allowed and Vcs-* in the dpkg-control model
Hi, First of all, thanks for writing and maintaining Config-Model! I've recently started using it as an additional validation tool in my Debian packaging work, and it has already uncovered a couple of problems, some of them lurking unnoticed for years! What do you think about the attached patches that let config-edit recognize the DM-Upload-Allowed field that is kind of common with DM- maintained packages ;) and also teaches it that there are other version control systems besides Subversion for maintaining packaging files in? :) Admittedly, this second fix is somewhat incomplete, since I think I've seen Vcs-* spelled with differing capitalization, e.g. Vcs-git or Vcs-cvs or Vcs-CVS or similar; after a (very!) quick look at Config- Model I'm not sure if it can handle this - is it possible to specify that a field might have any capitalization, or are lookups done in a strictly case-sensitive way? Once again, thanks for maintaining Config-Model, and keep up the good work! G'luck, Peter
Subject: 0002-Define-the-DM-Upload-Allowed-field-in-the-debian-con.patch
From 188df5f3b8522465c96794ec8540cd014b0050b5 Mon Sep 17 00:00:00 2001 From: Peter Pentchev <roam@ringlet.net> Date: Tue, 8 Feb 2011 17:56:11 +0200 Subject: [PATCH 2/2] Define the DM-Upload-Allowed field in the debian/control template. --- .../Model/models/Debian/Dpkg/Control/Source.pl | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/lib/Config/Model/models/Debian/Dpkg/Control/Source.pl b/lib/Config/Model/models/Debian/Dpkg/Control/Source.pl index 88ae322..df6ae1c 100644 --- a/lib/Config/Model/models/Debian/Dpkg/Control/Source.pl +++ b/lib/Config/Model/models/Debian/Dpkg/Control/Source.pl @@ -122,6 +122,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 the final user; fulfilling this requirement might imply pointing to an anonymous access of the repository instead of pointing to an SSH-accessible version of the same. ' }, + 'DM-Upload-Allowed', + { + 'value_type' => 'uniline', + 'summary' => 'The package may be uploaded by a Debian Maintainer', + 'match' => 'yes', + 'type' => 'leaf', + 'description' => 'If this field is present, then any Debian Maintainers listed in the Maintainer or Uploaders fields may upload the package directly to the Debian archive. For more information see the "Debian Maintainer" page at the Debian Wiki - http://wiki.debian.org/DebianMaintainer', + }, 'Homepage', { 'value_type' => 'uniline', -- 1.7.2.3
Subject: 0001-Accept-all-the-Vcs-tags-defined.patch
From 96783a0a6273b4fe65140e1e637415a59d44f681 Mon Sep 17 00:00:00 2001 From: Peter Pentchev <roam@ringlet.net> Date: Tue, 8 Feb 2011 18:05:41 +0200 Subject: [PATCH 1/2] Accept all the Vcs-* tags defined. TODO: find out how to do this in a case-insensitive manner. --- .../Model/models/Debian/Dpkg/Control/Source.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/Config/Model/models/Debian/Dpkg/Control/Source.pl b/lib/Config/Model/models/Debian/Dpkg/Control/Source.pl index d115eed..88ae322 100644 --- a/lib/Config/Model/models/Debian/Dpkg/Control/Source.pl +++ b/lib/Config/Model/models/Debian/Dpkg/Control/Source.pl @@ -113,7 +113,7 @@ The archive area and section for each package should be specified in the package The information is meant to be useful for the final user, willing to browse the latest work done on the package (e.g. when looking for the patch fixing a bug tagged as pending in the bug tracking system). ' }, - 'Vcs-Svn', + ['Vcs-Arch', 'Vcs-Bzr', 'Vcs-Cvs', 'Vcs-Darcs', 'Vcs-Git', 'Vcs-Hg', 'Vcs-Mtn', 'Vcs-Svn'], { 'value_type' => 'uniline', 'summary' => 'URL of the VCS repository', -- 1.7.2.3
Thanks for the patch :-) The first one is excellent. I never thought of using match to provide this king of 'yes-or-nothing' parameter. My usual reflex would be to define a leaf with : value_type => enum, choice => [qw/yes no/], upstream_default => 'no' Since upstream_default is 'no', config-model would not write a DM-Upload-Allowed field if a user selects 'no' throught the interface. If you run config-edit just as a validator, the behavior will be identical. I'm just wondering what the user will see through the GUI with your definition... Anyway, I'll apply your patch. For the second patch, it does work. Although the GUI shows a lot of VCS-* parameters which is a bit confusing. Again this is not a problem if you run config-edit as a validator, but the editor mode is more cluttered. I'm tempted to define this as a set of 2 parameters: vcs_type: enum of [Arch, Bzr, Cvs ...] vcs_url: uniline Then the control parser would read/write the correct Vcs-* parameter depending on vcs_type. On the plus side: the GUI is less cluttered and the user could not set 2 URLS (which would probably be an error) On the downside, any error message around Vcs may be confusing since the error message will mention vcs_type and vcs_url. That will not strictly match the parameter name in control file... [/me is scratching head] What do you think ? As a side note, I've tried to validate your patch with config-model-edit to no avail: your modif is destroyed and is not shown in config-model-edit GUI. One more bug on my side :-p All the best
I've applied the first patch. There's no config-model-edit bug. I just had an outdated version on my home machine (oops) I'm still thinking about all the Vcs parameters ... All the best
Rats, I forgot to reply to the case issue. The fact that keywords are case insensitive is a syntax issue and not a semantic one. Hence this is handled by Debian::Dpkg::Control backend: all keywords are read in a case-insensitive manner and written back using the Vcs-* keywords as they are defined in the model. For instance, 'vcs-svn' keyword will be written back as 'Vcs-Svn'. All the best
Debian developer's reference guide mentions in section 6.2.5.2 (http://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-vcs). Vcs-* that several Vcs-* fields are allowed. So my proposal of vcs-url and vcs-type is wrong. So I'm also going to apply your first patch. Thanks
Hello I've uploaded a new version with both your patches. Debian package will follow soon. All the best