Date: Mon, 02 Apr 2018 01:34:45 +0000 From: bugzilla-noreply@freebsd.org To: pkg@FreeBSD.org Subject: [Bug 227193] ports-mgmt/pkg: pkg updating only recognizes exact string matches for port origins Message-ID: <bug-227193-32340@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D227193 Bug ID: 227193 Summary: ports-mgmt/pkg: pkg updating only recognizes exact string matches for port origins Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: Individual Port(s) Assignee: pkg@FreeBSD.org Reporter: david@catwhisker.org CC: dhw@FreeBSD.org Assignee: pkg@FreeBSD.org Flags: maintainer-feedback?(pkg@FreeBSD.org) 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(lin= e, 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(dat= eline, 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.) --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-227193-32340>