source: lliurex-meta-maker/trunk/fuentes/bin/lliurex-meta-list-search @ 1278

Last change on this file since 1278 was 1278, checked in by kbut, 5 years ago

add scripts to check packages size

  • Property svn:executable set to *
File size: 831 bytes
Line 
1#!/bin/bash
2ALLPACKAGESFILE=$(tempfile)
3ONLYPACKAGESNAMEFILE=$(tempfile)
4PACKAGESTOSEARCHFILE=$(tempfile)
5PACKAGESSIZEFILE=$(tempfile)
6usage(){
7        echo -e "\nUsage:"
8        echo -e "\t$0"
9        echo -e ""
10        exit 0
11}
12if [ $# -ne 2 ]; then
13        usage
14fi
15lliurex-resolver -i $1 -o $ALLPACKAGESFILE 1>/dev/null
16cat $ALLPACKAGESFILE | cut -f 1 | sort -u > $ONLYPACKAGESNAMEFILE
17comm -1 $2 $ONLYPACKAGESNAMEFILE | sed -e '/^[ \t]\+/d' > $PACKAGESTOSEARCHFILE
18while read line; do
19        LANG=C apt-cache show $line | grep "Installed-Size:" >> $PACKAGESSIZEFILE
20done < $PACKAGESTOSEARCHFILE
21:> /tmp/.asumar
22cat $PACKAGESSIZEFILE | awk '{ print $2 }' > /tmp/.asumar
23python -c "f=open('/tmp/.asumar');a = sum(float(l) for l in f.readlines()); print(str(a/1024) + ' M')"
24rm $ALLPACKAGESFILE $ONLYPACKAGESNAMEFILE $PACKAGESTOSEARCHFILE $PACKAGESSIZEFILE /tmp/.asumar
Note: See TracBrowser for help on using the repository browser.