# Install on opensolaris 2008.05

4 messages from 2008-08-17 to 2008-08-17. Participants: Sean Brandt, Jeff King, Pierre Habouzit.
Thread: https://gitlist.dev/t/15057

## Sean Brandt, 2008-08-17 12:55

Subject: Install on opensolaris 2008.05
Message-ID: <7a675f570808170555ie640c86jb5561cc6f7b68c73@mail.gmail.com>
URL: https://gitlist.dev/e/7a675f570808170555ie640c86jb5561cc6f7b68c73%40mail.gmail.com

```
I'm building an opensolaris box, and am running into test failures
when compiling git.

 I'm installing on opensolaris 2008.05 and the tests fail in
t0002-gitfile.sh  ( test numbers 2 and 3 ) is this expected/ok?

*** t0002-gitfile.sh ***
*   ok 1: initial setup
* FAIL 2: bad setup: invalid .git file format

                echo "gitdir $REAL" >.git &&
                if git rev-parse 2>.err
                then
                        echo "git rev-parse accepted an invalid .git file"
                        false
                fi &&
                if ! grep -qe "Invalid gitfile format" .err
                then
                        echo "git rev-parse returned wrong error"
                        false
                fi

* FAIL 3: bad setup: invalid .git file path

                echo "gitdir: $REAL.not" >.git &&
                if git rev-parse 2>.err
                then
                        echo "git rev-parse accepted an invalid .git file path"
                        false
                fi &&
                if ! grep -qe "Not a git repository" .err
                then
                        echo "git rev-parse returned wrong error"
                        false
                fi

*   ok 4: final setup + check rev-parse --git-dir
*   ok 5: check hash-object
*   ok 6: check cat-file
*   ok 7: check update-index
*   ok 8: check write-tree
*   ok 9: check commit-tree
*   ok 10: check rev-list
* failed 2 among 10 test(s)
gmake[1]: *** [t0002-gitfile.sh] Error 1
gmake[1]: Leaving directory `/root/git-1.5.6.5/t'



Thanks

- Sean

```

## Jeff King, 2008-08-17 20:03

Subject: Re: Install on opensolaris 2008.05
Message-ID: <20080817200321.GA17785@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20080817200321.GA17785%40sigill.intra.peff.net
In-Reply-To: <7a675f570808170555ie640c86jb5561cc6f7b68c73@mail.gmail.com>

```
On Sun, Aug 17, 2008 at 08:55:57AM -0400, Sean Brandt wrote:

>  I'm installing on opensolaris 2008.05 and the tests fail in
> t0002-gitfile.sh  ( test numbers 2 and 3 ) is this expected/ok?

No, it's not expected nor ok (though it there is a reasonable chance it
is a portability problem in the test script, and not a real git
breakage).

What does

  make test GIT_TEST_OPTS="-v -i"

tell you?

>                 if ! grep -qe "Invalid gitfile format" .err

Just a guess, but I think Solaris grep doesn't understand "-q".

Does the patch below help?

---
diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh
index 4db4ac4..e4970fe 100755
--- a/t/t0002-gitfile.sh
+++ b/t/t0002-gitfile.sh
@@ -32,7 +32,7 @@ test_expect_success 'bad setup: invalid .git file format' '
 		echo "git rev-parse accepted an invalid .git file"
 		false
 	fi &&
-	if ! grep -qe "Invalid gitfile format" .err
+	if ! grep -e "Invalid gitfile format" .err
 	then
 		echo "git rev-parse returned wrong error"
 		false
@@ -46,7 +46,7 @@ test_expect_success 'bad setup: invalid .git file path' '
 		echo "git rev-parse accepted an invalid .git file path"
 		false
 	fi &&
-	if ! grep -qe "Not a git repository" .err
+	if ! grep -e "Not a git repository" .err
 	then
 		echo "git rev-parse returned wrong error"
 		false

```

## Sean Brandt, 2008-08-17 20:50

Subject: Re: Install on opensolaris 2008.05
Message-ID: <1DC600E8-5D3A-44F7-994E-2B46254F192C@fuzzymagic.com>
URL: https://gitlist.dev/e/1DC600E8-5D3A-44F7-994E-2B46254F192C%40fuzzymagic.com
In-Reply-To: <20080817200321.GA17785@sigill.intra.peff.net>

```
Ahh, looks like it's a grep problem, thanks. opensolaris grep doesn't  
like the options in the test.

