You are not logged in.
Is there a way to search for recently orphaned packages in the AUR?
In the web search there is no such search option, or at least I can not find it.
There is the option to list all orphaned packages. Would be nice to be able to sort it by orphan-date.
I think this could help users that want to adopt packages finding new candidates.
Last edited by michis (2016-02-02 20:01:00)
Offline
Ok, there is the option to sort by 'Last modified'.
If orphaning a package counts as a modification then sorting by last modified will do what i am looking for.
So, new question is:
Does orphaning a package count as modification that is recognized by the 'Last modified' search filter?
Offline
No. The last modified field is only updated when a new PKGBUILD is uploaded afaik.
Offline
Ok, then back to the original question...
Is there a way to search for recently orphaned packages in the AUR?
Offline
Here's a "poor man's" way to do it. Install python3-aur and save this script as e.g. "aur-orphans":
#!/usr/bin/env python3
import AUR.RPC
aur = AUR.RPC.AUR(full_info=False)
for p in aur.get('msearch', None):
print(p['Name'])
Use the script to create dated orphan lists:
aur-orphans.py | sort > $(date +%F).txt
Run the script again another day to generate a new list and use comm to see the new orphans:
comm -13 old_list.txt new_list.txt
It should be easy to wrap that all up in a nice little script.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Thanks Xyne, I'll try it out..
Offline
aur-orphans.py | sort > $(date +%F).txt
Is the sort command necessary? Seems the output of the python script is already sorted...
Offline
ok, it is ... comm: file 1 is not in sorted order
It should be easy to wrap that all up in a nice little script.
This is what I have so far...
#!/bin/bash
old_list=$HOME/.old-aur-orphaned.txt
new_list=$HOME/.new-aur-orphaned.txt
if [ ! -f ${old_list} ]; then
echo "First run, creating initial list of orphaned packages."
/usr/local/bin/aur-orphans | sort > ${old_list}
exit 0
fi
echo "Creating list of current orphaned packages"
/usr/local/bin/aur-orphans | sort > ${new_list}
echo "Orphaned packages since last run:"
comm -13 ${old_list} ${new_list}
mv ${new_list} ${old_list}
Thanks again.
Last edited by michis (2016-02-01 23:53:55)
Offline
Replaced your python script with cower
#!/bin/bash
old_list=$HOME/.old-aur-orphaned.txt
new_list=$HOME/.new-aur-orphaned.txt
if [ ! -f ${old_list} ]; then
echo "First run, creating initial list of orphaned packages."
cower -qm "" | sort > ${old_list}
exit 0
fi
echo "Creating list of current orphaned packages"
cower -qm "" | sort > ${new_list}
echo "Orphaned packages since last run:"
comm -13 ${old_list} ${new_list}
mv ${new_list} ${old_list}
This should work i think, but I am wondering if it's worth to file a feature request for an option to sort orphaned packages by orphan-date in the AUR web-interface?
Offline
Replaced your python script with cower
Just in case it was because of the speed, I have added an option to increase it in the backend. It's now consistently just a little faster at retrieving the list than cower on my system
Anyway, use whatever works best for you.
edit
And yeah, post a request to the aur-dev mailing list. There are a few ideas under consideration for the RPC interface so now is the time to throw your own into the mix.
Last edited by Xyne (2016-02-02 00:51:11)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
michis wrote:Replaced your python script with cower
Just in case it was because of the speed, ...
The reason was: only one script, only one extra package (cower) needed.
And yeah, post a request to the aur-dev mailing list. There are a few ideas under consideration for the RPC interface so now is the time to throw your own into the mix.
Maybe i'll do it, yet undecided.
Little improvement of the output.
Now it prints highlighted package names and the package descriptions.
#!/bin/bash
#
# This script lists new orphaned AUR packages since it's last execution.
# Dependencies: coreutils grep cower
old_list=$HOME/.old-aur-orphaned.txt
new_list=$HOME/.new-aur-orphaned.txt
if [ ! -f ${old_list} ]; then
echo "First run, creating initial list of orphaned packages."
cower -qm "" | sort > ${old_list}
exit 0
fi
echo "Creating list of current orphaned packages"
cower -qm "" | sort > ${new_list}
orphans=$(comm -13 ${old_list} ${new_list})
echo "Orphaned packages since last run:"
cower --color=always -i ${orphans} 2>/dev/null | grep -E "Name|Description"
mv ${new_list} ${old_list}
EDIT: Since the script works for me now, I'll mark the thread as solved.
Last edited by michis (2016-02-02 20:00:39)
Offline