summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Tools/scripts/README40
-rwxr-xr-xTools/scripts/find-work-for-installed-ports.sh64
2 files changed, 67 insertions, 37 deletions
diff --git a/Tools/scripts/README b/Tools/scripts/README
index 8dfb2b17028a..450a92136a92 100644
--- a/Tools/scripts/README
+++ b/Tools/scripts/README
@@ -12,21 +12,19 @@ bump_revision.pl - Small script to bump the PORTREVISION variable of ports
checkcats.py - verify that master categories in all ports are correct and
report any problems. Beware that the full check takes quite
some time.
-checknewvers - checks for availability for a newest version of distfiles on
+checknewver.sh - checks for availability for a newest version of distfiles on
MASTER_SITES (ftp only).
-checksum - allows checking of ports to see if their checksums
+checksum.sh - allows checking of ports to see if their checksums
match, and if they don't, give a diff against the older version to
help discover why the checksum didn't match.
chkorigin.sh - checks all ports in the tree for a wrong PKGORIGIN.
Run this tool after every repocopy.
doportlint - run portlint on every port and return the results
-distclean - compare md5 sums of distfiles in ports/distfiles with currently
+distclean.sh - compare md5 sums of distfiles in ports/distfiles with currently
installed ports collection in ports/* and prompt to remove
unmatched entries
getpatch - downloads patch attachments from a Bug Tracking Systems
getpatch.sh - downloads patch attachments from a Bug Tracking Systems (plain shell script)
-gnomedepends - Analyse pkg/PLIST and give an advice as to which GNOME ports
- should be listes in {RUN,LIB}_DEPENDS for this port
mark_safe.pl - utility to set subsets of ports to MAKE_JOBS_(UN)SAFE=yes
neededlibs.sh - Extract direct library dependencies from binaries.
port_conflicts_check.lua - Verify that files installed by more than 1 port are covered
@@ -47,38 +45,6 @@ update_crates - script used to generate an updated Makefile using make cargo-cra
----------------------------------------------------------------------
-gnomedepends is a script, which analyses pkg/PLIST and gives an advice as to
-which GNOME ports should be listes in {RUN,LIB}_DEPENDS for the port to ensure
-correct removal of GNOME shared directories. Usage is simple:
- % cd /usr/ports/CATEGORY/PORT
- % gnomedepends.py
- According to the contents of PLIST the port depends on the following GNOME
- port(s):
-
- /usr/ports/audio/gnomeaudio, for directories:
- share/gnome/sounds
-
- /usr/ports/sysutils/gnomecontrolcenter, for directories:
- share/gnome/apps
-
- /usr/ports/x11/gnomecore, for directories:
- share/gnome/apps/Games
-
- /usr/ports/x11/gnomelibs, for directories:
- etc/sound/events
- etc/sound
- share/gnome/games
- share/gnome/pixmaps
- share/gnome
-
-The example above means that you need to have ${PORTSDIR}/audio/gnomeaudio,
-${PORTSDIR}/sysutils/gnomecontrolcenter, ${PORTSDIR}/x11/gnomecore and
-${PORTSDIR}/x11/gnomelibs listed in {RUN,LIB}_DEPENDS for this port.
-Please be warned, that the this only means that the ports listed by the script
-required for correct removal of GNOME shared directories, not for the port
-functionality, so actual {RUN,LIB}_DEPENDS may have more entries.
-
-----------------------------------------------------------------------
portsearch - A utility for searching the ports tree.
portsearch is a utility to for searching of the ports tree. It permits
diff --git a/Tools/scripts/find-work-for-installed-ports.sh b/Tools/scripts/find-work-for-installed-ports.sh
new file mode 100755
index 000000000000..e9ad442aca88
--- /dev/null
+++ b/Tools/scripts/find-work-for-installed-ports.sh
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+# Tool to find work (such as unassigned Bugzilla PRs) to port committers or
+# perhaps other developers based on the list of locally installed ports.
+# More sources can be added later (such as GitHub pull requests).
+#
+# SPDX-License-Identifier: BSD-2-Clause
+# Copyright (c) 2025 René Ladan <rene@FreeBSD.org>
+# MAINTAINER=rene@FreeBSD.org
+
+set -eu
+
+# Look for PRs in Bugzilla having $1 in the summary line (as opposed to the full
+# PR content), and add each such PR to the output (PR number, assignee, summary)
+# if it is not assigned some FreeBSD.org, with the exception of
+# ports-bugs@FreeBSD.org. The matching is case-insensitive.
+get_PRs()
+{
+ catport=${1}
+ category="$(echo "${catport}" | cut -f 1 -d /)"
+ port="$(echo "${catport}" | cut -f 2 -d /)"
+ timeout=20 # seconds
+
+ echo "getting Bugzilla PRs having ${catport} in the synopsis" >&2
+ # content= looks for the search string in all of the pr content,
+ # summary= only looks in the summary line
+ url="https://bugs.freebsd.org/bugzilla/rest/bug?bug_status=__open__&product=Ports%20%26%20Packages&summary=${category}%2f${port}"
+ raw="$(fetch -q -T ${timeout} -o - "${url}")"
+ # Enable the next line to get full JSON output in per-port files for debugging
+ # echo "${raw}" > "${category}-${port}.json"
+ if [ -z "${raw}" ] ; then
+ echo "${catport}: no REST reply within ${timeout} seconds from URL: ${url}" >&2
+ exit 67
+ fi
+ pr_list="$(echo "${raw}" | jq '[.bugs | map(select(.assigned_to | test("ports-bugs@freebsd.org";"i") or test("@freebsd.org";"i") == false)).[] | {id,assigned_to,summary}]')"
+
+ # The below code is just to get one line per PR in the output.
+ num_prs=$(echo "${pr_list}" | jq length)
+ if [ ${num_prs} -gt 0 ] ; then
+ for i in $(jot ${num_prs} 0) ; do
+ echo "${pr_list}" | jq -r --argjson i ${i} '[.[$i].id,.[$i].assigned_to,.[$i].summary] | @tsv'
+ done
+ fi
+}
+
+if ! which jq >/dev/null ; then
+ echo "Please install textproc/jq" >&2
+ exit 66
+fi
+
+# Iterate through all installed ports which are not maintained by a FreeBSD.org
+# address (this includes ports-bugs and possibly you), and for each such port
+# see if there is output from get_PR() and if so, report it grouped by the port
+# maintainer.
+for p in $(pkg query -e '%m !~ *@FreeBSD.org' %o,%m) ; do
+ origin=$(echo "${p}" | cut -f 1 -d ,)
+ maintainer=$(echo "${p}" | cut -f 2 -d ,)
+
+ # see if there is a Bugzilla report for ${origin}
+ bz="$(get_PRs "${origin}")"
+ if [ -n "${bz}" ] ; then
+ printf "** %s\n%s\n" "${maintainer}" "${bz}"
+ fi
+done