Changeset 2101
- Timestamp:
- 03/14/08 04:08:14 (2 months ago)
- Files:
-
- alternc/trunk/bureau/admin/bro_main.php (modified) (1 diff)
- alternc/trunk/bureau/class/m_bro.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
alternc/trunk/bureau/admin/bro_main.php
r2094 r2101 113 113 if ($actextract) { 114 114 print _("extracting..."); 115 if ($bro->ExtractFile($ file, $R)) {115 if ($bro->ExtractFile($R. '/' . $file, $R)) { 116 116 print $err->errstr(); 117 117 print _("failed"); alternc/trunk/bureau/class/m_bro.php
r2092 r2101 424 424 { 425 425 global $err; 426 static $i=0, $ret;427 426 $file = $this->convertabsolute($file,0); 428 427 if (is_null($dest)) { … … 437 436 $file = escapeshellarg($file); 438 437 $dest = escapeshellarg($dest); 439 if ($i == 0) {440 438 #TODO new version of tar supports `tar xf ...` so there is no 441 439 # need to specify the compression format 442 exec("tar -xzf '$file' -C '$dest'", $void, $ret); 443 } else if ($i == 1) { 444 exec("tar -xjf '$file' -C '$dest'", $void, $ret); 445 } else if ($i == 2) { 446 exec("unzip '$file' -d '$dest'", $void, $ret); 447 } else { 448 $err->raise("bro","undefined extractiong error: %s", $ret); 449 return $ret; 450 } 451 440 exec("tar -xzf $file -C $dest", $void, $ret); 452 441 if ($ret) { 453 $i++; 454 $ret = $this->ExtractFile($file, $dest); 455 if ($ret) { 456 $err->raise("bro","could not find a way to extract file %s, unsupported format?", $file); 457 } 458 } 442 #print "tgz extraction failed, moving on to tbz\n"; 443 exec("tar -xjf $file -C $dest", $void, $ret); 444 } 445 if ($ret) { 446 $cmd = "unzip -o $file -d $dest"; 447 #print "tbz extraction failed, moving on to zip: $cmd\n"; 448 exec($cmd, $void, $ret); 449 } 450 if ($ret) { 451 $err->raise("bro","could not find a way to extract file %s, unsupported format?", $file); 452 } 453 459 454 return $ret; 460 455 }
