List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:September 17 2012 10:40pm
Subject:bzr commit into ABSv2 branch (reggie.burnett:39)
View as plain text  
#At file:///C:/work/wex/absv2/ based on revid:reggie.burnett@stripped

   39 Reggie Burnett	2012-09-17
      small correction in how we validate a product file

    modified:
      AbsUtility/ProductFile.cs
=== modified file 'AbsUtility/ProductFile.cs'
=== modified file 'AbsUtility/ProductFile.cs'
--- a/AbsUtility/ProductFile.cs	2012-09-17 22:01:12 +0000
+++ b/AbsUtility/ProductFile.cs	2012-09-17 22:40:37 +0000
@@ -52,12 +52,16 @@
         throw new Exception("Every product file requires a regular expression");
       if (Generated && String.IsNullOrEmpty(GenerationScript))
         throw new Exception("Generated files require a supplied generation script");
+      File = null;
       string[] files = Utility.MatchFiles(Product.IncomingFolder, RegularExpression);
-      if (files.Length != 1 && checkGenerated)
+      if (files != null && files.Length == 1)
+      {
+        File = files[0];
+        if (Utility.FileIsLocked(File))
+          throw new Exception(String.Format("File matching expression {0} is still locked", RegularExpression));
+      }
+      else if (checkGenerated)
         throw new Exception("Regular expression did not match exactly 1 file");
-      File = files[0];
-      if (Utility.FileIsLocked(File))
-        throw new Exception(String.Format("File matching expression {0} is still locked", RegularExpression));
     }
 
     public bool Build(Version newVersion)


Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20120917224037-pkzu85xs2rrqtiau.bundle
Thread
bzr commit into ABSv2 branch (reggie.burnett:39) Reggie Burnett19 Sep