diff options
| author | davidovski <david@davidovski.xyz> | 2022-08-28 18:31:25 +0000 | 
|---|---|---|
| committer | davidovski <david@davidovski.xyz> | 2022-08-28 18:31:25 +0000 | 
| commit | 62ac6c319289550931696346ce08f2c0ed70fc0d (patch) | |
| tree | db46daf7ef3bb5d0e1dad5f05c39bb6afb743953 /src | |
| parent | 45fdd7d7bdbffe9bca29ff630b1fea917b2338c2 (diff) | |
fixed removing removing from wrong sysrootv1.7.4
Diffstat (limited to 'src')
| -rwxr-xr-x | src/get.sh | 11 | ||||
| -rw-r--r-- | src/remove.sh | 2 | ||||
| -rw-r--r-- | src/util.sh | 12 | ||||
| -rwxr-xr-x | src/xi.sh | 2 | 
4 files changed, 20 insertions, 7 deletions
| @@ -156,16 +156,17 @@ get () {          checksum=$2          size=$3 -        if ! is_installed $package; then +        if is_installed $package; then +            if [ "$(get_installed_version $package)" = "$checksum" ]; then +                already="$already $package" +                continue +            fi +        else              install="$install $package"              total_download=$((total_download+size))              continue          fi -        if [ "$(get_installed_version $package)" = "$checksum" ]; then -            already="$already $package" -            continue -        fi          update="$update $package"          total_download=$((total_download+size))      done diff --git a/src/remove.sh b/src/remove.sh index ae5b58a..790dc5d 100644 --- a/src/remove.sh +++ b/src/remove.sh @@ -10,7 +10,7 @@ remove () {      local real=""      for package in $@; do -        local package_dir="${INSTALLED_DIR}/$package" +        local package_dir="${SYSROOT}${INSTALLED_DIR}/$package"          local filesfile="${package_dir}/files"          if [ -d $package_dir ]; then               [ -f $filesfile ] && diff --git a/src/util.sh b/src/util.sh index f92e4e3..871fe2a 100644 --- a/src/util.sh +++ b/src/util.sh @@ -1,9 +1,21 @@  #!/bin/sh +# Download a file and find out the http code +#  download_file() {      curl ${CURL_OPTS} -o $1 -w "%{http_code}" $2 2>> ${LOG_FILE}  } + +# Check if the user can write to the selected systemroot +# +checkroot () { +    [ -w "${SYSROOT}" ] || { +        printf "${RED}Please run as root!${RESET}\n" +        exit 1 +    } +} +  # this function is broken  wait_for_jobs () {      local text=$1 @@ -1,6 +1,6 @@  #!/bin/sh -#include xilib +#include xilib.sh  #include profile.sh  #include util.sh  #include validate.sh | 
