-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(datasource/deb): Support deb indices compression #35865
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
base: main
Are you sure you want to change the base?
Changes from 9 commits
087eff4
b10d621
cf79556
38f05ae
8a2cca6
ba87388
70d6c7b
52bddd7
d2cf00a
94979a8
744842c
5d9325a
c635c7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dc79555ac96e9efa6b17ef2c3d382b0ec25755706798a0cf3e763e49dadceb53 |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Origin: Debian | ||
Label: Debian | ||
Suite: stable | ||
Version: 12.10 | ||
Codename: bookworm | ||
Changelogs: https://metadata.ftp-master.debian.org/changelogs/@CHANGEPATH@_changelog | ||
Date: Sat, 15 Mar 2025 09:09:36 UTC | ||
Acquire-By-Hash: yes | ||
No-Support-for-Architecture-all: Packages | ||
Architectures: all amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x | ||
Components: main contrib non-free-firmware non-free | ||
Description: Debian 12.10 Released 15 March 2025 | ||
MD5Sum: | ||
SHA256: | ||
d0f253340d20cf69d4781b80088b6c2b00b0002e69ca0a50c9197c634bd1fcef 66277 non-free/binary-s390x/Packages.gz non-free/binary-test/Packages.gz | ||
0adc3569f322f7c993a39f471783aba9f91792789e57774ed2a28b3ecbbe0e0c 54196 non-free/binary-s390x/Packages.xz non-free/binary-test/Packages.xz | ||
d357305aec89074729f9c85a7f0c44061c75ed8db3db5e0e73f24a6da27e0879 121 non-free/binary-s390x/Release non-free/binary-test/Packages |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import { createUnzip } from 'zlib'; | ||
import * as lzma from 'lzma-native'; | ||
import unbzip2 from 'unbzip2-stream'; | ||
Comment on lines
+2
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are they using any binary node modules we need to take care of for different architecture? we build images for amd64 and arm64 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to their documentation, they do not require additional binary node modules. While unbzip2-stream is fully in JavaScript, lzma-native "provides pre-built binaries for multiple Node.js versions and all major OS using node-pre-gyp". |
||
import * as fs from '../../../util/fs'; | ||
|
||
/** | ||
* Extracts the specified compressed file to the output file. | ||
* | ||
* @param compressedFile - The path to the compressed file. | ||
* @param compression - The compression method used (currently only 'gz' is supported). | ||
* @param compression - The compression method used (currently 'gz', 'xz' and 'bzip2' is supported). | ||
* @param outputFile - The path where the extracted content will be stored. | ||
* @throws Will throw an error if the compression method is unknown. | ||
*/ | ||
|
@@ -14,12 +16,21 @@ export async function extract( | |
compression: string, | ||
outputFile: string, | ||
): Promise<void> { | ||
if (compression === 'gz') { | ||
const source = fs.createCacheReadStream(compressedFile); | ||
const destination = fs.createCacheWriteStream(outputFile); | ||
await fs.pipeline(source, createUnzip(), destination); | ||
} else { | ||
throw new Error(`Unsupported compression standard '${compression}'`); | ||
const source = fs.createCacheReadStream(compressedFile); | ||
const destination = fs.createCacheWriteStream(outputFile); | ||
|
||
switch (compression) { | ||
case 'gz': | ||
await fs.pipeline(source, createUnzip(), destination); | ||
break; | ||
case 'xz': | ||
await fs.pipeline(source, lzma.createDecompressor(), destination); | ||
break; | ||
case 'bz2': | ||
await fs.pipeline(source, unbzip2(), destination); | ||
break; | ||
default: | ||
throw new Error('Unsupported compression standard'); | ||
} | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.