public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Ulrich Mueller <ulm@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] RFD: Replacement for versionator.eclass in PMS (for EAPI 7?)
Date: Mon, 7 Dec 2015 08:41:13 +0100	[thread overview]
Message-ID: <22117.14361.364844.986597@a1i15.kph.uni-mainz.de> (raw)
In-Reply-To: <20151207053750.GA23517@meriadoc>

[-- Attachment #1: Type: text/plain, Size: 693 bytes --]

>>>>> On Mon, 7 Dec 2015, Jason Zaman wrote:

> Can we also have get_version_component_count() in there?

> I have a package that likes to change the number of parts so I need
> to know how many parts before I can split it up.

> Basically this:
> if [[ $(get_version_component_count) -eq 6 ]]; then
> 	STUDIO_V=$(get_version_component_range 1-4)
> 	BUILD_V=$(get_version_component_range 5-6)
> else
> 	STUDIO_V=$(get_version_component_range 1-3)
> 	BUILD_V=$(get_version_component_range 4-5)
> fi

You could use a condition like:

    if [[ -n $(version_cut 6) ]]; then

This assumes that the function would simply return an empty string
when trying to read after the last component.

Ulrich

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

      parent reply	other threads:[~2015-12-07  7:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-28 21:14 [gentoo-dev] RFD: Replacement for versionator.eclass in PMS (for EAPI 7?) Ulrich Mueller
2015-11-29 23:23 ` Peter Stuge
2015-11-30  6:28   ` Michał Górny
2015-12-02 11:03 ` Alexis Ballier
2015-12-02 12:04   ` Ulrich Mueller
2015-12-02 12:18     ` Alexis Ballier
2015-12-07  5:37 ` Jason Zaman
2015-12-07  7:00   ` Michał Górny
2015-12-07  7:41   ` Ulrich Mueller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22117.14361.364844.986597@a1i15.kph.uni-mainz.de \
    --to=ulm@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox