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 argparse
|
||||||
import bz2
|
import bz2
|
||||||
import gzip
|
import gzip
|
||||||
|
import lzma
|
||||||
import time
|
import time
|
||||||
from email.utils import parsedate_to_datetime
|
from email.utils import parsedate_to_datetime
|
||||||
from pathlib import Path
|
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:
|
if pkgidx_content is None:
|
||||||
print("getting packages index content")
|
print("getting packages index content")
|
||||||
suffix = pkgidx_file.suffix
|
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')
|
pkgidx_content = bz2.decompress(content).decode('utf-8')
|
||||||
elif suffix == '.gz':
|
elif suffix == '.gz':
|
||||||
pkgidx_content = gzip.decompress(content).decode('utf-8')
|
pkgidx_content = gzip.decompress(content).decode('utf-8')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user