source: trunk/package/opkg/patches/010-remove-flag.patch @ 19061

Last change on this file since 19061 was 19061, checked in by jow, 7 years ago

[package] opkg: update to r513, move lock-file to /var/lock and drop cleanup patch - went upstream

File size: 1.9 KB
  • libopkg/opkg_cmd.c

    a b  
    738738} 
    739739 
    740740static int 
    741 opkg_flag_cmd(int argc, char **argv) 
    742 { 
    743      int i; 
    744      pkg_t *pkg; 
    745      const char *flags = argv[0]; 
    746      
    747      signal(SIGINT, sigint_handler); 
    748  
    749      for (i=1; i < argc; i++) { 
    750           if (conf->restrict_to_default_dest) { 
    751                pkg = pkg_hash_fetch_installed_by_name_dest(argv[i], 
    752                                                            conf->default_dest); 
    753           } else { 
    754                pkg = pkg_hash_fetch_installed_by_name(argv[i]); 
    755           } 
    756  
    757           if (pkg == NULL) { 
    758                opkg_msg(ERROR, "Package %s is not installed.\n", argv[i]); 
    759                continue; 
    760           } 
    761           if (( strcmp(flags,"hold")==0)||( strcmp(flags,"noprune")==0)|| 
    762               ( strcmp(flags,"user")==0)||( strcmp(flags,"ok")==0)) { 
    763               pkg->state_flag = pkg_state_flag_from_str(flags); 
    764           } 
    765  
    766           /*  
    767            * Useful if a package is installed in an offline_root, and 
    768            * should be configured by opkg-cl configure at a later date. 
    769            */ 
    770           if (( strcmp(flags,"installed")==0)||( strcmp(flags,"unpacked")==0)){ 
    771               pkg->state_status = pkg_state_status_from_str(flags); 
    772           } 
    773  
    774           opkg_state_changed++; 
    775           opkg_msg(NOTICE, "Setting flags for package %s to %s.\n", 
    776                        pkg->name, flags); 
    777      } 
    778  
    779      write_status_files_if_changed(); 
    780      return 0; 
    781 } 
    782  
    783 static int 
    784741opkg_files_cmd(int argc, char **argv) 
    785742{ 
    786743     pkg_t *pkg; 
     
    11621119     {"list_upgradable", 0, (opkg_cmd_fun_t)opkg_list_upgradable_cmd, PFM_SOURCE}, 
    11631120     {"list-upgradable", 0, (opkg_cmd_fun_t)opkg_list_upgradable_cmd, PFM_SOURCE}, 
    11641121     {"info", 0, (opkg_cmd_fun_t)opkg_info_cmd, 0}, 
    1165      {"flag", 1, (opkg_cmd_fun_t)opkg_flag_cmd, PFM_DESCRIPTION|PFM_SOURCE}, 
    11661122     {"status", 0, (opkg_cmd_fun_t)opkg_status_cmd, PFM_DESCRIPTION|PFM_SOURCE}, 
    11671123     {"install", 1, (opkg_cmd_fun_t)opkg_install_cmd, PFM_DESCRIPTION|PFM_SOURCE}, 
    11681124     {"remove", 1, (opkg_cmd_fun_t)opkg_remove_cmd, PFM_DESCRIPTION|PFM_SOURCE}, 
Note: See TracBrowser for help on using the repository browser.