The following commit has been merged in the master branch:
commit 2d99551b9610edb5c048c18174ef3b62e4fe50c1
Author: Adam D. Barratt <[EMAIL PROTECTED]>
Date:   Wed Aug 6 21:02:50 2008 +0100

    Add Lintian::Collect::Binary::scripts

diff --git a/debian/changelog b/debian/changelog
index 9ea62f4..7e02992 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -136,6 +136,7 @@ lintian (1.24.3) unstable; urgency=low
       an Ocaml executable.  Also add information on segments which various
       checks scripts use which hadn't made it here yet.
     + [ADB] Make index() return a hash rather than an array
+    + [ADB] Add support for parsing the "scripts" index file
   * lib/Read_taginfo.pm:
     + [FL] Handle URLs in the Ref: field.
 
diff --git a/lib/Lintian/Collect/Binary.pm b/lib/Lintian/Collect/Binary.pm
index a16f03d..f03a047 100644
--- a/lib/Lintian/Collect/Binary.pm
+++ b/lib/Lintian/Collect/Binary.pm
@@ -126,6 +126,33 @@ sub file_info {
     return $self->{file_info};
 }
 
+sub scripts {
+    my ($self) = @_;
+    return $self->{scripts} if exists $self->{scripts};
+
+    my %scripts;
+    open(SCRIPTS, '<', "scripts")
+       or fail("cannot open scripts file: $!");
+    while (<SCRIPTS>) {
+       chomp;
+       my (%file, $name);
+
+       m/^(env )?(\S*) (.*)$/o
+           or fail("bad line in scripts file: $_");
+       ($file{calls_env}, $file{interpreter}, $name) = ($1, $2, $3);
+
+       $name =~ s,^\./,,o;
+       $name =~ s,/+$,,o;
+       $file{name} = $name;
+       $scripts{$name} = \%file;
+    }
+    close SCRIPTS;
+    $self->{scripts} = \%scripts;
+
+    return $self->{scripts};
+}
+
+
 # Returns the information from collect/objdump-info
 sub objdump_info {
     my ($self) = @_;

-- 
Debian package checker


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to