Page MenuHomeFreeBSD

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

Authored by tcberner on Thu, Nov 17, 8:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 2, 3:18 PM
Unknown Object (File)
Fri, Dec 2, 3:18 PM
Unknown Object (File)
Fri, Dec 2, 3:17 PM
Unknown Object (File)
Mon, Nov 28, 2:01 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 48414
Build 45300: arc lint + arc unit

Event Timeline

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

^ 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