Re: [arch-general] How do you extract version from pacman?

2012-07-27 Thread Christian Hesse
Oon-Ee Ng  on Fri, 2012/07/27 11:33:
> Thanks to Morris and Christian (karol too, but rather not have an
> additional package). Can't seem to find a reference to this specific
> behaviour on the pacman manpage, unfortunately, but it'll simplify my
> script.
> 
> Looks like there's no way not to have the last -4 included though, but
> since that's version reference and quite important, I guess no way
> around me having to sed it out. Thanks again =)

Or use cut for that as well:

$ pacman -Q virtualbox | cut -d' ' -f2 | cut -d- -f1
4.1.18
-- 
main(a){char*c=/*Schoene Gruesse */"B?IJj;MEH"
"CX:;",b;for(a/*Chris   get my mail address:*/=0;b=c[a++];)
putchar(b-1/(/*   gcc -o sig sig.c && ./sig*/b/42*2-3)*42);}


Re: [arch-general] How do you extract version from pacman?

2012-07-26 Thread Auguste Pop
On Thu, Jul 26, 2012 at 5:19 PM, Oon-Ee Ng  wrote:
> With the new virtualbox update I had to obtain virtualbox version in a
> script (and of course, virtualbox binary doesn't have a sane --version
> parameter...).
>
> Anyway, its pretty simple to pacman -Qi virtualbox | grep -e
> "^Version" | awk '{print $3}' | sed 's|-.||'
>
> Perhaps it may be nice to have a pacman flag to obtain just the
> version string. I'll file a feature request, but before that anyone
> has an comments on why it would be useless or a bad idea?

$ pacman -Q virtualbox
virtualbox 4.1.18-4
$ vboxmanage -v
4.1.18_OSEr78361


Re: [arch-general] How do you extract version from pacman?

2012-07-26 Thread Martin Cigorraga
On 26 July 2012 06:37, Christian Hesse  wrote:

> Morris  on Thu, 2012/07/26 11:24:
> > On Thu, Jul 26, 2012 at 11:19 AM, Oon-Ee Ng 
> wrote:
> >
>
Or the same with cut:
>
> $ pacman -Q virtualbox | cut -d' ' -f2
> 4.1.18-4
>
> Getting the complete package information is not required.
> -
>

I was just to suggest this!
Anyway, this diversity and broad way to achieve the same goal is what makes
Unix-like OSes so pretty: all roads leads to Rome  ^_^



-- 
-msx


Re: [arch-general] How do you extract version from pacman?

2012-07-26 Thread Oon-Ee Ng
Thanks to Morris and Christian (karol too, but rather not have an
additional package). Can't seem to find a reference to this specific
behaviour on the pacman manpage, unfortunately, but it'll simplify my
script.

Looks like there's no way not to have the last -4 included though, but
since that's version reference and quite important, I guess no way
around me having to sed it out. Thanks again =)


Re: [arch-general] How do you extract version from pacman?

2012-07-26 Thread Karol Blazewicz
>> On Thu, Jul 26, 2012 at 11:19 AM, Oon-Ee Ng  wrote:
>> > Perhaps it may be nice to have a pacman flag to obtain just the
>> > version string. I'll file a feature request, but before that anyone
>> > has an comments on why it would be useless or a bad idea?

Use expac:
$ expac %v -S virtualbox
4.1.18-3

(I don't have it installed, so I had to use '-S').


Re: [arch-general] How do you extract version from pacman?

2012-07-26 Thread Christian Hesse
Morris  on Thu, 2012/07/26 11:24:
> On Thu, Jul 26, 2012 at 11:19 AM, Oon-Ee Ng  wrote:
> 
> > With the new virtualbox update I had to obtain virtualbox version in a
> > script (and of course, virtualbox binary doesn't have a sane --version
> > parameter...).
> >
> > Anyway, its pretty simple to pacman -Qi virtualbox | grep -e
> > "^Version" | awk '{print $3}' | sed 's|-.||'
> >
> > Perhaps it may be nice to have a pacman flag to obtain just the
> > version string. I'll file a feature request, but before that anyone
> > has an comments on why it would be useless or a bad idea?
> >
> 
> you could just use:
> $ pacman -Q virtualbox | awk '{print $2}'
> 4.1.18-4

Or the same with cut:

$ pacman -Q virtualbox | cut -d' ' -f2
4.1.18-4

Getting the complete package information is not required.
-- 
main(a){char*c=/*Schoene Gruesse */"B?IJj;MEH"
"CX:;",b;for(a/*Chris   get my mail address:*/=0;b=c[a++];)
putchar(b-1/(/*   gcc -o sig sig.c && ./sig*/b/42*2-3)*42);}


Re: [arch-general] How do you extract version from pacman?

2012-07-26 Thread Morris
On Thu, Jul 26, 2012 at 11:19 AM, Oon-Ee Ng  wrote:

> With the new virtualbox update I had to obtain virtualbox version in a
> script (and of course, virtualbox binary doesn't have a sane --version
> parameter...).
>
> Anyway, its pretty simple to pacman -Qi virtualbox | grep -e
> "^Version" | awk '{print $3}' | sed 's|-.||'
>
> Perhaps it may be nice to have a pacman flag to obtain just the
> version string. I'll file a feature request, but before that anyone
> has an comments on why it would be useless or a bad idea?
>

you could just use:
$ pacman -Q virtualbox | awk '{print $2}'
4.1.18-4


[arch-general] How do you extract version from pacman?

2012-07-26 Thread Oon-Ee Ng
With the new virtualbox update I had to obtain virtualbox version in a
script (and of course, virtualbox binary doesn't have a sane --version
parameter...).

Anyway, its pretty simple to pacman -Qi virtualbox | grep -e
"^Version" | awk '{print $3}' | sed 's|-.||'

Perhaps it may be nice to have a pacman flag to obtain just the
version string. I'll file a feature request, but before that anyone
has an comments on why it would be useless or a bad idea?