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

[SCM] Debian package checker branch, master, updated. 2.5.10-159-g7b8db3d



The following commit has been merged in the master branch:
commit dd3500a1fcbabfc3f8bf2d461a8c151faba2154a
Author: Niels Thykier <niels@thykier.net>
Date:   Fri Sep 21 15:50:49 2012 +0200

    L::L::Manifest: Add support for transient entries
    
    Tranisent entries will not be written to manifest file with
    write_list.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/lib/Lintian/Lab/Manifest.pm b/lib/Lintian/Lab/Manifest.pm
index 75355cd..2b1100c 100644
--- a/lib/Lintian/Lab/Manifest.pm
+++ b/lib/Lintian/Lab/Manifest.pm
@@ -244,6 +244,7 @@ sub write_list {
 
     $visitor = sub {
         my ($entry) = @_;
+        return if exists $entry->{'_transient'};
         my %values = %$entry;
         print $fd join(';', @values{@$fields}) . "\n";
     };
@@ -351,6 +352,25 @@ sub set {
     return 1;
 }
 
+=item set_transient_marker (TRANSIENT, KEYS...)
+
+Set or clear transient flag.  Transient entries are not written to the
+disk (i.e. They will not appear in the file created/written by
+L</write_list (FILE)>).  KEYS is passed as is passed to
+L</get (KEYS...)>.
+
+By default all entries are persistent.
+
+=cut
+
+sub set_transient_marker {
+    my ($self, $marker, @keys) = @_;
+    my $entry = $self->get (@keys);
+    return unless $entry;
+    $self->{'_transient'} = 1 if $marker;
+    delete $self->{'_transient'} unless $marker;
+}
+
 =item delete (KEYS...)
 
 Removes the entry/entries found by KEYS (if any).  KEYS must contain

-- 
Debian package checker


Reply to: