Revision 38395

View differences:

branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/main/java/org/gvsig/installer/lib/impl/utils/Decompress.java
215 215
					List<String> defaultPackagesList = new ArrayList<String>();
216 216

  
217 217
					for (int i = 0; i < lineas.length; i++) {
218
						defaultPackagesList.add(lineas[i]);
218
					    
219
					    String trim_lineas = lineas[i].trim();
220
					    if (! ((trim_lineas.startsWith("#") || trim_lineas.startsWith(";")))) {
221
					        // not a comment
222
					        defaultPackagesList.add(lineas[i]);
223
					    }
224
						
219 225
					}
220 226

  
221 227
					defaultSelectedPackets = defaultPackagesList;
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/main/java/org/gvsig/installer/lib/impl/DefaultPackageInfo.java
31 31
import java.io.IOException;
32 32
import java.net.MalformedURLException;
33 33
import java.net.URL;
34
import java.security.InvalidParameterException;
34 35
import java.util.ArrayList;
35 36
import java.util.List;
36 37

  
......
104 105

  
105 106
    public String getID() {
106 107
        String id =
107
            this.getCode() + "#" + this.getVersion() + "#" + this.getBuild()
108
            this.getCode() + "#" + this.getVersion() 
108 109
                + "#" + this.getOperatingSystem() + "#"
109 110
                + this.getArchitecture();
110 111
        return id;
......
464 465
        String id = this.getID();
465 466
        String[] stringParts = string.split("#");
466 467

  
467
        if (stringParts.length == 1) {
468

  
468
        switch (stringParts.length) {
469
        case 1:
469 470
            if (stringParts[0].equals(this.getCode())) {
470 471
                return true;
471 472
            } else {
472 473
                return false;
473 474
            }
474
        } else {
475
            if (stringParts.length == 2) {
476
                if ((stringParts[0] + stringParts[1])
477
                    .equals((this.getCode() + this.getVersion()))) {
478
                    return true;
479
                } else {
480
                    return true;
481
                }
482
            } else {
483
                if (string.equals(id)) {
484
                    return true;
485
                } else {
486
                    return false;
487
                }
475
        case 2:
476
            if (!stringParts[0].equals(this.getCode())) {
477
                return false;
488 478
            }
479
            Version version = new DefaultVersion();
480
            try {
481
                version.parse(stringParts[1]);
482
            } catch (InvalidParameterException ex) {
483
                return false;
484
            }
485

  
486
            if (version.equals(this.getVersion())) {
487
                return true;
488
            }
489
            return false;
490
        default:
491
            return string.equals(id);
492

  
489 493
        }
490 494

  
491 495
    }

Also available in: Unified diff