summaryrefslogtreecommitdiff
path: root/package/opkg/patches/003-fs_overlay_support.patch
diff options
context:
space:
mode:
authorkaloz <kaloz@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-08-06 20:08:27 +0000
committerkaloz <kaloz@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-08-06 20:08:27 +0000
commitdbf38e7683be6728ee12540c68e59605a7c4f157 (patch)
tree2e13467d7c7cecf90a3deae35ea2c98f769bdd48 /package/opkg/patches/003-fs_overlay_support.patch
parent136e608800cdf0f02b063719ac70b5d66fe5787c (diff)
upgrade opkg to r215 from the googlecode svn
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@17152 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/opkg/patches/003-fs_overlay_support.patch')
-rw-r--r--package/opkg/patches/003-fs_overlay_support.patch47
1 files changed, 24 insertions, 23 deletions
diff --git a/package/opkg/patches/003-fs_overlay_support.patch b/package/opkg/patches/003-fs_overlay_support.patch
index c746cc3e6c..88a09d0a67 100644
--- a/package/opkg/patches/003-fs_overlay_support.patch
+++ b/package/opkg/patches/003-fs_overlay_support.patch
@@ -6,8 +6,8 @@ Signed-off-by: Nicolas Thill <nico@openwrt.org>
--- a/libopkg/opkg_conf.c
+++ b/libopkg/opkg_conf.c
-@@ -64,6 +64,7 @@ int opkg_init_options_array(const opkg_c
- { "offline_root", OPKG_OPT_TYPE_STRING, &conf->offline_root },
+@@ -70,6 +70,7 @@ int opkg_init_options_array(const opkg_c
+ { "offline_root_path", OPKG_OPT_TYPE_STRING, &conf->offline_root_path },
{ "offline_root_post_script_cmd", OPKG_OPT_TYPE_STRING, &conf->offline_root_post_script_cmd },
{ "offline_root_pre_script_cmd", OPKG_OPT_TYPE_STRING, &conf->offline_root_pre_script_cmd },
+ { "overlay_root", OPKG_OPT_TYPE_STRING, &conf->overlay_root },
@@ -16,8 +16,8 @@ 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
-@@ -67,6 +67,7 @@ struct opkg_conf
- char *offline_root;
+@@ -70,6 +70,7 @@ struct opkg_conf
+ char *offline_root_path;
char *offline_root_pre_script_cmd;
char *offline_root_post_script_cmd;
+ char *overlay_root;
@@ -26,35 +26,36 @@ Signed-off-by: Nicolas Thill <nico@openwrt.org>
int noaction;
--- a/libopkg/opkg_install.c
+++ b/libopkg/opkg_install.c
-@@ -524,10 +524,13 @@ static int verify_pkg_installable(opkg_c
+@@ -474,12 +474,15 @@ static int verify_pkg_installable(opkg_c
* my diddling with the .opk file size below isn't going to cut it.
* 3) return a proper error code instead of 1
*/
- int comp_size, blocks_available;
--
+ int comp_size, blocks_available = -1;
-+
+ char *root_dir;
+
if (!conf->force_space && pkg->installed_size != NULL) {
-- blocks_available = get_available_blocks(conf->default_dest->root_dir);
-+ if (conf->overlay_root != NULL)
-+ blocks_available = get_available_blocks(conf->overlay_root);
-+ if (blocks_available < 0)
-+ blocks_available = get_available_blocks(conf->default_dest->root_dir);
+ root_dir = pkg->dest ? pkg->dest->root_dir : conf->default_dest->root_dir;
+- blocks_available = get_available_blocks(root_dir);
++ if (conf->overlay_root != NULL)
++ blocks_available = get_available_blocks(conf->overlay_root);
++ if (blocks_available < 0)
++ blocks_available = get_available_blocks(root_dir);
comp_size = strtoul(pkg->installed_size, NULL, 0);
/* round up a blocks count without doing fancy-but-slow casting jazz */
--- a/libopkg/opkg_utils.c
+++ b/libopkg/opkg_utils.c
-@@ -30,10 +30,8 @@ int get_available_blocks(char * filesyst
+@@ -30,10 +30,8 @@ long unsigned int get_available_blocks(c
{
- struct statfs sfs;
+ struct statfs sfs;
-- if(statfs(filesystem, &sfs)){
-- fprintf(stderr, "bad statfs\n");
-- return 0;
-- }
-+ if(statfs(filesystem, &sfs))
-+ return -1;
- /* fprintf(stderr, "reported fs type %x\n", sfs.f_type); */
- return ((sfs.f_bavail * sfs.f_bsize) / 1024);
- }
+- if(statfs(filesystem, &sfs)){
+- fprintf(stderr, "bad statfs\n");
+- return 0;
+- }
++ if(statfs(filesystem, &sfs))
++ return -1;
+ /* fprintf(stderr, "reported fs type %x\n", sfs.f_type); */
+
+ // Actually ((sfs.f_bavail * sfs.f_bsize) / 1024)