You are not logged in.

#51 2010-06-25 17:08:28

CosineQuaNon
Member
Registered: 2010-05-23
Posts: 28

Re: Paconky: displays repo and AUR pkg info in conky

Haha, sorry about that. I did a text search, but I guess that didn't pick it up.

Offline

#52 2010-08-11 11:51:20

cga
Member
Registered: 2010-08-11
Posts: 25

Re: Paconky: displays repo and AUR pkg info in conky

Hi Xyne,

I've been reading the thread after the perl script.
I've installed rebase and put it at cron.hourly.
I saved the script as is and I've added the execi line to my .conkyrc:

${font :style=Bold}Pacman/AUR${font} ${hr 2}
${execpi 3600  .conkyscripts/ex_paconky.pl}

I only have one question/remark:

EDIT:

I was wrong.......

cga@gwenllian:~$ ps -ef | grep conky
cga      15514 16074  0 13:39 pts/5    00:00:08 conky
cga      21285 15514 99 13:58 pts/5    00:00:20 /usr/bin/perl .conkyscripts/ex_paconky.pl

sorry.

EDIT 2:

you might be interested in this error I get when launching the script manually and even when conky calls it at startup:

error: undefined fpath while loading config

conky works anyway, but I thought it might be good to know.


--
cga

Last edited by cga (2010-08-11 12:04:43)

Offline

#53 2010-08-13 23:47:46

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,535
Website

Re: Paconky: displays repo and AUR pkg info in conky

@cga
Can you post the full output when running the script manually?

You are running the script from this post, with the latest verson of perl-xyne-arch installed, right?


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#54 2010-08-14 08:28:33

cga
Member
Registered: 2010-08-11
Posts: 25

Re: Paconky: displays repo and AUR pkg info in conky

Xyne wrote:

@cga
Can you post the full output when running the script manually?

You are running the script from this post, with the latest verson of perl-xyne-arch installed, right?

Hi Xyne,

yes, that is the script i copied (except that i modified the conky colors attributes) and use by following all of your indication, i got perl-xyne-arch from aur.

here's the output on manual invocation:

cga@gwenllian:~$ perl .conkyscripts/ex_paconky.pl
error: undefined fpath while loading config
${color1}local packages ${alignr}${color1}up-to-datecga@gwenllian:~$ 

so i guess that the error comes from my mods. i'm copying the original again and see where i do wrong.

Offline

#55 2010-08-14 08:34:56

cga
Member
Registered: 2010-08-11
Posts: 25

Re: Paconky: displays repo and AUR pkg info in conky

cga wrote:

so i guess that the error comes from my mods. i'm copying the original again and see where i do wrong.

mmm nope.

even with original script i get the same error:

cga@gwenllian:.conkyscripts$ perl or_packonky.pl
error: undefined fpath while loading config
${color1}local packages ${alignr}${color2}up-to-datecga@gwenllian:.conkyscripts$ 

cheers

--
cga

Offline

#56 2010-08-14 13:10:20

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,535
Website

Re: Paconky: displays repo and AUR pkg info in conky

I hadn't realized it before but the script assumes that bauerbill is installed and tries to load the default configuration file. If it works without it then you can ignore the error message, otherwise simply install bauerbill from the repo on my site or the AUR (it's only 32 kB).

Btw, perl-xyne-arch is no longer available in the AUR. You are almost certainly using the version from [community].


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#57 2010-08-14 13:22:07

cga
Member
Registered: 2010-08-11
Posts: 25

Re: Paconky: displays repo and AUR pkg info in conky

Xyne wrote:

I hadn't realized it before but the script assumes that bauerbill is installed and tries to load the default configuration file. If it works without it then you can ignore the error message, otherwise simply install bauerbill from the repo on my site or the AUR (it's only 32 kB).

Btw, perl-xyne-arch is no longer available in the AUR. You are almost certainly using the version from [community].

Well the script works fine even w/o baurbill so I'll keep it like this.
thanks for support.

--
cga

Offline

#58 2010-09-06 18:14:14

cga
Member
Registered: 2010-08-11
Posts: 25

Re: Paconky: displays repo and AUR pkg info in conky

cga wrote:
Xyne wrote:

