From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lucy.dinwoodie.org (lucy.dinwoodie.org [IPv6:2001:8b0:de15:20ad:6beb:fd8f:c6fd:d1ac]) by sourceware.org (Postfix) with ESMTPS id 74B773858D28 for ; Tue, 17 Jan 2023 23:59:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 74B773858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinwoodie.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dinwoodie.org Received: from adam by lucy.dinwoodie.org with local (Exim 4.96) (envelope-from ) id 1pHvr4-0004we-0L; Tue, 17 Jan 2023 23:59:02 +0000 Date: Tue, 17 Jan 2023 23:59:02 +0000 From: Adam Dinwoodie To: Jon Turney Cc: Takashi Yano , "cygwin-apps@cygwin.com" Subject: Re: Version string of package Message-ID: <20230117235902.f7sr234ptcj77ees@lucy.dinwoodie.org> References: <20230113205210.e23a2f47c2ffd6ea86d97541@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Jan 13, 2023 at 01:22:44PM +0000, Jon Turney via Cygwin-apps wrote: > On 13/01/2023 11:52, Takashi Yano via Cygwin-apps wrote: > > Hi, > > > > Is it allowed to include '-' in version string (e.g. '20230113-stable')? > > I'm asking because mksetupini warns: > > > > mksetupini: file 'xxx.tar.xz' in package yyy contains '-' in version > > > > though it works as expected. > > Short answer: > > It's a bug that this isn't a fatal error. Please don't do it! > > Long answer: > > Package naming in Cygwin has a long and tangled history. This isn't > explicitly precluded by the rules at [1], but probably should be. > > (Fedora, which we generally follow for packaging rules, now doesn't allow > '-' in versions, just digits, letters and '.') > > We need to be able to unambiguously separate a NVR string into the package > name, version and release. > > Underscores are allowed in package names, so the simple approach of > splitting on the rightmost two hyphens would work, if we don't allow > exceptions like this. > > (We can get it right in this case, because we have a piece of extra > information: the directory the package is in, which happens to always be > named N in the current scheme of things, but we might want to change that) > > [1] https://cygwin.com/packaging-package-files.html I just spotted [0] in the Cygport documentation, and was reminded of this conversation. According to that, the version string is explicitly allowed to include hyphens! I suspect that's fundamentally a documentanion bug these days, and should just be expunged... [0]: https://cygwin.github.io/cygport/syntax_cygpart.html#VERSION Quick patch below; I can submit this properly as a GitHub PR or with `git send-email` or otherwise if that'd be useful... diff --git a/lib/syntax.cygpart b/lib/syntax.cygpart index 4a400a71..6b992031 100644 --- a/lib/syntax.cygpart +++ b/lib/syntax.cygpart @@ -316,7 +316,7 @@ __target_is_embedded() { #****v* Globals/VERSION # DESCRIPTION # The upstream package version number. PV must begin with a digit 0-9, and -# subsequent characters can be a digit, letter, dot, hyphen, or underscore. +# subsequent characters can be a digit, letter, dot, or underscore. #**** #****v* Globals/RELEASE # DESCRIPTION