ccollect:0.6.2->0.7.0
[nslu2-linux/optware.git] / scripts / show-outdated-ipk-dir.sh
blob5935e0a873874a542ad7ab938c0f4ce9aa896f2e
1 #!/bin/sh
3 # sample usage:
4 # ./scripts/$0 builds/*-ipk
5 # ./scripts/$0 {nslu2,wl500g}/builds/*-ipk
6 # don't be scared, this program won't actually remove directories
7 # it just prints out 'rm -rf' commands.
9 for d in $*
11 [ -d $d ] || exit -1
12 [ -r $d/CONTROL/control ] || exit -2
13 p=`awk '/^Package:/ {print $2}' $d/CONTROL/control`
14 v=`awk '/^Version:/ {print $2}' $d/CONTROL/control`
15 a=`awk '/^Architecture:/ {print $2}' $d/CONTROL/control`
16 ipk=`dirname $d`/"${p}_${v}_${a}.ipk"
17 [ -f $ipk ] || echo rm -rf $d
18 done