Page MenuHomeFreeBSD

Fix bump-revision.sh
ClosedPublic

Authored by garga on Jan 18 2016, 5:24 PM.
Tags
None
Referenced Files
F109150839: D4984.diff
Sat, Feb 1, 11:43 AM
Unknown Object (File)
Dec 7 2024, 5:41 PM
Unknown Object (File)
Nov 24 2024, 12:09 AM
Unknown Object (File)
Nov 23 2024, 3:29 PM
Unknown Object (File)
Nov 19 2024, 3:02 PM
Unknown Object (File)
Nov 11 2024, 10:22 AM
Unknown Object (File)
Nov 9 2024, 11:33 AM
Unknown Object (File)
Oct 16 2024, 10:22 PM
Subscribers
None

Details

Summary

bump-revision.sh is broken when PORTREVISION line doesn't exist in Makefile

While here make some improvements:

  • Add ex: line to adjust vi/vim indent settings
  • Use make -V PORTREVISION to obtain current value
  • Use grep -c to check if Makefile has multiple definitions of PORTREVISION
  • Add shift/continue when error happens to avoid too many levels of indent

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 2175
Build 2184: arc lint + arc unit

Event Timeline

garga retitled this revision from to Fix bump-revision.sh.
garga updated this object.
garga edited the test plan for this revision. (Show Details)
garga added a reviewer: robak.

Hey, can you provide one or two examples where the code doesnt behave as expected? The fact it doesnt do anything, where PORTREVISION is absent is a design feature rather than a bug - it was never meant to do it in such case, because it is too complicated and troublesome, instead, it was meant to easily and reliably bump PORTREVISION values for multiple ports, like that (its a set of 'problematic' ports edge cases used to debug and test the code in past):

[root@pd]❯❯❯ sh Tools/scripts/bump-revision.sh net/vmware-vsphere-cli security/p5-Net-SinFP accessibility/atk converters/ruby-iconv comms/concordance mail/opendkim                                                                                                                                  
INFO: net/vmware-vsphere-cli PORTREVISION= 3 found, bumping it by 1.
ERROR: security/p5-Net-SinFP PORTREVISION found more than once, unable to bump it reliably!
INFO: accessibility/atk PORTREVISION= 0 found, bumping it by 1.
ERROR: converters/ruby-iconv might not be a port directory because converters/ruby-iconv/Makefile is missing!
INFO: comms/concordance PORTREVISION= 1 found, bumping it by 1.
INFO: mail/opendkim PORTREVISION= 5 found, bumping it by 1.
[root@pd]❯❯❯

I didn't realize it was intentional to not set PORTREVISION to 1 when it's not found, that is why I thought it was broken

@garga I have nothing against implementing such functionality, but I havent done it so far, becuase it wasnt in original feature request from bapt and I've also found it hard to implement in a way that would work with all edge cases/strange ports we have. If we can test it properly and prove it works reliably, then I am happy to accept the patch.

Cool,

Do you remember where it was failing? Or have any specific test to suggest? I would be glad to run all necessary tests and provide any fixes it needs

Any news about this review?

I've never used this script. It's maintained by you, @robak, so how it works and who you want to be a blocking review is up to you.
Seems fine to me though.

Tools/scripts/bump-revision.sh
59

The old code checked for = here and I think it still should to avoid matching on non-PORTREVISION vars.

This revision is now accepted and ready to land.Jun 19 2018, 6:23 PM