Changeset 4825


Ignore:
Timestamp:
11/26/08 10:01:31 (8 years ago)
Author:
tick
Message:

opkg: trivial, clean up obsolete code, and some typo

Location:
trunk/src/target/opkg
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/opkg/libbb/unzip.c

    r4392 r4825  
    4040 * See the file algorithm.doc for the compression algorithms and file formats. 
    4141 */ 
    42  
    43 #if 0 
    44 static char *license_msg[] = { 
    45         "   Copyright (C) 1992-1993 Jean-loup Gailly", 
    46         "   This program is free software; you can redistribute it and/or modify", 
    47         "   it under the terms of the GNU General Public License as published by", 
    48         "   the Free Software Foundation; either version 2, or (at your option)", 
    49         "   any later version.", 
    50         "", 
    51         "   This program is distributed in the hope that it will be useful,", 
    52         "   but WITHOUT ANY WARRANTY; without even the implied warranty of", 
    53         "   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the", 
    54         "   GNU General Public License for more details.", 
    55         "", 
    56         "   You should have received a copy of the GNU General Public License", 
    57         "   along with this program; if not, write to the Free Software", 
    58         "   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.", 
    59         0 
    60 }; 
    61 #endif 
    6242 
    6343#include <sys/types.h> 
  • trunk/src/target/opkg/libopkg/opkg_install.c

    r4614 r4825  
    313313     return 0; 
    314314} 
    315 #if 0 
    316 int name_mark_dependencies_for_installation(opkg_conf_t *conf, const char *pkg_name, pkg_vec_t *pkgs_needed) 
    317 { 
    318      int cmp; 
    319      pkg_t *old, *new; 
    320      char *old_version, *new_version; 
    321  
    322      old = pkg_hash_fetch_installed_by_name(&conf->pkg_hash, pkg_name); 
    323      
    324      new = pkg_hash_fetch_best_installation_candidate_by_name(conf, pkg_name); 
    325      if (new == NULL) { 
    326           return OPKG_PKG_HAS_NO_CANDIDATE; 
    327      } 
    328      if (old) { 
    329           old_version = pkg_version_str_alloc(old); 
    330           new_version = pkg_version_str_alloc(new); 
    331  
    332           cmp = pkg_compare_versions(old, new); 
    333           if ( (conf->force_downgrade==1) && (cmp > 0) ){     /* We've been asked to allow downgrade  and version is precedent */ 
    334             opkg_message(conf, OPKG_DEBUG, " Forcing downgrade "); 
    335              cmp = -1 ;                                       /* then we force opkg to downgrade */  
    336                                                               /* We need to use a value < 0 because in the 0 case we are asking to */ 
    337                                                               /* reinstall, and some check could fail asking the "force-reinstall" option */ 
    338           }  
    339           opkg_message(conf, OPKG_DEBUG,  
    340                        "comparing visible versions of pkg %s:" 
    341                        "\n\t%s is installed " 
    342                        "\n\t%s is available " 
    343                        "\n\t%d was comparison result\n", 
    344                        pkg_name, old_version, new_version, cmp); 
    345           if (cmp == 0 && !conf->force_reinstall) { 
    346                opkg_message(conf, OPKG_NOTICE, 
    347                             "Package %s (%s) installed in %s is up to date.\n", 
    348                             old->name, old_version, old->dest->name); 
    349                free(old_version); 
    350                free(new_version); 
    351                return 0; 
    352           } else if (cmp > 0) { 
    353                opkg_message(conf, OPKG_NOTICE, 
    354                             "Not downgrading package %s on %s from %s to %s.\n", 
    355                             old->name, old->dest->name, old_version, new_version); 
    356                free(old_version); 
    357                free(new_version); 
    358                return 0; 
    359           } else if (cmp < 0) { 
    360                new->dest = old->dest; 
    361                old->state_want = SW_DEINSTALL; 
    362                old->state_flag |= SF_OBSOLETE; 
    363           } 
    364      } 
    365      return pkg_mark_dependencies_for_installation(conf, new, pkgs_needed); 
    366 } 
    367  
    368 #endif 
    369315 
    370316int satisfy_dependencies_for(opkg_conf_t *conf, pkg_t *pkg) 
  • trunk/src/target/opkg/libopkg/pkg.c

    r4818 r4825  
    13141314     } 
    13151315 
    1316      /* For uninstalled packages, get the file list firectly from the package. 
     1316     /* For uninstalled packages, get the file list directly from the package. 
    13171317        For installed packages, look at the package.list file in the database. 
    13181318     */ 
  • trunk/src/target/opkg/libopkg/pkg_depends.c

    r4466 r4825  
    4646{ 
    4747     depend_t *depend = (depend_t *)cdata; 
    48 #if 0 
    49      pkg_t * temp = pkg_new(); 
    50      int comparison; 
    51      parseVersion(temp, depend->version); 
    52      comparison = pkg_compare_versions(pkg, temp); 
    53      free(temp); 
    54  
    55      fprintf(stderr, "%s: pkg=%s pkg->version=%s constraint=%p type=%d version=%s comparison=%d satisfied=%d\n",  
    56              __FUNCTION__, pkg->name, pkg->version,  
    57              depend, depend->constraint, depend->version, 
    58              comparison, version_constraints_satisfied(depend, pkg)); 
    59 #endif 
    6048     if (version_constraints_satisfied(depend, pkg)) 
    6149          return 1; 
     
    706694         parseDepends(conflicts, hash, 
    707695                      pkg->conflicts_str[i]); 
    708 #if 0 
    709          for (j = 0; j < conflicts->possibility_count; j++) { 
    710               depend_t *possibility = conflicts->possibilities[j]; 
    711               abstract_pkg_t *conflicting_apkg = possibility->pkg; 
    712               pkg_add_conflict_pair(ab_pkg, conflicting_apkg); 
    713          } 
    714 #endif 
    715696         conflicts++; 
    716697    } 
     
    730711        return  -1; 
    731712     } 
    732  
    733      // if (strcmp(ab_pkg->name, pkg->name)) 
    734      //     fprintf(stderr, __FUNCTION__ ": ab_pkg=%s pkg=%s\n", ab_pkg->name, pkg->name); 
    735713 
    736714     for(i = 0; i < pkg->replaces_count; i++){ 
  • trunk/src/target/opkg/libopkg/pkg_vec.c

    r4443 r4825  
    109109     int found = 0; 
    110110 
    111 #if 0 
    112      /* look for a duplicate pkg by name, version, and architecture */ 
    113      for (i = 0; i < vec->len; i++) 
    114           if ((strcmp(pkg->name, vec->pkgs[i]->name) == 0) 
    115               && (pkg_compare_versions(pkg, vec->pkgs[i]) == 0) 
    116               && (strcmp(pkg->architecture, vec->pkgs[i]->name) == 0)) { 
    117                found = 1; 
    118                break; 
    119           } 
    120 #endif 
    121  
    122111     /* we didn't find one, add it */ 
    123112     if(!found){    
     
    198187{ 
    199188 
    200 #if 0 
    201     /* look for a duplicate pkg by name */ 
    202     for(i = 0; i < vec->len; i++) 
    203         if (strcmp(pkg->name, vec->pkgs[i]->name) == 0) 
    204             break; 
    205  
    206     /* we didn't find one, add it */ 
    207     if(i == vec->len){    
    208 #endif 
    209189        vec->pkgs =  
    210190          (abstract_pkg_t **) 
     
    212192        vec->pkgs[vec->len] = pkg; 
    213193        vec->len++; 
    214 #if 0 
    215     } 
    216 #endif 
    217194} 
    218195 
Note: See TracChangeset for help on using the changeset viewer.