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

[SCM] Debian package checker branch, master, updated. 2.5.11-33-gdc40b0d



The following commit has been merged in the master branch:
commit dc40b0dcb0523908822792ba784743f13d550e8c
Author: Niels Thykier <niels@thykier.net>
Date:   Mon Dec 31 16:19:24 2012 +0100

    L::Processable: Properly handle "source-version"
    
    When creating L::Lab::Entry instances, we currently rely on
    L::Processable's new_from_metadata to init the L::Lab::Entry instance.
    Unfortunately it previously discarded the "source-version" and relied
    on extracting it from the "source" field.
    
    The result is that the source-version field was effectively replaced
    with the package's own version (as is the default).  This error could
    then propagate back into the lab indices if these were changed in the
    run.
    
    Temporary labs are unaffected (it doesn't use indices) and static labs
    can be "repaired" by a simple "remove and re-add" of affected
    packages.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/debian/changelog b/debian/changelog
index d71655c..e2b3206 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -34,6 +34,9 @@ lintian (2.5.12) UNRELEASED; urgency=low
     + [NT] Re-instate the "TEXTREL" marker.  This fixes a regression
       where shared-libs compiled without pic was not reported.
       Thanks to Dmitry Shachnev for the assistance in debugging this.
+  * lib/Lintian/Processable.pm:
+    + [NT] Fix issue where packages loaded from the lab indices would
+      sometimes get a wrong source-version.
   * lib/Lintian/Relation/Version.pm:
     + [NT] Add and export "versions_comparator" that can be used for
       sorting purposes.
diff --git a/lib/Lintian/Processable.pm b/lib/Lintian/Processable.pm
index 5d2ebce..0909e92 100644
--- a/lib/Lintian/Processable.pm
+++ b/lib/Lintian/Processable.pm
@@ -101,8 +101,11 @@ sub new_from_metadata {
         if ($self->{'pkg_src'} =~ /^([-+\.\w]+)\s+\((.+)\)$/) {
             $self->{'pkg_src'} = $1;
             $self->{'pkg_src_version'} = $2;
+            croak "Two source-versions given (source + source-version)"
+                if exists $self->{'source-version'};
         } else {
-            $self->{'pkg_src_version'} = $self->pkg_version
+            $rename_field->('source-version', 'pkg_src_version',
+                            $self->pkg_version);
         }
         if (not exists $self->{'pkg_path'}) {
             my $fn = delete $self->{'filename'};

-- 
Debian package checker


Reply to: