Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <jacmet@uclibc.org>
To: buildroot@busybox.net
Subject: [Buildroot] Bug in pkg-stats?
Date: Wed, 05 Oct 2011 20:36:34 +0200	[thread overview]
Message-ID: <87sjn7nv4d.fsf@macbook.be.48ers.dk> (raw)
In-Reply-To: <ADE657CA350FB648AAC2C43247A983F001F39DCFE877@AUSP01VMBX24.collaborationhost.net> (H. Hartley Sweeten's message of "Wed, 5 Oct 2011 12:09:41 -0500")

>>>>> "H" == H Hartley Sweeten <hartleys@visionengravers.com> writes:

Hi,

 H>     version=""

 H>     if grep -m1 "_VERSION" $i > /dev/null ; then
 H> 	version=`grep -m1 "_VERSION" $i | awk '{ print $NF }'`
 H>     else
 H> 	version="unknown"
 H>     fi

 H> This works fine for the packages that have _VERSION defined like:

 H> FOO_VERSION = x.y.z

 H> But it ends up with the whole line when the spaces are missing around the
 H> '='.  Oh well...

You could simply do it awk:

version=$(awk -F'=| ' '/_VERSION/ { print $NF } END { print "unknown" } ' \
          $i | head -n 1)

But it naturally still doesn't work for packages with multiple versions
(like busybox) or where version is major.minor (like glib2).

-- 
Bye, Peter Korsgaard

  reply	other threads:[~2011-10-05 18:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-04 22:35 [Buildroot] Bug in pkg-stats? H Hartley Sweeten
2011-10-04 23:05 ` H Hartley Sweeten
2011-10-05  6:43   ` Thomas Petazzoni
2011-10-05 17:09     ` H Hartley Sweeten
2011-10-05 18:36       ` Peter Korsgaard [this message]
2011-10-05 18:52         ` H Hartley Sweeten
2011-10-05 19:08           ` Peter Korsgaard
2011-10-06  7:52             ` Thomas Petazzoni

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=87sjn7nv4d.fsf@macbook.be.48ers.dk \
    --to=jacmet@uclibc.org \
    --cc=buildroot@busybox.net \
    /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