diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/profile.sh | 3 | ||||
-rw-r--r-- | src/query.sh | 2 | ||||
-rw-r--r-- | src/stats.sh | 23 | ||||
-rwxr-xr-x | src/xi.sh | 5 |
4 files changed, 14 insertions, 19 deletions
diff --git a/src/profile.sh b/src/profile.sh index 683738e..c2bda20 100755 --- a/src/profile.sh +++ b/src/profile.sh @@ -6,11 +6,12 @@ export HBAR_COMPLETE="-c ${GREEN}${BG_DEFAULT}" export HBAR_RED="-c ${BLACK}${BG_RED}" - export CONF_FILE="/etc/xipkg.conf" export CURL_OPTS="-sSL" +export DEFAULT_OPTION=$(parseconf -v default_cmd) + export DEP_DIR=$(parseconf -v dir.deps) export REPOS="$(parseconf -v repos)" export SOURCES="$(parseconf sources.*)" diff --git a/src/query.sh b/src/query.sh index 14d9adf..17f0c57 100644 --- a/src/query.sh +++ b/src/query.sh @@ -35,7 +35,7 @@ files () { file_info () { for file in $@; do [ ! -f ${SYSROOT}$file ] && file=$(realpath $file) - for pkg in $(list_installed); do + for pkg in $(installed); do for list in ${INSTALLED_DIR}/$pkg/files; do grep -q ^${file}$ $list && printf "${LIGHT_BLUE}%s${BLUE} belongs to ${LIGHT_BLUE}%s${RESET}\n" $file $pkg diff --git a/src/stats.sh b/src/stats.sh index 61eb3ef..8c2c1be 100644 --- a/src/stats.sh +++ b/src/stats.sh @@ -3,20 +3,15 @@ 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 + printf "${LIGHT_BLACK}%-7s%*s/%s\n" " " 10 "installed" "total" + local total=0 + local installed=0 + for package in $(list); do + total=$((total+1)) + [ -d ${INSTALLED_DIR}/${package} ] && + installed=$((installed+1)) done + + printf "${LIGHT_WHITE}%-7s${GREEN}%*s${LIGHT_WHITE}/%s\n" "packages" 10 $installed $total } @@ -247,9 +247,8 @@ else usage ;; *) - checkroot - $DO_SYNC && sync - install $@ + + sudo $0 ${DEFAULT_OPTION:-install} $@ ;; esac fi |