MLA-Gobo <[EMAIL PROTECTED]> wrote:
> [...] I'm thinking of something like deborphan; show those programs that
> nothing depends upon. [...]
Here's a script that finds Programs which nothing depends on and
haven't been accessed in the last 30 days. Think of it as like
deborphan - popcon = ListUnpopular
#!/usr/bin/env zsh
. GoboPath
# print banner
cat >&2 <<EOF
ListUnpopular 1.0 - show programs which are not used in a month
(Copyright 2007 MJ Ray. Released under GNU GPL v2.)
EOF
typeset -A vidita
# Pass one, memorise all seen deps
find ${goboPrograms} -maxdepth 1 -type d -printf '%P\n' | while read prog ; do
cut -f1 '-d ' ${goboPrograms}/$prog/Current/Resources/Dependencies
2>/dev/null | while read depdo ; do
vidita[$depdo]=1
done
done
# Pass two, check stuff we don't dep on
find ${goboPrograms} -maxdepth 1 -type d -printf '%P\n' | while read prog ; do
if [ -z "${vidita[$prog]}" ] \
&& [ -e "${goboPrograms}/$prog/Current/" ] \
&& [ -z "$(find ${goboPrograms}/$prog/Current/ -path '*/Resources'
-prune -o -type f -atime -30 -print )" ] ; then
echo $prog
fi
done
Hope that helps,
--
MJ Ray - see/vidu http://mjr.towers.org.uk/email.html
Experienced webmaster-developers for hire http://www.ttllp.co.uk/
Also: statistician, sysadmin, online shop builder, workers co-op.
Writing on koha, debian, sat TV, Kewstoke http://mjr.towers.org.uk/
_______________________________________________
gobolinux-devel mailing list
[email protected]
http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel