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

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.Autotools/CustomMakefile.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-18 08:40:51 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090218084051-gh8m6ukvokbwj7cf
Tags: 1.9.2+dfsg-1ubuntu1
* Merge from Debian Experimental (LP: #330519), remaining Ubuntu changes:
  + debian/control:
    - Update for Gnome# 2.24
    - Add libmono-cairo1.0-cil to build-deps to fool pkg-config check

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
                        get {
92
92
                                if (varRegex == null)
93
93
                                        varRegex = new Regex(@"[.|\n]*^(?<varname>[a-zA-Z_0-9]*)((?<sep>[ \t]*:?=[ \t]*$)|((?<sep>\s*:?=\s*)" +
94
 
                                                multilineMatch + "))", RegexOptions.Multiline);
 
94
                                                multilineMatch + "))", RegexOptions.Multiline | RegexOptions.Compiled);
95
95
                                return varRegex;
96
96
                        }
97
97
                }
164
164
                                varToValuesDict [varname] = list;
165
165
                        }
166
166
                }
 
167
                
 
168
                static Dictionary<string,Regex> targetExps = new Dictionary<string, Regex> ();
167
169
        
168
170
                public string GetTarget (string var)
169
171
                {
170
172
                        //FIXME: //FILES = \
171
173
                        //\tabc.cs ---> the \t is not a must.. and there can be multiple \t's
172
 
                        Regex targetExp = new Regex(@"[.|\n]*^" + var + @"(?<sep>\s*:\s*)" + multilineMatch + @"\t" + multilineMatch, 
173
 
                                RegexOptions.Multiline);
 
174
                        Regex targetExp;
 
175
                        if (!targetExps.TryGetValue (var, out targetExp)) {
 
176
                                targetExp = new Regex(@"[.|\n]*^" + var + @"(?<sep>\s*:\s*)" + multilineMatch + @"\t" + multilineMatch, 
 
177
                                                      RegexOptions.Multiline | RegexOptions.Compiled);
 
178
                                targetExps [var] = targetExp;
 
179
                        }
174
180
                        return GetValue (var, targetExp);
175
181
                }
176
182
                
211
217
                        VarToValuesDict [var].Clear ();
212
218
                }
213
219
 
 
220
                static Dictionary<string,Regex> varExps = new Dictionary<string, Regex> ();
 
221
                
214
222
                void SaveVariable (string var)
215
223
                {
216
 
                        //FIXME: Make this static
217
 
                        Regex varExp = new Regex(@"[.|\n]*^(?<var>" + var + @"((?<sep>\s*:?=\s*\n)|((?<sep>\s*:?=\s*)" + multilineMatch + ")))", 
218
 
                                RegexOptions.Multiline);
 
224
                        Regex varExp;
 
225
                        if (!varExps.TryGetValue (var, out varExp)) {
 
226
                                varExp = new Regex(@"[.|\n]*^(?<var>" + var + @"((?<sep>\s*:?=\s*\n)|((?<sep>\s*:?=\s*)" + multilineMatch + ")))", 
 
227
                                                         RegexOptions.Multiline | RegexOptions.Compiled);
 
228
                                varExps [var] = varExp;
 
229
                        }
219
230
                        
220
231
                        Match match = varExp.Match (content);
221
232
                        if (!match.Success) 
246
257
 
247
258
                        using (StreamWriter sw = new StreamWriter (fileName))
248
259
                                sw.Write (content);
 
260
                        
 
261
                        FileService.NotifyFileChanged (fileName);
249
262
                }
250
263
                
251
264
                void ThrowMakefileVarNotFound (string var)