summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/buildhistory.bbclass12
-rw-r--r--meta/classes/package_rpm.bbclass2
-rw-r--r--meta/classes/populate_sdk_deb.bbclass6
-rw-r--r--meta/classes/populate_sdk_ipk.bbclass6
-rw-r--r--meta/classes/populate_sdk_rpm.bbclass2
-rwxr-xr-xscripts/oe-pkgdata-util59
-rwxr-xr-xscripts/opkg-query-helper.py2
7 files changed, 72 insertions, 17 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 1c49831978..b2e5cc50e8 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -337,12 +337,14 @@ buildhistory_get_installed() {
337 337
338 # Produce installed package sizes list 338 # Produce installed package sizes list
339 printf "" > $1/installed-package-sizes.tmp 339 printf "" > $1/installed-package-sizes.tmp
340 cat $pkgcache | while read pkg pkgfile 340 cat $pkgcache | while read pkg pkgfile pkgarch
341 do 341 do
342 if [ -f $pkgfile ] ; then 342 for vendor in ${TARGET_VENDOR} ${MULTILIB_VENDORS} ; do
343 pkgsize=`du -k $pkgfile | head -n1 | awk '{ print $1 }'` 343 size=`oe-pkgdata-util read-value ${TMPDIR}/pkgdata $vendor-${TARGET_OS} "PKGSIZE" ${pkg}_${pkgarch}`
344 echo $pkgsize $pkg >> $1/installed-package-sizes.tmp 344 if [ "$size" != "" ] ; then
345 fi 345 echo "$size $pkg" >> $1/installed-package-sizes.tmp
346 fi
347 done
346 done 348 done
347 cat $1/installed-package-sizes.tmp | sort -n -r | awk '{print $1 "\tKiB " $2}' > $1/installed-package-sizes.txt 349 cat $1/installed-package-sizes.tmp | sort -n -r | awk '{print $1 "\tKiB " $2}' > $1/installed-package-sizes.txt
348 rm $1/installed-package-sizes.tmp 350 rm $1/installed-package-sizes.tmp
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 324d83f751..53377a4e7f 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -127,6 +127,8 @@ translate_smart_to_oe() {
127 #echo "$pkg -> $new_pkg" >&2 127 #echo "$pkg -> $new_pkg" >&2
128 if [ "$arg1" = "arch" ]; then 128 if [ "$arg1" = "arch" ]; then
129 echo $new_pkg $new_arch $other 129 echo $new_pkg $new_arch $other
130 elif [ "$arg1" = "file" ]; then
131 echo $new_pkg $other $new_arch
130 else 132 else
131 echo $new_pkg $other 133 echo $new_pkg $other
132 fi 134 fi
diff --git a/meta/classes/populate_sdk_deb.bbclass b/meta/classes/populate_sdk_deb.bbclass
index 3e123ac561..ec116ab187 100644
--- a/meta/classes/populate_sdk_deb.bbclass
+++ b/meta/classes/populate_sdk_deb.bbclass
@@ -75,13 +75,13 @@ list_installed_packages() {
75 # Here we want the PACKAGE_ARCH not the deb architecture 75 # Here we want the PACKAGE_ARCH not the deb architecture
76 ${DPKG_QUERY_COMMAND} -W -f='${Package} ${PackageArch}\n' 76 ${DPKG_QUERY_COMMAND} -W -f='${Package} ${PackageArch}\n'
77 elif [ "$1" = "file" ] ; then 77 elif [ "$1" = "file" ] ; then
78 ${DPKG_QUERY_COMMAND} -W -f='${Package} ${Package}_${Version}_${Architecture}.deb\n' | while read pkg pkgfile 78 ${DPKG_QUERY_COMMAND} -W -f='${Package} ${Package}_${Version}_${Architecture}.deb ${PackageArch}\n' | while read pkg pkgfile pkgarch
79 do 79 do
80 fullpath=`find ${DEPLOY_DIR_DEB} -name "$pkgfile" || true` 80 fullpath=`find ${DEPLOY_DIR_DEB} -name "$pkgfile" || true`
81 if [ "$fullpath" = "" ] ; then 81 if [ "$fullpath" = "" ] ; then
82 echo "$pkg $pkgfile" 82 echo "$pkg $pkgfile $pkgarch"
83 else 83 else
84 echo "$pkg $fullpath" 84 echo "$pkg $fullpath $pkgarch"
85 fi 85 fi
86 done 86 done
87 else 87 else
diff --git a/meta/classes/populate_sdk_ipk.bbclass b/meta/classes/populate_sdk_ipk.bbclass
index 4e14d9a3a6..04c71af42e 100644
--- a/meta/classes/populate_sdk_ipk.bbclass
+++ b/meta/classes/populate_sdk_ipk.bbclass
@@ -61,13 +61,13 @@ list_installed_packages() {
61 if [ "$1" = "arch" ] ; then 61 if [ "$1" = "arch" ] ; then
62 opkg-cl ${OPKG_ARGS} status | opkg-query-helper.py -a 62 opkg-cl ${OPKG_ARGS} status | opkg-query-helper.py -a
63 elif [ "$1" = "file" ] ; then 63 elif [ "$1" = "file" ] ; then
64 opkg-cl ${OPKG_ARGS} status | opkg-query-helper.py -f | while read pkg pkgfile 64 opkg-cl ${OPKG_ARGS} status | opkg-query-helper.py -f | while read pkg pkgfile pkgarch
65 do 65 do
66 fullpath=`find ${DEPLOY_DIR_IPK} -name "$pkgfile" || true` 66 fullpath=`find ${DEPLOY_DIR_IPK} -name "$pkgfile" || true`
67 if [ "$fullpath" = "" ] ; then 67 if [ "$fullpath" = "" ] ; then
68 echo "$pkg $pkgfile" 68 echo "$pkg $pkgfile $pkgarch"
69 else 69 else
70 echo "$pkg $fullpath" 70 echo "$pkg $fullpath $pkgarch"
71 fi 71 fi
72 done 72 done
73 else 73 else
diff --git a/meta/classes/populate_sdk_rpm.bbclass b/meta/classes/populate_sdk_rpm.bbclass
index 219cd185ce..dd5f39a100 100644
--- a/meta/classes/populate_sdk_rpm.bbclass
+++ b/meta/classes/populate_sdk_rpm.bbclass
@@ -161,7 +161,7 @@ list_installed_packages() {
161 if [ "$1" = "arch" ]; then 161 if [ "$1" = "arch" ]; then
162 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" | translate_smart_to_oe arch 162 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" | translate_smart_to_oe arch
163 elif [ "$1" = "file" ]; then 163 elif [ "$1" = "file" ]; then
164 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH} %{PACKAGEORIGIN}\n]" | translate_smart_to_oe 164 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH} %{PACKAGEORIGIN}\n]" | translate_smart_to_oe file
165 else 165 else
166 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" | translate_smart_to_oe 166 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" | translate_smart_to_oe
167 fi 167 fi
diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util
index 629b2d5c84..c63f87d7e6 100755
--- a/scripts/oe-pkgdata-util
+++ b/scripts/oe-pkgdata-util
@@ -20,9 +20,12 @@
20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21# 21#
22# 22#
23# Currently only has one function - mapping of packages to their dev/dbg/doc/locale etc. 23# Currently only has two functions:
24# counterparts ("glob" command). Could be extended in future to perform other useful querying 24# 1) glob - mapping of packages to their dev/dbg/doc/locale etc. counterparts.
25# functions on the pkgdata though. 25# 2) read-value - mapping of packagenames to their location in
26# pkgdata and then returns value of selected variable (e.g. PKGSIZE)
27# Could be extended in future to perform other useful querying functions on the
28# pkgdata though.
26# 29#
27 30
28import sys 31import sys
@@ -32,7 +35,8 @@ import fnmatch
32import re 35import re
33 36
34def usage(): 37def usage():
35 print("syntax: pkgdata-util glob [-d] <pkgdatadir> <vendor-os> <pkglist> \"<globs>\""); 38 print("syntax: oe-pkgdata-util glob [-d] <pkgdatadir> <vendor-os> <pkglist> \"<globs>\"\n \
39 read-value [-d] <pkgdatadir> <vendor-os> <value-name> \"<package-name>_<package_architecture>\"");
36 40
37 41
38 42
@@ -151,7 +155,52 @@ def glob(args):
151 155
152 print("\n".join(mappedpkgs)) 156 print("\n".join(mappedpkgs))
153 157
158def read_value(args):
159 if len(args) < 4:
160 usage()
161 sys.exit(1)
162
163 pkgdata_dir = args[0]
164 target_suffix = args[1]
165 var = args[2]
166 packages = args[3].split()
154 167
168 if target_suffix.startswith("-"):
169 target_suffix = target_suffix[1:]
170
171 def readvar(pkgdata_file, var):
172 val = ""
173 with open(pkgdata_file, 'r') as f:
174 for line in f:
175 if line.startswith(var + ":"):
176 val = line.split(': ')[1].rstrip()
177 return val
178
179 if debug:
180 print "read-value('%s', '%s', '%s' '%s'" % (pkgdata_dir, target_suffix, var, packages)
181 for package in packages:
182 pkg_split = package.split('_')
183 pkg_name = pkg_split[0]
184 pkg_arch = '_'.join(pkg_split[1:])
185 if debug:
186 print "package: name: '%s', arch: '%s'" % (pkg_name, pkg_arch)
187 multimach_target_sys = "%s-%s" % (pkg_arch, target_suffix)
188 revlink = os.path.join(pkgdata_dir, multimach_target_sys, "runtime-reverse", pkg_name)
189 if debug:
190 print(revlink)
191 if not os.path.exists(revlink):
192 # [YOCTO #4227] try to drop -gnueabi from TARGET_OS
193 multimach_target_sys = '-'.join(multimach_target_sys.split('-')[:-1])
194 revlink = os.path.join(pkgdata_dir, multimach_target_sys, "runtime-reverse", pkg_name)
195 if debug:
196 print(revlink)
197 if os.path.exists(revlink):
198 mappedpkg = os.path.basename(os.readlink(revlink))
199 qvar = var
200 if qvar == "PKGSIZE":
201 # append packagename
202 qvar = "%s_%s" % (var, mappedpkg)
203 print(readvar(revlink, qvar))
155 204
156# Too lazy to use getopt 205# Too lazy to use getopt
157debug = False 206debug = False
@@ -173,6 +222,8 @@ if len(args) < 1:
173 222
174if args[0] == "glob": 223if args[0] == "glob":
175 glob(args[1:]) 224 glob(args[1:])
225elif args[0] == "read-value":
226 read_value(args[1:])
176else: 227else:
177 usage() 228 usage()
178 sys.exit(1) 229 sys.exit(1)
diff --git a/scripts/opkg-query-helper.py b/scripts/opkg-query-helper.py
index b52284b325..fa6c44fa8b 100755
--- a/scripts/opkg-query-helper.py
+++ b/scripts/opkg-query-helper.py
@@ -59,7 +59,7 @@ for line in fileinput.input(args):
59 ver = line.split(": ")[1] 59 ver = line.split(": ")[1]
60 elif line.startswith("Architecture:"): 60 elif line.startswith("Architecture:"):
61 arch = line.split(": ")[1] 61 arch = line.split(": ")[1]
62 print("%s %s_%s_%s.ipk" % (pkg,pkg,ver,arch)) 62 print("%s %s_%s_%s.ipk %s" % (pkg,pkg,ver,arch,arch))
63 else: 63 else:
64 if line.startswith("Depends:"): 64 if line.startswith("Depends:"):
65 depval = line.split(": ")[1] 65 depval = line.split(": ")[1]