From owner-freebsd-ports@freebsd.org Tue Sep 26 06:27:36 2017 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3EA9E0090A; Tue, 26 Sep 2017 06:27:36 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A58147CF02; Tue, 26 Sep 2017 06:27:36 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-it0-x22c.google.com with SMTP id o200so1718272itg.0; Mon, 25 Sep 2017 23:27:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2Wc8FxTUv8HRLveD5qvC8QgPSZbILRcag32zkjcidU0=; b=oglxxViupsktqXLoVD13iS0qRccpURx/bF9fNpII5MU9cYsR3DXjbLh8rKEH+y56jH tz9FYHOrNT1uRVy+rkNNKsEKNuprnoSkMJ7VorpqeoMC1yJEnsgZZGABmGVpuBbQRSZz eOHg3iNl7/h/xupEOQhR4m42t9TtvVVckai0wdy4Hn0Dv+EGHVpxxj1BxOf3nJsBToLW nldgtGYzzpwKvTgYkOGlPHepFGN2acEWcLbg3UJ/eknj4+MCXZ0/oxWPn3nmsOB05lhy Z6gwe40A95SYxM1eFrf4rt0J0VKF06ZHSN0FAJ63FVdlJiKnAg2pBqwqT+GGJ7B1Mut7 2bNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=2Wc8FxTUv8HRLveD5qvC8QgPSZbILRcag32zkjcidU0=; b=FOeLPa7I7Q993eMF3Y0uA8Blw7VSssd8LN/RsYLY0yvjwiLDI80z63ZWQhlupXApKH Gi0eOgQXgh+wP7OwGTfAW1NeU9KAH+2WyeeXY9K/rqi1xQyKHpL2xMqvU354YkoXbqUo C6oc2HHF00sKppEAcgt2jRJ/AbkrGBPyATBUGqTPGBRnT0k1w2LurFSQ7zu/a+vwNJKA AjBkDeuapAVvF7yW/8oU4MvECqkCoDMuWCvwQV443rIPQ1T/MKF8K8Wlb47MRQeLuGMf ohGJWm5csnKywsTr7apG0cmlND6dgAVAPlCR53+be/G25CVBN6Jat0C6DdEp0r/+rUq3 Gf3w== X-Gm-Message-State: AHPjjUg5LcM+ouhad3blW388YThjz7XqIIhM+MelmOEvgcb0N3sHLgZ8 a21us6q4OH3GrEGiBZCypD56pYRH X-Google-Smtp-Source: AOwi7QA0bj2wRA3Xlx+GZAVJ6CrrBsIaeUYKPUurKr+Rb1bMR1vLx/ivbLRDz7g1yvDydtzlj0rwUw== X-Received: by 10.36.105.142 with SMTP id e136mr4268517itc.17.1506407255614; Mon, 25 Sep 2017 23:27:35 -0700 (PDT) Received: from ?IPv6:2001:44b8:31ae:7b01:9442:79f1:c7c:81a3? (2001-44b8-31ae-7b01-9442-79f1-0c7c-81a3.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:9442:79f1:c7c:81a3]) by smtp.gmail.com with ESMTPSA id 191sm660097ita.36.2017.09.25.23.27.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Sep 2017 23:27:35 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: Porters Handbook section 4.4 To: Russell Haley Cc: freebsd-ports@freebsd.org, doc@freebsd.org References: <8a3e663a-d94f-0ef7-bbc7-8ebaa111f6dd@FreeBSD.org> From: Kubilay Kocak Message-ID: <7b2f2464-5c35-e24a-2047-838c1a9e96a3@FreeBSD.org> Date: Tue, 26 Sep 2017 16:21:16 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Thunderbird/54.0a2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-AU Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Sep 2017 06:27:37 -0000 On 9/26/17 2:53 PM, Russell Haley wrote: > On Sun, Sep 24, 2017 at 10:02 PM, Kubilay Kocak wrote: >> On 9/25/17 2:08 PM, Russell Haley wrote: >>> Hi, >>> >>> Section 4.3 of the porters handbook talks about making modifications >>> to a private copy of a tarball and recording the steps. >>> >>> Section 4.4 talks about changing directories into the affected ports >>> dir and running make makepatch to generate patch files. >>> >>> I am unsure how the makepatch target is supposed to find my private >>> directory. Since I was confused, I created patches, added them to the >>> port, ran make, then ran make makepatch and the system re-generated >>> new "makepatch" patches. >> >> Quite a number of new users have raised the same question on IRC. >> >>> So, my question is thus: >>> >>> To me, section 4.4 seems vague about where changes should be made, >>> which is compounded by the information in section 4.3. Can the >>> makepatch target ask for and find a private directory, or should the >>> handbook be clarified to state that the changes should be made to the >>> 'work' folder? If the later is true, I assume there is some proper >>> workflow to keep changes from being destroyed while testing? >> >> The handbook section needs to be updated to be less ambiguous with >> regard to where things should be done. >> >> I'd be happy to provide a docs committer with verbiage if they can help >> with formatting/commit. > Hi, > > If you provide the verbiage, I'll attempt a patch. :) > > Russ > >>> If there is a section in the handbook clarifying this, please just say >>> so and I will go find it. >>> >>> Thanks! >>> Russ >> >> ./koobs In section: 4.4. Patching - Add new section (at/numbered 4.4.2) - Name: Automatic Patch Generation - Renumber sections (4.4.2 -> 4.4.3) Text: The ports framework provides a {{{makepatch}} target, which when run, automatically creates correctly named and formatted patch files in the correct location. The general process is as follows: % cd % make patch Note: In the general case, {{{make patch}} is used (not just {{{make extract}}} to extract the DISTFILES), because ports that contain existing patches need to have the patches applied so that they are also generated (regenerated) in the last step. ``` % cd work/ (WRKSRC) ``` At this point, make the source changes in WRKSRC: ``` % cp .orig % edit ``` Repeat the above steps for each file at any location within WRKSRC that needs a patch file created. Go back to the main port directory: ``` % cd ``` Finally, run the {{{makepatch}}} target ``` % make makepatch ``` The makepatch target recursively searches WRKSRC for /.orig pairs within WRKSRC, and creates a patch file in PATCHDIR from each pair (using diff). NOTE: Any pre-existing patches in PATCHDIR that are *not* regenerated during the above process are placed in a backup location in WRKDIR. This backup location is deleted on {{{make clean}}}. This may occur when not using {{{make patch}}} to extract the sources, because existing patches are or were not applied, or if there are existing patch files that make edits to multiple files in a single patch file, which will now be in separate patch files after makepatch regeneration. Inspect and review the patch files in PATCHDIR to ensure they have been created as expected. == Other == - Patch files are stored in PATCHDIR, usually files/, from where they will be automatically applied + Patch files are stored in PATCHDIR, by default `files/` in the port directory, which are automatically applied in the 'patch' stage