By default it provides ggrep (gnu grep ) which does have the  
appropriate options.

After making some changes so that the right grep is available ( moving  
the old one out of the way and symlinking ggrep in place ) the tests  
proceed past the original point to here:


* passed all 6 test(s)
*** t0004-unwritable.sh ***
* expecting success:

         >file &&
         git add file &&
         test_tick &&
         git commit -m initial &&
         echo >file &&
         git add file


Created initial commit 1bd44cb: initial
  0 files changed, 0 insertions(+), 0 deletions(-)
  create mode 100644 file
*   ok 1: setup

* expecting success:

         (
                 chmod a-w .git/objects .git/objects/?? &&
                 test_must_fail git write-tree
         )
         status=$?
         chmod 775 .git/objects .git/objects/??
         (exit $status)


47d83249b05cf06491633be38ea8637c5b356acc
* FAIL 2: write-tree should notice unwritable repository


                 (
                         chmod a-w .git/objects .git/objects/?? &&
                         test_must_fail git write-tree
                 )
                 status=$?
                 chmod 775 .git/objects .git/objects/??
                 (exit $status)


gmake[1]: *** [t0004-unwritable.sh] Error 1
gmake[1]: Leaving directory `/root/git-1.5.6.5/t'
gmake: *** [test] Error 2




- Sean

On Aug 17, 2008, at 4:03 PM, Jeff King wrote:

> On Sun, Aug 17, 2008 at 08:55:57AM -0400, Sean Brandt wrote:
>
>> I'm installing on opensolaris 2008.05 and the tests fail in
>> t0002-gitfile.sh  ( test numbers 2 and 3 ) is this expected/ok?
>
> No, it's not expected nor ok (though it there is a reasonable chance  
> it
> is a portability problem in the test script, and not a real git
> breakage).
>
> What does
>
>  make test GIT_TEST_OPTS="-v -i"
>
> tell you?
>
>>                if ! grep -qe "Invalid gitfile format" .err
>
> Just a guess, but I think Solaris grep doesn't understand "-q".
>
> Does the patch below help?
>
> ---
> diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh
> index 4db4ac4..e4970fe 100755
> --- a/t/t0002-gitfile.sh
> +++ b/t/t0002-gitfile.sh
> @@ -32,7 +32,7 @@ test_expect_success 'bad setup: invalid .git file  
> format' '
> 		echo "git rev-parse accepted an invalid .git file"
> 		false
> 	fi &&
> -	if ! grep -qe "Invalid gitfile format" .err
> +	if ! grep -e "Invalid gitfile format" .err
> 	then
> 		echo "git rev-parse returned wrong error"
> 		false
> @@ -46,7 +46,7 @@ test_expect_success 'bad setup: invalid .git file  
> path' '
> 		echo "git rev-parse accepted an invalid .git file path"
> 		false
> 	fi &&
> -	if ! grep -qe "Not a git repository" .err
> +	if ! grep -e "Not a git repository" .err
> 	then
> 		echo "git rev-parse returned wrong error"
> 		false

```

## Pierre Habouzit, 2008-08-17 20:52

Subject: Re: Install on opensolaris 2008.05
Message-ID: <20080817205240.GC17148@artemis>
URL: https://gitlist.dev/e/20080817205240.GC17148%40artemis
In-Reply-To: <1DC600E8-5D3A-44F7-994E-2B46254F192C@fuzzymagic.com>

```
On Sun, Aug 17, 2008 at 08:50:13PM +0000, Sean Brandt wrote:
> Ahh, looks like it's a grep problem, thanks. opensolaris grep doesn't 
> like the options in the test.
> 
> By default it provides ggrep (gnu grep ) which does have the appropriate 
> options.
> 
> After making some changes so that the right grep is available ( moving 
> the old one out of the way and symlinking ggrep in place ) the tests 
> proceed past the original point to here:
> 
[...]
> * FAIL 2: write-tree should notice unwritable repository
[...]
> gmake[1]: *** [t0004-unwritable.sh] Error 1
> gmake[1]: Leaving directory `/root/git-1.5.6.5/t'
                                ^^^^

  Do not run the test-suite as root ?

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

```
