[Mono-devel-list] A new mono-find-provides/mono-find-requires

Ben Maurer bmaurer at ximian.com
Fri May 6 15:15:07 EDT 2005


Hey,

Today I hacked up a new script for the mono-find-[provides/requires]
tools that are used to package rpms. These tools automatically find
dependencies. For example, because mono-develop references gtk#, when
you rug in monodevelop, the rpm for gtk-sharp is pulled, because it is
needed.

The problem with the current scripts is that they use reflection to load
the assemblies. This has a few issues: 
      * Assembly dependences must be resolved. This is an issue for
        programs that have a plugin like system. For example, in
        monodevelop, the Monodevelop.Core.dll is stored
        in /usr/lib/monodevelop/bin. Plugins, which are stored in a
        different directory reference these assemblies. The assemblies
        are not located in the gac. When the current script tries to
        find the dependencies, it doesn't know where to find
        Monodevelop.Core.dll, and can't process the file. 
      * Reflection is limited to looking at dlls that use the current
        runtime version.

Ideally, I'd like to use cecil for this type of script. However, I don't
think we are ready for that today. So for now, I am using an awk script
on top of monodis.

Packagers can now use the following find-provides script:

 
filelist=`sed "s/['\"]/\\\&/g"`
  
{
    echo $filelist | tr [:blank:] \\n | /usr/lib/rpm/find-provides
    echo $filelist | tr [:blank:] \\n | /usr/bin/mono-find-provides
} | sort | uniq

The previous syntax of:

	MONO_GAC_PREFIX=dest/usr /usr/bin/mono-find-provides

Will still work, but is no longer needed.

For those building mono itself, the following syntax is needed:

	echo $filelist | tr [:blank:] \\n | MONO_PREFIX=dest/usr dest/usr/bin/mono-find-provides

One possibility is that rather than saying:

: ${MONO_PREFIX=/usr}

I could do

MONO_PREFIX=$(dirname $(dirname $0))

Which would allow the killing of that variable.

-- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mono-find-provides
Type: application/x-shellscript
Size: 1142 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050506/4ed39e66/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mono-find-requires
Type: application/x-shellscript
Size: 1321 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050506/4ed39e66/attachment-0001.bin 


More information about the Mono-devel-list mailing list