Porting patch(1) from NetBSD to FreeBSD (was Re: FreeBSD in Google Code-In 2012? You can help too!)

2012-10-27 Thread hiren panchasara
[removing the CC list]

On Wed, Oct 24, 2012 at 3:36 PM, Pedro Giffuni  wrote:

> (cc'ing -ports and cutting most of the rest)
>
> > From: Eitan Adler
> .>
> >On 24 October 2012 13:24, Fernando Apesteguía wrote:
> >> Also related to that, what about writing a section about redports[1]
> >> in the porter's handbook[2]?
> >
> >This is a good documentation task... but we need more *coding* tasks as
> well.
> >
>
> We do need to port and test patch (1) from NetBSD or DragonFly to replace
> GNU patch, and this shouldn't be difficult.
>

Hi Pedro / List,

I am not part of google summer of code but I've tried to port patch(1) from
NetBSD into FreeBSD head. I hope that is okay.

Patching was trivial and It _seems_ to be working fine.

I would appreciate any ideas around how to test the changes and how to
proceed further.

Thanks,
Hiren
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: Porting patch(1) from NetBSD to FreeBSD (was Re: FreeBSD in Google Code-In 2012? You can help too!)

2012-10-27 Thread Chris Rees
On 27 October 2012 22:17, hiren panchasara  wrote:
> [removing the CC list]
>
> On Wed, Oct 24, 2012 at 3:36 PM, Pedro Giffuni  wrote:
>
>> (cc'ing -ports and cutting most of the rest)
>>
>> > From: Eitan Adler
>> .>
>> >On 24 October 2012 13:24, Fernando Apesteguía wrote:
>> >> Also related to that, what about writing a section about redports[1]
>> >> in the porter's handbook[2]?
>> >
>> >This is a good documentation task... but we need more *coding* tasks as
>> well.
>> >
>>
>> We do need to port and test patch (1) from NetBSD or DragonFly to replace
>> GNU patch, and this shouldn't be difficult.
>>
>
> Hi Pedro / List,
>
> I am not part of google summer of code but I've tried to port patch(1) from
> NetBSD into FreeBSD head. I hope that is okay.
>
> Patching was trivial and It _seems_ to be working fine.
>
> I would appreciate any ideas around how to test the changes and how to
> proceed further.

Have you a patch :)?  You're right, there shouldn't have been many
changes needed.

Chris
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: Porting patch(1) from NetBSD to FreeBSD (was Re: FreeBSD in Google Code-In 2012? You can help too!)

2012-10-27 Thread hiren panchasara
+ Sean, who has been helping me.

On Sat, Oct 27, 2012 at 2:31 PM, Chris Rees  wrote:

> On 27 October 2012 22:17, hiren panchasara 
> wrote:
> > [removing the CC list]
> >
> > On Wed, Oct 24, 2012 at 3:36 PM, Pedro Giffuni  wrote:
> >
> >> (cc'ing -ports and cutting most of the rest)
> >>
> >> > From: Eitan Adler
> >> .>
> >> >On 24 October 2012 13:24, Fernando Apesteguía wrote:
> >> >> Also related to that, what about writing a section about redports[1]
> >> >> in the porter's handbook[2]?
> >> >
> >> >This is a good documentation task... but we need more *coding* tasks as
> >> well.
> >> >
> >>
> >> We do need to port and test patch (1) from NetBSD or DragonFly to
> replace
> >> GNU patch, and this shouldn't be difficult.
> >>
> >
> > Hi Pedro / List,
> >
> > I am not part of google summer of code but I've tried to port patch(1)
> from
> > NetBSD into FreeBSD head. I hope that is okay.
> >
> > Patching was trivial and It _seems_ to be working fine.
> >
> > I would appreciate any ideas around how to test the changes and how to
> > proceed further.
>
> Have you a patch :)?  You're right, there shouldn't have been many
> changes needed.
>

Will prepare a patch and post here as soon as I get a chance :-)

Thanks,
Hiren
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: Porting patch(1) from NetBSD to FreeBSD (was Re: FreeBSD in Google Code-In 2012? You can help too!)

2012-10-27 Thread Pedro Giffuni

Hello Hiren;


On 10/27/2012 16:48, hiren panchasara wrote:

+ Sean, who has been helping me.

On Sat, Oct 27, 2012 at 2:31 PM, Chris Rees > wrote:


