Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oe: Fix opkg status list parse - Missing postinst #41

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions meta/lib/oe/rootfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,9 @@ def _get_pkg_depends_list(pkg_depends):
return pkg_depends_list

pkgs = {}
pkg_name = ""
pkg_name = None
pkg_status_match = False
pkg_depends = ""
pkg_depends = None

with open(status_file) as status:
data = status.read()
Expand All @@ -519,17 +519,29 @@ def _get_pkg_depends_list(pkg_depends):
m_status = re.match("^Status:.*unpacked", line)
m_depends = re.match("^Depends: (.*)", line)

#Only one of m_pkg, m_status or m_depends is not None at time
#If m_pkg is not None, we started a new package
if m_pkg is not None:
if pkg_name and pkg_status_match:
pkgs[pkg_name] = _get_pkg_depends_list(pkg_depends)

#Get Package name
pkg_name = m_pkg.group(1)
#Make sure we reset other variables
pkg_status_match = False
pkg_depends = ""
pkg_depends = None
elif m_status is not None:
#New status matched
pkg_status_match = True
elif m_depends is not None:
#New depends macthed
pkg_depends = m_depends.group(1)
else:
pass

#Now check if we can process package depends and postinst
if pkg_name is not None and pkg_status_match:
pkgs[pkg_name] = _get_pkg_depends_list(pkg_depends)
else:
#Not enough information
pass

# remove package dependencies not in postinsts
pkg_names = list(pkgs.keys())
Expand Down