www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/01/17/14:02:11

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; q=dns; s=default; b=yVU
qPzYwpm9SzTDJuFIasi65LYig1NDNU2ckv3yWg64PGNKikqT54EF5OfCa1YEmI30
bWKCDhHg8mk0cAqW0GCrjrmZm3lmu75tajsgwQoHQo2adJ9ErfoaWdcSMEgL7HkL
Hyq7iYmPSOyUnKRHNMlNXaAzQSxu1jPXEMdrEanM=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; s=default; bh=P46ATtCYV
9ywJ8glo5cdJEUCfiE=; b=s/YKNsuShkwBiHvWULWA/qNUiyYBSEPbVLC2mS7qv
eCVa0o7ewmzBw00ZC1Rpaxxv5hiyZk3F46DtFTuJLPRWc4ySoISTiNdYP473zuHS
cDV0V9NgopG8w5w4noczyvzzfDLDWsKlvZk8YWNbiDxlx+LDzYDWGoXpKlmFyoDn
qo=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=
X-HELO: USA7109MR003.ACS-INC.COM
From: "Nellis, Kenneth (Conduent)" <Kenneth DOT Nellis AT conduent DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: separating cygcheck -f package name from version
Date: Tue, 17 Jan 2017 19:01:54 +0000
Message-ID: <0D835E9B9CD07F40A48423F80D3B5A704BBDBE05@USA7109MB022.na.xerox.net>
MIME-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id v0HJ29MY000606

I want to be able to extract a package's name from its version
information output by cygcheck -f. For many packages it is 
easy: just strip off after the first hyphen; for example:

$ cygcheck -f /usr/bin/find
findutils-4.6.0-1
$ cygcheck -f /usr/bin/find | cut -d- -f1
findutils
$

But, then there are cases where both the package name and the
version have multiple hyphens:

$ cygcheck -f /usr/share/man/man3p/wcstoimax.3p
man-pages-posix-2013-a-1
$ cygcheck -c man-pages-posix
Cygwin Package Information
Package              Version        Status
man-pages-posix      2013-a-1       OK
$

So, looking for ideas how best to do this.

--Ken Nellis

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019