summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-02-14 00:36:38 +0000
committerdavidovski <david@davidovski.xyz>2022-02-14 00:36:38 +0000
commit5e31b33fbe30f7b1775b89fc23abd6c96675cf99 (patch)
tree701251552c86a037226c180af332d56a180a3791
parent9f529b0e85c7b38e97d8ebb0371f7a6859f882f4 (diff)
updated xisync to work faster
-rw-r--r--src/xiget.sh12
-rwxr-xr-xsrc/xisync.sh28
-rw-r--r--xipkg.conf12
3 files changed, 33 insertions, 19 deletions
diff --git a/src/xiget.sh b/src/xiget.sh
new file mode 100644
index 0000000..815c47f
--- /dev/null
+++ b/src/xiget.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+export CONF_FILE="/etc/xipkg.conf"
+
+CURL_OPTS="-SsL"
+
+DEP_GRAPH=$(parseconf -v dir.deps)
+
+get_deps() {
+ local name=$1
+ [ -f $DEP_GRAPH ] && sed -rn "s/^$name: (.*)/\1/p" $DEP_GRAPH || echo
+}
diff --git a/src/xisync.sh b/src/xisync.sh
index 213f826..5349dd2 100755
--- a/src/xisync.sh
+++ b/src/xisync.sh
@@ -82,13 +82,6 @@ dep_graph () {
local package=$(echo $line | cut -d: -f1)
local new=$(echo $line | cut -d: -f2-)
echo $new >> $DEP_GRAPH/$package
- #local existing=$(get_deps $name)
-
- #sed -i "/^$package:.*$/d" $DEP_GRAPH
-
- #local all=$(echo "$new $existing" | tr ' ' '\n' | sort -u | tr '\n' ' ')
- #echo "$package: $all" >> $DEP_GRAPH
- #echo $line >> $DEP_GRAPH
done < "$tmp_file"
fi
}
@@ -117,8 +110,9 @@ popularity_contest () {
index_deps () {
local l=$1
- total=${#SOURCES[*]}
- completed=0
+ local total=${#SOURCES[*]}
+ local completed=0
+
for src in ${SOURCES[*]}; do
dep_graph $src
completed=$((completed+1))
@@ -128,10 +122,10 @@ index_deps () {
}
index_repo () {
- local repo=$1
- local l=$2
- total=$((${#SOURCES[*]}))
- completed=0
+ local repo=$1 l=$2
+ local total=${#SOURCES[*]}
+ local completed=0
+
for src in ${SOURCES[*]}; do
list_source $repo $src
completed=$((completed+1))
@@ -148,22 +142,24 @@ sync () {
rm -r $DEP_GRAPH
mkdir $DEP_GRAPH
- i=1
# create padding spaces for each hbar
for repo in ${REPOS[*]}; do
hbar
done
+ # download package lists and dep graphs at the same time
index_deps 0 &
+ local i=1
for repo in ${REPOS[*]}; do
index_repo $repo $i &
i=$((i+1))
done
-
+ # wait for all jobs to complete
wait
- hbar
+ # determine which version of which package should be regarded
+ hbar
popularity_contest
}
diff --git a/xipkg.conf b/xipkg.conf
index 086668b..08f3fd4 100644
--- a/xipkg.conf
+++ b/xipkg.conf
@@ -1,13 +1,15 @@
-# This is the default configuration for xipkg
+# load the default config for xipkg
#
include /etc/xipkg.d/default.conf
+# list of sources of where to find repos
+#
+# Keep this list short, with a few local mirrors
+# ensure that you have a bit of redunancy in case of back up
sources {
localhost http://localhost:8089/repo/
davidovski https://xi.davidovski.xyz/repo/
- codeberg https://xi.codeberg.page/repo/
ftp https://xilinux.ftp.sh/repo/
- ro https://xi.ro.lt/repo/
}
# The sources to download the keys from
@@ -15,6 +17,10 @@ key_authority [
davidovski
]
+# list of repos
+#
+# these repos will be search for packages
+# anything in any other repos will not be checked
repos [
xi
system