diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-01-13 20:21:39 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-01-13 20:21:39 +0000 |
commit | 6f8f045193b8384caf5a5bee446a4b944202721b (patch) | |
tree | 17580f055249c2f2f1848870b9a9a3ddc1a3dd97 /package | |
parent | d9e4e0db493be280bae9b50f68617eb440c98cda (diff) | |
download | upstream-6f8f045193b8384caf5a5bee446a4b944202721b.tar.gz upstream-6f8f045193b8384caf5a5bee446a4b944202721b.tar.bz2 upstream-6f8f045193b8384caf5a5bee446a4b944202721b.zip |
[package] opkg: fallback to dest->root_dir if specified overlay_root does not exist on filesystem (#6498)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19121 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r-- | package/opkg/patches/003-fs_overlay_support.patch | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/package/opkg/patches/003-fs_overlay_support.patch b/package/opkg/patches/003-fs_overlay_support.patch index 0716ae4818..0d4402ed12 100644 --- a/package/opkg/patches/003-fs_overlay_support.patch +++ b/package/opkg/patches/003-fs_overlay_support.patch @@ -26,22 +26,35 @@ Signed-off-by: Nicolas Thill <nico@openwrt.org> int noaction; --- a/libopkg/opkg_install.c +++ b/libopkg/opkg_install.c -@@ -189,13 +189,19 @@ +@@ -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; -+ if( !pkg->dest || !strcmp(pkg->dest->name, "root") ) -+ root_dir = conf->overlay_root; -+ else -+ root_dir = pkg->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; |