On Fri, 2008-12-12 at 15:49 -0700, Andrew Jorgensen wrote:
> On Fri, 2008-12-12 at 21:10 +0000, Jonathan Pryor wrote:
> > BTW, where is the source for mono-find-provides and mono-find-requires?
> > The only versions I see are shell scripts that do odd things
> > with /usr/share/doc and don't seem to do anything but sit there when I
> > execute them...
> 
> In the mono svn module:
> scripts/mono-find-provides.in
> scripts/mono-find-requires.in

How's this patch do for you?

It's not perfect -- for one, it won't distinguish between foo.dll and
foo.exe within the same directory, which is permitted -- but it should
fare better than the current scripts wrt public & private assembly
distinctions.

 - Jon

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 121485)
+++ ChangeLog	(working copy)
@@ -1,3 +1,13 @@
+2008-12-12  Jonathan Pryor  <jpr...@novell.com>
+
+	* scripts/mono-find-provides.in, scripts/mono-find-requires.in:
+	  Distinguish between "public" assemblies (presumably located in the
+	  GAC) and private assemblies (located within some directory).  These
+	  need to be distinguished so that private assemblies can be
+	  depended upon but aren't "global" -- e.g. multiple different apps
+	  can bundle log4net.dll, but if it's not in the GAC other packages
+	  should only depend upon a fully-qualified log4net, not mono(log4net).
+
 2008-12-11  Mark Mason <mma...@upwardaccess.com>
 
 	* configure.in: introduce SIZEOF_REGISTER - usually ==SIZEOF_VOID_P, except on mips/n32
Index: scripts/mono-find-provides.in
===================================================================
--- scripts/mono-find-provides.in	(revision 121007)
+++ scripts/mono-find-provides.in	(working copy)
@@ -35,9 +35,10 @@
 
 for i in "${monoli...@]}"; do
         ($bindir/monodis --assembly $i | awk '
-                BEGIN { LIBNAME=""; VERSION=""; }
+                BEGIN { LIBNAME=""; VERSION=""; PUBKEY=""; }
                 /^Version:/ { VERSION=$2 }
                 /^Name:/    { LIBNAME=$2 }
+                /^PublicKey:/ { PUBKEY=$3 }
                 END {
 			if (LIBNAME ~ /^policy/) {
 				cnt = split(LIBNAME, toks, ".")
@@ -48,7 +49,10 @@
 				LIBNAME=substr(LIBNAME, 1, length(LIBNAME)-1)
 			}
                         if (VERSION && LIBNAME)
-                                print "mono(" LIBNAME ") = " VERSION
+                                if (PUBKEY == "(0x00000000)")
+                                        print "mono(@DIR@/" LIBNAME ") = " VERSION
+                                else
+                                        print "mono(" LIBNAME ") = " VERSION
                 }
-            ') 2>/dev/null
+            ' | sed "s...@dir@#`dirname ${monoli...@]}`#g") 2>/dev/null
 done
Index: scripts/mono-find-requires.in
===================================================================
--- scripts/mono-find-requires.in	(revision 121007)
+++ scripts/mono-find-requires.in	(working copy)
@@ -53,7 +53,7 @@
 REQUIRES=$(
 	for i in "${monoli...@]}"; do
 		($bindir/monodis --assemblyref $i | awk '
-			BEGIN { START=0; LIBNAME=""; VERSION=""; }
+			BEGIN { START=0; LIBNAME=""; VERSION=""; OP=""; PUBKEY=""; }
 			(START==0) && /^[0-9]+: Version=/ {
 				START=1;
 				sub(/Version=/, "", $2);
@@ -68,10 +68,16 @@
 					OP=">="
 				else
 					OP="="
+			}
+			(START==1) && /^\tZero sized public key/ {
+				print "mono(@DIR@/" LIBNAME ") " OP " " VERSION
+				START=0
+			}
+			(START==1) && /^\tPublic Key:/ {
 				print "mono(" LIBNAME ") " OP " " VERSION
 				START=0
 			}
-		    ') 2> /dev/null
+		    ' | sed "s...@dir@#`dirname ${monoli...@]}`#g") 2> /dev/null
 	done
 )
 
@@ -154,14 +160,18 @@
 PROVIDES=$(
 	for i in "${monoli...@]}"; do
 		($bindir/monodis --assembly $i | awk '
-			BEGIN { LIBNAME=""; VERSION=""; }
+			BEGIN { LIBNAME=""; VERSION=""; PUBKEY=""; }
 			/^Version:/ { VERSION=$2 }
 			/^Name:/    { LIBNAME=$2 }
+			/^PublicKey:/ { PUBKEY=$3 }
 			END {
 				if (VERSION && LIBNAME)
-					print "mono(" LIBNAME ") = " VERSION
+					if (PUBKEY == "(0x00000000)")
+						print "mono(@DIR@/" LIBNAME ") = " VERSION
+					else
+						print "mono(" LIBNAME ") = " VERSION
 			}
-		    ') 2>/dev/null
+		    ' | sed "s...@dir@#`dirname ${monoli...@]}`#g") 2>/dev/null
 	done
 )
 #
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to