diff options
author | Maxim Sobolev <sobomax@FreeBSD.org> | 2001-12-11 10:49:51 +0000 |
---|---|---|
committer | Maxim Sobolev <sobomax@FreeBSD.org> | 2001-12-11 10:49:51 +0000 |
commit | 428d6d19952b4e480d9ffd28d974dc2fe4c9ed51 (patch) | |
tree | fc69ce978b15fec166868231499b10dd4c0293e1 /Tools | |
parent | 5eb1cd04128fb650a7c4b788c019dd0fe6c6f56f (diff) | |
download | ports-428d6d19952b4e480d9ffd28d974dc2fe4c9ed51.tar.gz ports-428d6d19952b4e480d9ffd28d974dc2fe4c9ed51.zip |
Add checkcats.py - a script that verifyes that master categories in all ports
are correct and reports any problems.
Notes
Notes:
svn path=/head/; revision=51349
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/scripts/README | 10 | ||||
-rwxr-xr-x | Tools/scripts/checkcats.py | 42 |
2 files changed, 51 insertions, 1 deletions
diff --git a/Tools/scripts/README b/Tools/scripts/README index c069063b01da..6c58548b6eef 100644 --- a/Tools/scripts/README +++ b/Tools/scripts/README @@ -3,7 +3,9 @@ $FreeBSD$ addport - future replacement for easy-import consistency-check - check whether all your ports are installed properly, - what files have changed, and what new files there are + what files have changed, and what new files there are. +checkcats.py - verify that master categories in all ports are correct and + report any problems. checknewvers - checks for availability for a newest version of distfiles on MASTER_SITES (ftp only). close-pr - a slightly hacked version of edit-pr(1) to quickly close PR. @@ -42,6 +44,12 @@ files above those installed by packages. ---------------------------------------------------------------------- +The checkcats.py script verifyes that master categories in all ports are +correct and report any problems. It doesn't require any command-line options. +Please beware that full check takes quite some time. + +---------------------------------------------------------------------- + getpr, prpatch and prdone are used as so: % cd /usr/ports/CATEGORY/PORT % getpr PRNUMBER diff --git a/Tools/scripts/checkcats.py b/Tools/scripts/checkcats.py new file mode 100755 index 000000000000..f4d80885124c --- /dev/null +++ b/Tools/scripts/checkcats.py @@ -0,0 +1,42 @@ +#!/usr/local/bin/python +# +# checkcats.py - verify that master categories in all ports are correct and +# report any problems. +# +# ---------------------------------------------------------------------------- +# "THE BEER-WARE LICENSE" (Revision 42, (c) Poul-Henning Kamp): +# Maxim Sobolev <sobomax@FreeBSD.org> wrote this file. As long as you retain +# this notice you can do whatever you want with this stuff. If we meet some +# day, and you think this stuff is worth it, you can buy me a beer in return. +# +# Maxim Sobolev +# ---------------------------------------------------------------------------- +# +# $FreeBSD$ +# +# MAINTAINER= sobomax@FreeBSD.org <- any unapproved commits to this file are +# highly discouraged!!! +# + +import glob, os.path +import patchtool +from patchtool import True, False + +PORTSDIR = '/usr/ports' + +if __name__ == '__main__': + portdirs = glob.glob(os.path.join(PORTSDIR, '*/*')) + for dirname in portdirs: + if not os.path.isfile(os.path.join(dirname, 'Makefile')): + continue + categories = patchtool.querymakevar('CATEGORIES', dirname) + try: + mastercat = categories.split()[0] + except IndexError: + print '%s: categories list is empty' % dirname + continue + mastercat_real = os.path.basename(os.path.dirname(dirname)) + if mastercat != mastercat_real: + print '%s: specified master category `%s\' doesn\'t match real one `%s\'' \ + % (dirname, mastercat, mastercat_real) + |