Add common file extensions to --exclude-compressed (#3951)
This commit is contained in:
@@ -1907,6 +1907,110 @@ static const char *compressedFileExtensions[] = {
|
|||||||
TXZ_EXTENSION,
|
TXZ_EXTENSION,
|
||||||
LZ4_EXTENSION,
|
LZ4_EXTENSION,
|
||||||
TLZ4_EXTENSION,
|
TLZ4_EXTENSION,
|
||||||
|
".7z",
|
||||||
|
".aa3",
|
||||||
|
".aac",
|
||||||
|
".aar",
|
||||||
|
".ace",
|
||||||
|
".alac",
|
||||||
|
".ape",
|
||||||
|
".apk",
|
||||||
|
".apng",
|
||||||
|
".arc",
|
||||||
|
".archive",
|
||||||
|
".arj",
|
||||||
|
".ark",
|
||||||
|
".asf",
|
||||||
|
".avi",
|
||||||
|
".avif",
|
||||||
|
".ba",
|
||||||
|
".br",
|
||||||
|
".bz2",
|
||||||
|
".cab",
|
||||||
|
".cdx",
|
||||||
|
".chm",
|
||||||
|
".cr2",
|
||||||
|
".divx",
|
||||||
|
".dmg",
|
||||||
|
".dng",
|
||||||
|
".docm",
|
||||||
|
".docx",
|
||||||
|
".dotm",
|
||||||
|
".dotx",
|
||||||
|
".dsft",
|
||||||
|
".ear",
|
||||||
|
".eftx",
|
||||||
|
".emz",
|
||||||
|
".eot",
|
||||||
|
".epub",
|
||||||
|
".f4v",
|
||||||
|
".flac",
|
||||||
|
".flv",
|
||||||
|
".gho",
|
||||||
|
".gif",
|
||||||
|
".gifv",
|
||||||
|
".gnp",
|
||||||
|
".iso",
|
||||||
|
".jar",
|
||||||
|
".jpeg",
|
||||||
|
".jpg",
|
||||||
|
".jxl",
|
||||||
|
".lz",
|
||||||
|
".lzh",
|
||||||
|
".m4a",
|
||||||
|
".m4v",
|
||||||
|
".mkv",
|
||||||
|
".mov",
|
||||||
|
".mp2",
|
||||||
|
".mp3",
|
||||||
|
".mp4",
|
||||||
|
".mpa",
|
||||||
|
".mpc",
|
||||||
|
".mpe",
|
||||||
|
".mpeg",
|
||||||
|
".mpg",
|
||||||
|
".mpl",
|
||||||
|
".mpv",
|
||||||
|
".msi",
|
||||||
|
".odp",
|
||||||
|
".ods",
|
||||||
|
".odt",
|
||||||
|
".ogg",
|
||||||
|
".ogv",
|
||||||
|
".otp",
|
||||||
|
".ots",
|
||||||
|
".ott",
|
||||||
|
".pea",
|
||||||
|
".png",
|
||||||
|
".pptx",
|
||||||
|
".qt",
|
||||||
|
".rar",
|
||||||
|
".s7z",
|
||||||
|
".sfx",
|
||||||
|
".sit",
|
||||||
|
".sitx",
|
||||||
|
".sqx",
|
||||||
|
".svgz",
|
||||||
|
".swf",
|
||||||
|
".tbz2",
|
||||||
|
".tib",
|
||||||
|
".tlz",
|
||||||
|
".vob",
|
||||||
|
".war",
|
||||||
|
".webm",
|
||||||
|
".webp",
|
||||||
|
".wma",
|
||||||
|
".wmv",
|
||||||
|
".woff",
|
||||||
|
".woff2",
|
||||||
|
".wvl",
|
||||||
|
".xlsx",
|
||||||
|
".xpi",
|
||||||
|
".xps",
|
||||||
|
".zip",
|
||||||
|
".zipx",
|
||||||
|
".zoo",
|
||||||
|
".zpaq",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -307,6 +307,8 @@ the last one takes effect.
|
|||||||
* `--show-default-cparams`:
|
* `--show-default-cparams`:
|
||||||
shows the default compression parameters that will be used for a particular input file, based on the provided compression level and the input size.
|
shows the default compression parameters that will be used for a particular input file, based on the provided compression level and the input size.
|
||||||
If the provided file is not a regular file (e.g. a pipe), this flag will output the parameters used for inputs of unknown size.
|
If the provided file is not a regular file (e.g. a pipe), this flag will output the parameters used for inputs of unknown size.
|
||||||
|
* `--exclude-compressed`:
|
||||||
|
only compress files that are not already compressed.
|
||||||
* `--`:
|
* `--`:
|
||||||
All arguments after `--` are treated as files
|
All arguments after `--` are treated as files
|
||||||
|
|
||||||
|
|||||||
@@ -410,6 +410,19 @@ zstd --long --rm -r precompressedFilterTestDir
|
|||||||
# Files should get compressed again without the --exclude-compressed flag.
|
# Files should get compressed again without the --exclude-compressed flag.
|
||||||
test -f precompressedFilterTestDir/input.5.zst.zst
|
test -f precompressedFilterTestDir/input.5.zst.zst
|
||||||
test -f precompressedFilterTestDir/input.6.zst.zst
|
test -f precompressedFilterTestDir/input.6.zst.zst
|
||||||
|
|
||||||
|
# Test some other compressed file extensions
|
||||||
|
datagen $size > precompressedFilterTestDir/input.flac
|
||||||
|
datagen $size > precompressedFilterTestDir/input.mov
|
||||||
|
datagen $size > precompressedFilterTestDir/input.mp3
|
||||||
|
zstd --exclude-compressed --long --rm -r precompressedFilterTestDir
|
||||||
|
test ! -f precompressedFilterTestDir/input.flac.zst
|
||||||
|
test ! -f precompressedFilterTestDir/input.mov.zst
|
||||||
|
test ! -f precompressedFilterTestDir/input.mp3.zst
|
||||||
|
zstd --long --rm -r precompressedFilterTestDir
|
||||||
|
test -f precompressedFilterTestDir/input.flac.zst
|
||||||
|
test -f precompressedFilterTestDir/input.mov.zst
|
||||||
|
test -f precompressedFilterTestDir/input.mp3.zst
|
||||||
rm -rf precompressedFilterTestDir
|
rm -rf precompressedFilterTestDir
|
||||||
println "Test completed"
|
println "Test completed"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user