From nobody Thu Jul 14 18:42:23 2022 X-Original-To: ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LkNdj0Cn5z3vRbf for ; Thu, 14 Jul 2022 18:42:33 +0000 (UTC) (envelope-from fuz@fuz.su) Received: from fuz.su (fuz.su [IPv6:2001:41d0:8:e508::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "fuz.su", Issuer "fuz.su" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LkNdh07Vtz3H65 for ; Thu, 14 Jul 2022 18:42:31 +0000 (UTC) (envelope-from fuz@fuz.su) Received: from fuz.su (localhost [127.0.0.1]) by fuz.su (8.16.1/8.16.1) with ESMTPS id 26EIgOtY095181 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Thu, 14 Jul 2022 18:42:24 GMT (envelope-from fuz@fuz.su) Received: (from fuz@localhost) by fuz.su (8.16.1/8.16.1/Submit) id 26EIgN6q095180 for ports@freebsd.org; Thu, 14 Jul 2022 20:42:23 +0200 (CEST) (envelope-from fuz) Date: Thu, 14 Jul 2022 20:42:23 +0200 From: Robert Clausecker To: ports@freebsd.org Subject: How does the pkg version syntax work? Message-ID: List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Queue-Id: 4LkNdh07Vtz3H65 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of fuz@fuz.su designates 2001:41d0:8:e508::1 as permitted sender) smtp.mailfrom=fuz@fuz.su X-Spamd-Result: default: False [-2.27 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.995]; NEURAL_HAM_LONG(-0.98)[-0.978]; R_SPF_ALLOW(-0.20)[+a]; MIME_GOOD(-0.10)[text/plain]; ASN(0.00)[asn:16276, ipnet:2001:41d0::/32, country:FR]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[ports]; FROM_EQ_ENVFROM(0.00)[]; DMARC_NA(0.00)[fuz.su]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[ports@freebsd.org]; TO_DN_NONE(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N The ports collection generates a PKGVERSION from the DISTVERSION or PORTVERSION provided by the port. This PKGVERSION is then used to decide whether one package is newer or older than the other. However, it seems to be poorly documented. There does not seem to be any documentation in the man pages and the source code (pkg_version.c) gives incomplete and seemingly contradictory information: - first it says that components are separated by dots - then it gives a regex for what does not separate components, but that rege excludes both dots and plus signs, despite these separating components as per the other comments. - plus signs get special treatment (in the version_cmp function), but it is never explained what that special treatment is and how it works - version_cmp then claims that the code supports versions in a way more lenient manner than what portlint enforces. Yet it does not say what portlint enforces and it'll be fun to compute the intersection of the checks done by the two tools (and possibly the additional checks done by the ports framework) Given that there are some surprises and that even what is documented in the code is not really obvious (e.g. words are resolved to their first letters, but pl and snap get special treatment for some reason), there should really be authoritative documentation for how this works. But there does not seem to be any. Anybody interested in improving the situation? Yours, Robert Clausecker -- () ascii ribbon campaign - for an 8-bit clean world /\ - against html email - against proprietary attachments