On Fri, Aug 03, 2007 at 01:34:25PM +0400, Alexey Tourbin wrote: > Господа, вот этот кусок кода я не понял и собираюсь его убить. > По-моему, он просто не работает, а добавлять 2>/dev/null дело не хитрое. Я разобрался, для чего нужны *.dll.config файлы, и реализовал поиск soname-зависимостей в *.dll байткоде mono. Это, в частности, означает, что теперь mono пакеты, как правило, не могут быть noarch. Если кто-то разбирается в том, как работает mono на уровне загрузки разделяемых библиотек, прошу посмотреть нижеследующее и высказаться. commit 5c616477a2f2fe314d7e684c0e1b75bb85b8f227 Author: Alexey Tourbin Date: Sun Aug 5 00:40:15 2007 +0400 mono.req: implemented MonoLibReq() to grab sonames from *.dll.config files The idea is that, since Mono bytecode must be portable, it cannot contain soname references, only "module references". Module to soname mapping is done with system-dependent *.dll.config xml file. I grab module references from dll and try to resolve them into sonames. See also http://www.mail-archive.com/pld-devel-en@lists.pld-linux.org/msg03358.html diff --git a/mono.req b/mono.req index 1d8e911..eff48d4 100755 --- a/mono.req +++ b/mono.req @@ -27,6 +27,32 @@ Monodis() fi } +MonoLibReq() +{ + local f="$1" out=; shift + out=$(Monodis --moduleref "$f") + local refs= + refs=$(echo "$out" |sed -n 's/^[1-9][0-9]*: *//p') + + [ -n "${RPM_LIB-}" ] || RPM_LIB=`rpm --eval %_lib` + local suffix; [ "$RPM_LIB" = lib64 ] && suffix='()(64bit)' || suffix= + + local ref + for ref in $refs; do + local target="$(fgrep "dll=\"$ref\"" "$f".config 2>/dev/null | + sed -n 's/.*target="\(lib[^"]*[.]so[.][^"]*\)".*/\1/p' |head -1)" + if [ -n "$target" ]; then + Verbose "$f: $ref -> $target" + echo "$target$suffix" + elif [ -z "${ref##lib*.so.*}" ]; then + Verbose "$f: $ref = $ref" + echo "$ref$suffix" + else + Info "$f: cannot resolve module reference $ref" + fi + done +} + MonoReq() { local f="$1" out=; shift @@ -50,6 +76,9 @@ MonoReq() print "mono(" LIBNAME ") " OP " " VERSION START=0 }' + if [ -f "$f".config ]; then + MonoLibReq "$f" + fi } MonoProv()