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

Leading directories are not always stripped #281

Closed
christianvdstap opened this issue Nov 7, 2014 · 3 comments
Closed

Leading directories are not always stripped #281

christianvdstap opened this issue Nov 7, 2014 · 3 comments
Labels
Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN

Comments

@christianvdstap
Copy link
Contributor

It seems if I use the included ckan file the leading directories are not stripped off, the debug log seems to support this.

From the spec on the install/file:
The file or directory root that this directive pertains to. All leading directories are stripped from the start of the filename during install. (Eg: MyMods/KSP/Foo will be installed into GameData/Foo.)

Used ckan:

{
    "spec_version"   : 1,
    "identifier"     : "BoxSat-kOS",
    "abstract"       : "kOS integration for BoxSat",
    "name"           : "BoxSat-kOS",
    "$kref"          : "#/ckan/kerbalstuff/118",
    "release_status" : "stable",
    "resources"      : {
        "homepage" : "http://forum.kerbalspaceprogram.com/threads/91616"
    },
    "depends" : [
        {"name" : "kOS"},
    {"name" : "BoxSat"},
    {"name" : "ModuleManager"}
    ],
    "install" : [
        {
        "file" : "BoxSat vA.02b/Optional ModuleManager files/kOS_BoxSat.cfg", 
        "install_to" : "GameData" 
    }
    ]
}

Debug output:

About to install...

 * BoxSat-kOS A.02b (cached)

Continue? [Y/N]

BoxSat-kOS:

2305 [1] DEBUG CKAN.ModuleInstaller (null) - Using BoxSat-kOS-A.02b.zip (cached)
2317 [1] INFO CKAN.ModuleInstaller (null) - Copying BoxSat vA.02b/Optional ModuleManager files/kOS_BoxSat.cfg
2317 [1] DEBUG CKAN.ModuleInstaller (null) - Writing file /home/leila/games/ksp/KSP_linux/GameData/BoxSat vA.02b/Optional ModuleManager files/kOS_BoxSat.cfg
2329 [1] DEBUG CKAN.Registry (null) - Pardon me, but I couldn't help overhear you're in a transaction...
2360 [1] DEBUG CKAN.Registry (null) - State saved
2361 [1] DEBUG CKAN.RegistryManager (null) - Saving CKAN registry at /home/leila/games/ksp/KSP_linux/CKAN/registry.json
2361 [1] DEBUG CKAN.SanityChecker (null) - BoxSat A.02b provides BoxSat
2361 [1] DEBUG CKAN.SanityChecker (null) - BoxSat-kOS A.02b provides BoxSat-kOS
2361 [1] DEBUG CKAN.SanityChecker (null) - BoxSat A.02b provides BoxSat
2361 [1] DEBUG CKAN.SanityChecker (null) - BoxSat-kOS A.02b provides BoxSat-kOS
2373 [Threadpool worker] DEBUG CKAN.Registry (null) - Registry prepared to commit transaction
2374 [1] DEBUG CKAN.Registry (null) - Registry transaction committed

Done!

@pjf pjf added the Bug Something is not working as intended label Nov 8, 2014
@pjf
Copy link
Member

pjf commented Nov 8, 2014

This is related to #260. Right now we strip everything up to and including GameData if we find it in the path; but if that's not found we simply use the path as-is.

There are a few ways we can go about trying to solve this. I suspect the most straightforward method is to both specify both a strip section (in this case BoxSat vA.02b/Optional ModuleManager files/) and a target section (eg: BoxSat), which allow us to do a basic search/replace manipulation on the start of the path; both of these would be optional, and both would have to do checks for consistency to make sure we don't go installing things outside of GameData, or that we're trying to strip paths which aren't there.

@pjf
Copy link
Member

pjf commented Nov 9, 2014

So, I think #287 provides some relief here. I know that it still doesn't let us properly specify the destination path; I don't recall if we have a ticket tracking that feature request or not.

@pjf pjf added the Core (ckan.dll) Issues affecting the core part of CKAN label Nov 9, 2014
@christianvdstap
Copy link
Contributor Author

Closing this issue as it is essentially resolved in #287

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

No branches or pull requests

2 participants