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 installation into Ships/Script #3180

Merged
merged 1 commit into from
Nov 5, 2020

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Oct 24, 2020

Problems

  • kOS stores scripts in the Ships/Script folder under the game root. Currently CKAN doesn't allow this, and Add SpaceCore kOS Script Pack from SpaceDock NetKAN#7967 is in stasis because it needs to install kOS scripts to that folder.
  • ShipSaveSplicer is being installed into GameData/veSplicer because it starts with Ships

Changes

  • Now we allow installation into Ships/Script, including creation of new directories.
    Since this requires an update of the schema, the next release of CKAN will need to be v1.29.0 if this is merged.
  • Now we require a path to start with Ships/ with a slash to trigger that truncation, so ShipSaveSplicer will be installed correctly.
    Fixes ShipSaveSplicer installed into wrong directory #3187.

@HebaruSan HebaruSan added Enhancement New features or functionality Core (ckan.dll) Issues affecting the core part of CKAN Pull request Spec Issues affecting the spec Netkan Issues affecting the netkan data Schema Issues affecting the schema labels Oct 24, 2020
@DasSkelett
Copy link
Member

With spec version <v1.12 it first outputs 1188 [1] FATAL CKAN.NetKAN.Program (null) - spec_version v1.12+ required to install to Ships/ with path, and only with a spec version v1.12 <= x < v1.29 it outputs the new warning.
Should we reorder the checks, or maybe narrow down the first one so it only triggers for Ships/SPH and Ships/VAB?

@HebaruSan
Copy link
Member Author

Fair point, moved the 1.29 check before the others.

@HebaruSan HebaruSan added the In progress We're still working on this label Nov 1, 2020
@HebaruSan
Copy link
Member Author

HebaruSan commented Nov 1, 2020

Just discovered this breaks typical netkans. Need to investigate (later).

$ ../CKAN/_build/netkan.exe NetKAN/MissingRobotics.netkan 
4985 [1] FATAL CKAN.NetKAN.Program (null) - GameData/Missing_robotics is not an absolute path

... this is a bit tricky. InstallableFile.destination is supposed to be an absolute path into the KSP dir, but it's relative if KSP.gameDir is /, because KSPPathUtils.NormalizePath does .TrimEnd('/'), which turns / into the empty string. NormalizePath seems like the part that's doing something wrong to me, since / and the empty string do not represent the same paths at all...

@HebaruSan
Copy link
Member Author

That stuff should be fixed with the latest changes.

@HebaruSan HebaruSan removed the In progress We're still working on this label Nov 2, 2020
Copy link
Member

@DasSkelett DasSkelett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unleash the kOS scripts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core (ckan.dll) Issues affecting the core part of CKAN Enhancement New features or functionality Netkan Issues affecting the netkan data Schema Issues affecting the schema Spec Issues affecting the spec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ShipSaveSplicer installed into wrong directory
2 participants