Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Netkan/Services/ModuleService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public Tuple<ZipEntry, bool> FindInternalAvc(CkanModule module, ZipFile zipfile,
/// <summary>
/// Returns an AVC object for the given file in the archive, if any.
/// </summary>
private static AvcVersion GetInternalAvc(ZipFile zipfile, ZipEntry avcEntry)
public static AvcVersion GetInternalAvc(ZipFile zipfile, ZipEntry avcEntry)
{
if (avcEntry == null)
{
Expand Down
12 changes: 8 additions & 4 deletions Netkan/Validators/VrefValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@ public void Validate(Metadata metadata)
bool installable = false;
try
{
// Pass a regex that matches anything so it returns the first if found
using (var zipfile = new ZipFile(zipFilePath))
{
// Pass a regex that matches anything so it returns the first if found
var verFileAndInstallable = _moduleService.FindInternalAvc(mod, zipfile, ".");
path = verFileAndInstallable?.Item1.Name;
installable = verFileAndInstallable?.Item2 ?? false;
if (verFileAndInstallable != null)
{
// This will throw if there's a syntax error
var avc = ModuleService.GetInternalAvc(zipfile, verFileAndInstallable.Item1);
path = verFileAndInstallable.Item1.Name;
installable = verFileAndInstallable.Item2;
}
}
}
catch (BadMetadataKraken)
Expand All @@ -60,7 +65,6 @@ public void Validate(Metadata metadata)
// This shouldn't cause the inflation to fail, but it does deprive us of the path.
path = "";
installable = false;
Log.Warn(k.Message);
}

bool hasVersionFile = (path != null);
Expand Down