I hadn't realized it before but the script assumes that bauerbill is installed and tries to load the default configuration file. If it works without it then you can ignore the error message, otherwise simply install bauerbill from the repo on my site or the AUR (it's only 32 kB).

Btw, perl-xyne-arch is no longer available in the AUR. You are almost certainly using the version from [community].

Well the script works fine even w/o baurbill so I'll keep it like this.
thanks for support.

--
cga

Hi Xyne,

I don't know what it could be but after a while that installed bauerbill your script (from this thread) started to hog CPU and RAM, so I removed it.

Do you mind if I fork paconky (bash version w/ related lib) and keep it alive?

Unless you can help here I don't have my other options.

Offline

#59 2010-09-06 18:47:45

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,535
Website

Re: Paconky: displays repo and AUR pkg info in conky

@cga
I recently added a "Threads" option to Powerpill/Bauerbill to disable Perl's heavy threads to alleviate the CPU & memory issue. Here's a tweaked version of the earlier script that  only uses one thread and much less memory and CPU:

#!/usr/bin/perl
use strict;
use warnings;

use Xyne::Arch::Bauerbill;


my $n_threads = 1;


my $bb = Xyne::Arch::Bauerbill->new({autoload=>1});
$bb->{AUR}->{CALLBACK}->{QUIET} = 1;
$bb->{PowerpillConf}->set_value('Threads', $n_threads);
$bb->{AUR}->{THREADS} = $n_threads;

my @repopkgs = sort $bb->get_upgradable_pkgnames();
my @aurpkgs = sort $bb->{AUR}->get_upgradable();

my %versions;
$versions{$_} = ($bb->{AUR}->get_versions($_))[0] foreach @aurpkgs;
$versions{$_} = $bb->get_sync_db_pkg_ver($_) foreach @repopkgs;

if (not @repopkgs and not @aurpkgs)
{
  print '${color1}local packages ${alignr}${color2}up-to-date';
  exit();
}

my $groups = $bb->group_pkgnames_by_repo(@repopkgs);

foreach my $reponame ($bb->get_repo_list)
{
  if (ref($groups->{$reponame}) eq 'ARRAY')
  {
    &display($reponame, @{$groups->{$reponame}});
  }
}

if (@aurpkgs)
{
  &display('AUR',@aurpkgs);
}


sub display
{
  my ($name,@pkgs) = @_;
  my $n = scalar(@pkgs);
  my $msg = ($n > 1) ? "$n new pkgs" : '1 new pkg';
  print '${color1}[${color2}'.$name.'${color1}]${alignr}${color3}'.$msg.'${voffset 0}${color3}'."\n";
  foreach my $pkg (@pkgs)
  {
    print $pkg.'${alignr}'.$versions{$pkg}."\n";
  }
  print "\${voffset 5}\n";
}

If that isn't sufficient and you prefer to fork the Bash code, go ahead... it's open-source after all wink


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#60 2010-09-06 19:24:29

cga
Member
Registered: 2010-08-11
Posts: 25

Re: Paconky: displays repo and AUR pkg info in conky

Xyne wrote:

@cga
I recently added a "Threads" option to Powerpill/Bauerbill to disable Perl's heavy threads to alleviate the CPU & memory issue. Here's a tweaked version of the earlier script that  only uses one thread and much less memory and CPU:

#!/usr/bin/perl
use strict;
use warnings;

use Xyne::Arch::Bauerbill;


my $n_threads = 1;


my $bb = Xyne::Arch::Bauerbill->new({autoload=>1});
$bb->{AUR}->{CALLBACK}->{QUIET} = 1;
$bb->{PowerpillConf}->set_value('Threads', $n_threads);
$bb->{AUR}->{THREADS} = $n_threads;

my @repopkgs = sort $bb->get_upgradable_pkgnames();
my @aurpkgs = sort $bb->{AUR}->get_upgradable();

my %versions;
$versions{$_} = ($bb->{AUR}->get_versions($_))[0] foreach @aurpkgs;
$versions{$_} = $bb->get_sync_db_pkg_ver($_) foreach @repopkgs;

if (not @repopkgs and not @aurpkgs)
{
  print '${color1}local packages ${alignr}${color2}up-to-date';
  exit();
}

my $groups = $bb->group_pkgnames_by_repo(@repopkgs);

