Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Apr 2018 01:34:45 +0000
From:      bugzilla-noreply@freebsd.org
To:        pkg@FreeBSD.org
Subject:   maintainer-feedback requested: [Bug 227193] ports-mgmt/pkg: pkg updating only recognizes exact string matches for port origins
Message-ID:  <bug-227193-32340-j7vdrwiPP8@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-227193-32340@https.bugs.freebsd.org/bugzilla/>
References:  <bug-227193-32340@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
Bugzilla Automation <bugzilla@FreeBSD.org> has asked pkg@FreeBSD.org for
maintainer-feedback:
Bug 227193: ports-mgmt/pkg: pkg updating only recognizes exact string match=
es
for port origins
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D227193



--- Description ---
The Porter's Handbook, section 11.2.1, contains a passage:

Note:

It is recommended that the AFFECTS line contains a glob matching all the po=
rts
affected by the entry so that automated tools can parse it as easily as
possible. If an update concerns all the existing BIND 9 versions the AFFECTS
content must be users of dns/bind9*, it must not be users of BIND 9


However, empirical observations (ref., e.g., the email thread that starts at
<http://docs.FreeBSD.org/cgi/mid.cgi?20180331142525.GE1272>) and inspection=
 of
the code in pkg-1.10.5's src/updating.c:

		tmp =3D NULL;
		if (found =3D=3D 0) {
			if (strstr(line, "AFFECTS") !=3D NULL) {
				SLIST_FOREACH(port, &origins, next) {
					if (caseinsensitive) {
						if ((tmp =3D strcasestr(line,
port->origin)) !=3D NULL) {
							break;
						}
					} else {
						if ((tmp =3D strstr(line,
port->origin)) !=3D NULL) {
							break;
						}
					}
				}
				if (tmp !=3D NULL) {
					if ((date !=3D NULL) && strncmp(dateline,
date, 8) < 0) {
						continue;
					}
					printf("%s%s",dateline, line);
					found =3D 1;
				}
			}
		} else {
			printf("%s",line);
		}


shows that "pkg updating" cannot make constructive use of "globs" -- and if
they are specified in ports/UPDATING, "pkg updating" will fail to match such
entries to any installed port, and will thus fail to display the entries for
affected ports.

That said, another way to address the inconsistency (between the Porter's
Handbook recommendation and the code in updating.c) would be to change the
recommendation (and corresponding practice) to only use port origin specifi=
ers
that "pkg updating" will recognize: I am not in a position to make a claim =
as
to which approach makes more sense (either now or in the future).

(Indeed: it may well be that it may be better to use regular expressions,
rather than globs -- in which case code, documentation, and practice would =
each
need to change.  But that's not my call.)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-227193-32340-j7vdrwiPP8>