-
Notifications
You must be signed in to change notification settings - Fork 907
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
(#1332) Add switch to disable logging for archive extraction #2449
Conversation
Maybe I missed it, but I didn't see any tests that installed packages with archives, so there is nowhere to add a test at the moment. |
Pulling this in would require an upstream change in the chocolatey.extension. Going to hold off on this one for now... |
8f94f71
to
1a5ff31
Compare
Kind of pedantic, but wouldn't it be a downstream change? Since |
1a5ff31
to
02e7768
Compare
b7f368b
to
eba8a30
Compare
src/chocolatey.resources/helpers/functions/Get-ChocolateyUnzip.ps1
Outdated
Show resolved
Hide resolved
src/chocolatey.resources/helpers/functions/Get-ChocolateyUnzip.ps1
Outdated
Show resolved
Hide resolved
@TheCakeIsNaOH I have rebased this PR on the head of develop, so you will need to reset it before making any additional changes. I made my comments after rebasing as I thought I was ready to merge, and then I noticed a couple of things. Normally I don't force push to a branch unless I am ready to merge, apologies! |
Adds a switch "disableLogging" to Get-ChocolateyUnzip and Install-ChocolateyZipPackage. This switch disable 7zip logging of extracted filenames and does not write out the log of extracted files. Install-ChocolateyZip passes the switch to Get-ChocolateyUnzip, and the functionality is implemented into Get-ChocolateyUnzip. This is useful for large archives with a very large number of files as logging the extracted files can significantly slow down the extraction process.
1050421
to
d9b7be2
Compare
@gep13 I've updated the PR with your suggested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@TheCakeIsNaOH thanks for getting that fixed up! |
Description Of Changes
Adds a switch "disableLogging" to Get-ChocolateyUnzip and
Install-ChocolateyZipPackage. This switch disable 7zip logging of
extracted filenames and does not write out the log of extracted
files. Install-ChocolateyZip passes the switch to Get-ChocolateyUnzip,
and the functionality is implemented into Get-ChocolateyUnzip.
Motivation and Context
This is useful for large archives with a very large number of files as
logging the extracted files can significantly slow down the extraction
process.
Testing
chocolateyInstall.psm1
into apowershell.exe -version 2
window, the module loads fine..\choco.exe install filespy --verbose --debug
to validate that the files are still correctly logged into the debug output and to the filechocolateyInstall.ps1
to add theDisableLogging
parameter, and installed the edited package to validate that the switch is passed correctly fromInstall-ChocolateyZipPackage
toGet-ChocolateyUnzip
and to validate that the logging and output file are correctly disabled.Change Types Made
Related Issue
Fixes #1332
Change Checklist