Date: Tue, 23 Aug 2022 13:42:32 GMT From: Baptiste Daroussin <bapt@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 4dfa8c4b4524 - main - Scripts: remove now inaccurate gnomedepends.py Message-ID: <202208231342.27NDgWNk057118@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/ports/commit/?id=4dfa8c4b4524325509ba9e2484f49631a4c1902e commit 4dfa8c4b4524325509ba9e2484f49631a4c1902e Author: Baptiste Daroussin <bapt@FreeBSD.org> AuthorDate: 2022-08-23 13:39:50 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2022-08-23 13:42:27 +0000 Scripts: remove now inaccurate gnomedepends.py --- Tools/scripts/gnomedepends.py | 126 ------------------------------------------ 1 file changed, 126 deletions(-) diff --git a/Tools/scripts/gnomedepends.py b/Tools/scripts/gnomedepends.py deleted file mode 100755 index 2c5da9c7fc29..000000000000 --- a/Tools/scripts/gnomedepends.py +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env python -# -# gnomedepends -# Analyse pkg/PLIST and give an advice as to which GNOME -# ports should be listes in {RUN,LIB}_DEPENDS for this port -# -# ---------------------------------------------------------------------------- -# "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 -# ---------------------------------------------------------------------------- -# -# MAINTAINER= gnome@FreeBSD.org -# -# TODO: -# - analyse actual {RUN,LIB}_DEPENDS and give an advice about what should be -# added; -# - analyse results and remove redundant dependencies (for example if gnomecore -# has gnomecontrolcenter listed as dependency, and it is found that the port -# requires both gnomecontrolcenter and gnomecore do not list -# gnomecontrolcenter then); -# - parse ports/INDEX directly. -# - -import os, os.path, sys, string, re - -def getcmdout(cmdline): - results = [] - pipe = os.popen(cmdline) - buffer = pipe.readlines() - for result in buffer: - result = string.strip(result) - if len(result) > 0: - results.append(result) - pipe.close() - return results - -def readfile(filename): - file = open(filename) - result = file.readlines() - file.close() - return result - -def filter(lines, regobj): - results = [] - for line in lines: - match = regobj.match(line) - if match != None: - result = string.strip(match.group(1)) - try: - tmp = results.index(result) - except ValueError: - results.append(result) - return results - -gnomeports = getcmdout('cd /usr/ports && make search key=gnome | grep ^Path:') -newgnomeports = [] -for i in gnomeports: - newgnomeports.append(string.split(i)[1]) -gnomeports = newgnomeports -newgnomeports = [] - -regobj = re.compile('^@dirrm (?P<dirname>\S+).*$') -for portdir in gnomeports: - try: - lines = readfile(os.path.join(portdir, 'pkg-plist')) - lines = list(filter(lines, regobj)) - if len(lines) > 0: - newgnomeports.append([portdir, lines]) - except IOError: - pass -gnomeports = newgnomeports -newgnomeports = [] - -try: - currplist = readfile('pkg-plist') -except IOError as errmsg: - print(errmsg) - sys.exit(1) - -regobj = re.compile('^(?!@)(?P<dirname>\S+)/.*') -currdirs = list(filter(currplist, regobj)) -regobj = re.compile('^@dirrm (?P<dirname>\S+).*$') -currdirs.extend(list(filter(currplist, regobj))) -currportdir = os.getcwd() - -newcurrdirs = [] -for dir in currdirs: - incremental = '' - for component in string.split(dir, '/'): - if incremental != '': - incremental = incremental + '/' - incremental = incremental + component - try: - tmp = newcurrdirs.index(incremental) - except ValueError: - newcurrdirs.append(incremental) -currdirs = newcurrdirs - -depends = [] -for gnomeport in gnomeports: - if (currportdir == gnomeport[0]): - continue - matches = [] - for gnomedir in gnomeport[1]: - for dir in currdirs: - if (gnomedir == dir): - matches.append(dir) - if len(matches) > 0: - depends.append([gnomeport[0], matches]) - -if len(depends) == 0: - sys.stdout.writelines(['No dependencies found (maybe it is not a GNOME port).\n']) - sys.exit(0) - -sys.stdout.writelines(['According to the contents of pkg-plist the port depends on the following GNOME\n', 'port(s):\n\n']) -for depend in depends: - sys.stdout.writelines([depend[0], ', for directories:\n']) - for dir in depend[1]: - sys.stdout.writelines(['\t', dir, '\n']) - sys.stdout.writelines(['\n']) - -
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202208231342.27NDgWNk057118>