foreach my $reponame ($bb->get_repo_list)
{
  if (ref($groups->{$reponame}) eq 'ARRAY')
  {
    &display($reponame, @{$groups->{$reponame}});
  }
}

if (@aurpkgs)
{
  &display('AUR',@aurpkgs);
}


sub display
{
  my ($name,@pkgs) = @_;
  my $n = scalar(@pkgs);
  my $msg = ($n > 1) ? "$n new pkgs" : '1 new pkg';
  print '${color1}[${color2}'.$name.'${color1}]${alignr}${color3}'.$msg.'${voffset 0}${color3}'."\n";
  foreach my $pkg (@pkgs)
  {
    print $pkg.'${alignr}'.$versions{$pkg}."\n";
  }
  print "\${voffset 5}\n";
}

If that isn't sufficient and you prefer to fork the Bash code, go ahead... it's open-source after all wink

Hi Xyne,

I give this new script a shot.

If it works good, I'll keep it otherwise I'll fork smile

viva FLOSS wink

Offline

#61 2010-09-06 19:36:38

cga
Member
Registered: 2010-08-11
Posts: 25

Re: Paconky: displays repo and AUR pkg info in conky

mmmm something seems wrong here:

cga@gwenllian:~$ cat .conkyscripts/paconky.pl
#!/usr/bin/perl

use strict;
use warnings;

use Xyne::Arch::Bauerbill;

my $n_threads = 1;

my $bb = Xyne::Arch::Bauerbill->new({autoload=>1});
$bb->{AUR}->{CALLBACK}->{QUIET} = 1;
$bb->{PowerpillConf}->set_value('Threads', $n_threads);
$bb->{AUR}->{THREADS} = $n_threads;

my @repopkgs = sort $bb->get_upgradable_pkgnames();
my @aurpkgs = sort $bb->{AUR}->get_upgradable();

my %versions;
$versions{$_} = ($bb->{AUR}->get_versions($_))[0] foreach @aurpkgs;
$versions{$_} = $bb->get_sync_db_pkg_ver($_) foreach @repopkgs;

if (not @repopkgs and not @aurpkgs)
{
  print '${color1}local packages ${alignr}${color2}up-to-date';
  exit();
}

my $groups = $bb->group_pkgnames_by_repo(@repopkgs);

foreach my $reponame ($bb->get_repo_list)
{
  if (ref($groups->{$reponame}) eq 'ARRAY')
  {
    &display($reponame, @{$groups->{$reponame}});
  }
}

if (@aurpkgs)
{
  &display('AUR',@aurpkgs);
}


sub display
{
  my ($name,@pkgs) = @_;
  my $n = scalar(@pkgs);
  my $msg = ($n > 1) ? "$n new pkgs" : '1 new pkg';
  print '${color1}[${color2}'.$name.'${color1}]${alignr}${color3}'.$msg.'${voffset 0}${color3}'."\n";
  foreach my $pkg (@pkgs)
  {
    print $pkg.'${alignr}'.$versions{$pkg}."\n";
  }
  print "\${voffset 5}\n";
}
cga@gwenllian:~$ 
cga@gwenllian:~$ conky &
[3] 21262
cga@gwenllian:~$ Conky: desktop window (1e01807) is subwindow of root window (15e)
Conky: window type - override
Conky: drawing to created window (0x6600001)
Conky: drawing to double buffer
.conkyscripts/paconky.pl: line 3: use: command not found
.conkyscripts/paconky.pl: line 4: use: command not found
.conkyscripts/paconky.pl: line 6: use: command not found
.conkyscripts/paconky.pl: line 8: my: command not found
.conkyscripts/paconky.pl: line 10: syntax error near unexpected token `('
.conkyscripts/paconky.pl: line 10: `my $bb = Xyne::Arch::Bauerbill->new({autoload=>1});'

Offline

#62 2010-09-06 22:26:25

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,535
Website

Re: Paconky: displays repo and AUR pkg info in conky

You don't seem to be executing the script. You seem to be trying to insert the content of the script directly.

Are you running it exactly the same way that you ran the old script?

What's the output of running the script in a terminal?
Make sure that you're running it in conky using "execpi" too... the same way you ran the last one. Post the line from your conkyrc file that you're using to run it if you don't see anything wrong with it.

Btw, I just thought of something else... did you use a 1 hour interval with the last script? If you forgot to set it to an hour it would run every time conky itself updates, which would really eat up CPU and memory.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#63 2010-09-07 06:16:03

