workflow question: how do you maintain the port in sync with upstream?
Helen Koike
helen.koike at collabora.com
Sun Aug 19 05:07:57 UTC 2018
On 08/14/2018 11:41 AM, blubee blubeeme wrote:
> On Tue, Aug 14, 2018 at 8:56 PM Helen Koike <helen.koike at collabora.com>
> wrote:
>
>>
>>
>> On 08/13/2018 09:50 PM, blubee blubeeme wrote:
>>>
>>>
>>> On Tue, Aug 14, 2018, 08:26 Helen Koike <helen.koike at collabora.com
>>> <mailto:helen.koike at collabora.com>> wrote:
>>>
>>>
>>>
>>> On 08/13/2018 08:00 PM, blubee blubeeme wrote:
>>> >
>>> >
>>> > On Tue, Aug 14, 2018, 06:30 Helen Koike <helen.koike at collabora.com
>>> <mailto:helen.koike at collabora.com>
>>> > <mailto:helen.koike at collabora.com
>>> <mailto: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 one is fairly straight forward, you can simply replace that string
> with a regex command;
> This is an example of running a replace command for strings after the patch
> phase of the build;
>
> post-patch:
> @${REINPLACE_CMD} -e 's|for Linux|for FreeBSD|g' ${WRKSRC}/README
>
>
>
>>> >
>>> > 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
>>
> Depending on how drastic the changes are, you can use the above command to
> simply replace strings;
> There's also binary alias, that allows to replace sed with gsed:
> https://www.freebsd.org/doc/en/books/porters-handbook/binary-alias.html
>
> Speaking of which, FreeBSD has access to all the GNU tools such as;
> gmake [gnu make]
> gsed [gnu sed]
>
> if it's only a few commands you can use binary alias.
Interesting, but unfortunately (if I understand correctly) this is only
for build time no? but I need to replace sed by gsed in the final
script, not just in the build time.
Thanks
Helen
More information about the freebsd-ports
mailing list