From: Michael Wallner Date: Mon, 9 Mar 2015 16:26:28 +0000 (+0100) Subject: preserve symlinks X-Git-Tag: v2.0.0~5 X-Git-Url: https://git.m6w6.name/?p=pharext%2Fpharext;a=commitdiff_plain;h=b6364a5f8842b1a7a8448f8c0763be7688745aea preserve symlinks --- diff --git a/bin/pharext b/bin/pharext index 6137e91..3ab0aad 100755 Binary files a/bin/pharext and b/bin/pharext differ diff --git a/src/pharext/SourceDir/Git.php b/src/pharext/SourceDir/Git.php index df52101..531aa65 100644 --- a/src/pharext/SourceDir/Git.php +++ b/src/pharext/SourceDir/Git.php @@ -47,15 +47,17 @@ class Git implements \IteratorAggregate, SourceDir $pwd = getcwd(); chdir($this->path); if (($pipe = popen("git ls-tree -r --name-only HEAD", "r"))) { + $path = realpath($this->path); while (!feof($pipe)) { if (strlen($file = trim(fgets($pipe)))) { if ($this->cmd->getArgs()->verbose) { $this->cmd->info("Packaging %s\n", $file); } - if (!($realpath = realpath($file))) { - $this->cmd->error("File %s does not exist\n", $file); + /* there may be symlinks, so no realpath here */ + if (!file_exists("$path/$file")) { + $this->cmd->error("File %s does not exist in %s\n", $file, $path); } - yield $realpath; + yield "$path/$file"; } } pclose($pipe);