p5-freshports-modules changes for 2.3.0

p5-freshports-modules is being updated to 2.3.0 – this post outlines the changes. This package jumps from 2.2.2 to 2.3.0 mainly to keep in line with a recent p5-freshports-scripts update.

A small release: two commits, two files. port.pm starts recording PKGVERSION as make reports it, instead of leaving every consumer to compose a package version out of version, revision and portepoch — which was wrong for about a hundred ports. config.pm.sample gains the flag which lets the nightly INDEX comparison queue its own refresh job. Both halves belong to the same piece of work as ingress/scripts, and the first of them cannot be deployed without it.

  • Release: ingress/modules 2.3.0. Of r6226–r6270, two revisions touch this module: r6260 and r6270. Previous release 2.2.2 was cut at r6225.
  • Files: port.pm, config.pm.sample
  • Requires, in this order: the ports.pkgversion column from database-schema r6262, then this release and the matching ingress/scripts release together. Deploying either of those two alone corrupts every port it touches. See “Installing” below.
  • Config: one new value in config.pm, $FreshPorts::Config::RefreshFromIndexFlag. No new dependencies.
  • Tested on: dev-ingress01, through the nightly comparison and through set-pkgversion.pl across the tree.
  • Rollback to: 2.2.2, with ingress/scripts rolled back in the same step. The new column can stay.

Record PKGVERSION, which is not always what we compose

r6260. File: port.pm

FreshPorts stored version, revision and portepoch, and everything which needed a package version composed them: version, then _revision, then ,portepoch. That is not always what the port builds as. audio/oss has PORTVERSION 4.2.b2019 and PORTREVISION 5, which compose to 4.2.b2019_5, but its PKGVERSION is 4.2.b2019.1501000_5. The kmod framework splices ${OSVERSION} in between the version and the revision, where none of the variables we fetched could show it. Host and jail agree on the value, so it is not environmental. Around a hundred ports are affected, and no amount of composing would ever have produced their real version, because the component was never fetched.

  • make-port.sh now asks for PKGVERSION and port.pm records it in ports.pkgversion. Five touch points, the same five every other make -V variable has: _initialize, _GetValuesFromRow, the _save UPDATE, the split, and the debug print.
  • It is asked for last, which fixes a bug that was there before this work. split with no limit discards trailing empty fields, so $use_rc_subr — the last field until now — was left undefined for any port which does not set USE_RC_SUBR, which is most of them. PKGVERSION is never empty, so it now shields the field which could be.
  • Nothing the site displays changes as a result of this commit. version, revision and portepoch are untouched; pkgversion exists to be compared against the INDEX.
  • The column is NULL until a port has been refreshed, so nothing can rely on it on the day it ships. Once every port has been through a refresh, compare-index.sh can compare it directly, and the two OSVERSION regexes, the composing with its NOT IN ('', '0') cases, and most of the (empty) handling all go away.

Schedule a refresh when the comparison finds work

r6270. File: config.pm.sample

The nightly comparison had been finding ports whose version was out of date and then doing nothing about them. It now raises a flag which job-waiting.pl picks up.

  • One new value: $FreshPorts::Config::RefreshFromIndexFlag, ${BaseDir}/signals/refresh_from_index. It is the same path as REFRESHFROMINDEXFLAG in config.sh, since the shell raises the flag and perl reads it. Set them to the same thing or the job never runs.
  • The rest of this change is in ingress/scripts: job-waiting.pl maps the flag to refresh-from-index.sh, which runs refresh-listed-ports.pl against the list the comparison wrote.
  • The flag goes up only when the list has something in it. Most nights it does not, and raising it anyway would start a job with nothing to do.

Installing

  1. ports.pkgversion first. database-schema r6262. port.pm names the column in its UPDATE, so with this release installed against a database without it, every port refresh fails.
  2. This release and ingress/scripts in one step. make-port.sh runs one make -V with 49 variables and port.pm assigns them by position, 49 names against 49 values. A mismatched pair does not fail — it puts every field after the mismatch into the wrong column, and keeps doing so until someone notices. Both packages carry one half of that contract.
  3. Add $FreshPorts::Config::RefreshFromIndexFlag to config.pm, matching REFRESHFROMINDEXFLAG in config.sh.
  4. Run the set-pkgversion.pl backfill from the scripts package. Until it has run, pkgversion is NULL for every port which has not happened to be refreshed, so anything reading it sees a mostly empty column.

If this host is coming from a release earlier than 2.2.2, that release’s ports.build_run_depends column and its EXTRACT_DEPENDS/PATCH_DEPENDS data migration are prerequisites too, and the same positional argument applies to them.

Smoke tests after install

CheckExpect
Refresh any port with debug onA pkgversion = '…' line in the dump, non-empty
Refresh a port which does not set USE_RC_SUBRuse_rc_subr = '' and no uninitialised-value warning
Refresh a port which does set itIts USE_RC_SUBR value, unchanged from before this release — confirms the 49 fields still line up
Refresh audio/osspkgversion = 4.2.b2019.1501000_5, while version stays 4.2.b2019 and revision stays 5
Any port pageUnchanged. This release alters nothing the site reads.
touch $RefreshFromIndexFlagjob-waiting.pl runs refresh-from-index.sh and the flag is gone afterwards

The third row is the one worth doing deliberately. A positional mismatch is silent, and the only cheap way to see it is to refresh a port whose later fields have known values and read them back.

Rollback

Back to 2.2.2, and ingress/scripts back in the same step — the two move together in either direction, for the same reason they install together. ports.pkgversion can stay: nothing reads it with the old port.pm in place, and leaving it means the backfill is not thrown away if this is reinstalled. Values written while this release was live stay correct; they simply stop being updated.

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

Leave a Comment

Scroll to Top