You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a custom deb package (ar format) and I'm receiving an error when setting the libarchive.constants.ARCHIVE_FORMAT_AR in libarchive.public.create_file.
The code is below:
import libarchive.constants
import libarchive.public
newDeb = ''.join(random.choice(string.ascii_lowercase + string.digits + string.ascii_uppercase) for _ in range(8))
tmpRan = ''.join(random.choice(string.ascii_lowercase + string.digits + string.ascii_uppercase) for _ in range(8))
tmpDir = '/tmp/' + tmpRan
newDeb = newDeb + ".deb"
for entry in libarchive.public.create_file('/tmp/'+newDeb,
libarchive.constants.ARCHIVE_FORMAT_AR,
[tmpDir+'/debian-binary', tmpDir+'/control.tar.gz', tmpDir+'/data.tar.gz' ]):
print(entry)
the error is:
Traceback (most recent call last):
File "test.py", line 429, in ar_files
[tmpDir+'/debian-binary', tmpDir+'/control.tar.gz', tmpDir+'/data.tar.gz' ]):
File "/usr/local/lib/python2.7/dist-packages/libarchive/adapters/archive_write.py", line 199, in _create
_set_write_context(a, format_code, filter_code)
File "/usr/local/lib/python2.7/dist-packages/libarchive/adapters/archive_write.py", line 184, in _set_write_context
format_code)
File "/usr/local/lib/python2.7/dist-packages/libarchive/adapters/archive_write_set_format.py", line 8, in archive_write_set_format
code)
File "/usr/local/lib/python2.7/dist-packages/libarchive/calls/archive_write_set_format.py", line 8, in _check_zero_success
raise ValueError("Function returned failure: (%d)" % (value))
ValueError: Function returned failure: (-30)
If I change the format to libarchive.constants.ARCHIVE_FORMAT_7ZIP, everything goes well and it creates the archive.
Here are some info on my env:
root@ubuntu:/tmp# pip list | grep libarchive
libarchive (0.4.3)
root@ubuntu:/tmp# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty
root@ubuntu:/tmp# python -V
Python 2.7.6
root@ubuntu:/tmp#
The text was updated successfully, but these errors were encountered:
I'm trying to create a custom deb package (ar format) and I'm receiving an error when setting the
libarchive.constants.ARCHIVE_FORMAT_AR
inlibarchive.public.create_file
.The code is below:
the error is:
If I change the format to
libarchive.constants.ARCHIVE_FORMAT_7ZIP
, everything goes well and it creates the archive.Here are some info on my env:
The text was updated successfully, but these errors were encountered: