Changeset 191

Show
Ignore:
Timestamp:
05/14/07 11:47:53 (2 years ago)
Author:
mrook
Message:

Enable relative path handling in zip task (patch by Oliver Schlicht)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/classes/phing/lib/Zip.php

    r123 r191  
    12691269    else if ($p_remove_dir != "") 
    12701270    { 
     1271      $p_remove_dir = $this->_tool_TranslateWinPath($p_remove_dir, false); 
     1272         
    12711273      if (substr($p_remove_dir, -1) != '/') 
    12721274        $p_remove_dir .= "/"; 
  • trunk/classes/phing/tasks/ext/ZipTask.php

    r144 r191  
    9696                    throw new BuildException("basedir does not exist!", $this->getLocation()); 
    9797                } 
    98  
    99                 // add the main fileset to the list of filesets to process. 
    100                 $mainFileSet = new FileSet($this->fileset); 
    101                 $mainFileSet->setDir($this->baseDir); 
    102                 $this->filesets[] = $mainFileSet; 
     98                 
     99                if (0 == count($this->fileset)) 
     100                { 
     101                        // add the main fileset to the list of filesets to process. 
     102                        $mainFileSet = new FileSet($this->fileset); 
     103                        $mainFileSet->setDir($this->baseDir); 
     104                        $this->filesets[] = $mainFileSet; 
     105                } 
    103106            } 
    104107 
     
    143146                // to also include empty directories.  Not high priority, since non-inclusion 
    144147                // of empty dirs is probably not unexpected behavior for ZipTask. 
    145                 $fsBasedir = $fs->getDir($this->project); 
     148                $fsBasedir = (null != $this->baseDir) ? $this->baseDir : 
     149                                                                        $fs->getDir($this->project); 
     150                 
    146151                $filesToZip = array(); 
    147152                for ($i=0, $fcount=count($files); $i < $fcount; $i++) {