Author: wade
Date: 2008-01-23 11:04:58 -0500 (Wed, 23 Jan 2008)
New Revision: 93665

Modified:
   trunk/mono/scripts/mono-find-requires.in
Log:
Print a warning to stderr instead of generating invalid deps containing
"no package provides <blah>"



Modified: trunk/mono/scripts/mono-find-requires.in
===================================================================
--- trunk/mono/scripts/mono-find-requires.in    2008-01-23 15:56:43 UTC (rev 
93664)
+++ trunk/mono/scripts/mono-find-requires.in    2008-01-23 16:04:58 UTC (rev 
93665)
@@ -4,8 +4,9 @@
 #
 # Authors:
 #       Ben Maurer ([EMAIL PROTECTED])
+#       Wade Berrier ([EMAIL PROTECTED])
 #
-# (C) 2005 Novell (http://www.novell.com)
+# (C) 2008 Novell (http://www.novell.com)
 #
 
 IFS=$'\n'
@@ -69,6 +70,9 @@
                        }
                    ') 2> /dev/null
        done
+)
+
+rpm_config_REQUIRES=$(
        # Parse the xml .config files to see what native binaries we call into
        # TODO: also check monodis --moduleref
        for i in "[EMAIL PROTECTED]"; do
@@ -110,12 +114,25 @@
                                }
                        }
                        if(!ignore) {
-                               system("rpm -q --whatprovides --queryformat 
\"%{NAME}\n\" ""\""req"'$libext'""\"")
+                               print req"'$libext'"
                        }
                } ' $i 2>/dev/null
        done
 )
 
+# Resolve provides to packages, warning on missing to stderr
+config_REQUIRES=$(
+       for i in [EMAIL PROTECTED] ; do
+               out=$(rpm -q --whatprovides --queryformat "%{NAME}\n" $i)
+               if [ $? -eq 0 ] ; then
+                       echo $out
+               else
+                       # echo to stderr
+                       echo "mono-find-requires: Warning, could not find 
package that provides: $i" >&2
+               fi
+       done
+)
+
 # Note about above:
 #  Use to do: system("rpm -q --whatprovides --queryformat \"%{NAME}\n\" 
""\""req"'$libext'""\"")
 #  rpmlint prefers to have lib names instead of package names.  There was a 
reason I was using package names but it slips me now...
@@ -140,9 +157,10 @@
 # in PROVIDES. While RPM functions correctly when such deps exist,
 # they make the metadata a bit bloated.
 #
+# TODO: make this use the mono-find-provides script, to share code
 
 # Filter out dups from both lists
-REQUIRES=$(echo "$REQUIRES" | sort | uniq)
+REQUIRES=$(echo "$REQUIRES" "$config_REQUIRES"  | sort | uniq)
 PROVIDES=$(echo "$PROVIDES" | sort | uniq)
 
 #

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

Reply via email to