Changeset 18864


Ignore:
Timestamp:
2009-12-20T22:21:14+01:00 (8 years ago)
Author:
jow
Message:

[package] opkg: update to r503 - reduces peak memory usage by further 20%, rebased patches, restored old config file default

Location:
trunk/package/opkg
Files:
1 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/opkg/Makefile

    r18380 r18864  
    99 
    1010PKG_NAME:=opkg 
    11 PKG_REV:=284 
     11PKG_REV:=503 
    1212PKG_VERSION:=$(PKG_REV) 
    1313PKG_RELEASE:=1 
  • trunk/package/opkg/patches/003-fs_overlay_support.patch

    r18380 r18864  
    77--- a/libopkg/opkg_conf.c 
    88+++ b/libopkg/opkg_conf.c 
    9 @@ -72,6 +72,7 @@ 
    10           { "offline_root_path", OPKG_OPT_TYPE_STRING, &conf->offline_root_path }, 
    11           { "offline_root_post_script_cmd", OPKG_OPT_TYPE_STRING, &conf->offline_root_post_script_cmd }, 
    12           { "offline_root_pre_script_cmd", OPKG_OPT_TYPE_STRING, &conf->offline_root_pre_script_cmd }, 
    13 +         { "overlay_root", OPKG_OPT_TYPE_STRING, &conf->overlay_root }, 
    14           { "proxy_passwd", OPKG_OPT_TYPE_STRING, &conf->proxy_passwd }, 
    15           { "proxy_user", OPKG_OPT_TYPE_STRING, &conf->proxy_user }, 
    16           { "query-all", OPKG_OPT_TYPE_BOOL, &conf->query_all }, 
     9@@ -58,6 +58,7 @@ 
     10          { "noaction", OPKG_OPT_TYPE_BOOL, &_conf.noaction }, 
     11          { "nodeps", OPKG_OPT_TYPE_BOOL, &_conf.nodeps }, 
     12          { "offline_root", OPKG_OPT_TYPE_STRING, &_conf.offline_root }, 
     13+         { "overlay_root", OPKG_OPT_TYPE_STRING, &_conf.overlay_root }, 
     14          { "proxy_passwd", OPKG_OPT_TYPE_STRING, &_conf.proxy_passwd }, 
     15          { "proxy_user", OPKG_OPT_TYPE_STRING, &_conf.proxy_user }, 
     16          { "query-all", OPKG_OPT_TYPE_BOOL, &_conf.query_all }, 
    1717--- a/libopkg/opkg_conf.h 
    1818+++ b/libopkg/opkg_conf.h 
    19 @@ -70,6 +70,7 @@ 
    20       char *offline_root_path; 
    21       char *offline_root_pre_script_cmd; 
    22       char *offline_root_post_script_cmd; 
     19@@ -74,6 +74,7 @@ 
     20      int check_signature; 
     21      int nodeps; /* do not follow dependences */ 
     22      char *offline_root; 
    2323+     char *overlay_root; 
    2424      int query_all; 
     
    2727--- a/libopkg/opkg_install.c 
    2828+++ b/libopkg/opkg_install.c 
    29 @@ -470,12 +470,15 @@ 
    30       *    my diddling with the .opk file size below isn't going to cut it. 
    31       * 3) return a proper error code instead of 1 
    32       */ 
    33 -     int comp_size, blocks_available; 
    34 +     int comp_size, blocks_available = -1; 
    35       char *root_dir; 
    36       
    37       if (!conf->force_space && pkg->installed_size != NULL) { 
    38            root_dir = pkg->dest ? pkg->dest->root_dir : conf->default_dest->root_dir; 
    39 -         blocks_available = get_available_blocks(root_dir); 
    40 +         if (conf->overlay_root != NULL) 
    41 +               blocks_available = get_available_blocks(conf->overlay_root); 
    42 +         if (blocks_available < 0) 
    43 +               blocks_available = get_available_blocks(root_dir); 
     29@@ -194,8 +194,11 @@ 
     30        if (conf->force_space || pkg->installed_size == 0) 
     31                return 0; 
    4432  
    45           comp_size = strtoul(pkg->installed_size, NULL, 0); 
    46           /* round up a blocks count without doing fancy-but-slow casting jazz */  
    47 --- a/libopkg/opkg_utils.c 
    48 +++ b/libopkg/opkg_utils.c 
    49 @@ -31,10 +31,8 @@ 
    50  { 
    51      struct statfs sfs; 
     33-       root_dir = pkg->dest ? pkg->dest->root_dir : 
     34-                                               conf->default_dest->root_dir; 
     35+       root_dir = pkg->dest 
     36+               ? pkg->dest->root_dir 
     37+               : conf->overlay_root 
     38+                       ? conf->overlay_root 
     39+                       : conf->default_dest->root_dir; 
     40        kbs_available = get_available_kbytes(root_dir); 
    5241  
    53 -    if(statfs(filesystem, &sfs)){ 
    54 -        fprintf(stderr, "bad statfs\n"); 
    55 -        return 0; 
    56 -    } 
    57 +    if(statfs(filesystem, &sfs)) 
    58 +        return -1; 
    59      /*    fprintf(stderr, "reported fs type %x\n", sfs.f_type); */ 
    60   
    61      // Actually ((sfs.f_bavail * sfs.f_bsize) / 1024)  
     42        pkg_size_kbs = (pkg->installed_size + 1023)/1024; 
  • trunk/package/opkg/patches/004-host_cpu.patch

    r18380 r18864  
    1313@@ -1,5 +1,5 @@ 
    1414- 
    15 -AM_CFLAGS=-Wall -Werror -DHOST_CPU_STR=\"@host_cpu@\" -DBUILD_CPU=@build_cpu@ -DLIBDIR=\"@libdir@\" -DOPKGLIBDIR=\"@opkglibdir@\" -DOPKGETCDIR=\"@opkgetcdir@\" -DDATADIR=\"@datadir@\" -I$(top_srcdir) $(BIGENDIAN_CFLAGS) $(CURL_CFLAGS) $(GPGME_CFLAGS) $(PATHFINDER_CFLAGS) 
     15-AM_CFLAGS=-Wall -DHOST_CPU_STR=\"@host_cpu@\" -DBUILD_CPU=@build_cpu@ -DLIBDIR=\"@libdir@\" -DOPKGLIBDIR=\"@opkglibdir@\" -DOPKGETCDIR=\"@opkgetcdir@\" -DDATADIR=\"@datadir@\" -I$(top_srcdir) $(BIGENDIAN_CFLAGS) $(CURL_CFLAGS) $(GPGME_CFLAGS) $(PATHFINDER_CFLAGS) 
    1616+HOST_CPU=@host_cpu@ 
    17 +AM_CFLAGS=-Wall -Werror -DHOST_CPU_STR=\"$(HOST_CPU)\" -DBUILD_CPU=@build_cpu@ -DLIBDIR=\"@libdir@\" -DOPKGLIBDIR=\"@opkglibdir@\" -DOPKGETCDIR=\"@opkgetcdir@\" -DDATADIR=\"@datadir@\" -I$(top_srcdir) $(BIGENDIAN_CFLAGS) $(CURL_CFLAGS) $(GPGME_CFLAGS) $(PATHFINDER_CFLAGS) 
     17+AM_CFLAGS=-Wall -DHOST_CPU_STR=\"$(HOST_CPU)\" -DBUILD_CPU=@build_cpu@ -DLIBDIR=\"@libdir@\" -DOPKGLIBDIR=\"@opkglibdir@\" -DOPKGETCDIR=\"@opkgetcdir@\" -DDATADIR=\"@datadir@\" -I$(top_srcdir) $(BIGENDIAN_CFLAGS) $(CURL_CFLAGS) $(GPGME_CFLAGS) $(PATHFINDER_CFLAGS) 
    1818  
    1919 libopkg_includedir=$(includedir)/libopkg 
    20  libopkg_include_HEADERS= opkg.h 
     20 libopkg_include_HEADERS= *.h 
  • trunk/package/opkg/patches/007-force_static.patch

    r18380 r18864  
    1616- 
    1717-# make sure we only export symbols that are for public use 
    18 -libopkg_la_LDFLAGS = -export-symbols-regex "^opkg_.*" 
     18-#libopkg_la_LDFLAGS = -export-symbols-regex "^opkg_.*" 
    1919- 
    2020- 
     
    3535        unzip.c \ 
    3636        wfopen.c \ 
    37 --- a/src/Makefile.am 
    38 +++ b/src/Makefile.am 
    39 @@ -2,5 +2,5 @@ 
    40  bin_PROGRAMS = opkg-cl 
    41   
    42  opkg_cl_SOURCES = opkg-frontend.c 
    43 -opkg_cl_LDADD = $(top_builddir)/libopkg/libopkg.la \ 
    44 -                $(top_builddir)/libbb/libbb.la  
    45 +opkg_cl_LDADD = $(top_builddir)/libopkg/libopkg.a \ 
    46 +                $(top_builddir)/libbb/libbb.a 
    4737--- a/tests/Makefile.am 
    4838+++ b/tests/Makefile.am 
     39@@ -4,11 +4,11 @@ 
     40 #noinst_PROGRAMS = libopkg_test opkg_active_list_test 
     41 noinst_PROGRAMS = libopkg_test 
     42  
     43-#opkg_hash_test_LDADD = $(top_builddir)/libbb/libbb.la $(top_builddir)/libopkg/libopkg.la 
     44+#opkg_hash_test_LDADD = $(top_builddir)/libbb/libbb.a $(top_builddir)/libopkg/libopkg.a 
     45 #opkg_hash_test_SOURCES = opkg_hash_test.c 
     46 #opkg_hash_test_CFLAGS = $(ALL_CFLAGS) -I$(top_srcdir) 
     47  
     48-#opkg_extract_test_LDADD = $(top_builddir)/libbb/libbb.la $(top_builddir)/libopkg/libopkg.la 
     49+#opkg_extract_test_LDADD = $(top_builddir)/libbb/libbb.a $(top_builddir)/libopkg/libopkg.a 
     50 #opkg_extract_test_SOURCES = opkg_extract_test.c 
     51 #opkg_extract_test_CFLAGS = $(ALL_CFLAGS) -I$(top_srcdir) 
     52  
    4953@@ -16,7 +16,7 @@ 
    5054 #opkg_active_list_test_SOURCES = opkg_active_list_test.c 
     
    5458+libopkg_test_LDADD = $(top_builddir)/libopkg/libopkg.a $(top_builddir)/libbb/libbb.a 
    5559 libopkg_test_SOURCE = libopkg_test.c 
     60 libopkg_test_LDFLAGS = -static 
    5661  
     62--- a/src/Makefile.am 
     63+++ b/src/Makefile.am 
     64@@ -2,5 +2,5 @@ 
     65 bin_PROGRAMS = opkg-cl 
    5766  
     67 opkg_cl_SOURCES = opkg-cl.c 
     68-opkg_cl_LDADD = $(top_builddir)/libopkg/libopkg.la \ 
     69-                $(top_builddir)/libbb/libbb.la  
     70+opkg_cl_LDADD = $(top_builddir)/libopkg/libopkg.a \ 
     71+                $(top_builddir)/libbb/libbb.a 
  • trunk/package/opkg/patches/009-remove-upgrade-all.patch

    r18380 r18864  
    1 --- a/libopkg/args.c 
    2 +++ b/libopkg/args.c 
    3 @@ -259,7 +259,7 @@ 
    4       
    5       printf("\nPackage Manipulation:\n"); 
    6       printf("\tupdate                  Update list of available packages\n"); 
    7 -     printf("\tupgrade                 Upgrade all installed packages to latest version\n"); 
    8 +     printf("\tupgrade <pkg>           Upgrade package to latest version\n"); 
    9       printf("\tinstall <pkg>           Download and install <pkg> (and dependencies)\n"); 
    10       printf("\tinstall <file.opk>      Install package <file.opk>\n"); 
    11       printf("\tconfigure [<pkg>]       Configure unpacked packages\n"); 
    121--- a/libopkg/opkg_cmd.c 
    132+++ b/libopkg/opkg_cmd.c 
    14 @@ -75,7 +75,7 @@ 
    15     array for easier maintenance */ 
    16  static opkg_cmd_t cmds[] = { 
    17       {"update", 0, (opkg_cmd_fun_t)opkg_update_cmd},  
    18 -     {"upgrade", 0, (opkg_cmd_fun_t)opkg_upgrade_cmd}, 
    19 +     {"upgrade", 1, (opkg_cmd_fun_t)opkg_upgrade_cmd}, 
    20       {"list", 0, (opkg_cmd_fun_t)opkg_list_cmd}, 
    21       {"list_installed", 0, (opkg_cmd_fun_t)opkg_list_installed_cmd}, 
    22       {"list_upgradable", 0, (opkg_cmd_fun_t)opkg_list_upgradable_cmd}, 
    23 @@ -607,17 +607,6 @@ 
    24                     opkg_install_by_name(conf, arg); 
     3@@ -495,17 +495,6 @@ 
     4                    opkg_install_by_name(arg); 
    255                } 
    266          } 
     
    288-         pkg_vec_t *installed = pkg_vec_alloc(); 
    299- 
    30 -         pkg_info_preinstall_check(conf); 
     10-         pkg_info_preinstall_check(); 
    3111- 
    32 -         pkg_hash_fetch_all_installed(&conf->pkg_hash, installed); 
     12-         pkg_hash_fetch_all_installed(installed); 
    3313-         for (i = 0; i < installed->len; i++) { 
    3414-              pkg = installed->pkgs[i]; 
    35 -              opkg_upgrade_pkg(conf, pkg); 
     15-              opkg_upgrade_pkg(pkg); 
    3616-         } 
    3717-         pkg_vec_free(installed); 
    3818      } 
    3919  
    40       opkg_configure_packages(conf, NULL); 
     20      opkg_configure_packages(NULL); 
     21@@ -1163,7 +1152,7 @@ 
     22    array for easier maintenance */ 
     23 static opkg_cmd_t cmds[] = { 
     24      {"update", 0, (opkg_cmd_fun_t)opkg_update_cmd, PFM_DESCRIPTION|PFM_SOURCE}, 
     25-     {"upgrade", 0, (opkg_cmd_fun_t)opkg_upgrade_cmd, PFM_DESCRIPTION|PFM_SOURCE}, 
     26+     {"upgrade", 1, (opkg_cmd_fun_t)opkg_upgrade_cmd, PFM_DESCRIPTION|PFM_SOURCE}, 
     27      {"list", 0, (opkg_cmd_fun_t)opkg_list_cmd, PFM_SOURCE}, 
     28      {"list_installed", 0, (opkg_cmd_fun_t)opkg_list_installed_cmd, PFM_SOURCE}, 
     29      {"list-installed", 0, (opkg_cmd_fun_t)opkg_list_installed_cmd, PFM_SOURCE}, 
  • trunk/package/opkg/patches/010-remove-flag.patch

    r18380 r18864  
    1 --- a/libopkg/args.c 
    2 +++ b/libopkg/args.c 
    3 @@ -264,8 +264,6 @@ 
    4       printf("\tinstall <file.opk>      Install package <file.opk>\n"); 
    5       printf("\tconfigure [<pkg>]       Configure unpacked packages\n"); 
    6       printf("\tremove <pkg|regexp>     Remove package <pkg|packages following regexp>\n"); 
    7 -     printf("\tflag <flag> <pkg> ...   Flag package(s) <pkg>\n"); 
    8 -     printf("\t <flag>=hold|noprune|user|ok|installed|unpacked (one per invocation)    \n"); 
    9       
    10       printf("\nInformational Commands:\n"); 
    11       printf("\tlist                    List available packages and descriptions\n"); 
    121--- a/libopkg/opkg_cmd.c 
    132+++ b/libopkg/opkg_cmd.c 
    14 @@ -54,7 +54,6 @@ 
    15  static int opkg_list_upgradable_cmd(opkg_conf_t *conf, int argc, char **argv); 
    16  static int opkg_remove_cmd(opkg_conf_t *conf, int argc, char **argv); 
    17  static int opkg_purge_cmd(opkg_conf_t *conf, int argc, char **argv); 
    18 -static int opkg_flag_cmd(opkg_conf_t *conf, int argc, char **argv); 
    19  static int opkg_files_cmd(opkg_conf_t *conf, int argc, char **argv); 
    20  static int opkg_search_cmd(opkg_conf_t *conf, int argc, char **argv); 
    21  static int opkg_download_cmd(opkg_conf_t *conf, int argc, char **argv); 
    22 @@ -80,7 +79,6 @@ 
    23       {"list_installed", 0, (opkg_cmd_fun_t)opkg_list_installed_cmd}, 
    24       {"list_upgradable", 0, (opkg_cmd_fun_t)opkg_list_upgradable_cmd}, 
    25       {"info", 0, (opkg_cmd_fun_t)opkg_info_cmd}, 
    26 -     {"flag", 1, (opkg_cmd_fun_t)opkg_flag_cmd}, 
    27       {"status", 0, (opkg_cmd_fun_t)opkg_status_cmd}, 
    28       {"install_pending", 0, (opkg_cmd_fun_t)opkg_install_pending_cmd}, 
    29       {"install", 1, (opkg_cmd_fun_t)opkg_install_cmd}, 
    30 @@ -960,48 +958,6 @@ 
    31       return 0; 
     3@@ -735,49 +735,6 @@ 
    324 } 
    335  
    34 -static int opkg_flag_cmd(opkg_conf_t *conf, int argc, char **argv) 
     6 static int 
     7-opkg_flag_cmd(int argc, char **argv) 
    358-{ 
    369-     int i; 
     
    3811-     const char *flags = argv[0]; 
    3912-     
    40 -     global_conf = conf; 
    4113-     signal(SIGINT, sigint_handler); 
    4214- 
    4315-     for (i=1; i < argc; i++) { 
    4416-         if (conf->restrict_to_default_dest) { 
    45 -              pkg = pkg_hash_fetch_installed_by_name_dest(&conf->pkg_hash, 
    46 -                                                          argv[i], 
     17-              pkg = pkg_hash_fetch_installed_by_name_dest(argv[i], 
    4718-                                                          conf->default_dest); 
    4819-         } else { 
    49 -              pkg = pkg_hash_fetch_installed_by_name(&conf->pkg_hash, argv[i]); 
     20-              pkg = pkg_hash_fetch_installed_by_name(argv[i]); 
    5021-         } 
    5122- 
    5223-         if (pkg == NULL) { 
    53 -              opkg_message(conf, OPKG_ERROR, 
    54 -                           "Package %s is not installed.\n", argv[i]); 
     24-              opkg_msg(ERROR, "Package %s is not installed.\n", argv[i]); 
    5525-              continue; 
    5626-         } 
     
    5929-             pkg->state_flag = pkg_state_flag_from_str(flags); 
    6030-          } 
    61 -/* pb_ asked this feature 03292004 */ 
    62 -/* Actually I will use only this two, but this is an open for various status */ 
     31- 
     32-         /*  
     33-          * Useful if a package is installed in an offline_root, and 
     34-          * should be configured by opkg-cl configure at a later date. 
     35-          */ 
    6336-          if (( strcmp(flags,"installed")==0)||( strcmp(flags,"unpacked")==0)){ 
    6437-             pkg->state_status = pkg_state_status_from_str(flags); 
    6538-          } 
     39- 
    6640-         opkg_state_changed++; 
    67 -         opkg_message(conf, OPKG_NOTICE, 
    68 -                      "Setting flags for package %s to %s\n", 
     41-         opkg_msg(NOTICE, "Setting flags for package %s to %s.\n", 
    6942-                      pkg->name, flags); 
    7043-     } 
    7144- 
    72 -     write_status_files_if_changed(conf); 
     45-     write_status_files_if_changed(); 
    7346-     return 0; 
    7447-} 
    7548- 
    76  static int opkg_files_cmd(opkg_conf_t *conf, int argc, char **argv) 
     49-static int 
     50 opkg_files_cmd(int argc, char **argv) 
    7751 { 
    7852      pkg_t *pkg; 
     53@@ -1159,7 +1116,6 @@ 
     54      {"list_upgradable", 0, (opkg_cmd_fun_t)opkg_list_upgradable_cmd, PFM_SOURCE}, 
     55      {"list-upgradable", 0, (opkg_cmd_fun_t)opkg_list_upgradable_cmd, PFM_SOURCE}, 
     56      {"info", 0, (opkg_cmd_fun_t)opkg_info_cmd, 0}, 
     57-     {"flag", 1, (opkg_cmd_fun_t)opkg_flag_cmd, PFM_DESCRIPTION|PFM_SOURCE}, 
     58      {"status", 0, (opkg_cmd_fun_t)opkg_status_cmd, PFM_DESCRIPTION|PFM_SOURCE}, 
     59      {"install", 1, (opkg_cmd_fun_t)opkg_install_cmd, PFM_DESCRIPTION|PFM_SOURCE}, 
     60      {"remove", 1, (opkg_cmd_fun_t)opkg_remove_cmd, PFM_DESCRIPTION|PFM_SOURCE}, 
Note: See TracChangeset for help on using the changeset viewer.