X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=scripts%2Fmono-find-provides.in;h=f7ee80ea4cb2218f5f124cc950a37aca5b3ebb56;hb=f82ebdb1e7fd643513dd085608c411f1b8fa2e95;hp=e287f2d7017e9627a4bea2f213342f3ca045aab3;hpb=7ff8f29ff29fa3f08ef305ac43ef079097323286;p=mono.git diff --git a/scripts/mono-find-provides.in b/scripts/mono-find-provides.in index e287f2d7017..f7ee80ea4cb 100644 --- a/scripts/mono-find-provides.in +++ b/scripts/mono-find-provides.in @@ -1,2 +1,55 @@ -#!/bin/sh -exec @bindir@/@mono_interp@ @plat_bindir@/mono-find-provides.exe "$@" +#!/bin/bash +# +# mono-find-provides +# +# Authors: +# Ben Maurer (bmaurer@ximian.com) +# +# (C) 2005 Novell (http://www.novell.com) +# + +IFS=$'\n' +filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/')) +monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$")) + +# Only include files with /gac/ in path +# (Allows packages to contain private assemblies that don't conflict with other packages) +#monolist=($(printf "%s\n" "${monolist[@]}" | egrep "/gac/")) +# Disabled... see ChangeLog + +a=`which "$0"` +d=`dirname "$a"` + +# Set the prefix, unless it is overriden (used when building mono rpms) +: ${prefix=$d/..} + +exec_prefix=$d/.. +libdir=$prefix/@reloc_libdir@ +bindir=$d + +[ -x $bindir/monodis ] || exit 0; +[ -f $libdir/libmono.so ] || exit 0; + + +# set LD_LIBRARY_PATH to ensure that libmono.so is found +export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} + +for i in "${monolist[@]}"; do + ($bindir/monodis --assembly $i | awk ' + BEGIN { LIBNAME=""; VERSION=""; } + /^Version:/ { VERSION=$2 } + /^Name:/ { LIBNAME=$2 } + END { + if (LIBNAME ~ /^policy/) { + cnt = split(LIBNAME, toks, ".") + VERSION=toks[2] "." toks[3] ".0.0" + LIBNAME="" + for (i=4; i<= cnt; i++) + LIBNAME = (LIBNAME toks[i] ".") + LIBNAME=substr(LIBNAME, 1, length(LIBNAME)-1) + } + if (VERSION && LIBNAME) + print "mono(" LIBNAME ") = " VERSION + } + ') 2>/dev/null +done