~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
161
161
                public IEnumerable<string> GetAllPkgConfigFiles ()
162
162
                {
163
163
                        HashSet<string> packageNames = new HashSet<string> ();
164
 
                        foreach (string pcdir in PkgConfigDirs)
165
 
                                foreach (string pcfile in Directory.GetFiles (pcdir, "*.pc"))
 
164
                        foreach (string pcdir in PkgConfigDirs) {
 
165
                                string[] files;
 
166
                                try {
 
167
                                        files = Directory.GetFiles (pcdir, "*.pc");
 
168
                                } catch (Exception ex) {
 
169
                                        LoggingService.LogError (string.Format (
 
170
                                                "Runtime '{0}' error in pc file scan of directory '{1}'", DisplayName, pcdir), ex);
 
171
                                        continue;
 
172
                                }
 
173
                                foreach (string pcfile in files)
166
174
                                        if (packageNames.Add (Path.GetFileNameWithoutExtension (pcfile)))
167
175
                                                yield return pcfile;
 
176
                        }
168
177
                }
169
178
                
170
179
                protected override void OnInitialize ()
171
180
                {
 
181
                        if (!monoRuntimeInfo.IsValidRuntime)
 
182
                                return;
172
183
                        foreach (string pcfile in GetAllPkgConfigFiles ()) {
173
184
                                try {
174
185
                                        ParsePCFile (pcfile);
227
238
                        bool inconsistentFrameworks = false;
228
239
                        
229
240
                        foreach (PackageAssemblyInfo pi in pinfo.Assemblies) {
230
 
                                string targetFramework = Runtime.SystemAssemblyService.GetTargetFrameworkForAssembly (Runtime.SystemAssemblyService.CurrentRuntime, pi.File);
 
241
                                TargetFrameworkMoniker targetFramework = Runtime.SystemAssemblyService.GetTargetFrameworkForAssembly (Runtime.SystemAssemblyService.CurrentRuntime, pi.File);
231
242
                                if (commonFramework == null) {
232
243
                                        commonFramework = Runtime.SystemAssemblyService.GetTargetFramework (targetFramework);
233
244
                                        if (commonFramework == null)
250
261
                        if (inconsistentFrameworks)
251
262
                                LoggingService.LogError ("Inconsistent target frameworks found in " + pcfile);
252
263
                        if (commonFramework != null)
253
 
                                pinfo.SetData ("targetFramework", commonFramework.Id);
 
264
                                pinfo.SetData ("targetFramework", commonFramework.Id.ToString ());
254
265
                        else
255
266
                                pinfo.SetData ("targetFramework", "FxUnknown");
256
267
                }