opkg: only select overlay_root if the install destination is root, this eliminates...
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 22 Dec 2009 11:46:49 +0000 (11:46 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 22 Dec 2009 11:46:49 +0000 (11:46 +0000)
SVN-Revision: 18884

package/opkg/Makefile
package/opkg/patches/003-fs_overlay_support.patch

index 6cabdec30587fc3e1908e62f3fe59c9d7a3ecebe..491d52e43208e7f9e2b9f6130af18ca20c83fa80 100644 (file)
@@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
 PKG_NAME:=opkg
 PKG_REV:=503
 PKG_VERSION:=$(PKG_REV)
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=svn
 PKG_SOURCE_VERSION:=$(PKG_REV)
index 8d18c28d2cc7f843489786fab7de93ae2c7f1239..aa8b83ba6e70380fc7dc33bf3ed076f840806940 100644 (file)
@@ -26,17 +26,26 @@ Signed-off-by: Nicolas Thill <nico@openwrt.org>
       int noaction;
 --- a/libopkg/opkg_install.c
 +++ b/libopkg/opkg_install.c
-@@ -194,8 +194,11 @@
+@@ -189,13 +189,19 @@
+ verify_pkg_installable(pkg_t *pkg)
+ {
+       unsigned long kbs_available, pkg_size_kbs;
+-      char *root_dir;
++      char *root_dir = NULL;
        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 || !strcmp(pkg->dest->name, "root") )
++              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;