diff options
author | davidovski <david@davidovski.xyz> | 2022-02-20 22:42:46 +0000 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-02-20 22:42:46 +0000 |
commit | c27df8fa817d2578332ee49ccc79df133fd77f20 (patch) | |
tree | 2a8fabd0e4ae7f1334aca2b213a814dea2c74b3a /src | |
parent | 42352a35a057c8315e8acd8ea4217df8353ae16a (diff) |
Diffstat (limited to 'src')
-rwxr-xr-x | src/get.sh | 2 | ||||
-rwxr-xr-x | src/profile.sh | 3 | ||||
-rw-r--r-- | src/stats.sh | 26 | ||||
-rwxr-xr-x | src/xi.sh | 6 |
4 files changed, 33 insertions, 4 deletions
@@ -148,10 +148,8 @@ get () { for package in $(cat $out); do if package_exists $package; then set -- $(get_package_download_info $package) - url=$1 checksum=$2 size=$3 - files=$4 if is_installed $package; then if [ "$(get_installed_version $package)" != "$checksum" ]; then diff --git a/src/profile.sh b/src/profile.sh index 43e4900..cce8884 100755 --- a/src/profile.sh +++ b/src/profile.sh @@ -4,7 +4,7 @@ export HBAR_COMPLETE="-c ${GREEN}${BG_DEFAULT}" && export HBAR_RED="-c ${BLACK}${BG_RED}" -#. /usr/lib/glyphs.sh +. /usr/lib/glyphs.sh export CONF_FILE="/etc/xipkg.conf" @@ -22,4 +22,5 @@ export CACHE_DIR=$(parseconf -v dir.cache) export PACKAGE_CACHE="${CACHE_DIR}/packages" export SYNC_CACHE="${CACHE_DIR}/sync" +. /usr/lib/glyphs.sh diff --git a/src/stats.sh b/src/stats.sh new file mode 100644 index 0000000..b7e927a --- /dev/null +++ b/src/stats.sh @@ -0,0 +1,26 @@ +#!/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 + + if [ "$repo" = "xi" ]; then + installed=35 + fi + + printf "${LIGHT_WHITE}%-7s${GREEN}%*s${LIGHT_WHITE}/%s\n" $repo 10 $installed $total + + done +} @@ -60,6 +60,9 @@ EOF [ -z "${LIBDIR}" ] && LIBDIR=/usr/lib/xipkg +[ -f ${LIBDIR}/VERSION ] && VERSION=$(cat ${LIBDIR}/VERSION) || VERSION= +export VERSION + export SYSROOT=/ export CONF_FILE="/etc/xipkg.conf" export VERBOSE=false @@ -106,6 +109,7 @@ done . ${LIBDIR}/util.sh . ${LIBDIR}/validate.sh +. ${LIBDIR}/stats.sh . ${LIBDIR}/query.sh . ${LIBDIR}/sync.sh . ${LIBDIR}/install.sh @@ -116,7 +120,7 @@ done shift $((OPTIND-1)) if [ "$#" = "0" ]; then - echo "xilinux running xipkg (palceholder text)" + show_xipkg_stats else case "$1" in "sync") |