From owner-freebsd-ports@freebsd.org Tue Aug 14 14:27:21 2018 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A4B01079C76 for ; Tue, 14 Aug 2018 14:27:21 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1180571C42; Tue, 14 Aug 2018 14:27:21 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from ogg.in.absolight.net (ogg.in.absolight.net [IPv6:2a01:678:ab:50::42:42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: mat/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 8B798BD33; Tue, 14 Aug 2018 14:27:20 +0000 (UTC) (envelope-from mat@FreeBSD.org) Date: Tue, 14 Aug 2018 16:27:19 +0200 From: Mathieu Arnold To: Helen Koike Cc: freebsd-ports@freebsd.org Subject: Re: workflow question: how do you maintain the port in sync with upstream? Message-ID: <20180814142707.ueg3d5ygiumi6j2i@ogg.in.absolight.net> References: <05457c2b-b85c-a929-20e7-38ff1b2899d6@collabora.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="k65v7pzmgpypfzcv" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180622 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Aug 2018 14:27:21 -0000 --k65v7pzmgpypfzcv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 14, 2018 at 11:20:59AM -0300, Helen Koike wrote: >=20 >=20 > On 08/14/2018 12:05 AM, Adam Weinberger wrote: > > On Mon, Aug 13, 2018 at 4:28 PM Helen Koike = 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, a= nd > >> 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 pu= ll > >> 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 th= at > >> I am not aware of?). > >=20 > > 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. > >=20 > > 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). >=20 > I didn't know about this target, I'll take a look. Thanks. >=20 > >=20 > > 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. >=20 > 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. --=20 Mathieu Arnold --k65v7pzmgpypfzcv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAABCgB9FiEEOraXidLtEhBkQLpbOkUW81GDzkgFAlty5sdfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNB QjY5Nzg5RDJFRDEyMTA2NDQwQkE1QjNBNDUxNkYzNTE4M0NFNDgACgkQOkUW81GD zkibPQ/5AY5o5pA4jyV5x03FATenUH/PkA5tVp0WRemvBQ68rBSXVB6JLoA7qBUq HDB+4w2PNorPHXjL1zTAF0Bq7EO95FGsB4hxx82jbMS4CXvt47sZF4WxAHaci1mh cvs+YPWrd4FIfqCxvuXBSV/zgQD6FfyesYR/g0ZPSiv1dbFfTMdg6ZwMM/UtyTBS qRirfvIZXM/2WmNAxc68a7wmAOS5xE1DH2wEI7FfqSx99BzgRDox5YdZpXt9j6oU zKL7LGdsmnagZpdtZQ+pSSWrwPjiZJ53JGBgu9TSDgpCCRq737kBubvUT45WBwoB uKMP1F1AkGjNHe7aGEfA0+qdbz432/jQaJBVup9Jf7UbJ1aewdQk4d2UQ7d+knIe ExWucW8K8cDv/ljaqqkxL+l4fUOgPg4Wu2D0Yog/fghYt4IWGwOoLHMAosr23//l zJ5AXDqgLSwa2hHy/dj60Db3QU4YhOJU6+Cm2/qOcTeYlcHYZE8jGtecidEN7ygP 161eEwTAZr3vARNlLp0M3hHQ1fHvQQCGleBpEjv7noK2J3+FvrKnwmaeOROrupJ1 bODguRKPRwQA65NvOmv52h0xrWB2sPt3lATQSTE7iZHZebeRnxLLoNQPU0B+pC52 Kui3EgnO2NY0jYMSr/lEYtgma48ZU5C9m+xEN+jJ+q7G0w4IpKo= =Gp15 -----END PGP SIGNATURE----- --k65v7pzmgpypfzcv--