[malta] include wpad-mini and mac80211_hwsim by default
[openwrt.git] / package / opkg / patches / 003-fs_overlay_support.patch
index 8d18c28..0d4402e 100644 (file)
@@ -6,8 +6,8 @@ Signed-off-by: Nicolas Thill <nico@openwrt.org>
 
 --- a/libopkg/opkg_conf.c
 +++ b/libopkg/opkg_conf.c
-@@ -58,6 +58,7 @@
-         { "noaction", OPKG_OPT_TYPE_BOOL, &_conf.noaction },
+@@ -62,6 +62,7 @@
+         { "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 },
@@ -16,7 +16,7 @@ Signed-off-by: Nicolas Thill <nico@openwrt.org>
          { "query-all", OPKG_OPT_TYPE_BOOL, &_conf.query_all },
 --- a/libopkg/opkg_conf.h
 +++ b/libopkg/opkg_conf.h
-@@ -74,6 +74,7 @@
+@@ -76,6 +76,7 @@
       int check_signature;
       int nodeps; /* do not follow dependences */
       char *offline_root;
@@ -26,17 +26,39 @@ Signed-off-by: Nicolas Thill <nico@openwrt.org>
       int noaction;
 --- a/libopkg/opkg_install.c
 +++ b/libopkg/opkg_install.c
-@@ -194,8 +194,11 @@
+@@ -21,6 +21,7 @@
+ #include <time.h>
+ #include <signal.h>
+ #include <unistd.h>
++#include <sys/stat.h>
+ #include "pkg.h"
+ #include "pkg_hash.h"
+@@ -189,13 +190,24 @@
+ 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;
-+      root_dir = pkg->dest
-+              ? pkg->dest->root_dir
-+              : conf->overlay_root
-+                      ? conf->overlay_root
-+                      : 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;
This page took 0.030144 seconds and 4 git commands to generate.