960e305d9a
Write a list of installed packages to a .manifest file next to the image, so we can find out what went into the image after it has been constructed without necessarily having to have buildhistory enabled (although that will provide more detail.) We can make use of this for example in the testimage class associated code that checks for installed packages for determining whether or not to run specific tests. Note: this replaces the previous ipk-specific manifest code with something that works for ipk, rpm and deb, and instead of a pruned status file, packages are listed one per line, in the following format: <packagename> <packagearch> <version> Tests for all three backends have shown that the performance impact of this change is negligible (about 1.5s max). Implements [YOCTO #5410] (From OE-Core rev: 2978d1f2617a33e2e3a77e249d73e998d79b4ec9) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
86 lines
2.7 KiB
Python
Executable file
86 lines
2.7 KiB
Python
Executable file
#!/usr/bin/env python
|
|
|
|
# OpenEmbedded opkg query helper utility
|
|
#
|
|
# Written by: Paul Eggleton <paul.eggleton@linux.intel.com>
|
|
#
|
|
# Copyright 2012 Intel Corporation
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License version 2 as
|
|
# published by the Free Software Foundation.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License along
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
#
|
|
#
|
|
|
|
|
|
import sys
|
|
import fileinput
|
|
import re
|
|
|
|
archmode = False
|
|
filemode = False
|
|
vermode = False
|
|
|
|
args = []
|
|
for arg in sys.argv[1:]:
|
|
if arg == '-a':
|
|
archmode = True
|
|
elif arg == '-f':
|
|
filemode = True
|
|
elif arg == '-v':
|
|
vermode = True
|
|
else:
|
|
args.append(arg)
|
|
|
|
# Regex for removing version specs after dependency items
|
|
verregex = re.compile(' \([=<>]* [^ )]*\)')
|
|
|
|
pkg = ""
|
|
ver = ""
|
|
for line in fileinput.input(args):
|
|
line = line.rstrip()
|
|
if ': ' in line:
|
|
if line.startswith("Package:"):
|
|
pkg = line.split(": ")[1]
|
|
ver = ""
|
|
else:
|
|
if archmode:
|
|
if line.startswith("Architecture:"):
|
|
arch = line.split(": ")[1]
|
|
print("%s %s" % (pkg,arch))
|
|
elif filemode:
|
|
if line.startswith("Version:"):
|
|
ver = line.split(": ")[1]
|
|
elif line.startswith("Architecture:"):
|
|
arch = line.split(": ")[1]
|
|
print("%s %s_%s_%s.ipk %s" % (pkg,pkg,ver,arch,arch))
|
|
elif vermode:
|
|
if line.startswith("Version:"):
|
|
ver = line.split(": ")[1]
|
|
elif line.startswith("Architecture:"):
|
|
arch = line.split(": ")[1]
|
|
print("%s %s %s" % (pkg,arch,ver))
|
|
else:
|
|
if line.startswith("Depends:"):
|
|
depval = line.split(": ")[1]
|
|
deps = depval.split(", ")
|
|
for dep in deps:
|
|
dep = verregex.sub('', dep)
|
|
print("%s|%s" % (pkg,dep))
|
|
elif line.startswith("Recommends:"):
|
|
recval = line.split(": ")[1]
|
|
recs = recval.split(", ")
|
|
for rec in recs:
|
|
rec = verregex.sub('', rec)
|
|
print("%s|%s [REC]" % (pkg, rec))
|
|
|