summaryrefslogtreecommitdiff
path: root/yocto-poky/meta/recipes-devtools/opkg-utils
diff options
context:
space:
mode:
Diffstat (limited to 'yocto-poky/meta/recipes-devtools/opkg-utils')
-rw-r--r--yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch47
-rw-r--r--yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb41
2 files changed, 88 insertions, 0 deletions
diff --git a/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch b/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
new file mode 100644
index 0000000000..4dddb08c96
--- /dev/null
+++ b/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/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb b/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
new file mode 100644
index 0000000000..5f518d22d1
--- /dev/null
+++ b/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
@@ -0,0 +1,41 @@
+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 += "virtual/update-alternatives"
+
+SRCREV = "53274f087565fd45d8452c5367997ba6a682a37a"
+PV = "0.1.8+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/opkg-utils"
+
+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"
+PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
+
+do_install() {
+ oe_runmake PREFIX=${prefix} DESTDIR=${D} install
+}
+
+do_install_append_class-target() {
+ sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${libdir},g'
+}
+
+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"