Page MenuHomeFreeBSD

framework: new hook to try to ensure clean removal of ports
Needs ReviewPublic

Authored by tcberner on Nov 17 2022, 8:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 10 2024, 6:50 AM
Unknown Object (File)
Dec 20 2023, 8:09 AM
Unknown Object (File)
Nov 14 2023, 12:49 PM
Unknown Object (File)
Sep 21 2023, 10:18 PM
Unknown Object (File)
Sep 11 2023, 1:31 PM
Unknown Object (File)
Aug 26 2023, 5:06 AM
Unknown Object (File)
Jul 4 2023, 10:17 AM
Unknown Object (File)
May 11 2023, 8:05 PM

Details

Reviewers
mat
bapt
Group Reviewers
portmgr
Summary

This hook tries to help people when removing ports from the tree.
It checks that

  • there are no commented lines containing "=.*category/port".
  • there are no moved entries pointing to the removed port
  • there is a moved entry removing this port
> git rm -r devel/kf5-extra-cmake-modules
[...]
>  git commit -m "remove devel/kf5-extra-cmake-modules"
[pre-commit] ERROR: no MOVED entry for 'devel/kf5-extra-cmake-modules'.
[pre-commit] ERROR: ports are marked moved to 'devel/kf5-extra-cmake-modules' in MOVED.
[pre-commit] ERROR: port 'devel/kf5-extra-cmake-modules' still referenced in:
                    * deskutils/syncthingtray/Makefile
                    * graphics/drawpile/Makefile
[pre-commit] ERROR: port 'devel/kf5-extra-cmake-modules' still referenced in:
                    * Mk/Uses/kde.mk
[pre-commit] ERROR: removal of ports is incomplete. Please fix above issues.

Diff Detail

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

Event Timeline

tcberner created this revision.
.hooks/pre-commit.d/check_rmport
25

^ that regex should be "[^#]*=.*${removed_port}(@[a-z0-9]+)?$" to catch flavors and ensure that no ports with the same prefix are matched, I guess.

from discussion with @dch in IRC:

  • check_moved:
      • ports can also be moved to a new origin -- the current check errors out on those: Fix: check that new origin exists, and only if not, error out
    • check_subdir (new):
      • also make sure the category-Makefile does no longer contain SUBDIR +=

from discussion with @makc in IRC:

  • use git grep --cached for speed