threads / discuss / 12500

t4109-apply-multifrag.sh problem on solaris -- looks like problem w/ solaris patch cmd

Subject: t4109-apply-multifrag.sh problem on solaris -- looks like problem w/ solaris patch cmd

## tl;dr

2 messages between Mar 4, 2008 and Mar 4, 2008.

replies: 1people: 2as markdown or json

Whit Armstrong· Mar 4, 2008, 16:22 UTC · lore
using git current: c95b3ad9ea310ec89e31a21edecaaf2c374e2c46
xs5-trd-p1.grn:warmstro> sh t4109-apply-multifrag.sh -v -i
* expecting success: git apply patch1.patch patch2.patch
*   ok 1: S = git apply (1)
* expecting success: cat patch1.patch patch2.patch | patch -p1
  Looks like a unified context diff.
File to patch: ^CFATAL: Unexpected exit with code 3
xs5-trd-p1.grn:warmstro> sh t4109-apply-multifrag.sh -i -v
* expecting success: git apply patch1.patch patch2.patch
*   ok 1: S = git apply (1)
* expecting success: cat patch1.patch patch2.patch | patch -p1
  Looks like a unified context diff.
File to patch: ^CFATAL: Unexpected exit with code 3
xs5-trd-p1.grn:warmstro>
the test just hangs at "File to patch:" and I have to C^ to exit.
and that's exactly what I get executing the patch command myself:
xs5-trd-p1.grn:warmstro> cd trash/
xs5-trd-p1.grn:warmstro> cat patch1.patch patch4.patch | patch -p1
  Looks like a unified context diff.
File to patch:
No file found -- skip this patch? [no]
File to patch:
No file found -- skip this patch? [no] yes
Skipping patch...
  The next patch looks like a unified context diff.
File to patch: ^Cxs5-trd-p1.grn:warmstro>
xs5-trd-p1.grn:warmstro>

but with GNU patch-2.5.4 the test works (not sure what the failure is at the end, but it looks like all the individual tests pass):

xs5-trd-p1.grn:warmstro> sh t4109-apply-multifrag.sh -i -v
* expecting success: git apply patch1.patch patch2.patch
*   ok 1: S = git apply (1)
* expecting success: cat patch1.patch patch2.patch | patch -p1
patching file main.c
patching file main.c
*   ok 2: S = patch (1)
* expecting success: cmp main.c.git main.c
*   ok 3: S = cmp (1)
* expecting success: git apply patch1.patch patch2.patch patch3.patch
*   ok 4: S = git apply (2)
* expecting success: cat patch1.patch patch2.patch patch3.patch | patch -p1
patching file main.c
patching file main.c
patching file main.c
*   ok 5: S = patch (2)
* expecting success: cmp main.c.git main.c
*   ok 6: S = cmp (2)
* expecting success: git apply patch1.patch patch4.patch
*   ok 7: S = git apply (3)
* expecting success: cat patch1.patch patch4.patch | patch -p1
patching file main.c
patching file main.c
*   ok 8: S = patch (3)
* expecting success: cmp main.c.git main.c
*   ok 9: S = cmp (3)
* passed all 9 test(s)
FATAL: Unexpected exit with code 0
xs5-trd-p1.grn:warmstro>

Again, this is on a Solaris 5.9 machine: xs5-trd-p1.grn:warmstro> uname -a SunOS xs5-trd-p1.grn.tudor.com 5.9 Generic_118558-38 sun4u sparc SUNW,Sun-Fire-V240 Solaris xs5-trd-p1.grn:warmstro>

Is the answer to use GNU patch? Or is there a trick to make the Solaris version of patch work?

Thanks, Whit

Junio C Hamano· Mar 4, 2008, 19:32 UTC · re: Whit Armstrong · lore

Re: t4109-apply-multifrag.sh problem on solaris -- looks like problem w/ solaris patch cmd

"Whit Armstrong" <armstrong.whit@gmail.com> writes:
Show 12 quoted lines
> * expecting success: git apply patch1.patch patch2.patch patch3.patch
> *   ok 4: S = git apply (2)
>
> * expecting success: cat patch1.patch patch2.patch patch3.patch | patch -p1
> patching file main.c
> patching file main.c
> patching file main.c
> *   ok 5: S = patch (2)
> ...
>
> Is the answer to use GNU patch? Or is there a trick to make the
> Solaris version of patch work?

If we are reasonably sure that we will not be needing to change these test vectors (and because "git apply" is now solid, I think we are), I think the best way to address this is to prepare a new t/t4109 directory, store the expected output in there, and compare output from "git apply" that is being tested with the precomputed test vectors.

← back to recent threads