On 27 October 2012 22:17, hiren panchasara
mailto:hiren.panchas...@gmail.com>>
wrote:
> [removing the CC list]
>
> On Wed, Oct 24, 2012 at 3:36 PM, Pedro Giffuni mailto:p...@freebsd.org>> wrote:
>
>> (cc'ing -ports and cutting most of the rest)
>>
>> > From: Eitan Adler
>> .>
>> >On 24 October 2012 13:24, Fernando Apesteguía wrote:
>> >> Also related to that, what about writing a section about
redports[1]
>> >> in the porter's handbook[2]?
>> >
>> >This is a good documentation task... but we need more *coding*
tasks as
>> well.
>> >
>>
>> We do need to port and test patch (1) from NetBSD or DragonFly
to replace
>> GNU patch, and this shouldn't be difficult.
>>
>
> Hi Pedro / List,
>
> I am not part of google summer of code but I've tried to port
patch(1) from
> NetBSD into FreeBSD head. I hope that is okay.
>
> Patching was trivial and It _seems_ to be working fine.
>
> I would appreciate any ideas around how to test the changes and
how to
> proceed further.

Have you a patch :)?  You're right, there shouldn't have been many
changes needed.


Will prepare a patch and post here as soon as I get a chance :-)



This is great news Hiren, Thanks!


The stress test for this utility is the ports tree but before that we 
have to

know what will change.

What needs to be done is:

1- Compare the options between our old patch and the new BSD patch.
2- Document this in FreeBSD's wiki.
3- Prepare a port for testing.

Unfortunately I will be very busy for more than a month and I can't
help much but I am sure some other committer will love to follow
on this.

Thanks for taking the initiative, that's what FreeBSD needs!

Pedro.

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: Porting patch(1) from NetBSD to FreeBSD (was Re: FreeBSD in Google Code-In 2012? You can help too!)

2012-10-27 Thread hiren panchasara
On Sat, Oct 27, 2012 at 3:35 PM, Pedro Giffuni  wrote:

>  Hello Hiren;
>
>
>
> On 10/27/2012 16:48, hiren panchasara wrote:
>
> + Sean, who has been helping me.
>
> On Sat, Oct 27, 2012 at 2:31 PM, Chris Rees  wrote:
>
>>  On 27 October 2012 22:17, hiren panchasara 
>> wrote:
>> > [removing the CC list]
>> >
>> > On Wed, Oct 24, 2012 at 3:36 PM, Pedro Giffuni  wrote:
>> >
>> >> (cc'ing -ports and cutting most of the rest)
>> >>
>> >> > From: Eitan Adler
>> >> .>
>> >> >On 24 October 2012 13:24, Fernando Apesteguía wrote:
>> >> >> Also related to that, what about writing a section about redports[1]
>> >> >> in the porter's handbook[2]?
>> >> >
>> >> >This is a good documentation task... but we need more *coding* tasks
>> as
>> >> well.
>> >> >
>> >>
>> >> We do need to port and test patch (1) from NetBSD or DragonFly to
>> replace
>> >> GNU patch, and this shouldn't be difficult.
>> >>
>> >
>> > Hi Pedro / List,
>> >
>> > I am not part of google summer of code but I've tried to port patch(1)
>> from
>> > NetBSD into FreeBSD head. I hope that is okay.
>> >
>> > Patching was trivial and It _seems_ to be working fine.
>> >
>> > I would appreciate any ideas around how to test the changes and how to
>> > proceed further.
>>
>>  Have you a patch :)?  You're right, there shouldn't have been many
>> changes needed.
>>
>
> Will prepare a patch and post here as soon as I get a chance :-)
>
>
> This is great news Hiren, Thanks!
>
>
> The stress test for this utility is the ports tree but before that we have
> to
> know what will change.
>
Thanks Pedro!
I will have  a lot of questions as I am a newbie here. :-)

>
> What needs to be done is:
>
> 1- Compare the options between our old patch and the new BSD patch.
>
Will do.

> 2- Document this in FreeBSD's wiki.
>
I think this needs to be done when we are done deciding on diffs and how
the changes look, right?
Also, I do not think I have write access to the wiki.

> 3- Prepare a port for testing.
>
Does this need to be a port? I thought this would live in
/src/usr.bin/patch.
Also, I believe this will co-exist with current gnu patch(1). Is that a
right assumption?

Thank you,
Hiren

>
> Unfortunately I will be very busy for more than a month and I can't
> help much but I am sure some other committer will love to follow
> on this.
>
> Thanks for taking the initiative, that's what FreeBSD needs!
>
> Pedro.
>
>
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: Porting patch(1) from NetBSD to FreeBSD (was Re: FreeBSD in Google Code-In 2012? You can help too!)

2012-10-27 Thread Pedro Giffuni

Hi;

On 10/27/2012 22:08, hiren panchasara wrote:



On Sat, Oct 27, 2012 at 3:35 PM, Pedro Giffuni > wrote:


Hello Hiren;



On 10/27/2012 16:48, hiren panchasara wrote:



...



This is great news Hiren, Thanks!


The stress test for this utility is the ports tree but before that
we have to
know what will change.

Thanks Pedro!
I will have  a lot of questions as I am a newbie here. :-)


What needs to be done is:

1- Compare the options between our old patch and the new BSD patch.

Will do.

2- Document this in FreeBSD's wiki.

I think this needs to be done when we are done deciding on diffs and 
how the changes look, right?

Also, I do not think I have write access to the wiki.


Well, I am hoping that we don't have to do any hacking on patch to be
acceptable but having a table like this would be nice:
http://wiki.freebsd.org/SOC2010BenFiedler

This is mandatory though, just planning ahead.




3- Prepare a port for testing.

Does this need to be a port? I thought this would live in 
/src/usr.bin/patch.
Also, I believe this will co-exist with current gnu patch(1). Is that 
a right assumption?




We like to be safe and having it in the ports tree makes it easier to
test it on all FreeBSD versions and platforms before it finds it's way
into the base system. I know this sounds like a long tedious process
but we have a reputation to take care of ;).

Creating a new port of this is really easy though; you can probably start
with the bsd sort port as a template and check porter's handbook
if there is any doubt.

Let us know if you need to a place to put of the tarball.


Pedro.


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: Porting patch(1) from NetBSD to FreeBSD (was Re: FreeBSD in Google Code-In 2012? You can help too!)

2012-10-27 Thread Xin Li
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi,

On 10/27/12 2:17 PM, hiren panchasara wrote:
> [removing the CC list]
> 
> On Wed, Oct 24, 2012 at 3:36 PM, Pedro Giffuni 
> wrote:
> 
>> (cc'ing -ports and cutting most of the rest)
>> 
>>> From: Eitan Adler
>> .>
>>> On 24 October 2012 13:24, Fernando Apesteguía wrote:
 Also related to that, what about writing a section about
 redports[1] in the porter's handbook[2]?
>>> 
>>> This is a good documentation task... but we need more *coding*
>>> tasks as
>> well.
>>> 
>> 
>> We do need to port and test patch (1) from NetBSD or DragonFly to
>> replace GNU patch, and this shouldn't be difficult.
>> 
> 
> Hi Pedro / List,
> 
> I am not part of google summer of code but I've tried to port
> patch(1) from NetBSD into FreeBSD head. I hope that is okay.
> 
> Patching was trivial and It _seems_ to be working fine.
> 
> I would appreciate any ideas around how to test the changes and how
> to proceed further.

I've a version of OpenBSD patch(1) at:

http://svnweb.freebsd.org/base/user/delphij/patch/

But I don't have much time to work on it lately, so I wouldn't mind if
someone more energized to take over the lead :)

Note that if this is intended to replace the current FreeBSD half-GNU
patch(1), please make sure that the features are all in your version
before proceeding.

Cheers,
-BEGIN PGP SIGNATURE-

iQEcBAEBCAAGBQJQjLx4AAoJEG80Jeu8UPuzfsgIAKRpxxX2+KYHeHNCiFOVOyd4
V39XPaVocxHajjtGagWTZ4VfFWKhWMwz2vl94wjApkBpDGpE6Vt6/17g8xyAZJ4a
krNF+TobXR2LFjUffDgKBNwouwqxnaPk1fm3M0+HJJPCc+O79Im5pEZfOf3J1atV
k4Z2qliYjphPXUFjq/6+vUWPt2N35OyxQAtDJrRWGD6j8sKE/uzmGF4jIKibY0Sx
Z5wx3q06xdXpvHFFqKU7AZvTu0Jz22S2MEMTV+0OJdOAka8BDWsM9UwIlSdD90VT
VgWjv3M0+eZLa7vxhXEzEw/uLfeDsBmuT7zq6CUHFRaMvVGLN99yZu97tpwvy6E=
=sHUs
-END PGP SIGNATURE-
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: Porting patch(1) from NetBSD to FreeBSD (was Re: FreeBSD in Google Code-In 2012? You can help too!)

2012-10-28 Thread Gabor Kovesdan
Em 27-10-2012 23:17, hiren panchasara escreveu:
> Hi Pedro / List,
> 
> I am not part of google summer of code but I've tried to port patch(1) from
> NetBSD into FreeBSD head. I hope that is okay.
> 
> Patching was trivial and It _seems_ to be working fine.
> 
> I would appreciate any ideas around how to test the changes and how to
> proceed further.

Hi Hiren,

good to hear that someone is working on this! However, porting these
utilies is much tougher than it apparently seems. There are much more
criteria than just it compiles and works. More specifically, you should
make sure that:

- It is feature-complete and has at least the features that are present
in the current patch.

- Features are actually compatible and do the same. The same set of
command-line options have to produce identical output.

- Performance is not behind the current implementation.

- It works fine with multi-byte locales.

- As mentioned by someone else, it should be available as a port for
testers. And once the above points seem to be ok, you should ask the
portmgr team to do a package build with it. It may reveal some problems
that you couldn't produce earlier.

- And as seen in BSD grep, all of this above may not be enough, there
may still be some undiscovered bugs. :) So it should co-exist with the
current patch for some time, first as a secondary one and then as the
default and only then should the current patch be removed.

BSD sort has gone through all of this but BSD grep is still not
completed. These utilities are apparently simple but because of their
importance, they need to be near to flawless so this makes it a good
challenge. I hope you will enjoy hacking and hope you can make some
progress in this!

Gabor
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: Porting patch(1) from NetBSD to FreeBSD (was Re: FreeBSD in Google Code-In 2012? You can help too!)

2012-10-28 Thread Adrian Chadd
On 28 October 2012 03:55, Gabor Kovesdan  wrote:

> Hi Hiren,
>
> good to hear that someone is working on this! However, porting these
> utilies is much tougher than it apparently seems. There are much more
> criteria than just it compiles and works. More specifically, you should
> make sure that:

[snip]

* It's totally bug compatible for now with gnu patch/diff.
* You write a _lot_ of test cases for the test framework, so people
can do automated regression testing on both performance and behaviour.

It'd be nice to have more regression testing. :-)



Adrian
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: Porting patch(1) from NetBSD to FreeBSD (was Re: FreeBSD in Google Code-In 2012? You can help too!)

2012-10-28 Thread Garrett Cooper
On Sun, Oct 28, 2012 at 9:07 AM, Adrian Chadd  wrote:
> On 28 October 2012 03:55, Gabor Kovesdan  wrote:
>
>> Hi Hiren,
>>
>> good to hear that someone is working on this! However, porting these
>> utilies is much tougher than it apparently seems. There are much more
>> criteria than just it compiles and works. More specifically, you should
>> make sure that:
>
> [snip]
>
> * It's totally bug compatible for now with gnu patch/diff.
> * You write a _lot_ of test cases for the test framework, so people
> can do automated regression testing on both performance and behaviour.
>
> It'd be nice to have more regression testing. :-)

If you're looking for bug compatibility with GNU patch, I would start
with the tests produced by upstream [1] as a base for determining how
compatible BSD patch really is. Similar steps could and should have
been done for BSD grep [2] (unfortunately GNU sort doesn't have any
tests, but if we develop the guts (inputs and expected output) of some
tests and commit them back to GNU, I'm sure they would appreciate it).

Thanks,
-Garrett

1. http://git.savannah.gnu.org/cgit/patch.git/tree/tests
2. http://git.savannah.gnu.org/cgit/grep.git/tree/tests
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: Porting patch(1) from NetBSD to FreeBSD (was Re: FreeBSD in Google Code-In 2012? You can help too!)

2012-10-29 Thread hiren panchasara
Thank you all for the inputs.
I understand this is a long grueling process so I will attempt to do things
in approximately following order:

1) prepare a new port for bsd patch
2) make sure new bsd patch has all options of existing gnu patch
3) merge outstanding patches:
http://svnweb.freebsd.org/base/head/gnu/usr.bin/patch/?view=log
4) bug compatibility
5) performance

cheers,
Hiren
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: Porting patch(1) from NetBSD to FreeBSD (was Re: FreeBSD in Google Code-In 2012? You can help too!)

2012-11-13 Thread Ulrich Spörlein
On Mon, 2012-10-29 at 23:13:00 -0700, hiren panchasara wrote:
> Thank you all for the inputs.
> I understand this is a long grueling process so I will attempt to do things
> in approximately following order:
> 
> 1) prepare a new port for bsd patch
> 2) make sure new bsd patch has all options of existing gnu patch
> 3) merge outstanding patches:
> http://svnweb.freebsd.org/base/head/gnu/usr.bin/patch/?view=log
> 4) bug compatibility
> 5) performance

For 2) and 4) (maybe also 5?) you really should look into ATF and come
up with some test cases for each option, someone else also mentioned
unit tests that GNU patch ships with?

We really would like to see *BSD patch in the base, but it should come
with unit tests; it is 2012, after all :)

Thanks!
Uli
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"