summaryrefslogtreecommitdiff
path: root/poky/meta/recipes-devtools/opkg
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/recipes-devtools/opkg')
-rw-r--r--poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb12
-rw-r--r--poky/meta/recipes-devtools/opkg/opkg/0001-remove_maintainer_scripts-use-strict-matching.patch56
-rw-r--r--poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service17
-rw-r--r--poky/meta/recipes-devtools/opkg/opkg_0.3.6.bb15
4 files changed, 59 insertions, 41 deletions
diff --git a/poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb b/poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb
index 18d6abdde..a20e316a3 100644
--- a/poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb
+++ b/poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb
@@ -35,14 +35,6 @@ FILES_${PN} = "${datadir}/opkg/keyrings"
# We need 'opkg-key' to run the postinst script
RDEPENDS_${PN} = "opkg"
-pkg_postinst_${PN} () {
-#! /bin/sh
-set -e
-
-if [ x"$D" = "x" ]; then
- # On target
- opkg-key populate
-else
- exit 1
-fi
+pkg_postinst_ontarget_${PN} () {
+opkg-key populate
}
diff --git a/poky/meta/recipes-devtools/opkg/opkg/0001-remove_maintainer_scripts-use-strict-matching.patch b/poky/meta/recipes-devtools/opkg/opkg/0001-remove_maintainer_scripts-use-strict-matching.patch
new file mode 100644
index 000000000..ec160290b
--- /dev/null
+++ b/poky/meta/recipes-devtools/opkg/opkg/0001-remove_maintainer_scripts-use-strict-matching.patch
@@ -0,0 +1,56 @@
+From 55c4ad666e76281bdd0db55fa6f4ab2744fea7e4 Mon Sep 17 00:00:00 2001
+From: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+Date: Tue, 4 Sep 2018 18:06:00 -0500
+Subject: [PATCH] remove_maintainer_scripts: use strict matching
+
+The function is using a glob to select which metadata files needs to be
+deleted during package removal, on the info_dir. However, the glob may
+match metadata files from packages with similar names. For example,
+during removal of package glibc-binary-localedata-de-at, the current
+logic was also removing the metadata for
+glibc-binary-localedata-de-at.iso-8859-1. Add check for an exact match
+before deletion.
+
+Fixes bugzilla: 12905
+
+Upstream-Status: Submitted [https://groups.google.com/forum/#!topic/opkg-devel/Fr40Yt0NBno]
+Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+---
+ libopkg/opkg_remove.c | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c
+index 82125fa..3936628 100644
+--- a/libopkg/opkg_remove.c
++++ b/libopkg/opkg_remove.c
+@@ -137,7 +137,7 @@ void remove_maintainer_scripts(pkg_t * pkg)
+ {
+ unsigned int i;
+ int err;
+- char *globpattern;
++ char *globpattern, *filename, *lastdot;
+ glob_t globbuf;
+
+ if (opkg_config->noaction)
+@@ -151,8 +151,16 @@ void remove_maintainer_scripts(pkg_t * pkg)
+ return;
+
+ for (i = 0; i < globbuf.gl_pathc; i++) {
+- opkg_msg(INFO, "Deleting %s.\n", globbuf.gl_pathv[i]);
+- unlink(globbuf.gl_pathv[i]);
++ filename = xstrdup(basename(globbuf.gl_pathv[i]));
++ lastdot = strrchr(filename, '.');
++ *lastdot = '\0';
++ // Only delete files that match the package name (the glob may match files
++ // with similar names)
++ if (!strcmp(filename, pkg->name)) {
++ opkg_msg(INFO, "Deleting %s.\n", globbuf.gl_pathv[i]);
++ unlink(globbuf.gl_pathv[i]);
++ }
++ free(filename);
+ }
+ globfree(&globbuf);
+ }
+--
+2.18.0
+
diff --git a/poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service b/poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service
deleted file mode 100644
index 432c3ddc2..000000000
--- a/poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service
+++ /dev/null
@@ -1,17 +0,0 @@
-[Unit]
-Description=Opkg first boot configure
-DefaultDependencies=no
-After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount
-Before=sysinit.target
-
-[Service]
-Type=oneshot
-EnvironmentFile=-@SYSCONFDIR@/default/postinst
-ExecStart=-@BASE_BINDIR@/sh -c " if [ $POSTINST_LOGGING = '1' ]; then @BINDIR@/opkg configure > $LOGFILE 2>&1; else @BINDIR@/opkg configure; fi"
-ExecStartPost=@BASE_BINDIR@/systemctl --no-reload disable opkg-configure.service
-StandardOutput=syslog
-RemainAfterExit=No
-
-[Install]
-WantedBy=basic.target
-WantedBy=sysinit.target
diff --git a/poky/meta/recipes-devtools/opkg/opkg_0.3.6.bb b/poky/meta/recipes-devtools/opkg/opkg_0.3.6.bb
index 70f20af73..6ebd58b96 100644
--- a/poky/meta/recipes-devtools/opkg/opkg_0.3.6.bb
+++ b/poky/meta/recipes-devtools/opkg/opkg_0.3.6.bb
@@ -12,9 +12,9 @@ DEPENDS = "libarchive"
PE = "1"
SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \
- file://opkg-configure.service \
file://opkg.conf \
file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \
+ file://0001-remove_maintainer_scripts-use-strict-matching.patch \
"
SRC_URI[md5sum] = "79e04307f6f54db431c251772d7d987c"
@@ -22,8 +22,6 @@ SRC_URI[sha256sum] = "f607f0e61be8cf8a3bbd0d2dccd9ec9e9b6c21dd4307b671c600d6eeaf
inherit autotools pkgconfig systemd
-SYSTEMD_SERVICE_${PN} = "opkg-configure.service"
-
target_localstatedir := "${localstatedir}"
OPKGLIBDIR = "${target_localstatedir}/lib"
@@ -46,16 +44,6 @@ do_install_append () {
# We need to create the lock directory
install -d ${D}${OPKGLIBDIR}/opkg
-
- if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then
- install -d ${D}${systemd_unitdir}/system
- install -m 0644 ${WORKDIR}/opkg-configure.service ${D}${systemd_unitdir}/system/
- sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
- -e 's,@SYSCONFDIR@,${sysconfdir},g' \
- -e 's,@BINDIR@,${bindir},g' \
- -e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
- ${D}${systemd_unitdir}/system/opkg-configure.service
- fi
}
RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config libarchive"
@@ -68,7 +56,6 @@ RPROVIDES_${PN} = "opkg-collateral"
PACKAGES =+ "libopkg"
FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/"
-FILES_${PN} += "${systemd_unitdir}/system/"
BBCLASSEXTEND = "native nativesdk"