Opened 7 years ago

Closed 3 years ago

Last modified 3 years ago

#53851 closed enhancement (fixed)

Add port action that bumps version and checksum

Reported by: l2dy (Zero King) Owned by:
Priority: Normal Milestone: MacPorts 2.6.0
Component: base Version:
Keywords: Cc: raimue (Rainer Müller), 1-61803, satraul (Satryaji Aulia), lhaeger (Lothar Haeger)
Port:

Description (last modified by l2dy (Zero King))

Homebrew has brew bump-formula-pr. Such functionality saves a lot of work when updating many ports. Bumping ports using PortGroup like github and bitbucket should also be supported. Existing revision should be reset or removed interactively. A suggested commit message for the update should be shown.

Use cases (pseudo commands):

  • port bump [[portname | pseudo-portname | port-expressions | port-url]] bumps checksums only
  • port bump [[portname | pseudo-portname | port-expressions | port-url]] @<version> bumps version and checksums
  • port bump --livecheck [[portname | pseudo-portname | port-expressions | port-url]] bumps both with livecheck result if ${version} == ${livecheck.version}

Change History (21)

comment:1 Changed 7 years ago by Schamschula (Marius Schamschula)

Just be mindful that numerous ports have checksums for multiple files. I personally use a python script to automatically update checksums, but this script has a list of which Portfiles need to be updated manually.

comment:2 Changed 7 years ago by l2dy (Zero King)

Description: modified (diff)

Checksum for multiple files shouldn't be a problem, simply find and replace every old hash with the corresponding new one should work. Some ports have version set by custom methods so the version has to be updated manually. The Portfile have to be checked afterwards anyway.

comment:3 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

I use my portcheckup script to do this, though I have some local changes that haven't been committed yet.

Just "bumping" checksums is seldom desired; more work is needed to handle that situation correctly; see PortfileRecipes#stealth-updates.

comment:4 Changed 7 years ago by l2dy (Zero King)

In the first use case I'd bump the version manually and let port(1) update the checksum.

Take R for example, it's not viable to automate the version bump in base, but the checksum could be automatically updated.

set major 3
set minor 3
set point 3
version                     ${major}.${minor}.${point}
Last edited 7 years ago by l2dy (Zero King) (previous) (diff)

comment:5 Changed 7 years ago by l2dy (Zero King)

Description: modified (diff)

comment:6 Changed 7 years ago by l2dy (Zero King)

Description: modified (diff)

comment:7 in reply to:  4 ; Changed 7 years ago by raimue (Rainer Müller)

Cc: raimue added

Replying to l2dy:

[...] the checksum could be automatically updated.

Checksums should be verified with the checksums published by upstream, whenever possible. I am afraid that fully automating the process will lead to maintainers being less careful. port -v checksum already prints the checksums in a format suitable for copy&paste to the Portfile.

comment:8 in reply to:  7 Changed 7 years ago by l2dy (Zero King)

Replying to raimue:

port -v checksum already prints the checksums in a format suitable for copy&paste to the Portfile.

Not really, there are spacing and expansion problems (e.g. ${certdata_distfile} being expanded).

I am afraid that fully automating the process will lead to maintainers being less careful.

And I forgot to remove revision lines several times which could be avoided with automation.

Version 2, edited 7 years ago by l2dy (Zero King) (previous) (next) (diff)

comment:9 Changed 7 years ago by danielluke (Daniel J. Luke)

I like this idea. I think the tradeoff for making it easier for maintainers to version-bump a port is worth the potential of maintainers misuse (I doubt that the current behavior actually results in careless maintainers being more careful).

comment:10 Changed 7 years ago by l2dy (Zero King)

Description: modified (diff)

comment:11 Changed 7 years ago by l2dy (Zero King)

Description: modified (diff)

comment:12 Changed 7 years ago by l2dy (Zero King)

Description: modified (diff)

comment:13 in reply to:  4 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to l2dy:

Take R for example, it's not viable to automate the version bump in base, but the checksum could be automatically updated.

set major 3
set minor 3
set point 3
version                     ${major}.${minor}.${point}

Aberrations like that should be fixed (e.g. https://github.com/macports/macports-ports/pull/1371).

comment:14 Changed 6 years ago by 1-61803

Cc: 1-61803 added

comment:15 Changed 6 years ago by l2dy (Zero King)

I think a consistent way for port maintainers to warn others that updating this port requires special handling is needed if we add this target.

comment:16 Changed 6 years ago by raimue (Rainer Müller)

Summary: Add target that bumps version and checksumAdd port action that bumps version and checksum

comment:17 Changed 6 years ago by pmetzger (Perry E. Metzger)

Zero King: I think we underuse tests, fwiw. If you have a "port test" available, you don't have to wonder if your bump broke a port.

comment:18 Changed 5 years ago by mojca (Mojca Miklavec)

Cc: satraul added

comment:19 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: lhaeger added

Has duplicate #60539.

comment:20 in reply to:  18 Changed 3 years ago by l2dy (Zero King)

Resolution: fixed
Status: newclosed

Replying to mojca:

See https://github.com/macports/macports-base/pull/120

Thanks. This feature has been implemented and released, so I'm going to close the ticket.

P.S. I don't like it fetching distfiles from our mirrors, because distfiles for the new version are likely not there.

comment:21 Changed 3 years ago by jmroot (Joshua Root)

Milestone: MacPorts 2.6.0
Note: See TracTickets for help on using tickets.