From owner-freebsd-ports@freebsd.org Tue Aug 14 03:06:10 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 9A75B10677DE for ; Tue, 14 Aug 2018 03:06:10 +0000 (UTC) (envelope-from adamw@adamw.org) Received: from mail-yw1-xc2e.google.com (mail-yw1-xc2e.google.com [IPv6:2607:f8b0:4864:20::c2e]) (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 1BFD17B1F0 for ; Tue, 14 Aug 2018 03:06:09 +0000 (UTC) (envelope-from adamw@adamw.org) Received: by mail-yw1-xc2e.google.com with SMTP id q129-v6so15200015ywg.8 for ; Mon, 13 Aug 2018 20:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adamw-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LCnzJtVxxexB2MkZ51FHJxAUe1CjFd4GSZ/brTEcqyM=; b=cY9DqG4qOh835CZe6COkRZDw/5trSJi78Hz6Mb3EV8y47LHs83JecIjbknpkXCQMtE UICB8zHi/2GiLJk/Nb4Elgu0h3eJ9T1K6boWgOg6w2I3ElzhO/TBSaXA9oD35RqUnS5d QqVrVttoCBeza2JSLrPAL1ENlTWk3KupfK0taQ2VEMq0ntLiQDccRJPFw5/sI8vEhRtX 4BwQBklfLWE/ke32D0n3FGEb5EfBYCnA+XhhnIwvLhCrGfKHwojcbNdb9yEVrLOqTrWG T9pJeoTYNELOLnL5CPfQ37FM18njisGJadjoYreVqnlAg8dqY37HF822MDgswhB2W+YS j+Fg== 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=LCnzJtVxxexB2MkZ51FHJxAUe1CjFd4GSZ/brTEcqyM=; b=XLnqhSkWghhSJdNC0Msokp6M8X0KtYVztJloHS0MqT/bodG2EcB/VJVaOpb1p+cVA6 tcgaaX0FJwG4jHA6AZYStFG45fptKDLnSesdiXhvbvEKfJJpo/T6FHr1Rb/S7p1/LlXd FmuwAsVLN/9U3Sqw4v8XN4XU3WNk4i4ASxsnlRFcMVJuC/382/gKWVJ8zG2TQmhGIh0q HL7JgGgebMDoHD4sDMmxzENTMrDfNpA4NNbUpgV/x6TRQT08xQsw36qAjlRfbcoRwQYm QVjwrJbjWaSDnWf1nQ0/bIUC5pVL0/sLWAz0mu13QdvsRmgjkG0gryQUX6DFiNFw3OXC q0rA== X-Gm-Message-State: AOUpUlGbDgwlQMcBKFV8QbU90msjAJs3q6kxno8iML6fymeC1/2emTos jPP345Qnuuum11aUuFA8E7bEu7FnajHtBRAX3MHgQg== X-Google-Smtp-Source: AA+uWPwbVNXcOVJ/QkArhj/40HseMoD4/nWSOeJOlWKobwAt2wS4TJs/TYro4X6eMDxV4CMfEA5NR3lkp2wlIRg68ys= X-Received: by 2002:a25:ab8f:: with SMTP id v15-v6mr10447149ybi.408.1534215969090; Mon, 13 Aug 2018 20:06:09 -0700 (PDT) MIME-Version: 1.0 References: <05457c2b-b85c-a929-20e7-38ff1b2899d6@collabora.com> In-Reply-To: <05457c2b-b85c-a929-20e7-38ff1b2899d6@collabora.com> From: Adam Weinberger Date: Mon, 13 Aug 2018 21:05:53 -0600 Message-ID: Subject: Re: workflow question: how do you maintain the port in sync with upstream? To: helen.koike@collabora.com Cc: freebsd-ports@freebsd.org Content-Type: text/plain; charset="UTF-8" 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 03:06:10 -0000 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). 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. Do any of those help? # Adam -- Adam Weinberger adamw@adamw.org https://www.adamw.org