Closed jmaass closed 7 years ago
Did you set strip_components 0
? The archive resource follows the usual FOSS convention that everything in the zip will be in a top-level folder matching the name of the archive, a convention that your example file doesn't follow so you need to tell it. In the future it would be nice if it auto-detected this like some nicer archive tools (eg. The Unarchiver for macOS has some heuristics for deciding which mode to use) but for now it's manual.
Hi Noah,
thanks for the quick reply! I just figured this out this morning, and everything’s running smoothly now, but I ran into another problem: Apparently, the cookbook just checks if the zip file is in the chef-client’s cache directory and if that’s the case, it will not try to inflate it again, even though the inflated files may have been deleted in the meantime. If you know that, the remedy is simple: you just delete the file in the cache. But if you don’t know it, then debugging just got a little more complicated.
I believe you can change this behavious by passing source_properties in the resource, but it would be good to mention it in the documentation, so noobs like me don’t run into this problem.
Thanks a lot for your great work!
Mit freundlichen Grüßen/Kind regards
Jörg Maaß Hays AG
M-net Telekommunikations GmbH Emmy-Noether-Str. 2 | 80992 München
Von: Noah Kantrowitz [mailto:notifications@github.com] Gesendet: Mittwoch, 5. Oktober 2016 01:06 An: poise/poise-archive Cc: Maaß.Jörg; Author Betreff: Re: [poise/poise-archive] Zip file directory structure is not retained (#3)
Did you set strip_components 0? The archive resource follows the usual FOSS convention that everything in the zip will be in a top-level folder matching the name of the archive, a convention that your example file doesn't follow so you need to tell it. In the future it would be nice if it auto-detected this like some nicer archive tools (eg. The Unarchiver for macOS has some heuristics for deciding which mode to use) but for now it's manual.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/poise/poise-archive/issues/3#issuecomment-251539124, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AKAyBF1OUaqvA6s5oRTY2EQLL5i5j7gLks5qwtvhgaJpZM4KN6HW.
Yeah, I should probably make it clearer that using it with a URL is a very different mode of operation. If source is a normal path, it would re-unpack every time but that's almost never what you want soooo this is a compromise.
Thanks, this helped!!
When we unzip a zip file that itself contains other zip files, poise-archive does not retain the Directory structure:
From .kitchen/logs/kitchen.log:
Login to converged node, let's see how it looks:
OK, now let's delete the existing files and unzip the cached zip file from poise-archive's run by hand:
If you look at the different inflating results, you will notice that they are completely different. Since we are dependent on preserving the zipped directory structure, we are unable to use poise-archive at the moment, and we consider this behaviour of the cookbook a bug.
poise-archive should preserve the directory structure in the zip file when inflating it.