cga
Member
Registered: 2010-08-11
Posts: 25

Re: Paconky: displays repo and AUR pkg info in conky

Xyne wrote:

You don't seem to be executing the script. You seem to be trying to insert the content of the script directly.

Are you running it exactly the same way that you ran the old script?

What's the output of running the script in a terminal?
Make sure that you're running it in conky using "execpi" too... the same way you ran the last one. Post the line from your conkyrc file that you're using to run it if you don't see anything wrong with it.

Btw, I just thought of something else... did you use a 1 hour interval with the last script? If you forgot to set it to an hour it would run every time conky itself updates, which would really eat up CPU and memory.

Hi Xyne,

my bad: I copied the old execpi line for some other bash script and forgot to remove sh before path/to/script hmm

the old script was running with execpi 3600 , so an hour yes. (and of course everytime i modified .conkyrc)

thanks for help

i let you know how this is going.

Offline

#64 2010-09-08 17:31:06

cga
Member
Registered: 2010-08-11
Posts: 25

Re: Paconky: displays repo and AUR pkg info in conky

Hi Xyne,

the (new) script is working gret this time smile kudos.

I only would like to understand how to show only

[core]          #new pckgs (or up-to-date)
[extra]        #new pckgs (or up-to-date)
[comm]      #new pckgs (or up-to-date)
[AUR]         #new pckgs (or up-to-date)

instead of having the lists too.

Most of the time the lists are too long and mess my conky look. I'd like to keep it at a constant dimension.
At the end of the day, what i really need is to know about updates, not what is going to be updated.

Thanks

Offline

#65 2010-09-09 03:19:30

jalu
Member
Registered: 2009-04-05
Posts: 140

Re: Paconky: displays repo and AUR pkg info in conky

Is there currently a known issue about paconky not printing output? I am currently using 2.4-1. My configuration is as follows (it's based on the example given in the manual), but using paconky .paconky prints nothing.

.paconky

New Repo Pkgs %PKG%

Execution

$ paconky .paconky
$ 

edit: I just realized that I recently did a pacman -Syu. I guess that would explain the empty output. Epic facepalm. :-)
Thanks for what looks to be a fantastic little tool. I can't wait to start using it.

Last edited by jalu (2010-09-09 03:55:50)

Offline

#66 2010-09-09 22:39:22

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,535
Website

Re: Paconky: displays repo and AUR pkg info in conky

@cga
The "display" sub at the end of the script is what actually displays the output. Just comment out the "foreach" loop that prints out the package list if you do not want to display it.

You should be able to tweak the rest of the output too just by looking at the code in that section and the output that it generates when you run the script, even if you don't know any Perl. wink

Of course, if you know Perl, you could do even more, such as limiting the list to 5 items or only displaying "important" packages.





@jalu
If paconky doesn't work for whatever reason, try the perl script.



@everyone
The alternative perl script is now on the paconky project page.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#67 2010-09-14 09:33:03

koral
Member
Registered: 2010-08-05
Posts: 26

Re: Paconky: displays repo and AUR pkg info in conky

Is it normal that it takes 30 seconds to 1 minute to output the text ? Could be enough since I only want to update it every 10 minutes, but I still can't understand why such a simple thing takes so long...

Offline

#68 2010-09-14 19:08:50

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,535
Website

Re: Paconky: displays repo and AUR pkg info in conky

@koral

