diff --git a/ModuleInstaller.cs b/ModuleInstaller.cs index a31ac83121..06e9c2e0ba 100644 --- a/ModuleInstaller.cs +++ b/ModuleInstaller.cs @@ -448,7 +448,7 @@ private string Sha1Sum(string path) /// Returns a default install stanza for the module provided. This finds the topmost /// directory which matches the module identifier, and installs that into GameData. /// - internal ModuleInstallDescriptor GenerateDefaultInstall(CkanModule module, ZipFile zipfile) + internal static ModuleInstallDescriptor GenerateDefaultInstall(string identifier, ZipFile zipfile) { var stanza = new ModuleInstallDescriptor(); stanza.description = "Default install (autogenerated)"; @@ -462,7 +462,7 @@ internal ModuleInstallDescriptor GenerateDefaultInstall(CkanModule module, ZipFi // don't include entries for directories, but still include entries // for the files they contain. - string ident_filter = @"(^|/|\\)" + Regex.Escape(module.identifier) + @"$"; + string ident_filter = @"(^|/|\\)" + Regex.Escape(identifier) + @"$"; // Let's find that directory foreach (ZipEntry entry in zipfile) @@ -470,7 +470,7 @@ internal ModuleInstallDescriptor GenerateDefaultInstall(CkanModule module, ZipFi string directory = Path.GetDirectoryName(entry.Name); // If this looks like what we're after, remember it. - if (Regex.IsMatch(directory, ident_filter)) + if (Regex.IsMatch(directory, ident_filter, RegexOptions.IgnoreCase )) { candidate_set.Add(directory); } diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index ccee9b1fe9..91ef7b6c4f 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -24,4 +24,7 @@ //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")] +// Tests can see our internals. +[assembly: InternalsVisibleTo("Tests")] + // NB: The CKAN build/release process appends an AssemblyInformationalVersion to this file.