File: foo.sh

package info (click to toggle)
quinn-diff 0.51
  • links: PTS
  • area: main
  • in suites: potato
  • size: 552 kB
  • ctags: 227
  • sloc: ansic: 2,107; sh: 606; makefile: 66
file content (28 lines) | stat: -rwxr-xr-x 1,537 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /opt/SBA/jjtroup/bin/bash

primary_architecture=$(grep "^Architecture: " Packages-primary | grep -v "Architecture: all" | sed -e "s/Architecture: //"  | head -n 1)
secondary_architecture=$(grep "^Architecture: " Packages-secondary | grep -v "Architecture: all" | sed -e "s/Architecture: //"  | head -n 1)

# This is slow; there has to be a better way.
egrep -v "^#|^$|^[ \t]" Packages-arch-specific | grep -v $secondary_architecture | grep $primary_architecture | sed -e "s/:.*//" > qwqtmpwer.1
grep "^Package:" Packages-primary | sed -e "s/Package: //" > qwqtmpwer.2
for i in $(cat qwqtmpwer.1); do grep -v $i qwqtmpwer.2 > qwqtmpwer.3; mv qwqtmpwer.3 qwqtmpwer.2; done
number_of_packages=$(cat qwqtmpwer.2 | wc -l )

number_unported=$(./quinn2.sh | grep "has not been compiled for" | wc -l)
number_out_of_date=$(./quinn2.sh | grep -v "has not been compiled for" | wc -l)

# We don't want bc splitting lines, as this is going into a HTML doc.

export BC_LINE_LENGTH=120 

result=$(echo $number_of_packages $number_unported $number_out_of_date | bc foo.bc)
percent_ported=$(echo $result | awk '{print $1}')
number_ported=$(echo $result | awk '{print $2}')
percent_uptodate=$(echo $result | awk '{print $3}')
number_uptodate=$(echo $result | awk '{print $4}')

printf "<P>There are %d Debian packages in main which are compilable on $secondary_architecture.  %0.2f%% (%d) have been ported, and of those, %0.2f%% (%d) are up-to-date.</P>\n" \
	    $number_of_packages $percent_ported $number_ported $percent_uptodate $number_uptodate