summaryrefslogtreecommitdiffstats
path: root/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils
diff options
context:
space:
mode:
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-devtools/opkg-utils')
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-re-do-find-ls-code-to-not-fail-on-filenam.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/opkg-build-Exit-when-fail-to-list-files.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb48
4 files changed, 196 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-re-do-find-ls-code-to-not-fail-on-filenam.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-re-do-find-ls-code-to-not-fail-on-filenam.patch
new file mode 100644
index 000000000..5cbb55a7d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-re-do-find-ls-code-to-not-fail-on-filenam.patch
@@ -0,0 +1,56 @@
+From 8e424296ce2af4a5a7392c38a31f8723f9b9fbda Mon Sep 17 00:00:00 2001
+From: Denys Dmytriyenko <denys@ti.com>
+Date: Thu, 7 Apr 2016 20:43:13 -0400
+Subject: [PATCH] opkg-build: re-do find/ls code to not fail on filenames with
+ spaces
+
+Signed-off-by: Denys Dmytriyenko <denys@ti.com>
+---
+ opkg-build | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/opkg-build b/opkg-build
+index a9ccad2..07305b2 100755
+--- a/opkg-build
++++ b/opkg-build
+@@ -6,7 +6,6 @@
+ # 2003-04-25 rea@sr.unh.edu
+ # Updated to work on Familiar Pre0.7rc1, with busybox tar.
+ # Note it Requires: binutils-ar (since the busybox ar can't create)
+-# For UID debugging it needs a better "find".
+ set -e
+
+ version=1.0
+@@ -47,12 +46,12 @@ pkg_appears_sane() {
+
+ PKG_ERROR=0
+
+- tilde_files=`find . -name '*~'`
++ tilde_files=`find . -name '*~' -ls -printf '\\\n'`
+ if [ -n "$tilde_files" ]; then
+ if [ "$noclean" = "1" ]; then
+ echo "*** Warning: The following files have names ending in '~'.
+ You probably want to remove them: " >&2
+- ls -ld $tilde_files
++ echo -e $tilde_files
+ if [ $? -ne 0 ]; then
+ echo "*** Error: Fail to list files have names ending in '~'."
+ exit 1
+@@ -64,12 +63,12 @@ You probably want to remove them: " >&2
+ fi
+ fi
+
+- large_uid_files=`find . -uid +99 || true`
++ large_uid_files=`find . -uid +99 -ls -printf '\\\n' || true`
+
+ if [ "$ogargs" = "" ] && [ -n "$large_uid_files" ]; then
+ echo "*** Warning: The following files have a UID greater than 99.
+ You probably want to chown these to a system user: " >&2
+- ls -ld $large_uid_files
++ echo -e $large_uid_files
+ if [ $? -ne 0 ]; then
+ echo "*** Error: Fail to list files have a UID greater than 99."
+ exit 1
+--
+2.2.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/opkg-build-Exit-when-fail-to-list-files.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/opkg-build-Exit-when-fail-to-list-files.patch
new file mode 100644
index 000000000..6c66902ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/opkg-build-Exit-when-fail-to-list-files.patch
@@ -0,0 +1,45 @@
+We have an issue when ls segfaults in some cases [1] so it's
+better to detect the failure at this level instead of continue
+the build process.
+
+[YOCTO #8926]
+
+Upstream-Status: Submitted [2]
+
+[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8926#c0
+[2] https://groups.google.com/forum/#!topic/opkg-devel/cmX02bgHZms
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ opkg-build | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/opkg-build b/opkg-build
+index 98008b6..a9ccad2 100755
+--- a/opkg-build
++++ b/opkg-build
+@@ -53,6 +53,10 @@ pkg_appears_sane() {
+ echo "*** Warning: The following files have names ending in '~'.
+ You probably want to remove them: " >&2
+ ls -ld $tilde_files
++ if [ $? -ne 0 ]; then
++ echo "*** Error: Fail to list files have names ending in '~'."
++ exit 1
++ fi
+ echo >&2
+ else
+ echo "*** Removing the following files: $tilde_files"
+@@ -66,6 +70,10 @@ You probably want to remove them: " >&2
+ echo "*** Warning: The following files have a UID greater than 99.
+ You probably want to chown these to a system user: " >&2
+ ls -ld $large_uid_files
++ if [ $? -ne 0 ]; then
++ echo "*** Error: Fail to list files have a UID greater than 99."
++ exit 1
++ fi
+ echo >&2
+ fi
+
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
new file mode 100644
index 000000000..4dddb08c9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
@@ -0,0 +1,47 @@
+If a the number of hard links decreases or increases while creating
+the tar files used for an ipk package, tar fails with error code 1:
+
+| DEBUG: Executing python function do_package_ipk
+| tar: ./usr/src/debug/gperf/3.0.4-r0/gperf-3.0.4/src/main.cc: file changed as we read it
+NOTE: recipe gperf-3.0.4-r0: task do_package_write_ipk: Failed
+ERROR: Task 6539 (recipes-extended/gperf/gperf_3.0.4.bb, do_package_write_ipk) failed with exit code '1'
+
+
+We detect if the error code produced by tar is 1 and in this case ignore it.
+
+This a similar behavior to the one on dpkg:
+http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=40731942515ec8d80c727ad561174986d4f05818
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+
+Index: git/opkg-build
+===================================================================
+--- git.orig/opkg-build
++++ git/opkg-build
+@@ -250,8 +250,21 @@ tmp_dir=$dest_dir/IPKG_BUILD.$$
+ mkdir $tmp_dir
+
+ echo $CONTROL > $tmp_dir/tarX
+-( cd $pkg_dir && tar $ogargs -X $tmp_dir/tarX -cz $tarformat -f $tmp_dir/data.tar.gz . )
+-( cd $pkg_dir/$CONTROL && tar $ogargs -cz $tarformat -f $tmp_dir/control.tar.gz . )
++
++
++# Ignore error code 1, caused by modifying the number of hard links while creating the tar file
++rc=0
++( cd $pkg_dir && tar $ogargs -X $tmp_dir/tarX -cz $tarformat -f $tmp_dir/data.tar.gz . ) || rc=$?
++if [ $rc -ne 1 ] && [ $rc -ne 0 ]; then
++ exit $rc
++fi
++
++rc=0
++( cd $pkg_dir/$CONTROL && tar $ogargs -cz $tarformat -f $tmp_dir/control.tar.gz . ) || rc=$?
++if [ $rc -ne 1 ] && [ $rc -ne 0 ]; then
++ exit $rc
++fi
++
+ rm $tmp_dir/tarX
+
+ echo "2.0" > $tmp_dir/debian-binary
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
new file mode 100644
index 000000000..8873b2870
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
@@ -0,0 +1,48 @@
+SUMMARY = "Additional utilities for the opkg package manager"
+SUMMARY_update-alternatives-opkg = "Utility for managing the alternatives system"
+SECTION = "base"
+HOMEPAGE = "http://code.google.com/p/opkg/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://opkg.py;beginline=1;endline=18;md5=15917491ad6bf7acc666ca5f7cc1e083"
+PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}"
+
+SRCREV = "53274f087565fd45d8452c5367997ba6a682a37a"
+PV = "0.1.8+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/opkg-utils \
+ file://opkg-build-Exit-when-fail-to-list-files.patch \
+ file://0001-opkg-build-re-do-find-ls-code-to-not-fail-on-filenam.patch"
+SRC_URI_append_class-native = " file://tar_ignore_error.patch"
+
+S = "${WORKDIR}/git"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+PYTHONRDEPS = "python python-shell python-io python-math python-crypt python-logging python-fcntl python-subprocess python-pickle python-compression python-textutils python-stringold"
+PYTHONRDEPS_class-native = ""
+
+PACKAGECONFIG = "python update-alternatives"
+PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
+PACKAGECONFIG[update-alternatives] = ",,,"
+
+do_install() {
+ oe_runmake PREFIX=${prefix} DESTDIR=${D} install
+ if ! ${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'true', 'false', d)}; then
+ rm -f "${D}${bindir}/update-alternatives"
+ fi
+}
+
+do_install_append_class-target() {
+ if [ -e "${D}${bindir}/update-alternatives" ]; then
+ sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${nonarch_libdir},g'
+ fi
+}
+
+PACKAGES =+ "update-alternatives-opkg"
+FILES_update-alternatives-opkg = "${bindir}/update-alternatives"
+RPROVIDES_update-alternatives-opkg = "update-alternatives update-alternatives-cworth"
+RREPLACES_update-alternatives-opkg = "update-alternatives-cworth"
+RCONFLICTS_update-alternatives-opkg = "update-alternatives-cworth"
+
+BBCLASSEXTEND = "native nativesdk"
OpenPOWER on IntegriCloud