from abc import ABCMeta, abstractmethod
import os
import glob
import subprocess
import shutil
import multiprocessing
import re
import collections
import bb
import tempfile
import oe.utils
import oe.path
import string
from oe.gpg_sign import get_signer
# this can be used by all PM backends to create the index files in paralleldefcreate_index(arg):
index_cmd = arg
bb.note("Executing '%s' ..."% index_cmd)
result = subprocess.check_output(index_cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")if result:
bb.note(result)"""This method parse the output from the package managerand returna dictionary with the information of the packages. This is usedwhen the packages are in deb or ipk format."""defopkg_query(cmd_output):
verregex = re.compile(' \([=<>]* [^ )]*\)')
output =dict()
pkg =""
arch =""
ver =""
filename =""
dep = []
pkgarch =""for line in cmd_output.splitlines():
line = line.rstrip()if':'in line:if line.startswith("Package: "):
pkg = line.split(": ")[1]elif line.startswith("Architecture: "):
arch = line.split(": ")[1]elif line.startswith("Version: "):
ver = line.split(": ")[1]elif line.startswith("File: ")