diff options
author | sobomax <sobomax@FreeBSD.org> | 2001-12-11 18:49:51 +0800 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2001-12-11 18:49:51 +0800 |
commit | 9844ddea740cf27bc59fac59ec1c9c4d5d68a0f8 (patch) | |
tree | d807746cad0337b31ffe79c0aada47f9da6904f8 /Tools | |
parent | 95aec343a34a8b7f441af0e94665b5092cc25e7b (diff) | |
download | freebsd-ports-gnome-9844ddea740cf27bc59fac59ec1c9c4d5d68a0f8.tar.gz freebsd-ports-gnome-9844ddea740cf27bc59fac59ec1c9c4d5d68a0f8.tar.zst freebsd-ports-gnome-9844ddea740cf27bc59fac59ec1c9c4d5d68a0f8.zip |
Add checkcats.py - a script that verifyes that master categories in all ports
are correct and reports any problems.
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) + |