{ "download_only", OPKG_OPT_TYPE_BOOL, &_conf.download_only },
{ "nodeps", OPKG_OPT_TYPE_BOOL, &_conf.nodeps },
{ "offline_root", OPKG_OPT_TYPE_STRING, &_conf.offline_root },
+ { "overlay_root", OPKG_OPT_TYPE_STRING, &_conf.overlay_root },
{ "proxy_passwd", OPKG_OPT_TYPE_STRING, &_conf.proxy_passwd },
{ "proxy_user", OPKG_OPT_TYPE_STRING, &_conf.proxy_user },
{ "query-all", OPKG_OPT_TYPE_BOOL, &_conf.query_all },
#include <time.h>
#include <signal.h>
#include <unistd.h>
+#include <sys/stat.h>
#include "pkg.h"
#include "pkg_hash.h"
verify_pkg_installable(pkg_t *pkg)
{
unsigned long kbs_available, pkg_size_kbs;
- char *root_dir;
+ char *root_dir = NULL;
+ struct stat s;
if (conf->force_space || pkg->installed_size == 0)
return 0;
- root_dir = pkg->dest ? pkg->dest->root_dir :
- conf->default_dest->root_dir;
+ if (pkg->dest)
+ {
+ if (!strcmp(pkg->dest->name, "root") && conf->overlay_root
+ && !stat(conf->overlay_root, &s) && (s.st_mode & S_IFDIR))
+ root_dir = conf->overlay_root;
+ else
+ root_dir = pkg->dest->root_dir;
+ }
+
+ if (!root_dir)
+ root_dir = conf->default_dest->root_dir;
+
kbs_available = get_available_kbytes(root_dir);
pkg_size_kbs = (pkg->installed_size + 1023)/1024;