mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 04:12:42 +00:00
add support of Packages.xz
This commit is contained in:
parent
bba730ffd5
commit
1780541c36
@ -10,6 +10,7 @@ import tempfile
|
||||
import argparse
|
||||
import bz2
|
||||
import gzip
|
||||
import lzma
|
||||
import time
|
||||
from email.utils import parsedate_to_datetime
|
||||
from pathlib import Path
|
||||
@ -141,7 +142,9 @@ def apt_mirror(base_url: str, dist: str, repo: str, arch: str, dest_base_dir: Pa
|
||||
if pkgidx_content is None:
|
||||
print("getting packages index content")
|
||||
suffix = pkgidx_file.suffix
|
||||
if suffix == '.bz2':
|
||||
if suffix == '.xz':
|
||||
pkgidx_content = lzma.decompress(content).decode('utf-8')
|
||||
elif suffix == '.bz2':
|
||||
pkgidx_content = bz2.decompress(content).decode('utf-8')
|
||||
elif suffix == '.gz':
|
||||
pkgidx_content = gzip.decompress(content).decode('utf-8')
|
||||
|
Loading…
x
Reference in New Issue
Block a user