summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/opkg/opkg/0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/opkg/opkg/0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch')
-rw-r--r--meta/recipes-devtools/opkg/opkg/0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch71
1 files changed, 71 insertions, 0 deletions
diff --git a/meta/recipes-devtools/opkg/opkg/0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch b/meta/recipes-devtools/opkg/opkg/0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch
new file mode 100644
index 0000000000..900c150471
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch
@@ -0,0 +1,71 @@
1From 1f709b4540e12cf7e08592aae0ad7e3e35322cab Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Thu, 15 Dec 2011 21:08:49 +0000
4Subject: [PATCH 4/7] Failed postinst script is not fatal with
5 conf->offline_root
6
7When we have an offline root and have specified force-postinstall,
8attempt to run the postinstall but if it fails, just leave it in the
9status file as needing to run. We can issue a NOTICE this is happened
10but supress errors. This means the OE class doesn't have to do any
11further post processing of the postinstalls itself.
12
13Upstream-Status: Submitted
14http://code.google.com/p/opkg/issues/detail?id=93
15
16Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
17---
18 libopkg/opkg_cmd.c | 3 ++-
19 libopkg/opkg_configure.c | 5 ++++-
20 libopkg/pkg.c | 5 +++--
21 3 files changed, 9 insertions(+), 4 deletions(-)
22
23diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
24index 11e7867..36ff8eb 100644
25--- a/libopkg/opkg_cmd.c
26+++ b/libopkg/opkg_cmd.c
27@@ -453,7 +453,8 @@ opkg_configure_packages(char *pkg_name)
28 pkg->state_flag &= ~SF_PREFER;
29 opkg_state_changed++;
30 } else {
31- err = -1;
32+ if (!conf->offline_root)
33+ err = -1;
34 }
35 }
36 }
37diff --git a/libopkg/opkg_configure.c b/libopkg/opkg_configure.c
38index 719da5a..169828d 100644
39--- a/libopkg/opkg_configure.c
40+++ b/libopkg/opkg_configure.c
41@@ -35,7 +35,10 @@ opkg_configure(pkg_t *pkg)
42
43 err = pkg_run_script(pkg, "postinst", "configure");
44 if (err) {
45- opkg_msg(ERROR, "%s.postinst returned %d.\n", pkg->name, err);
46+ if (!conf->offline_root)
47+ opkg_msg(ERROR, "%s.postinst returned %d.\n", pkg->name, err);
48+ else
49+ opkg_msg(NOTICE, "%s.postinst returned %d, marking as unpacked only, configuration required on target.\n", pkg->name, err);
50 return err;
51 }
52
53diff --git a/libopkg/pkg.c b/libopkg/pkg.c
54index d8c3984..6ccbde2 100644
55--- a/libopkg/pkg.c
56+++ b/libopkg/pkg.c
57@@ -1297,8 +1297,9 @@ pkg_run_script(pkg_t *pkg, const char *script, const char *args)
58 free(cmd);
59
60 if (err) {
61- opkg_msg(ERROR, "package \"%s\" %s script returned status %d.\n",
62- pkg->name, script, err);
63+ if (!conf->offline_root)
64+ opkg_msg(ERROR, "package \"%s\" %s script returned status %d.\n",
65+ pkg->name, script, err);
66 return err;
67 }
68
69--
701.7.12
71