mirror of
https://git.yoctoproject.org/git/opkg-utils
synced 2026-05-07 10:05:52 +02:00
opkg.py/get_file_list(): Add xz support
Open data.tar.xz if gz payload is not present. This change allows xz payloads to be archived in filelist. However, only python3's tarfile has xz support. This therefore only works if opkg-make-index's shebang is overridden to run in python3. Signed-off-by: Haris Okanovic <haris.okanovic@ni.com> Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
This commit is contained in:
committed by
Alejandro del Castillo
parent
03a7c66c6d
commit
9b2e2b989b
8
opkg.py
8
opkg.py
@@ -408,8 +408,12 @@ class Package(object):
|
||||
return []
|
||||
f = open(self.fn, "rb")
|
||||
ar = arfile.ArFile(f, self.fn)
|
||||
tarStream = ar.open("data.tar.gz")
|
||||
tarf = tarfile.open("data.tar.gz", "r", tarStream)
|
||||
try:
|
||||
tarStream = ar.open("data.tar.gz")
|
||||
tarf = tarfile.open("data.tar.gz", "r", tarStream)
|
||||
except IOError:
|
||||
tarStream = ar.open("data.tar.xz")
|
||||
tarf = tarfile.open("data.tar.xz", "r:xz", tarStream)
|
||||
self.file_list = tarf.getnames()
|
||||
self.file_list = [["./", ""][a.startswith("./")] + a for a in self.file_list]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user