#include <string.h>
#include <ctype.h>
#include <unistd.h>
+#include <libgen.h>
#include "pkg.h"
fp = fopen(file_name, "r");
if (fp == NULL) {
- opkg_perror(ERROR, "Failed to open %s");
+ opkg_perror(ERROR, "Failed to open %s", file_name);
free(file_name);
return;
}
case 'M':
if (strcasecmp(field, "Maintainer") == 0) {
if (pkg->maintainer) {
- fprintf(fp, "maintainer: %s\n", pkg->maintainer);
+ fprintf(fp, "Maintainer: %s\n", pkg->maintainer);
}
} else if (strcasecmp(field, "MD5sum") == 0) {
if (pkg->md5sum) {
/* XXX: FEATURE: When conf->offline_root is set, we should run the
maintainer script within a chroot environment. */
- if (conf->offline_root) {
+ if (conf->offline_root && !conf->force_postinstall) {
opkg_msg(INFO, "Offline root mode: not running %s.%s.\n",
pkg->name, script);
return 0;
free(cmd);
if (err) {
- opkg_msg(ERROR, "%s script returned status %d.\n", script, err);
+ opkg_msg(ERROR, "package \"%s\" %s script returned status %d.\n",
+ pkg->name, script, err);
return err;
}