summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-08-28 18:31:25 +0000
committerdavidovski <david@davidovski.xyz>2022-08-28 18:31:25 +0000
commit62ac6c319289550931696346ce08f2c0ed70fc0d (patch)
treedb46daf7ef3bb5d0e1dad5f05c39bb6afb743953
parent45fdd7d7bdbffe9bca29ff630b1fea917b2338c2 (diff)
fixed removing removing from wrong sysrootv1.7.4
-rwxr-xr-xbuild.shmk2
-rwxr-xr-xsrc/get.sh11
-rw-r--r--src/remove.sh2
-rw-r--r--src/util.sh12
-rwxr-xr-xsrc/xi.sh2
5 files changed, 22 insertions, 7 deletions
diff --git a/build.shmk b/build.shmk
index d23d538..91f2a95 100755
--- a/build.shmk
+++ b/build.shmk
@@ -1,5 +1,7 @@
#!/usr/bin/env shmk
+search_path="src $search_path"
+
PROGS="
src/xi.sh
"
diff --git a/src/get.sh b/src/get.sh
index 197b232..08e5ee5 100755
--- a/src/get.sh
+++ b/src/get.sh
@@ -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
diff --git a/src/xi.sh b/src/xi.sh
index 2f50fa5..adf7c1c 100755
--- a/src/xi.sh
+++ b/src/xi.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-#include xilib
+#include xilib.sh
#include profile.sh
#include util.sh
#include validate.sh