Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow installing modules without download_size #2491

Merged

Conversation

HebaruSan
Copy link
Member

Problem

Some old modules don't have download_size set:

https://github.com/KSP-CKAN/CKAN-meta/blob/master/Toolbar/Toolbar-1.7.9.ckan

But it's just a simple int, so that causes it to be set to 0:

[JsonProperty("download_size")]
public long download_size;

When that happens, we can't install the module because it thinks the size "should be 0":

// Check file size
if (fi.Length != module.download_size)
throw new InvalidModuleFileKraken(module, path,
$"{module}: {path} has length {fi.Length}, should be {module.download_size}");

https://ci.ksp-ckan.org/job/CKAN-meta/939/console

CKAN.InvalidModuleFileKraken: Toolbar 1.7.9: /tmp/tmp44f9291a.tmp has length 63906, should be 0
  at CKAN.NetModuleCache.Store (CKAN.CkanModule module, System.String path, System.String description, System.Boolean move) [0x00061] in <cf516cc8950f43f6b8db7627f6e8d84f>:0 
  at CKAN.NetAsyncModulesDownloader.ModuleDownloadsComplete (CKAN.NetModuleCache cache, System.Uri[] urls, System.String[] filenames, System.Exception[] errors) [0x00031] in <cf516cc8950f43f6b8db7627f6e8d84f>:0 

This has blocked validation of KSP-CKAN/CKAN-meta#1356

Changes

Now we only enforce the size requirement if download_size is positive.

@HebaruSan HebaruSan added Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN Pull request labels Aug 7, 2018
@HebaruSan HebaruSan force-pushed the fix/install-without-download_size branch from 1937784 to 382e1fe Compare August 7, 2018 18:20
@HebaruSan HebaruSan merged commit 37c8477 into KSP-CKAN:master Aug 7, 2018
@HebaruSan HebaruSan deleted the fix/install-without-download_size branch August 7, 2018 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant