Tools/scripts/rmport: change method to look for PRs
Use the Bugzilla REST interface to look for PRs files against the
port(s) to be deleted as that one still allows anonymous access.
Tools/scripts: use a port-specific commit message if removing a single port.
This helps in `git shortlog`, replacing "cleanup: Remove expired ports" by
"category/port: Remove expired port" for a given category and port.
Reported by: gerald
cleanup: remove LEGAL and (support in) related tools.
LEGAL is badly maintained, LEGALlint notices quite a number of ports
which mismatch their line in LEGAL. The port itself is always leading.
* math/giacxcas: restrict RESTRICTED_FILES to giac_* only
Differential Revision: https://reviews.freebsd.org/D30061
Reviewed by: portmgr (mat), dch, eadler, marcus
rmport: ready for git
- do not remove ports immediately but store them in a temporary file
and remove them once the script has iterated over all ports to be
removed. This prevents failed searches. The Subversion version
used a temporary worktree so the main tree was unaffected.
- remove a "merge" from a question, we use rebase now.
- check if INDEX is readable and exit if not
rmport: fix and simplify workflow
- gather information about the deleted port for the commit message
before removing the port. I somehow missed that when testing the
script.
- Instead of a temporary branch, just operate on the current branch
and incorporate upstream changes with git pull --rebase. This
prevents one from being stranded on a temporary branch if the
script crashes and oblivates the need for a squash merge [1]
Suggested by: mat [1]
Tools/scripts/rmport: convert workflow to git.
Do not push the final result automatically yet, unlike its previous
Subversion version.
Reviewed by: emaste, mat, uqs
Approved by: crees (maintainer, implicit)
Differential Revision: https://reviews.freebsd.org/D29451
rmport: fix and speed up the find_expired() function.
find_expired() is used with -F (report on all expired ports using the
format "date category/port: reason") and -a (remove all expired ports).
Some speedups:
- only calculate the deprecation reason for -F
- use nested loops instead of nested recursion for traversing all ports.
The nested recursion would also stop after finding the first port.
Approved by: maintainer (crees) (implicit, fixit)
rmport: correctly deal with expired ports when the -a (find all expired) option.
Instead of grepping port Makefiles for EXPIRATION_DATE, evaluate this variable
using make. Also find ports by evaluating SUBDIR recursively instead of using
find on Makefile\*
Submitted by: crees (maintainer)
Approved by: crees (maintainer)
Support flavor_EXPIRATION_DATE
Correctly ignore commented dates (why would that exist?)
Handle more neatly when EXPIRATION_DATE is not in the main Makefile
Tools/scrips/rmport: improve usability
- if svn is not found, look for svnlite
- improve workflow of removing ports
Submitted by: blackend via email
Approved by: maintainer (crees)
rmport: provide default for EDITOR varialble to prevent
an error "svnlog: not found" when EDITOR is undefined.
Reported by: Matthias Fechner <idefix@fechner.net>
Approved by: portmgr (crees)
As a frequent user of the rmport script, it was time for some improvements:
- allow PORTSDIR to be a symbolic link when looking for expired ports or
dependent ports
- allow for trailing slashes when specifying ports as cat/name. This prevents
the port being a false positive for itself when the Makefile mentions the
port name (e.g., in PLIST_FILES)
- fetch possibly open PRs via Bugzilla, GNATS is long gone. Remove the
version that used freefall. Thanks to crees for pretty-printing the results.
- forcibly delete the temporary checkout to prevent rm(1) from asking for
confirmation on each file in .svn
- add myself as author
Approved by: maintainer (crees)
Differential Revision: https://reviews.freebsd.org/D6396
Make check_deps behave the same as check_PRs:
propose to skip removing a port if anything depends on it, instead of infinite
looping on "ignore the issue"
Take maintainership-- thanks to vd for his past work on this script
Approved by: vd (maintainer)
- Make the diff output work
- Use cdiff if exists, otherwise stick with $EDITOR
- Stop trying to remove CVSROOT; hasn't been checked out since modules
support was removed by erwin
Use echo instead of printf because external commands cannot be executed
with very long arguments (>400000 characters).
The problem reveals for example if
/usr/ports/Tools/scripts/rmport -d print/ghostscript-gnu
is executed - it does
printf "%s\n" "... 451109 chars ..."
Spotted by: rafan
* Make it possible to skip existing dependencies and ports references in LEGAL
and continue with removal anyway. Requested by miwi@
* Pipe dependencies information (if any) through a PAGER because INDEX lines
are very long and hard to read when wrapped
Add check for existing non-closed PRs related to the port being removed.
If any are found then ask if the port should be skipped from removal or
removed regardless of the PRs.
* Create custom commit message template and populate it with the ports
to be removed, possibly with the expiration date and deprecated reason
* If port is not marked for expiration than put "Removed" in ports/MOVED
entry instead of "Has expired"
* Implement -a option to remove all expired ports
* Ask if the cvs diff output should be recreated/reviewed again thus
giving the committer a chance to edit files by hand and view diff
results afterwards
* Cosmetic changes
When checking for dependencies of foocategory/barport also find constructs
like .../barport/something e.g. expect either space, slash or eol after
port's name
Remove grep's -w switch from the dependency check since it misses some
dependencies. This needs some more polishing but for now it is better to
emit false positives than skip dependencies.
Add support for specifying ports to be removed as directories on the
filesystem (either absolute or relative) in addition to `category/port'.
PR: ports/96649
Submitted by: Cheng-Lung Sung <clsung@freebsd.org>
Reworked by: vd
Improve dependency check:
When removing category/port - look if other ports' Makefiles contain
`/port' rather than `category/port', since the later misses things
like `${.CURDIR}/../port'