[Pkg-cli-common-commits] [SCM] cli-common branch, master, updated. debian/0.7.1-6-g8fb37e2

Mirco Bauer meebey at meebey.net
Fri Mar 25 00:31:59 UTC 2011


The following commit has been merged in the master branch:
commit db4ff93fdfe786c8b0662dbf9934993e75541e5e
Author: Mirco Bauer <meebey at meebey.net>
Date:   Thu Mar 24 23:07:34 2011 +0100

    Enhanced error handling for signature parsing and ignore delay-signed assemblies in dh_makeclilibs

diff --git a/dh_makeclilibs b/dh_makeclilibs
index 96bd72a..cff47fd 100755
--- a/dh_makeclilibs
+++ b/dh_makeclilibs
@@ -134,7 +134,7 @@ my $sn = 'sn';
 if (defined($dh{INTERNAL_MONO_FLAG}) ||
     (defined($ARGV[0]) && $ARGV[0] eq "internal-mono")) {
     $clr = "mono";
-    my $mono_path = "LD_LIBRARY_PATH=debian/tmp/usr/lib MONO_PATH=debian/tmp/usr/lib/mono/4.0";
+    my $mono_path = "LD_LIBRARY_PATH=debian/tmp/usr/lib MONO_PATH=debian/tmp/usr/lib/mono/4.0 MONO_CFG_DIR=debian/tmp/etc";
     $cli_parser = "$mono_path debian/tmp/usr/bin/monodis";
     $sn = "$mono_path debian/tmp/usr/bin/mono debian/tmp/usr/lib/mono/4.0/sn.exe";
     verbose_print("Will use build Mono (debian/tmp/usr/bin/monodis) for CIL parsing.");
@@ -194,35 +194,43 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
             chomp;
             my ($library, $ver, $libfile);
             $libfile = $_;
-            my $sig = `$sn -T $_ 2> /dev/null`;
-            $sig =~ s/.*key token: (\w+).*/$1/is;
-            if ($sig=~/\s/) {
-               warning "$libfile has no valid signature, ignoring";
-               next dll;
+
+            my $sig;
+            my $command = "$sn -T $libfile 2>&1";
+            verbose_print("running signature reader command: $command");
+            my $output = `$command`;
+            if ($? == 0) {
+                $sig = $output;
+                if ($sig !~ s/.*key token: (\w+).*/$1/is) {
+                   warning "$libfile has no signature, ignoring";
+                   next dll;
+                }
+            } else {
+                error("signature reader call failed: '$command' rc: $? output:\n$output");
+                return;
+            }
+
+            $command = "$sn -v $libfile 2>&1";
+            verbose_print("running signature verifier command: $command");
+            $output = `$command`;
+            if ($? != 0) {
+                verbose_print("signature verifier call failed: '$command' rc: $? output:\n$output");
+                warning("$libfile has no valid signature, ignoring");
+                next dll;
             }
 
-            my $command = "LANG=C MONO_GAC_PREFIX=\$MONO_GAC_PREFIX:$tmp/usr $cli_parser --assembly $libfile 2>&1";
+            $command = "LANG=C MONO_GAC_PREFIX=\$MONO_GAC_PREFIX:$tmp/usr $cli_parser --assembly $libfile 2>&1";
             verbose_print("running CLI parser command: $command");
 
-            my $dis = `$command`;
-            if ($dis =~ m/Name:\s+(\S+)/) {
-               $library = $1;
-               $dis =~ m/Version:\s+(\S+)/;
-               $ver = $1;
+            $output = `$command`;
+            if ($? == 0) {
+                $output =~ m/Name:\s+(\S+)/;
+                $library = $1;
+                $output =~ m/Version:\s+(\S+)/;
+                $ver = $1;
             } else {
-               # completely broken code, we need a mature app not
-               # depending on assembly loading
-               # verbose_print("trouble parsing monodis output, components not installed? Fallback to parsing the pure monodis output.");
-               # $dis = `monodis $libfile 2>&1`;
-               # $dis =~ /^module (\S+)/is;
-               # $library = $1;
-               # $library =~ s/'|"//;
-               warning("$cli_parser could not open $libfile, maybe some components not installed yet. Using filename to guess the assembly name :(");
-               $libfile=~ m,/(\d+\.\d+.\d+.\d+)__(\w+)/([^/]+)\.dll$,is;
-               next dll if (!($1 && $2 && $3));
-               $ver=$1;
-               $sig=$2;
-               $library=$3;
+                error("cli_parser call failed: '$command' rc: $? output:\n$output");
+                return;
             }
 
             if (!-d "$tmp/DEBIAN") {

-- 
cli-common



More information about the Pkg-cli-common-commits mailing list