[izpack-changes] r1906 - izpack-src/trunk/src/lib/com/izforge/izpack/installer

noreply at berlios.de noreply at berlios.de
Fri Nov 16 14:42:30 CET 2007


Author: dreil
Date: 2007-11-16 14:42:26 +0100 (Fri, 16 Nov 2007)
New Revision: 1906

Modified:
   izpack-src/trunk/src/lib/com/izforge/izpack/installer/MultiVolumeUnpacker.java
   izpack-src/trunk/src/lib/com/izforge/izpack/installer/Unpacker.java
Log:
added condition support in installation.xml

Modified: izpack-src/trunk/src/lib/com/izforge/izpack/installer/MultiVolumeUnpacker.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/installer/MultiVolumeUnpacker.java	2007-11-16 12:58:42 UTC (rev 1905)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/installer/MultiVolumeUnpacker.java	2007-11-16 13:42:26 UTC (rev 1906)
@@ -420,16 +420,11 @@
                 // We get the internationalized name of the pack
                 final Pack pack = ((Pack) packs.get(i));
                 // evaluate condition
-                if (pack.hasCondition()) {
-                    if (rules != null) {
-                        if (!rules.isConditionTrue(pack.getCondition())) {
-                            // skip pack, condition is not fullfilled.
-                            continue;
-                        }
-                    }
-                    else {
-                        // TODO: skip pack, because condition can not be checked 
-                    }
+                if (pack.hasCondition() && (rules != null)) {                    
+                    if (!rules.isConditionTrue(pack.getCondition())) {
+                        // skip pack, condition is not fullfilled.
+                        continue;
+                    }                    
                 }
                 String stepname = pack.name;// the message to be passed to the
                 // installpanel
@@ -447,7 +442,12 @@
                 {
                     // We read the header
                     XPackFile pf = (XPackFile) objIn.readObject();
-
+                    if (pf.hasCondition() && (rules != null)) {
+                        if (!rules.isConditionTrue(pf.getCondition())) {
+                            // skip file, condition is false
+                            continue;
+                        }
+                    }
                     if (OsConstraint.oneMatchesCurrentSystem(pf.osConstraints()))
                     {
                         // We translate & build the path
@@ -676,6 +676,12 @@
                             fin.setVolumename(nextmedia.getAbsolutePath());
                         }
                     }
+                    if (pf.hasCondition() && (rules != null)) {
+                        if (!rules.isConditionTrue(pf.getCondition())) {
+                            // skip parsable, condition is false
+                            continue;
+                        }
+                    }
                     pf.path = IoHelper.translatePath(pf.path, vs);
                     Debug.trace("Found parsable: " + pf.path);
                     parsables.add(pf);
@@ -687,7 +693,12 @@
                 for (int k = 0; k < numExecutables; k++)
                 {
                     ExecutableFile ef = (ExecutableFile) objIn.readObject();
-
+                    if (ef.hasCondition() && (rules != null)) {
+                        if (!rules.isConditionTrue(ef.getCondition())) {
+                            // skip, condition is false
+                            continue;
+                        }
+                    }
                     ef.path = IoHelper.translatePath(ef.path, vs);
                     if (null != ef.argList && !ef.argList.isEmpty())
                     {

Modified: izpack-src/trunk/src/lib/com/izforge/izpack/installer/Unpacker.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/installer/Unpacker.java	2007-11-16 12:58:42 UTC (rev 1905)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/installer/Unpacker.java	2007-11-16 13:42:26 UTC (rev 1906)
@@ -351,7 +351,13 @@
                 {
                     // We read the header
                     PackFile pf = (PackFile) objIn.readObject();
-
+                    // TODO: reaction if condition can not be checked
+                    if (pf.hasCondition() && (rules != null)) {
+                        if (!rules.isConditionTrue(pf.getCondition())) {
+                            // skip, condition is not fulfilled
+                            continue;
+                        }
+                    }
                     if (OsConstraint.oneMatchesCurrentSystem(pf.osConstraints()))
                     {
                         // We translate & build the path
@@ -552,6 +558,12 @@
                 for (int k = 0; k < numParsables; k++)
                 {
                     ParsableFile pf = (ParsableFile) objIn.readObject();
+                    if (pf.hasCondition() && (rules != null)) {
+                        if (!rules.isConditionTrue(pf.getCondition())) {
+                            // skip, condition is not fulfilled
+                            continue;
+                        }
+                    }
                     pf.path = IoHelper.translatePath(pf.path, vs);
                     parsables.add(pf);
                 }
@@ -561,6 +573,12 @@
                 for (int k = 0; k < numExecutables; k++)
                 {
                     ExecutableFile ef = (ExecutableFile) objIn.readObject();
+                    if (ef.hasCondition() && (rules != null)) {
+                        if (!rules.isConditionTrue(ef.getCondition())) {
+                            // skip, condition is false
+                            continue;
+                        }
+                    }
                     ef.path = IoHelper.translatePath(ef.path, vs);
                     if (null != ef.argList && !ef.argList.isEmpty())
                     {



More information about the izpack-changes mailing list