From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from int-mx1.corp.redhat.com (nat-pix.rdu.redhat.com [10.255.18.200]) by listman.rdu-colo.redhat.com (8.11.6/8.11.6) with ESMTP id h4NAvR508876 for ; Fri, 23 May 2003 06:57:27 -0400 Received: (from mail@localhost) by int-mx1.corp.redhat.com (8.11.6/8.11.6) id h4NAw3301281 for blinux-list@listman.rdu-colo.redhat.com; Fri, 23 May 2003 06:58:03 -0400 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with SMTP id h4NAw3I01275 for ; Fri, 23 May 2003 06:58:03 -0400 Received: from lexx.delysid.org (mail@chello080109223066.lancity.graz.surfer.at [80.109.223.66]) by mx1.redhat.com (8.11.6/8.11.6) with SMTP id h4NAw2H15367 for ; Fri, 23 May 2003 06:58:02 -0400 Received: from mlang by lexx.delysid.org with local (Exim 3.36 #1 (Debian)) id 19JAFT-0002RE-00 for ; Fri, 23 May 2003 12:58:07 +0200 To: blinux-list@redhat.com Subject: diff and patch Was: Re: need help with yasr patch In-Reply-To: (Cheryl Homiak's message of "Thu, 22 May 2003 11:03:38 -0500 (CDT)") References: From: Mario Lang Date: Fri, 23 May 2003 12:58:07 +0200 Message-ID: <87n0hec4lc.fsf@lexx.delysid.org> User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Loop: blinux-list@redhat.com Sender: blinux-list-admin@redhat.com Errors-To: blinux-list-admin@redhat.com X-BeenThere: blinux-list@redhat.com X-Mailman-Version: 2.0.13 Precedence: list Reply-To: blinux-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux for blind general discussion List-Unsubscribe: , List-Archive: Cheryl Homiak writes: > Just be sure you cut it off at the right place when you edited it out of the > email. Tip of the day: patch is smart enough to detect if you got extra, irrelevant, lines of text in your patch file. So usually, you should be able to just save the mail, and apply it, as long as the patch wasn't base64 encoded or something like that. Looking at "cvs diff" output is an example for that. cvs outputs additional lines of information about the patch, which are not part of a normal diff file. patch happily ignores those without the need to manually edit the diff, or filter it in some way. Another related trick is executable patch files. Since patch ignores irrelevant, non-diff text lines, you can begin your patch file like #!/bin/sh and write a little interactive script which applies "patch" on itself, something like patch -p1 <$0 This way you can put safety checks in your patch to avoid common user errors. You just need to set the executable bit on your patch file, and off you go. -- CYa, Mario | Debian Developer | Get my public key via finger mlang@db.debian.org | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44