summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpixdamix@gmail.com <pixdamix@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2012-11-22 04:17:50 (EST)
committer pixdamix@gmail.com <pixdamix@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2012-11-22 04:17:50 (EST)
commit0497af4e81defd66d0ba4d475c47ff617b31906a (patch)
tree0de050802c2334287def2c83cd1c4896168296ae
parentea1f09e2112cf5c98d45c973af0bcc34fb3f43f1 (diff)
Failed postinst script is not fatal with conf->offline_root
When we have an offline root and have specified force-postinstall, attempt to run the postinstall but if it fails, just leave it in the status file as needing to run. We can issue a NOTICE this is happened but supress errors. This means the OE class doesn't have to do any further post processing of the postinstalls itself. Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> git-svn-id: http://opkg.googlecode.com/svn/trunk@639 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r--libopkg/opkg_cmd.c3
-rw-r--r--libopkg/opkg_configure.c5
-rw-r--r--libopkg/pkg.c5
3 files changed, 9 insertions, 4 deletions
diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
index 11e7867..36ff8eb 100644
--- a/libopkg/opkg_cmd.c
+++ b/libopkg/opkg_cmd.c
@@ -453,7 +453,8 @@ opkg_configure_packages(char *pkg_name)
pkg->state_flag &= ~SF_PREFER;
opkg_state_changed++;
} else {
- err = -1;
+ if (!conf->offline_root)
+ err = -1;
}
}
}
diff --git a/libopkg/opkg_configure.c b/libopkg/opkg_configure.c
index 719da5a..169828d 100644
--- a/libopkg/opkg_configure.c
+++ b/libopkg/opkg_configure.c
@@ -35,7 +35,10 @@ opkg_configure(pkg_t *pkg)
err = pkg_run_script(pkg, "postinst", "configure");
if (err) {
- opkg_msg(ERROR, "%s.postinst returned %d.\n", pkg->name, err);
+ if (!conf->offline_root)
+ opkg_msg(ERROR, "%s.postinst returned %d.\n", pkg->name, err);
+ else
+ opkg_msg(NOTICE, "%s.postinst returned %d, marking as unpacked only, configuration required on target.\n", pkg->name, err);
return err;
}
diff --git a/libopkg/pkg.c b/libopkg/pkg.c
index d8c3984..3493a8b 100644
--- a/libopkg/pkg.c
+++ b/libopkg/pkg.c
@@ -1297,8 +1297,9 @@ pkg_run_script(pkg_t *pkg, const char *script, const char *args)
free(cmd);
if (err) {
- opkg_msg(ERROR, "package \"%s\" %s script returned status %d.\n",
- pkg->name, script, err);
+ if (!conf->offline_root)
+ opkg_msg(ERROR, "package \"%s\" %s script returned status %d.\n",
+ pkg->name, script, err);
return err;
}