From b6364a5f8842b1a7a8448f8c0763be7688745aea Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 9 Mar 2015 17:26:28 +0100 Subject: [PATCH] preserve symlinks --- bin/pharext | Bin 41514 -> 41616 bytes src/pharext/SourceDir/Git.php | 8 +++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/pharext b/bin/pharext index 6137e91b8dfd00df99eeb788ad1753f2974c7a65..3ab0aad8cb015fabf0b1ef8017facf4748cc3ad5 100755 GIT binary patch delta 520 zcmZ2=glWQ2rVZIrljq7v^F*Hf8{)vgz;Mj@_14L1(t2QlE@lRXmrLg6P5vsS3KsY- z%fR4Xvf$0+qtaSnfebzdhPl2wgC|drRu$O6%D@0J2Sm@hZ~b8MZ)shys!|pPhF_0t z?o3XQ7MWZrBLEhh!^FVgsvlMY7A%(%V2V6Bxl_szMD3B%1yQf1 e&i5b1r#!kB-OjGweDk+>fPv)XLTOQP_skN#f{cP7 zRt5%;A`rb|%R$k}f2Fj*MrH6ZFwFJc89X^dS{H0gDGLL`uSYg_V8)07jS-pLAj1K2 zRTt1zTcrgAKt|1BVqkF94=VvFoSZHt4>ryLX!SAY*IOqu$_P*9kQD(7iUOVc`@K)w zkqzpu0HSIKaosx-{;zU***ci$>8qf>jVG}fSs-Y 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); -- 2.30.2