Files
opkg-utils/makePackage
Alejandro del Castillo 9e2381d9c7 migrate to python 3
General fixes
* Add __future__ imports
* Use print function instead of print statement
* Use new style classes
* Iterate over list, instead of over object.keys()
* Use six.iteritems  instead of iteritems()

opkg.py:
* Add conditional to decode string if needed in Package:read_control

arfile.py
* Add seekable method to FileSection class (needed by tarfile)

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2016-06-01 17:17:44 -05:00

17 lines
451 B
Python
Executable File

#!/usr/bin/python
# The general algorithm this program follows goes like this:
# Run tar to extract control from control.tar.gz from the package.
# Insert the filename, size, and md5 lines before the description.
# Call it like this:
# find . -name \*.opk | xargs -n 1 makePackage > Packages
from __future__ import absolute_import
from __future__ import print_function
import sys
import opkg
fn = sys.argv[1]
pkg = opkg.Package(fn)
print(pkg)