You are not logged in.

#1 2014-02-24 07:30:54

The Compiler
Member
From: Switzerland
Registered: 2011-05-01
Posts: 214
Website

aurood: Find installed AUR packages which are out of date.

I was getting annoyed by having some AUR packages installed which are out of date, and maybe were so for some time. So I wanted to find all out-of-date packages so I can bug the maintainer and maybe overtake the package if they don't care.

Since there didn't seem to be a finished solution, I did something quick myself, in python. Figured it might be useful for other people. It needs python-requests.

#!/usr/bin/python
# by: Florian Bruhin (The Compiler) <aurood@the-compiler.org>
# I hereby place this code in the public domain.

import subprocess
import requests

out = subprocess.check_output(['pacman', '-Qm'], universal_newlines=True)
pkgs = [pkg.split()[0] for pkg in out.split('\n') if pkg]

payload = {'type': 'multiinfo', 'arg[]': pkgs}
json = requests.get('https://aur.archlinux.org/rpc.php', params=payload).json()

for result in json['results']:
    if result['OutOfDate']:
        print(result['Name'])

>>> from __future__ import braces
  File "<stdin>", line 1
SyntaxError: not a chance

Offline

#2 2014-02-24 07:31:45

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: aurood: Find installed AUR packages which are out of date.

Nice one! Thank you.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-02-24 10:19:44

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: aurood: Find installed AUR packages which are out of date.

How is this different from cower?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2014-02-24 10:24:55

The Compiler
Member
From: Switzerland
Registered: 2011-05-01
Posts: 214
Website

Re: aurood: Find installed AUR packages which are out of date.

graysky wrote:

How is this different from cower?

I'll answer to that with another question: How can cower do what this does?

Maybe it can do the same thing indeed, but I didn't find any way.

My script doesn't check which packages are newer on AUR than installed locally (that's what AUR helpers are for), it checks if any package installed locally is marked as "out of date" in the AUR. Basically like aurphan just for out of date instead of orphaned.


>>> from __future__ import braces
  File "<stdin>", line 1
SyntaxError: not a chance

Offline

#5 2014-02-24 11:14:49

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: aurood: Find installed AUR packages which are out of date.

You can do

cower -i --format "%n %t\n" $(pacman -Qqm) | awk '/ yes/ {print $1}'

but it's slower than aurood.

I'm not sure what '--no-ignore-ood' does:

man cower wrote:

       --no-ignore-ood
           The reverse of --ignore-ood.

       -o, --ignore-ood
           Ignore all results marked as out of date.

Offline

#6 2014-02-24 11:47:52

progandy
Member
Registered: 2012-05-17
Posts: 5,196

Re: aurood: Find installed AUR packages which are out of date.

Very nice, added it to my ~/bin
If you have a very large amount of AUR packages (>100) you might run into some limitation for the url length. Consider splitting the pkgs-list into smaller chunks. Also use "-Qqm", which gives cleaner pacman output and removes some splitting from your python code.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

Board footer

Powered by FluxBB