It has to send a request for every foreign package that you have on your system (pacman -Qqm). You could increase the number of threads to make it go faster (assuming you're using the Perl script), but there really is no reason to do so as it's just a background process displaying information in Conky, i.e. you're not sat in front of it waiting for it to finish.

Also, checking for updates every 10 minutes is not only pointless (the AUR doesn't move that fast), it's also a waste of the server's resources and thus very selfish and rude. The minimum interval that you should use is 1 hour. Anything shorter is just abuse.* 





* If you really need to know about an available update within 10 minutes of its release, write a custom script just for that package... and feel free to explain what could possible merit such urgency.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#69 2010-09-14 19:35:58

cga
Member
Registered: 2010-08-11
Posts: 25

Re: Paconky: displays repo and AUR pkg info in conky

Xyne wrote:

@cga
The "display" sub at the end of the script is what actually displays the output. Just comment out the "foreach" loop that prints out the package list if you do not want to display it.

You should be able to tweak the rest of the output too just by looking at the code in that section and the output that it generates when you run the script, even if you don't know any Perl. wink

Of course, if you know Perl, you could do even more, such as limiting the list to 5 items or only displaying "important" packages.

Hi Xyne,

I see your answer only now, my subscription didn't notify me of your answer hmm

I don't know any any Perl unfortunately. I can only code BASH at the moment and I'm learning Ruby. Perl is on the list as C++ and Qt are, actually after them tongue.

Anyway, I'll try to get the wanted result and post it here as a contribution if I manage to. That day you are free to include it as an option if you please.

thanks

ps: removing the foreach was easy and it's half the need tongue

Offline

#70 2010-09-14 19:57:48

koral
Member
Registered: 2010-08-05
Posts: 26

Re: Paconky: displays repo and AUR pkg info in conky

@Xyne

Waw, I wasn't expecting such a kind answer from you 0o. I just didn't know it needed to query the servers to get that information, please excuse my ignorance. I thought your script was only retrieving information from the local database, and that queries to servers were done during the "pacman -Su" command (which I happen to do every hour).

Offline

#71 2010-09-14 21:34:46

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,535
Website

Re: Paconky: displays repo and AUR pkg info in conky

@cga
I intend to eventually convert the script into a fully configurable application, but it is very far down on my agenda.


koral wrote:

@Xyne
Waw, I wasn't expecting such a kind answer from you 0o. I just didn't know it needed to query the servers to get that information, please excuse my ignorance.

If you read my reply with a negative tone, it was unintentional.  Sorry about that. It's difficult to convey tone in forum posts and I probably don't use enough smileys. I was admittedly a little unhappy about the 10 minute interval though, but only because I stressed the recommended interval length in the original post of this thread.

koral wrote:

I thought your script was only retrieving information from the local database, and that queries to servers were done during the "pacman -Su" command (which I happen to do every hour).

It queries the sync database to detect available upgrades for packages in the repositories, but it has to query the AUR server for packages in the AUR as there is no other way to know if an upgrade is available.

Btw, just in case it wasn't a typo, the command to update the sync database is "pacman -Sy".


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#72 2010-09-15 06:59:42

koral
Member
Registered: 2010-08-05
Posts: 26

Re: Paconky: displays repo and AUR pkg info in conky

Xyne wrote:

If you read my reply with a negative tone, it was unintentional.  Sorry about that. It's difficult to convey tone in forum posts and I probably don't use enough smileys. I was admittedly a little unhappy about the 10 minute interval though, but only because I stressed the recommended interval length in the original post of this thread.

I only read the manual before posting (what a bad habit, isn't it ? smile ). I then suggest you stress it in the manual too.

Xyne wrote:

It queries the sync database to detect available upgrades for packages in the repositories, but it has to query the AUR server for packages in the AUR as there is no other way to know if an upgrade is available.

If I don't put any feedback about AUR packages (I mean: no %AUR_XXX% variable in my textfile), does it still perform queries to AUR server ?

Xyne wrote:

Btw, just in case it wasn't a typo, the command to update the sync database is "pacman -Sy".

Was a typo, but thanks anyway smile . (I might have used a lot of smileys in this post smile ).

Offline

#73 2010-09-15 17:37:44

cga
Member
Registered: 2010-08-11
Posts: 25

Re: Paconky: displays repo and AUR pkg info in conky

Xyne wrote:

@cga
I intend to eventually convert the script into a fully configurable application, but it is very far down on my agenda.

Hi Xyne,

I hope that day comes soon.

I'm trying to modify paconky.pl without success, I definitely suck at Perl hmm

I can move the if norepopkg no aurpkgs to get a list of up-to-date, but I really cannot get the wanted result with each value for single repo and aur.

sudo make me a sandwich! tongue

Offline

#74 2010-09-15 17:57:16

cga
Member
Registered: 2010-08-11
Posts: 25

Re: Paconky: displays repo and AUR pkg info in conky

@Xyne:

this is what I'm trying anyway:

cga@gwenllian:~$ cat .conkyscripts/paconky.pl
#!/usr/bin/perl

use strict;
use warnings;
use Xyne::Arch::Bauerbill;

my $n_threads = 1;
my $bb = Xyne::Arch::Bauerbill->new({autoload=>1});

$bb->{AUR}->{CALLBACK}->{QUIET} = 1;
$bb->{PowerpillConf}->set_value('Threads', $n_threads);
$bb->{AUR}->{THREADS} = $n_threads;

my @repopkgs = sort $bb->get_upgradable_pkgnames();
my @aurpkgs = sort $bb->{AUR}->get_upgradable();

my %versions;
$versions{$_} = ($bb->{AUR}->get_versions($_))[0] foreach @aurpkgs;
$versions{$_} = $bb->get_sync_db_pkg_ver($_) foreach @repopkgs;

my $groups = $bb->group_pkgnames_by_repo(@repopkgs);

foreach my $reponame ($bb->get_repo_list)
{
  if (ref($groups->{$reponame}) eq 'ARRAY')
  {
    &display($reponame, @{$groups->{$reponame}});
  }
}

sub display
{
  my ($name,@pkgs) = @_;
  my $n = scalar(@pkgs);
  if (not @repopkgs and not @aurpkgs)
  {
    my $msg = "up-to-date";
    print '${color1}[${color1}'.$name.'${color1}]${alignr}${color1}'.$msg.'${voffset 0}${color1}'."\n";
    print '${color1}[${color1}'.'AUR'.'${color1}]${alignr}${color1}'.$msg.'${voffset 0}${color1}'."\n";
    exit();
  }

  if ($n > 1)
  { my $msg = "$n new pkgs";
    print '${color1}[${color1}'.$name.'${color1}]${alignr}${color1}'.$msg.'${voffset 0}${color1}'."\n";
    print '${color1}[${color1}'.'AUR'.'${color1}]${alignr}${color1}'.@aurpkgs.'${voffset 0}${color1}'."\n";
  } else { my $msg = "up-to-date";
    print '${color1}[${color1}'.$name.'${color1}]${alignr}${color1}'.$msg.'${voffset 0}${color1}'."\n";
    print '${color1}[${color1}'.'AUR'.'${color1}]${alignr}${color1}'.@aurpkgs.'${voffset 0}${color1}'."\n";
  }
}

mmmmmmmm hmm

edit: I think I should kind of loop the check for pacakges and set $msg for each repo accordingly, but I don't know Perl that much (at all...)

Last edited by cga (2010-09-15 18:00:56)

Offline

#75 2010-09-18 00:19:19

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,535
Website

Re: Paconky: displays repo and AUR pkg info in conky

@cga
Is this what you want?

#!/usr/bin/perl
use strict;
use warnings;

use Xyne::Arch::Bauerbill;


my $n_threads = 1;


my $bb = Xyne::Arch::Bauerbill->new({autoload=>1});
$bb->{AUR}->{CALLBACK}->{QUIET} = 1;
$bb->{PowerpillConf}->set_value('Threads', $n_threads);
$bb->{AUR}->{THREADS} = $n_threads;

my @repopkgs = sort $bb->get_upgradable_pkgnames();
my @aurpkgs = sort $bb->{AUR}->get_upgradable();

my %versions;
$versions{$_} = ($bb->{AUR}->get_versions($_))[0] foreach @aurpkgs;
$versions{$_} = $bb->get_sync_db_pkg_ver($_) foreach @repopkgs;


my $groups = $bb->group_pkgnames_by_repo(@repopkgs);

foreach my $reponame ($bb->get_repo_list)
{
  if (ref($groups->{$reponame}) eq 'ARRAY')
  {
    &display($reponame, @{$groups->{$reponame}});
  }
  else
  {
    &display($reponame);
  }
}

if (@aurpkgs)
{
  &display('AUR',@aurpkgs);
}


sub display
{
  my ($name,@pkgs) = @_;
  my $msg;
  if (@pkgs)
  {
    my $n = scalar(@pkgs);
    $msg = ($n > 1) ? "$n new pkgs" : '1 new pkg';
  }
  else
  {
    $msg = "up-to-date";
  }
  print '${color1}[${color2}'.$name.'${color1}]${alignr}${color3}'.$msg.'${voffset 0}${color3}'."\n";
  print "\${voffset 5}\n";
}

Last edited by Xyne (2010-09-25 16:56:50)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB