Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
ExtraPlanetaryLaunchpads's netkan currently uses a
$kref
property with a hard coded URL. This means that we have to update the netkan manually every time there's a new release.This mod has a publicly hosted remote .version file at http://taniwha.org/~bill/EL.version
The KSP-AVC spec says:
In principle this should let us pick up new versions automatically, but currently that functionality doesn't exist.
Changes
Now Netkan will support this format:
The
Id
part of the$kref
gives a URL to check for a .version file, which contains aDOWNLOAD
property that points to the latest version of the mod.To accomplish this, a new
AvcKrefTransformer
class is added (the awkward name is because there's already anAvcTransformer
which handles$vref
, which needs to remain separate and is called too late to handle a$kref
properly). The remaining AVC properties are added toAvcVersion
, and used by the new transformer to set metadata properties. Setting thedownload
property allows the remaining transformers to download the file and index it.To set
version
andksp_version
/_min
/_max
,AvcTransformer
's logic for this is split out into a public static function for sharing.In testing, the above
$kref
generated a .ckan file for ExtraPlanetaryLaunchpads 6.0.0 that exactly matches the one already in the index.Fixes #286. Fixes #1765.