(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / tools / mono-rpm-helpers / mono-find-provides / mono-find-provides.cs
blob64c29701d60ece1c45c4f83b3532aac7cd479165
1 //
2 // mono-find-provides.cs - Prints out an assembly's name and version
3 //
4 // Author: Duncan Mak (duncan@ximian.com)
5 //
6 // 2004 Copyright Novell Inc.
7 //
9 using System;
10 using System.Reflection;
12 namespace Mono {
13 class FindProvides {
15 static void Main (string [] args)
17 if (args.Length == 0) {
18 string s = Console.ReadLine ();
20 while (s != null) {
21 PrintProvides (s);
22 s = Console.ReadLine ();
25 } else {
26 foreach (string s in args)
27 PrintProvides (s);
31 static void PrintProvides (string s)
33 try {
34 Assembly a = Assembly.LoadFrom (s);
35 AssemblyName an = a.GetName ();
37 // hack to work around the issue with a 2.0 corlib
38 if (s.Trim ().EndsWith ("2.0/mscorlib.dll"))
39 Console.WriteLine ("mono({0}) = {1}", "mscorlib", "2.0.3600.0");
40 else
41 Console.WriteLine ("mono({0}) = {1}", an.Name, an.Version);
43 } catch {}