Hello Robert,

Robert Connolly wrote:
> Hello. I have a problem with:
> bzcat ../loop-AES-v3.2e-20090112.diff.bz2 | patch -p1 &&
> 
> The && is useless because of the |. Redirection would work, except that the 
> patch is bzip2 compressed. For example:
> patch -p1 < ../loop-AES-v3.2e-20090112.diff
> works, but
> patch -p1 < $(bzcat ../loop-AES-v3.2e-20090112.diff.bz2)
> does not (ambiguous redirect).
> 
> Is there another way, aside from decompressing the patch in the sources 
> directory?


I think your first approach works fine.

Perhaps I don't understand.
What do you mean when you say that "the && is useless"?

The && seems to work fine when I try this:


--------------------------------------------
mkdir t1
mkdir t2
cat > t1/foo.txt << EOF
foo
bzr
EOF
cat > t2/foo.txt << EOF
foo
bar
EOF
diff -ur t1 t2 > d.diff
bzip2 d.diff
cd t1
bzcat ../d.diff.bz2 | patch -Np1 && echo YAY || echo DARN
bzcat ../d.diff.bz2 | patch -Np1 && echo YAY || echo DARN
--------------------------------------------

I see the following output:

--------------------------------------------
halle:~ eric$ mkdir t1
halle:~ eric$ mkdir t2
halle:~ eric$ cat > t1/foo.txt << EOF
 > foo
 > bzr
 > EOF
halle:~ eric$ cat > t2/foo.txt << EOF
 > foo
 > bar
 > EOF
halle:~ eric$ diff -ur t1 t2 > d.diff
halle:~ eric$ bzip2 d.diff
halle:~ eric$ cd t1
halle:t1 eric$ bzcat ../d.diff.bz2 | patch -Np1 && echo YAY || echo DARN
patching file foo.txt
YAY
halle:t1 eric$ bzcat ../d.diff.bz2 | patch -Np1 && echo YAY || echo DARN
patching file foo.txt
Reversed (or previously applied) patch detected!  Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file foo.txt.rej
DARN
halle:t1 eric$
--------------------------------------------

This seems to indicate that the redirection and the && and the || are 
working exactly as expected.

Can you provide a more complete example to demonstrate the problem?

Cheers,
  -Eric

> 
> robert
> 


-- 
http://www.freesa.org/ -- mobile: +31 620719662
aim: ericigps -- skype: eric_herman -- jabber: [email protected]
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-chat
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to