Author: wade
Date: 2007-05-05 04:55:53 -0400 (Sat, 05 May 2007)
New Revision: 76732

Modified:
   trunk/mono/ChangeLog
   trunk/mono/scripts/mono-find-provides.in
   trunk/mono/scripts/mono-find-requires.in
Log:
2007-05-05  Wade Berrier  <[EMAIL PROTECTED]>

        * scripts/mono-find-provides.in: don't use 'which' anymore (never solved
        anything since it broke symlinks)
        * scripts/mono-find-requires.in: also don't use 'which'
        Parse .config files to look for native libs.  Honor 'os' attributes for
        dllmaps.  Query rpm db for package that provides this lib.  Support 
64bit
        rpm configurations, as well as 32bit running on 64bit.



Modified: trunk/mono/ChangeLog
===================================================================
--- trunk/mono/ChangeLog        2007-05-05 07:46:56 UTC (rev 76731)
+++ trunk/mono/ChangeLog        2007-05-05 08:55:53 UTC (rev 76732)
@@ -1,3 +1,12 @@
+2007-05-05  Wade Berrier  <[EMAIL PROTECTED]>
+
+       * scripts/mono-find-provides.in: don't use 'which' anymore (never solved
+       anything since it broke symlinks)
+       * scripts/mono-find-requires.in: also don't use 'which'
+       Parse .config files to look for native libs.  Honor 'os' attributes for
+       dllmaps.  Query rpm db for package that provides this lib.  Support 
64bit
+       rpm configurations, as well as 32bit running on 64bit.
+
 2007-04-27  Marek Habersack  <[EMAIL PROTECTED]>
 
        * data/net_2_0/web.config: use fully qualified assembly names in

Modified: trunk/mono/scripts/mono-find-provides.in
===================================================================
--- trunk/mono/scripts/mono-find-provides.in    2007-05-05 07:46:56 UTC (rev 
76731)
+++ trunk/mono/scripts/mono-find-provides.in    2007-05-05 08:55:53 UTC (rev 
76732)
@@ -17,19 +17,15 @@
 #monolist=($(printf "%s\n" "[EMAIL PROTECTED]" | 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/..}
+: [EMAIL PROTECTED]@}
 
-exec_prefix=$d/..
 libdir=$prefix/@reloc_libdir@
-bindir=$d
+bindir=$prefix/bin
 
 # Bail out if monodis or libmono is missing
 if [ ! -x $bindir/monodis ] || [ ! -f $libdir/libmono.so ] ; then
-       echo "monodis missing or unusable, exiting..."
+       echo "monodis missing or unusable, exiting..." 1>&2
        exit 1
 fi
 

Modified: trunk/mono/scripts/mono-find-requires.in
===================================================================
--- trunk/mono/scripts/mono-find-requires.in    2007-05-05 07:46:56 UTC (rev 
76731)
+++ trunk/mono/scripts/mono-find-requires.in    2007-05-05 08:55:53 UTC (rev 
76732)
@@ -12,22 +12,29 @@
 filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
 monolist=($(printf "%s\n" "[EMAIL PROTECTED]" | egrep "\\.(exe|dll)\$"))
 
-a=`which "$0"`
-d=`dirname "$a"`
+# parse .config files to find which native libraries to depend on 
+#  (target attribute must have double quotes for this to work, ie: 
target="file" )
+# Add /etc/mono/config ?
+configlist=($(printf "%s\n" "[EMAIL PROTECTED]" | egrep "\\.config\$"))
 
 # Set the prefix, unless it is overriden (used when building mono rpms)
-: ${prefix=$d/..}
+: [EMAIL PROTECTED]@}
 
-exec_prefix=$d/..
 libdir=$prefix/@reloc_libdir@
-bindir=$d
+bindir=$prefix/bin
 
 # Bail out if monodis or libmono is missing
 if [ ! -x $bindir/monodis ] || [ ! -f $libdir/libmono.so ] ; then
-       echo "monodis missing or unusable, exiting..."
+       echo "monodis missing or unusable, exiting..." 1>&2
        exit 1
 fi
 
+# special case for 64bit archs
+if test "[EMAIL PROTECTED]@" = "xlib64" ; then
+        libext="()(64bit)"
+else
+        libext=""
+fi
 
 # set LD_LIBRARY_PATH to ensure that libmono.so is found
 export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
@@ -55,6 +62,47 @@
                        }
                    ') 2> /dev/null
        done
+       # Parse the xml .config files to see what native binaries we call into
+       # TODO: also check monodis --moduleref
+       for i in "[EMAIL PROTECTED]"; do
+               awk 'match($_, /<dllmap .*target=.*/) {
+                       ignore=0
+                       req=""
+                       split($_, toks, "\"")
+                       for(i=1; i <= length(toks); i++) {
+                               if(toks[i] ~ /target=/) {
+                                       req=toks[i+1]
+                               }
+                               if(toks[i] ~ /os=/) {
+                                       negate=0
+                                       found=0
+
+                                       attr=toks[i+1]
+                                       if(attr ~ /^!/) {
+                                               attr=substr(attr, 2, 
length(attr)-1)
+                                               negate=1
+                                       }
+
+                                       split(attr, os_targets, ",")
+                                       for(j=1; j <= length(os_targets); j++) {
+                                               if(os_targets[j] == "linux") {
+                                                       found=1
+                                               }
+                                       }
+
+                                       if(negate) {
+                                               found=!found
+                                       }
+                                       if (!found) {
+                                               ignore=1
+                                       } 
+                               }
+                       }
+                       if(!ignore) {
+                               system("rpm -q --whatprovides --queryformat 
\"%{NAME}\n\" ""\""req"'$libext'""\"")
+                       }
+               } ' $i 2>/dev/null
+       done
 )
 
 PROVIDES=$(

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to