View Single Post
Posts: 150 | Thanked: 93 times | Joined on Oct 2009 @ Pennsylvania, US
#10
I put together a quick script last night... It'll check any packages that aren't dependencies of mp-fremantle-*-pr (which should exclude most of the pre-installed packages) to see if they place any files in /opt - if they don't it'll let you know that [package_name] isn't optified.

Just copy this code into a file on your device and in x-term type ". ./filename" in the directory the file is in, and you'll get a list of packages that may be a problem. If you see something you don't remember installing, it's probably best to ignore it (as it may be a system package, see below for the reason why).

Code:
getpkg () { dpkg -l $1 | grep -E "^i" | sed -r "s/^.. *//g;s/ +.*$//g"; }
getdepends () { apt-cache depends $1 | grep "Depends:" | sed -r "s/(.*: |<|>)//g"; }
fremantlepkg=$(getpkg mp-fremantle-\*-pr | head -1)
if [ "$fremantlepkg" == "" ]; then echo Missing mp-fremantle-\*-pr package, aborting
else sysdeps="x $fremantlepkg $(getdepends $fremantlepkg) x"; pypaths="";
if [ -e /opt/pymaemo ]; then pypaths="|/usr/lib/python2.5/|/usr/share/pyshared/|/usr/lib/pyshared/|/usr/share/python-support/|/usr/lib/python-support/"; fi
for x in $(getpkg); do
 dpkg -L $x | grep -E "^(/opt/$pypaths)" > /dev/null || echo $sysdeps | grep " $x " > /dev/null || echo $x not optified
done; fi
In another version, I made an attempt at enumerating the entire dependency tree for mp-fremantle-*-pr, but it was too time consuming (after 20 minutes, it was still tracing dependencies). Because the script above doesn't know about every system package, there may be a few packages reported that are system packages and not user installed - most of the noise should be filtered, however.

If you find this useful, feel free to thank me by using this "Thanks!" link

Last edited by rewt; 2010-01-13 at 21:35. Reason: updated to detect mp-fremantle-*-pr package name and recognize python optification
 

The Following 12 Users Say Thank You to rewt For This Useful Post: