2014-07-12 13:01 GMT+02:00 Andrew Fresh <[email protected]>: > On Sat, Jul 12, 2014 at 10:51:49AM +0200, Vadim Zhukov wrote: >> Here is an improved version of portbump(1). I'm using it often now, >> and it has most bugs I was aware of fixed. > > > I guess fortunately I don't have that many ports yet to need this. > > It looks to be very nice and I would like it. I think ${PORTSDIR}/bin > seems like a good place for it to live, but I don't know how espie and > sthen feel about adding files there, so I will leave an OK to someone > else. > > I see some things that look very familiar. Your Makefile parsing seems > much more advanced than mine has needed to be. > > https://github.com/afresh1/openbsd-module-ports > > > I wouldn't mind if some of these things lived in external modules so I > could re-use them, but maybe I can just steal them someday. > > It's perl, so the only style I really care about is that the file is > internally consistent. I do have some comments tho. > > Why the @EXPORT? Without Exporter it doesn't actually do anything.
Probably a leftover from some copy-paste... > Perl usually uses $self, not $this, for the instance variable, $this > breaks my brain like it is trying to be be javascript or something. Okay, I'll tweak this. :) > All the subroutine prototypes are also a bit odd as most perl doesn't > use them. In 5.20 we're getting subroutine signatures, so that should > be amazing! Yep, already read about them. :) I use prototypes for quick checking of function calls, and I could zap them without problem. > Mixing `X == 0` and `!X` makes me think there is a reason they were done > differently, , but I don't know why. I prefer to use "X == 0" when checking "does this number equal to zero", without zero being a magic value, and "!X" in all other places. But I'll recheck for consistency - or, if you have a stronger opinion, unify all checks either way. > So nothing major. I am a fan of tooling to make porting easier. Good points, and thank you for input. I'll tweak the corresponding bits and send updated version soon. -- WBR, Vadim Zhukov
