Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Smile Failed Patch/Diff File From Googlegroups


    I try to use a patch /diff for a linux graphics program.
    The patch file was obtained from Googlegroups. Unfortunately the patch failed (3 hunks).

    Apparently googlegroups add several "carriage return" (ASCII 13) to diff / patch files.

    I edited the files and delete all "carriage return" characters.
    The patch work perfectly.

    Is it better to use GZ or ZIP file format for uploading patch to googlegroups?

  2. #2
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Belgium
    Posts
    1,429
    What is the extension of the patch you downloaded? For gziped patches, you should do
    Code:
    patch -p0 / -p1 < zcat [patch]
    For bzip2ed patches, it is
    Code:
    patch -p0 / - p1 | bzcat [patch]
    Debian Jessie x86_64 & armhf :: LibreELEC is the solution for your Linux-based HTPC setups.

  3. #3
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    That's not quite true. Rather, it should be:
    Code:
    zcat patch.gz | patch -pwhatever
    Same for bzcat.

    However, that doesn't even seem to be the problem. I'm quite puzzled by the problem. It is indeed standard procedure to add carriage returns to text/* MIME types when they enter any mail-like system (include Usenet). However, they should be converted back when they are downloaded. I can only guess that you downloaded it using a web browser, and not some mail client, is that right?

    If you experience this problem often, you can use the dos2unix program to automatically remove the carriage returns.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Belgium
    Posts
    1,429
    Yeah I'm sorry . Not redirection but piping, and reverse order...
    Debian Jessie x86_64 & armhf :: LibreELEC is the solution for your Linux-based HTPC setups.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •