From owner-freebsd-ports@freebsd.org Tue Aug 14 14:45:56 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 450B4107A2F8 for ; Tue, 14 Aug 2018 14:45:56 +0000 (UTC) (envelope-from gurenchan@gmail.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB36272832 for ; Tue, 14 Aug 2018 14:45:55 +0000 (UTC) (envelope-from gurenchan@gmail.com) Received: by mail-io0-x243.google.com with SMTP id w11-v6so18464523iob.2 for ; Tue, 14 Aug 2018 07:45:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=B+QI9xAHAStSMajNVbaWHTOfdTxi9Fqjq0XuIXXxon4=; b=Wj851yR8L6VLqeSE+iuiVrfqLEypeDk+wW6RwzRDU4Qt180DVuJQbqynV878UcUKGH JPVroqK/oY/sWzb42sa/JhgplQc0vAh1wsv+XrJ0XDbB5VQKPpqBWFmuTBpN51tU8T14 WljJ+hrsfqF3Wp1qZIv68hcXtNmHr0PrGVRVBrjknwEaPWNRKJiKjUG9hb0cd9qgSDN1 o/fCDkTc2WSq1kTM+PgI0r3F7SC/lLsl2jhWbnFVdg4X5whK6sEBDW/NZyYLOjdtUecR /+pU0cVVAfJXZhLYTMThpEe132pt+XgEo5zXu5jqdgpEB9z7l0rV4XHT8dlBVKWDYRQi aOCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=B+QI9xAHAStSMajNVbaWHTOfdTxi9Fqjq0XuIXXxon4=; b=McCtBfMJWguNLTrYfsqbOCc7nELwoYR7CTl7dAQk6BmIfPJSzR+6jOtwsK5uZKAakR lBVKHe12P5E9I86/rmAilGlFmH1uQlDeD5Wto7fW8NJ8GQ/tSgLHqunNX+cD0QFZm0bi lApV6WVowfKWyac3jmkMFd7WmBzZSkz/WJnIAOjZ2QyT2BRE33jECbALIqHYb3imCgdk NeOpSFoTZKN8khPaf7G8tYZ0oP28H7gdYda+esQcg/YyowLEcXvzTyF5/kN9ySnug+Bh QcjfW/4n29/zowk9OSx+u08zmb1Es869w80YqCtKo+uAQ0BBwNeCj73cfwoHSs4YwSXH esNw== X-Gm-Message-State: AOUpUlFzOROHbKHipdjDxAsmKKrVDJTJGRr2IK8slF2a4R2w3lvrO1/X m0gwpKx2tHG1FAPrRaJfzeguc5BkE6jTMUNRbak= X-Google-Smtp-Source: AA+uWPx5tLT21SYB8mvEPNG+9Hy2ocVmPwp97J2TlT9HPSfPs+aT8bCYV0qXdmmBCsTV7XhY58PdrslJMH7PMCTpr0o= X-Received: by 2002:a6b:2c82:: with SMTP id s124-v6mr17923834ios.136.1534257955332; Tue, 14 Aug 2018 07:45:55 -0700 (PDT) MIME-Version: 1.0 References: <05457c2b-b85c-a929-20e7-38ff1b2899d6@collabora.com> In-Reply-To: From: blubee blubeeme Date: Tue, 14 Aug 2018 22:45:44 +0800 Message-ID: Subject: Re: workflow question: how do you maintain the port in sync with upstream? To: Helen Koike Cc: Adam Weinberger , FreeBSD Ports Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 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:45:56 -0000 On Tue, Aug 14, 2018 at 10:23 PM Helen Koike wrote: > > > 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, 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. > FreeBSD patching explained a bit here: https://www.freebsd.org/doc/en/books/porters-handbook/slow-patch.html I am not too sure on the particulars of git diffs but FreeBSD uses a unified diff; The part that will cause your makefile to fail is if the filepath at the top of each patch file is incorrect. section 4.4.2. Manual Patch Generation in the above link gives a good overview of how to manually generate patch files. I am pretty sure there has to be tools that can automate transforming whatever style patch git uses to a unified patch file. > > > > > Do any of those help? > > > > # Adam > > > > > > Thanks > Helen > _______________________________________________ > freebsd-ports@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-ports > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org" > Best, Owen