8000 [Finder] Adds bsd adapter. by jfsimon · Pull Request #5876 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Finder] Adds bsd adapter. #5876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 1, 2012
Merged

[Finder] Adds bsd adapter. #5876

merged 2 commits into from
Nov 1, 2012

Conversation

jfsimon
Copy link
Contributor
@jfsimon jfsimon commented Oct 30, 2012

OK on mac os x.

@fabpot
Copy link
Member
fabpot commented Oct 31, 2012

Here are the results for the Finder tests on my Mac:

...............................................................  63 / 181 ( 34%)
......................find: -regextype: unknown primary or operator
F..............find: -regextype: unknown primary or operator
find: -regextype: unknown primary or operator
.find: -regextype: unknown primary or operator
find: -regextype: unknown primary or operator
......................... 126 / 181 ( 69%)
.......................................................

Time: 1 second, Memory: 10.75Mb

There was 1 failure:

1) Symfony\Component\Finder\Tests\FinderTest::testIgnoreDotFiles with data set #1 (Symfony\Component\Finder\Adapter\PhpAdapter)
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => '/var/folders/h7/55h7wcsx4g1cl...r/.bar'
-    1 => '/var/folders/h7/55h7wcsx4g1cl...r/.foo'
-    2 => '/var/folders/h7/55h7wcsx4g1cl...o/.bar'
-    3 => '/var/folders/h7/55h7wcsx4g1cl...r/.git'
-    4 => '/var/folders/h7/55h7wcsx4g1cl...er/foo'
-    5 => '/var/folders/h7/55h7wcsx4g1cl...oo bar'
-    6 => '/var/folders/h7/55h7wcsx4g1cl...ar.tmp'
-    7 => '/var/folders/h7/55h7wcsx4g1cl...st.php'
-    8 => '/var/folders/h7/55h7wcsx4g1cl...est.py'
-    9 => '/var/folders/h7/55h7wcsx4g1cl...r/toto'
 )

.../src/Symfony/Component/Finder/Tests/Iterator/IteratorTestCase.php:25
.../src/Symfony/Component/Finder/Tests/FinderTest.php:207
phpunit:46

@jfsimon
Copy link
Contributor Author
jfsimon commented Oct 31, 2012

@fabpot thank you! It seems I need to experiment a little more...

fabpot added a commit to fabpot/symfony that referenced this pull request Oct 31, 2012
This PR was merged into the master branch.

Commits
-------

2401274 [Finder] Added bsd adapter (need tests).

Discussion
----------

[WIP] [Finder] Adds bsd adapter (need tests).

**I have no mac or bsd system. Could someone please tell me if test pass?**

I used this solution to replace `-printf` option: `find . -print0 | xargs -0 stat -f '%i '` (http://stackoverflow.com/questions/752818/why-does-macs-find-not-have-the-option-printf).

Too bad Github didn't handle the file move :(
The only difference between the two `find` implementation is:
  * GNU: https://github.com/jfsimon/symfony/pull/new/bsd_find#L2R48
  * BSD: https://github.com/jfsimon/symfony/pull/new/bsd_find#L1R46
->ins('find')
->add('find ')
->arg($dir)
->add('-noleaf') // -noleaf option is required for filesystems who doesn't follow '.' and '..' convention
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. :)

@jfsimon
Copy link
Contributor Author
jfsimon commented Nov 1, 2012

@fabpot BSD adapter is OK on mac os x.

fabpot added a commit that referenced this pull request Nov 1, 2012
This PR was merged into the master branch.

Commits
-------

b550677 [Finder] Fix the BSD adapter
2401274 [Finder] Added bsd adapter (need tests).

Discussion
----------

[Finder] Adds bsd adapter.

OK on mac os x.

---------------------------------------------------------------------------

by fabpot at 2012-10-31T08:22:05Z

Here are the results for the Finder tests on my Mac:

```
...............................................................  63 / 181 ( 34%)
......................find: -regextype: unknown primary or operator
F..............find: -regextype: unknown primary or operator
find: -regextype: unknown primary or operator
.find: -regextype: unknown primary or operator
find: -regextype: unknown primary or operator
......................... 126 / 181 ( 69%)
.......................................................

Time: 1 second, Memory: 10.75Mb

There was 1 failure:

1) Symfony\Component\Finder\Tests\FinderTest::testIgnoreDotFiles with data set #1 (Symfony\Component\Finder\Adapter\PhpAdapter)
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => '/var/folders/h7/55h7wcsx4g1cl...r/.bar'
-    1 => '/var/folders/h7/55h7wcsx4g1cl...r/.foo'
-    2 => '/var/folders/h7/55h7wcsx4g1cl...o/.bar'
-    3 => '/var/folders/h7/55h7wcsx4g1cl...r/.git'
-    4 => '/var/folders/h7/55h7wcsx4g1cl...er/foo'
-    5 => '/var/folders/h7/55h7wcsx4g1cl...oo bar'
-    6 => '/var/folders/h7/55h7wcsx4g1cl...ar.tmp'
-    7 => '/var/folders/h7/55h7wcsx4g1cl...st.php'
-    8 => '/var/folders/h7/55h7wcsx4g1cl...est.py'
-    9 => '/var/folders/h7/55h7wcsx4g1cl...r/toto'
 )

.../src/Symfony/Component/Finder/Tests/Iterator/IteratorTestCase.php:25
.../src/Symfony/Component/Finder/Tests/FinderTest.php:207
phpunit:46
```

---------------------------------------------------------------------------

by jfsimon at 2012-10-31T08:46:22Z

@fabpot thank you! It seems I need to experiment a little more...

---------------------------------------------------------------------------

by jfsimon at 2012-11-01T14:38:31Z

@fabpot BSD adapter is OK on mac os x.
@fabpot fabpot merged commit b550677 into symfony:master Nov 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0