blob: 61eb3efacbdafc7287860b853f9974aaf63e2744 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/bin/sh
show_xipkg_stats () {
printf "${LIGHT_CYAN}${XI}${BLUE}Pkg ${LIGHT_CYAN}$VERSION ${BLUE}on ${LIGHT_BLUE}%s\n" $(cat /etc/hostname)
echo
printf "${LIGHT_BLACK}%-7s%*s/%s\n" "repo" 10 "installed" "total"
for repo in ${REPOS}; do
local total=0
local installed=0
for package in $(list | grep "^$repo/"); do
total=$((total+1))
name=${package#$repo/}
[ -d ${INSTALLED_DIR}/${name} ] &&
installed=$((installed+1))
done
printf "${LIGHT_WHITE}%-7s${GREEN}%*s${LIGHT_WHITE}/%s\n" $repo 10 $installed $total
done
}
|