summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/opkg
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2017-01-10 15:39:47 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-16 18:05:13 +0000
commitb894376415d09781890fa03d5643e9e05248f11e (patch)
tree87121dc092e312aa0e643bea8dd88e4afef2ca64 /meta/recipes-devtools/opkg
parent3f6504dc65747c00797b12d280088ebca0e5140d (diff)
downloadpoky-b894376415d09781890fa03d5643e9e05248f11e.tar.gz
opkg: fix conffile errors in 'opkg status' calls
If a conffile has been deleted (common when building a debugfs) the status command will throw errors instead of handling that situation. Stop the code being executed in the first place if it wasn't asked for, and handle errors gracefully. [ YOCTO #10761 ] (From OE-Core rev: 0aaaacdf4456fe832b1c3940997c097e7e94b9e6) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/opkg')
-rw-r--r--meta/recipes-devtools/opkg/opkg/status-conffile.patch69
-rw-r--r--meta/recipes-devtools/opkg/opkg_0.3.4.bb1
2 files changed, 70 insertions, 0 deletions
diff --git a/meta/recipes-devtools/opkg/opkg/status-conffile.patch b/meta/recipes-devtools/opkg/opkg/status-conffile.patch
new file mode 100644
index 0000000000..6fc405b2fd
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/status-conffile.patch
@@ -0,0 +1,69 @@
1Upstream-Status: Submitted
2Signed-off-by: Ross Burton <ross.burton@intel.com>
3
4From 086d5083dfe0102368cb7c8ce89b0c06b64ca773 Mon Sep 17 00:00:00 2001
5From: Ross Burton <ross.burton@intel.com>
6Date: Tue, 10 Jan 2017 15:24:59 +0000
7Subject: [PATCH 1/2] opkg_cmd: only look at conffile status if we're going to
8 output it
9
10The loop to compare the recorded conffile hash with their hash on disk is
11outputted at level INFO but the loop was executed at level NOTICE and higher.
12
13This means that if a conffile had been deleted the status operation would
14produce error messages for output it isn't displaying.
15
16Signed-off-by: Ross Burton <ross.burton@intel.com>
17---
18 libopkg/opkg_cmd.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
22index ba57c6a..37416fd 100644
23--- a/libopkg/opkg_cmd.c
24+++ b/libopkg/opkg_cmd.c
25@@ -638,7 +638,7 @@ static int opkg_info_status_cmd(int argc, char **argv, int installed_only)
26
27 pkg_formatted_info(stdout, pkg);
28
29- if (opkg_config->verbosity >= NOTICE) {
30+ if (opkg_config->verbosity >= INFO) {
31 conffile_list_elt_t *iter;
32 for (iter = nv_pair_list_first(&pkg->conffiles); iter;
33 iter = nv_pair_list_next(&pkg->conffiles, iter)) {
34--
352.8.1
36
37From 225e30e0f9fa7cfeaa3f89e2713e5147ab371def Mon Sep 17 00:00:00 2001
38From: Ross Burton <ross.burton@intel.com>
39Date: Tue, 10 Jan 2017 15:28:47 +0000
40Subject: [PATCH 2/2] conffile: gracefully handle deleted conffiles in
41 conffile_has_been_modified
42
43Handle conffiles that don't exist gracefully so that instead of showing an error
44message from file_md5sum_alloc() a notice that the file has been deleted is
45shown instead.
46
47Signed-off-by: Ross Burton <ross.burton@intel.com>
48---
49 libopkg/conffile.c | 5 +++++
50 1 file changed, 5 insertions(+)
51
52diff --git a/libopkg/conffile.c b/libopkg/conffile.c
53index b2f2469..7b4b87b 100644
54--- a/libopkg/conffile.c
55+++ b/libopkg/conffile.c
56@@ -51,6 +51,11 @@ int conffile_has_been_modified(conffile_t * conffile)
57 }
58
59 root_filename = root_filename_alloc(filename);
60+ if (!file_exists(root_filename)) {
61+ opkg_msg(INFO, "Conffile %s deleted\n", conffile->name);
62+ free(root_filename);
63+ return 1;
64+ }
65
66 md5sum = file_md5sum_alloc(root_filename);
67
68--
692.8.1
diff --git a/meta/recipes-devtools/opkg/opkg_0.3.4.bb b/meta/recipes-devtools/opkg/opkg_0.3.4.bb
index 5cf2facf01..6ac9438268 100644
--- a/meta/recipes-devtools/opkg/opkg_0.3.4.bb
+++ b/meta/recipes-devtools/opkg/opkg_0.3.4.bb
@@ -15,6 +15,7 @@ SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz
15 file://opkg-configure.service \ 15 file://opkg-configure.service \
16 file://opkg.conf \ 16 file://opkg.conf \
17 file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \ 17 file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \
18 file://status-conffile.patch \
18" 19"
19 20
20SRC_URI[md5sum] = "6c52a065499056a196e0b45a27e392de" 21SRC_URI[md5sum] = "6c52a065499056a196e0b45a27e392de"