}
foreach ($this->args[0] as $file) {
- if (file_exists($file)) {
- $this->updatePackage(new SplFileInfo($file));
+ $info = new SplFileInfo($file);
+
+ while ($info->isLink()) {
+ $info = new SplFileInfo($info->getLinkTarget());
+ }
+
+ if ($info->isFile()) {
+ $this->updatePackage($info);
} else {
$this->error("File '%s' does not exist\n", $file);
exit(self::EARGS);
if (!copy($file->getPathname(), $temp)) {
throw new Exception;
}
+ if (!chmod($temp, $file->getPerms())) {
+ throw new Exception;
+ }
$this->replacePharext($temp);