quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Quilt-dev] [patch 6/7] Exit with an error when diffs retcode=2 (err


From: Jean Delvare
Subject: Re: [Quilt-dev] [patch 6/7] Exit with an error when diffs retcode=2 (error) on patch
Date: Sun, 12 Jan 2014 12:28:37 +0100

Hi Martin,

On Mon, 30 Dec 2013 10:50:01 +0100, Martin Quinson wrote:
> On Mon, Dec 30, 2013 at 08:52:20AM +0100, Raphael Hertzog wrote:
> > On Sun, 29 Dec 2013, Martin Quinson wrote:
> > > I took all of your suggestions and added a small test case. It does
> > > not test what happens with binary diffs because I could not think of
> > > how to generate a binary file in a portable manner, but uses chmod -r.
> > 
> > Maybe something like this ?
> > 
> > printf "\x02\x00\x01" >binary
> > 
> > I don't know if that construct is portable, but printf should be.
> 
> That's a good idea! (...)

I confirm that portability isn't an issue because bash implements
printf.

> But unfortunately, I fail to put your idea into practice because I
> fail to get the right parsing in the test file. If the test file reads
>       $ printf "\x02\x00\x01" > test
> I get x02x00x01 in the diff. I tried several combination, in vain.
> 
> Jean, you just rewrote the main loop and variable substitution parts
> of test/run. Do you have an idea of how to fix that too, please?

Well, just doubling the backslashes did the trick for me. The following
test case works for me (bash versions 3.2.51 and 4.2.45):

        $ printf "\\x02\\x00\\x01" > test.bin

        $ quilt new test2.diff
        > Patch %{P}test2.diff is now on top
        $ quilt add test.bin
        > File test.bin added to patch %{P}test2.diff

        $ printf "\\x03\\x00\\x01" > test.bin
        $ quilt diff -pab --no-index
        >~ (Files|Binary files) a/test\.bin and b/test\.bin differ

Does it not work for you?

-- 
Jean Delvare
Suse L3 Support



reply via email to

[Prev in Thread] Current Thread [Next in Thread]