From owner-freebsd-ports@FreeBSD.ORG Wed Jul 10 12:37:16 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BD990E70 for ; Wed, 10 Jul 2013 12:37:16 +0000 (UTC) (envelope-from ljboiler@gmail.com) Received: from mail-gg0-x236.google.com (mail-gg0-x236.google.com [IPv6:2607:f8b0:4002:c02::236]) by mx1.freebsd.org (Postfix) with ESMTP id 86AE91B0D for ; Wed, 10 Jul 2013 12:37:16 +0000 (UTC) Received: by mail-gg0-f182.google.com with SMTP id f1so2313370ggn.13 for ; Wed, 10 Jul 2013 05:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=OpzGvOA9KRMrZB4uT4T3VAnUXwhoy9Hw/BuexrPiibU=; b=lqI3N0sGndMOElcCBb20DME8QutQ/LGE3CPwBpAMF+TdMm0W1HmF5DUefhiC/bzLb0 5zrzZML5BGqNNZm9PM8AqwhF5O1KO4g2RBrgZcF3oVsxmZAQGs8pGFAYorr+nCF2evl9 CW5WrCzRIP8I/+olnmCCYLxK8iqKyFYFsoFEd0Xv9m75VPdm5cdmkyyx1gA4/j42n9k3 EGwazZdLA3pxqKpmo23+4iPqw5JOqcEJ0VE1nliOh1MAz7WwMr2T5BvnBsuA5PmQ1Nga nPyOT7zKR3tMSuNIqjrfPDaSfbkvRyBwvchx23WFrb+bbqyI5k4F9pJtI7FMt1GxshTT WjVQ== X-Received: by 10.236.193.169 with SMTP id k29mr18213595yhn.146.1373459836017; Wed, 10 Jul 2013 05:37:16 -0700 (PDT) Received: from jmobile.jimmy.local (71-81-196-43.dhcp.stls.mo.charter.com. [71.81.196.43]) by mx.google.com with ESMTPSA id z45sm16939618yhb.0.2013.07.10.05.37.13 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Jul 2013 05:37:15 -0700 (PDT) Received: by jmobile.jimmy.local (sSMTP sendmail emulation); Wed, 10 Jul 2013 07:37:13 -0500 Date: Wed, 10 Jul 2013 07:37:12 -0500 From: Jimmy Kelley To: freebsd-ports@freebsd.org Subject: Re: order of patches under ports/xxx/zzz/files Message-ID: <20130710123712.GA12775@jmobile.jimmy.localnet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jul 2013 12:37:16 -0000 In article you wrote: > I'm trying to understand exactly how the patches > located in files directory in a port apply. > For example, port math/metis-edf has under files: > > # ls files/ > medis-patch-Lib_Makefile.txt patch-Lib::proto.h patch-Test::Makefile > patch-CONFIG::configure patch-Lib_Makefile patch-onmetis > patch-CONFIG_onmetis.in patch-Programs::Makefile > # > > Patch medis-patch-Lib_Makefile.txt must be applied > on top of patch-Lib_Makefile. This does seem to > work, but what process makes sure that the order > of patch application is exactly that. > > I can see that it works manually: > > # cd ./work/metis-edf-4.1/ > /usr/ports/math/metis-edf/work/metis-edf-4.1 > # patch < ../../files/patch-Lib_Makefile > Hmm... Looks like a unified diff to me... > The text leading up to this was: > -------------------------- > |--- Lib/Makefile.orig 2008-12-03 11:08:03.000000000 +0100 > |+++ Lib/Makefile 2010-05-16 16:33:40.000000000 +0200 > -------------------------- > Patching file Lib/Makefile using Plan A... > Hunk #1 succeeded at 2. > Hunk #2 succeeded at 22. > done > # patch < ../../files/medis-patch-Lib_Makefile.txt > Hmm... Looks like a unified diff to me... > The text leading up to this was: > -------------------------- > |--- Lib/Makefile.intermediate 2013-03-22 20:40:34.429173000 +0000 > |+++ Lib/Makefile > -------------------------- > Patching file Lib/Makefile using Plan A... > Hunk #1 succeeded at 22. > done > # > > and that applying the second patch directly does not > work: > > # cd ../.. > # make clean extract > ===> Cleaning for metis-edf-4.1.2_3 > ===> metis-edf-4.1.2_3 depends on file: /usr/local/sbin/pkg - found > ===> Fetching all distfiles required by metis-edf-4.1.2_3 for building > ===> Extracting for metis-edf-4.1.2_3 > => SHA256 Checksum OK for aster-full-src-10.8.0-3.noarch.tar.gz. > (cd /usr/ports/math/metis-edf/work && /usr/bin/tar -xf /usr/ports/math/metis-edf/work/aster-full-src-10.8.0/SRC/metis-edf-4.1-2.noarch.tar.gz --no-same-owner --no-same-permissions) > # cd work/metis-edf-4.1/ > # patch < ../../files/medis-patch-Lib_Makefile.txt > Hmm... Looks like a unified diff to me... > The text leading up to this was: > -------------------------- > |--- Lib/Makefile.intermediate 2013-03-22 20:40:34.429173000 +0000 > |+++ Lib/Makefile > -------------------------- > Patching file Lib/Makefile using Plan A... > Hunk #1 failed at 22. > 1 out of 1 hunks failed--saving rejects to Lib/Makefile.rej > done > # > > But how does the ports environment know the order > of patch application? > > Thanks > > Anton > > _______________________________________________ > freebsd-ports@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ports > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org" > The application of patches in a ports "files" directory is done with a for-loop of all files named patch-* (see /usr/ports/Mk/bsd.port.mk), so I imagine the file names would be sorted alphabetically by the wildcard. It is not required, but each patch file generally is meant to patch a specific source file, and the individual sections of a patch file are applied in the order that they appear. If your new patch just adds to the existing patch, you could just concatenate it to the end of the existing patch file, and the patch command will handle the ordering. Jimmy