From e7b2de40c6d03f3a5b4fb3906ef826ad169a7cb2 Mon Sep 17 00:00:00 2001 From: davidovski Date: Sat, 30 Jul 2022 18:36:34 +0000 Subject: sysroot is now included in functions themselves --- src/build.sh | 2 +- src/install.sh | 8 ++++---- src/profile.sh | 6 +++--- src/stats.sh | 2 +- src/util.sh | 4 ++-- src/xi.sh | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/build.sh b/src/build.sh index 89d2bf3..614924b 100644 --- a/src/build.sh +++ b/src/build.sh @@ -49,7 +49,7 @@ get_revision () { # return the installed revision of the given package # get_installed_revision () { - local infofile=${INSTALLED_DIR}/$1/info + local infofile=${SYSROOT}${INSTALLED_DIR}/$1/info [ -f $infofile ] && { sed -rn "s/^REVISION=(.*)$/\1/p" $infofile } diff --git a/src/install.sh b/src/install.sh index 4bbacbe..c2505c5 100644 --- a/src/install.sh +++ b/src/install.sh @@ -10,7 +10,7 @@ install_package () { local name="$2" local info_file="$pkg_file.info" - local installed_dir="${INSTALLED_DIR}/$name" + local installed_dir="${SYSROOT}${INSTALLED_DIR}/$name" local info="$installed_dir/info" local files="$installed_dir/files" local checksum="$installed_dir/checksum" @@ -90,7 +90,7 @@ install () { ${VERBOSE} && printf "${BLACK}Requested to install: $@\n${RESET}" if [ "$#" = "0" ]; then - packages=$(ls ${INSTALLED_DIR}) + packages=$(ls ${SYSROOT}${INSTALLED_DIR}) fi local missing="" @@ -109,8 +109,8 @@ install () { ${VERBOSE} && printf "${BLACK}installing $name from $package \n${RESET}" install_package $package $name & - mkdir -p "${INSTALLED_DIR}/$name/" - filelist="${INSTALLED_DIR}/$name/files" + mkdir -p "${SYSROOT}${INSTALLED_DIR}/$name/" + filelist="${SYSROOT}${INSTALLED_DIR}/$name/files" touch $filelist files_files="$files_files $filelist" done diff --git a/src/profile.sh b/src/profile.sh index c2bda20..165bf0a 100755 --- a/src/profile.sh +++ b/src/profile.sh @@ -1,7 +1,7 @@ #!/bin/sh -. /usr/lib/colors.sh -. /usr/lib/glyphs.sh +#include colors.sh +#include glyphs.sh export HBAR_COMPLETE="-c ${GREEN}${BG_DEFAULT}" export HBAR_RED="-c ${BLACK}${BG_RED}" @@ -17,7 +17,7 @@ export REPOS="$(parseconf -v repos)" export SOURCES="$(parseconf sources.*)" export PACKAGES_DIR=$(parseconf -v dir.packages) -export INSTALLED_DIR=${SYSROOT}$(parseconf -v dir.installed) +export INSTALLED_DIR=$(parseconf -v dir.installed) export KEYCHAIN_DIR=$(parseconf -v dir.keychain) export CACHE_DIR=$(parseconf -v dir.cache) diff --git a/src/stats.sh b/src/stats.sh index 8c2c1be..903bfde 100644 --- a/src/stats.sh +++ b/src/stats.sh @@ -9,7 +9,7 @@ show_xipkg_stats () { local installed=0 for package in $(list); do total=$((total+1)) - [ -d ${INSTALLED_DIR}/${package} ] && + [ -d ${SYSROOT}${INSTALLED_DIR}/${package} ] && installed=$((installed+1)) done diff --git a/src/util.sh b/src/util.sh index 2b7044c..f92e4e3 100644 --- a/src/util.sh +++ b/src/util.sh @@ -86,14 +86,14 @@ prompt_question () { # return if a package is present on the system or not # is_installed() { - [ -f "${INSTALLED_DIR}/$1/checksum" ] + [ -f "${SYSROOT}${INSTALLED_DIR}/$1/checksum" ] } # get the installed checksum of a package ($1) # get_installed_version () { local name=$1 - local file="${INSTALLED_DIR}/$name/checksum" + local file="${SYSROOT}${INSTALLED_DIR}/$name/checksum" [ -f $file ] && cat $file } diff --git a/src/xi.sh b/src/xi.sh index 93d4c36..2f50fa5 100755 --- a/src/xi.sh +++ b/src/xi.sh @@ -225,7 +225,7 @@ else ;; "verify") shift - [ -z "$*" ] && set -- $(ls ${INSTALLED_DIR}) + [ -z "$*" ] && set -- $(ls ${SYSROOT}${INSTALLED_DIR}) while [ ! -z "$*" ]; do validate_files $1 || { ${QUIET} && printf "%s\n" $1 || printf "${LIGHT_RED}Failed to verify $1\n" -- cgit v1.2.1