Skip to content

Error on unzip when attempting to use kpm to install package from archive #9

Description

@wizerdwolf

I was trying to install a Kindle application, KNotes. I downloaded the zip file to my PW2 using curl. I then tried running the command kpm -U knotes.zip, but received this output:

Copying knotes.zip -> /mnt/us/kpm/packages/knotes
Extracting ZIP...
Archive: /mnt/us/kpm/packages/knotes
unzip: short read
unzip failed with exit code 1

Perusing the source code, and testing by manually duplicating the unzip command on my device, the error seems to be a result of the fact that outpath and pkgdir have the same value, the zip file is being copied into outpath instead of INSTALL_DIR (where the zips downloaded when running kpm -S package_name appear to go), and then the "archive" specified to unzip (and tar seems to be treated the same) is actually the name of the directory the zip file is thrown into, outpath, instead of the path of the zip file itself.

I believe the fix is as simple as making outpath be INSTALL_DIR/package.zip (or w/e the correct file extension is) instead of INSTALL_DIR/package

if I have time later I may try to create a pull request to fix this since it looks pretty straight-forward, but I haven't actually set up a dev environment for kindle apps yet :p

Side note, it occurs to me that kpm probably can't install the application I was trying to in the method I was attempting to since it doesn't have its own install.kpm, but given the error occurred before reaching this point, I believe the error still would have occurred even if it did. I do wonder if there's a way this could be made to work, tho.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions