Porting Practice

Brandon helsley brandon.helsley at hotmail.com
Sun Jul 5 14:42:35 UTC 2020


For making changes to a port, I find ’svn diff’ to be the easiest way by far. I tend to do this:
1. svn up my work-in-progress ports tree
2. Make the changes and run tests (portlint, poudriere testport etc)
3. cd /ports; svn diff thecategory/theport > /portpatches/thecategory_theport_version.diff (change the paths to the dirs of your choice)
4. Upload the .diff file to Bugzilla

Since I use svn in step 1, svn takes care of tracking the changes so I don’t need to keep .orig files and run diff by hand.

The diffing that Jonathan mentioned is more applicable if you have to make changes to the upstream code itself in order for it to work on FreeBSD. I personally do that in the port’s ‘work’ dir and create the patches with ‘make makepatch’, and there I need to create .orig files (cp file.c file.c.orig before making changes).


Could you please go into more detail about what you mean in step one and three, I am getting really close to figuring out how this works. In step three I don't understand "cd /ports" or "portpatches/thecategory_theport_version.diff"
________________________________________
From: owner-freebsd-ports at freebsd.org [owner-freebsd-ports at freebsd.org] on behalf of Vidar Karlsen [vidar at karlsen.tech]
Sent: Sunday, July 5, 2020 2:18 AM
To: Brandon helsley
Cc: freebsd-ports
Subject: Re: Porting Practice

> On 5 Jul 2020, at 02:46, Brandon helsley <brandon.helsley at hotmail.com> wrote:

[…]

> The documentation for (diff -u) says "To create a suitable diff for a single patch, copy the file that needs patching to something.orig, save the changes to something and then create the patch:"
> % diff -u something.orig something > something.diff
>
> Im not sure really the meaning of this documentation. What file needs patching, which file to copy, where to save changes to exactly, and how and why the svn method is different. Which method should I choose? I know it says that unified diff and svn are preffered but since I am new maybe the (diff -u) command would be easier to begin with? Please help and include anything that's relevant even if i didn't mention it. I'm really excited to get started and will absorb like a sponge any know how that's offered!!!

For making changes to a port, I find ’svn diff’ to be the easiest way by far. I tend to do this:
1. svn up my work-in-progress ports tree
2. Make the changes and run tests (portlint, poudriere testport etc)
3. cd /ports; svn diff thecategory/theport > /portpatches/thecategory_theport_version.diff (change the paths to the dirs of your choice)
4. Upload the .diff file to Bugzilla

Since I use svn in step 1, svn takes care of tracking the changes so I don’t need to keep .orig files and run diff by hand.

The diffing that Jonathan mentioned is more applicable if you have to make changes to the upstream code itself in order for it to work on FreeBSD. I personally do that in the port’s ‘work’ dir and create the patches with ‘make makepatch’, and there I need to create .orig files (cp file.c file.c.orig before making changes).


Hope this helps,
Vidar Karlsen
_______________________________________________
freebsd-ports at freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscribe at freebsd.org"


More information about the freebsd-ports mailing list