[Pkg-mono-svn-commits] [SCM] mono branch, master-experimental, updated. debian/2.6.7-5-88-gbf09b22

Mirco Bauer meebey at meebey.net
Wed Apr 6 22:10:12 UTC 2011


The following commit has been merged in the master-experimental branch:
commit f8e8352c10cfda80cc5fcf62e3310759f555307d
Author: Mirco Bauer <meebey at meebey.net>
Date:   Mon Apr 4 20:14:40 2011 +0200

    Re-synced debhelper tools from cli-common 0.8~git.ca22e7 with .NET 4.0 support

diff --git a/debian/dh_clideps b/debian/dh_clideps
index 296d218..37d2880 100755
--- a/debian/dh_clideps
+++ b/debian/dh_clideps
@@ -156,10 +156,11 @@ if (defined($dh{INTERNAL_MONO_FLAG}) ||
 {
   local $/="";
   open(FILE, 'debian/control');
-  my @filedata = <FILE>;
+  my $srcblock = <FILE>;
   close(FILE);
-  if (!($filedata[0] =~ /Build-Depends(-Indep)?: .*cli-common-dev \(>= 0\.4\.4\)/)) {
-      warning("Warning! No Build-Depends(-Indep) on cli-common-dev (>= 0.4.4)!");
+  if ($srcblock =~ m/Build-Depends(?:\-Indep)?\:(?:.*\n\s+)*.*cli\-common\-dev\s*\(>=\s*([^\)]+)\)/ &&
+      system("dpkg", "--compare-versions", $1, ">=", "0.4.4") != 0) {
+    warning("Warning! No Build-Depends(-Indep) on cli-common-dev (>= 0.4.4)!");
   }
 }
 
@@ -220,6 +221,7 @@ close($fh);
 our $needs_net_1_0;
 our $needs_net_2_0;
 our $needs_net_2_1;
+our $needs_net_4_0;
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
   my $tmp = tmpdir($package);
@@ -230,6 +232,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
   $needs_net_1_0 = 0;
   $needs_net_2_0 = 0;
   $needs_net_2_1 = 0;
+  $needs_net_4_0 = 0;
   
   # for idempotency
   delsubstvar($package, "cli:Depends");
@@ -264,7 +267,9 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
   my $vm_ref = "";
   if (!defined($dh{R_FLAG}) && $found_exe) {
     if ($clr eq "mono") {
-      if ($needs_net_2_1) {
+      if ($needs_net_4_0) {
+        $vm_ref = "mono-runtime (>= 2.10.1), ";
+      } elsif ($needs_net_2_1) {
         $vm_ref = "mono-runtime (>= 1.2.6), ";
       } elsif ($needs_net_2_0) {
         $vm_ref = "mono-runtime (>= 1.1.8.1), ";
@@ -370,8 +375,22 @@ sub loadDllMap {
    foreach my $mapentry (@mapentries) {
      my $dll = $mapentry->getAttribute("dll");
      my $target = $mapentry->getAttribute("target");
-     #verbose_print("DLL map: '$dll' target: '$target'");
-     $dllmapdata->{$dll} = $target;
+     my $os = $mapentry->getAttribute("os");
+     my $valid = 1;
+     if ($os) {
+       $valid = ($os =~ m/^!/);
+       $os =~ s/^!//;
+       foreach (split(/,/, $os)) {
+         if ($_ eq "linux") {
+           $valid = !$valid;
+           last;
+         }
+       }
+     }
+     if ($valid) {
+       verbose_print("DLL map: '$dll' target: '$target'");
+       $dllmapdata->{$dll} = $target;
+     }
    }
 }
 
@@ -504,6 +523,8 @@ sub resolveClilibRefs {
           $needs_net_2_0 = 1;
         } elsif ($ver eq "2.1.0.0") {
           $needs_net_2_1 = 1;
+        } elsif ($ver eq "4.0.0.0") {
+          $needs_net_4_0 = 1;
         } else {
           warning("Warning: Unknown mscorlib version: $ver!");
         }
diff --git a/debian/dh_clifixperms b/debian/dh_clifixperms
index 36cced9..f6c0051 100755
--- a/debian/dh_clifixperms
+++ b/debian/dh_clifixperms
@@ -49,10 +49,10 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 	# Fix the permissions of various CLI-based files
 	for my $ext (qw(dll mdb cs config aspx))
 	{
-	    complex_doit("find $tmp $find_options -name \"*.$ext\" -print0",
+	    complex_doit("find $tmp $find_options -name \"*.$ext\" -type f -print0",
 			 "2>/dev/null | xargs -0r chmod 0644");
 	}
-	complex_doit("find $tmp $find_options -name \"*.exe\" -print0",
+	complex_doit("find $tmp $find_options -name \"*.exe\" -type f -print0",
 		     "2>/dev/null | xargs -0r chmod 0755");
 }
 
diff --git a/debian/dh_makeclilibs b/debian/dh_makeclilibs
index 2bec0a9..cff47fd 100755
--- a/debian/dh_makeclilibs
+++ b/debian/dh_makeclilibs
@@ -134,9 +134,9 @@ 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/1.0:debian/tmp/usr/lib/mono/2.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/1.0/sn.exe";
+    $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.");
 } elsif (-x "/usr/bin/monodis") {
     $clr = "mono";
@@ -153,10 +153,11 @@ if (defined($dh{INTERNAL_MONO_FLAG}) ||
 {
   local $/="";
   open(FILE, 'debian/control');
-  my @filedata = <FILE>;
-  close FILE;
-  if (!($filedata[0] =~ /Build-Depends(-Indep)?: .*cli-common-dev \(>= 0\.4\.4\)/)) {
-      warning("Warning! No Build-Depends(-Indep) on cli-common-dev (>= 0.4.4)!");
+  my $srcblock = <FILE>;
+  close(FILE);
+  if ($srcblock =~ m/Build-Depends(?:\-Indep)?\:(?:.*\n\s+)*.*cli\-common\-dev\s*\(>=\s*([^\)]+)\)/ &&
+      system("dpkg", "--compare-versions", $1, ">=", "0.4.4") != 0) {
+    warning("Warning! No Build-Depends(-Indep) on cli-common-dev (>= 0.4.4)!");
   }
 }
 
@@ -193,31 +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;
             }
-            my $dis = `$cli_parser --assembly $libfile 2>&1`;
-            if ($dis =~ m/Name:\s+(\S+)/) {
-               $library = $1;
-               $dis =~ m/Version:\s+(\S+)/;
-               $ver = $1;
+
+            $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;
+            }
+
+            $command = "LANG=C MONO_GAC_PREFIX=\$MONO_GAC_PREFIX:$tmp/usr $cli_parser --assembly $libfile 2>&1";
+            verbose_print("running CLI parser command: $command");
+
+            $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") {

-- 
mono



More information about the Pkg-mono-svn-commits mailing list