From owner-freebsd-ports@freebsd.org Tue Sep 26 06:38:09 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 24454E00E2E; Tue, 26 Sep 2017 06:38:09 +0000 (UTC) (envelope-from russ.haley@gmail.com) Received: from mail-wr0-x22a.google.com (mail-wr0-x22a.google.com [IPv6:2a00:1450:400c:c0c::22a]) (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 ADBB07D475; Tue, 26 Sep 2017 06:38:08 +0000 (UTC) (envelope-from russ.haley@gmail.com) Received: by mail-wr0-x22a.google.com with SMTP id u96so11616655wrb.6; Mon, 25 Sep 2017 23:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GyBnq4Z31Velk6OwcU2Z97hCzQcDOq/cpGQbmnFZZPs=; b=hbFomyndY55w4ljg+k/YJ46LmC8iXEh5qB4qGTAbBPoQlEg27kjuvYYIWLUSfGYeBF 6JmSSCIQJAqPV7xsztEbd9z5SkCrbQnuWyCH7fuqYVdmbPcF/8FCN7ZS2WSMDFG3RA3C GcpdmK7msx+MIoNTqKNYmCkeqJabeYEmcrIXtwVYF31Til4g9+RfQZ/Yn34XBmyKyTI6 P8lt/6zPFGBZiPgGDYA4r2M9wzdLQRqwV8aPmSxGjydibdTLKxw3Hyd52CkZLdkZFqXT mbSsV80GTFHdnjCiUTBRTQfPk6Dat/ARhsmLHt04NKzwgXZKCRVzB+y97Qf5FXV8MBOr EZzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GyBnq4Z31Velk6OwcU2Z97hCzQcDOq/cpGQbmnFZZPs=; b=aUcuhMZtdEXdoS0tHi7krbl5hNy4l91/KYDmZqyqe+H6Kw1dBxKmCaaBVOBXoaOuGw b6WEwqmZ60QDeRW8o2MwKonzEzYc5KryNjtNWzRaXE7HD2KZuWJH+Ew97OB7WazBPoaO 58W5uKJN22DtkWizB/ZKCP4cxa29pQ80fOGy1DevsHsjlJTiwv+av2dvaSkImkEjObjI /XRjtKqTGTyi1EiIpGmMF+WU6TtlG3cEgTsDcFqlayodUdyqDEC0IfJE5/7v8W6YY2fS 73du5OGNA2N3qa7COd7vRCOfLgCMA4zgW/hqF8y0oEYevDbs/R9QKEvvr8TJYkDlzwcp QppQ== X-Gm-Message-State: AHPjjUhNssGPMGQAAH68Qknet8q8e0LD4WBb0Ffye2cGC9lpPhhTbivE K0SS26ZV8V3+xLi8hL6Rd80Ahp28FSoq1ovoL5QsKg== X-Google-Smtp-Source: AOwi7QANmnn8JckY59xP0Wu2X3IxctUugMTOJdhGS6bNxhe5ak2LXdEXDAS8mJfMQ7CsH7Bv1ZoWxaFnN7SKhe3Id/A= X-Received: by 10.46.64.142 with SMTP id r14mr3480280lje.192.1506407886956; Mon, 25 Sep 2017 23:38:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.81.65 with HTTP; Mon, 25 Sep 2017 23:38:06 -0700 (PDT) In-Reply-To: <7b2f2464-5c35-e24a-2047-838c1a9e96a3@FreeBSD.org> References: <8a3e663a-d94f-0ef7-bbc7-8ebaa111f6dd@FreeBSD.org> <7b2f2464-5c35-e24a-2047-838c1a9e96a3@FreeBSD.org> From: Russell Haley Date: Mon, 25 Sep 2017 23:38:06 -0700 Message-ID: Subject: Re: Porters Handbook section 4.4 To: koobs@freebsd.org Cc: freebsd-ports@freebsd.org, doc@freebsd.org Content-Type: text/plain; charset="UTF-8" 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:38:09 -0000 On Mon, Sep 25, 2017 at 11:21 PM, Kubilay Kocak wrote: > 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 Thanks! I'll play with this on the weekend. Russ