Page MenuHomeFreeBSD

Make "make update-packages" idempotent
ClosedPublic

Authored by asomers on Thu, May 7, 6:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 13, 5:26 PM
Unknown Object (File)
Wed, May 13, 12:34 AM
Unknown Object (File)
Mon, May 11, 8:58 PM
Unknown Object (File)
Mon, May 11, 4:05 PM
Unknown Object (File)
Sun, May 10, 3:57 PM
Unknown Object (File)
Sun, May 10, 3:55 PM
Unknown Object (File)
Sun, May 10, 11:40 AM
Unknown Object (File)
Sun, May 10, 6:28 AM
Subscribers

Details

Summary

If the user runs "make update-packages" without bumping BRANCH, then it
isn't possible to copy packages from the old location to the new one
(because the two locations are the same). So just skip that step.

Sponsored by: ConnectWise
PR: 295085
MFC after: 1 week

Test Plan

Ran "make update-packages" twice in a row

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ivy added a reviewer: pkgbase.

one potential issue here is that the user might not realise why their new packages aren't being used if the version number didn't change. but the previous behaviour does not seem intentional, and i think this is better than an error.

This revision is now accepted and ready to land.Fri, May 8, 1:25 AM

@brd this is what I was talking about when I complained about errors running "make update-packages".

@brd this is what I was talking about when I complained about errors running "make update-packages".

Oh, I see.. I never saw this because I only run CURRENT and so all the packages are datestamped.

LGTM, but is it worth adding an echo in the case that PKG_VERSION didn't change so that we always emit some message here?

Something like

.if defined(PKG_VERSION_FROM_DIR)
    .if ${PKG_VERSION} != ${PKG_VERSION_FROM}
        @echo "==> Package version ${PKG_VERSION} unchanged, keeping old package set"
    .else
        ...
     .endif
.endif

Or actually, avoiding more indentation, changing the existing else case to

.elif defined(PKG_VERSION_FROM_DIR)
    @echo version not changed
.else
    @echo bootstrapping repository, not checking...
.endif

LGTM, but is it worth adding an echo in the case that PKG_VERSION didn't change so that we always emit some message here?

Something like

.if defined(PKG_VERSION_FROM_DIR)
    .if ${PKG_VERSION} != ${PKG_VERSION_FROM}
        @echo "==> Package version ${PKG_VERSION} unchanged, keeping old package set"
    .else
        ...
     .endif
.endif

Or actually, avoiding more indentation, changing the existing else case to

.elif defined(PKG_VERSION_FROM_DIR)
    @echo version not changed
.else
    @echo bootstrapping repository, not checking...
.endif

Ok, I'll commit it with this change.

This revision was automatically updated to reflect the committed changes.