workflow question: how do you maintain the port in sync with upstream?

Mathieu Arnold mat at FreeBSD.org
Tue Aug 14 14:27:21 UTC 2018


On Tue, Aug 14, 2018 at 11:20:59AM -0300, Helen Koike wrote:
> 
> 
> On 08/14/2018 12:05 AM, Adam Weinberger wrote:
> > On Mon, Aug 13, 2018 at 4:28 PM Helen Koike <helen.koike at collabora.com> wrote:
> >>
> >> Hello,
> >>
> >> I am new to the community, I am maintaining two packages and I would
> >> like to check with you if there is a better workflow to do this.
> >>
> >> The upstream project of the port I am maintaining is held in github, and
> >> I also have patches in the /usr/ports/sysutils/myport/file/ folder.
> >>
> >> So I keep a fork of the upstream project with a branch containing a
> >> commit with the patches from the /usr/ports/sysutils/myport/file/.
> >>
> >> Every time I need to update the port to a newer version, I do a git pull
> >> in this branch, then I run a script [1] to re-generate the patches in
> >> the /usr/ports/sysutils/myport/file/
> >>
> >> This script basically generates a file.orig of all modified files in
> >> git, then copy the modified file to WORK_DIR, then run make makepatch.
> >>
> >>
> >> for file in ${CHANGES}; do
> >>         mv ${WORK_DIR}/${file} ${WORK_DIR}/${file}.orig
> >>         cp ${PROJECT_PATH}/${file} ${WORK_DIR}/${file}
> >> done
> >> make makepatch
> >>
> >>
> >> I would like to know if there is a better way to do this (some tool that
> >> I am not aware of?).
> > 
> > IIUC, the process you're describing seems to be rebasing your changes
> > and then generating diffs. You might have an easier time if you just
> > do that: rebase, and then generate a diff (see the last point here)>
> > Your script automates some of the routine Makefile changes, and while
> > there are some tools in ports-mgmt/ that can automate that, we don't
> > generally recommend them.
> > 
> > It's common for Makefiles to have a maintainer-update: target that
> > keeps the repetitive update tasks in the Makefile (which also helps
> > the next person to maintain the port).
> 
> I didn't know about this target, I'll take a look. Thanks.
> 
> > 
> > Also, where many files are modified on a continually-changing basis,
> > it's acceptable (though less systemically desirable) to put all your
> > patches into one file. The benefit is that you can generate that one
> > file with a single git diff, and it makes PR submission far, far
> > simpler.
> 
> Is there a way to easily transform a git patch to the FreeBSD
> file/*.patch format? Because I use make makepatch, and it will generate
> several patches anyway.
> Once I used "diff -Nur", but it doesn't seem to be the same exact format
> as the one generated by make makepatch.

make makepatch generates cleaned-up patches.  So there is no single
command to generate them.

There may be other ways to do what you do.

You said you maintain your local "patch" on github, so instead of adding
the commits to PATCHDIR, you could use PATCH_SITES and PATCHFILES, to
see an example, you could have a look at audio/rubberband

You could also point the port to your fork with the local commits and
use that, it would alleviate the need of patches.

-- 
Mathieu Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20180814/0058f9f6/attachment.sig>


More information about the freebsd-ports mailing list