Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/update
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2024-09-12 07:53:18 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2024-09-12 07:53:18 +0200
commitc6b8602075156e9997d0504fc861f11cd60ab613 (patch)
tree5ae82af4b74bf8f8d8feca4a9f57ef9010814655 /bin/update
initial revision, checking out states and repos
Diffstat (limited to 'bin/update')
-rwxr-xr-xbin/update46
1 files changed, 46 insertions, 0 deletions
diff --git a/bin/update b/bin/update
new file mode 100755
index 0000000..31333dc
--- /dev/null
+++ b/bin/update
@@ -0,0 +1,46 @@
+#!/bin/oksh
+
+BASE="${0%/*}/.."
+. "${BASE}/conf/default.conf"
+
+if test ! -d "${state_dir}"; then
+ echo "no upstream git state repo of packages.. exiting.."
+ exit 1
+fi
+
+if test ! -d "${packages_dir}"; then
+ echo "no directory for uptream package descriptions.. exiting.."
+ exit 1
+fi
+
+git -C "${state_dir}" pull
+
+find "${state_dir}"/{core,extra}-{any,x86_64} -type f > /tmp/update_packages.$$
+nof_packages=`cat /tmp/update_packages.$$ | wc -l`
+
+nof_checked_out_packages=`find "${packages_dir}" -type f -name PKGBUILD | wc -l`
+
+echo "${nof_packages} packages in state repo"
+echo "${nof_checked_out_packages} packages are checked out"
+
+sleep 10
+
+for pkgfile in `cat /tmp/update_packages.$$`; do
+ repo=`echo "${pkgfile}" | rev | cut -f 2 -d / | rev`
+ OLDIFS="$IFS"
+ IFS=" "
+ while read pkgname pkgver tag revision; do
+ echo "${repo} ${pkgname}"
+ if test ! -d "${packages_dir}/${repo}/${pkgname}"; then
+ cd "${packages_dir}/${repo}" || exit 1
+ pkgctl repo clone --protocol=https "${pkgname}"
+ sleep 10
+ else
+ true
+# git -C "${packages_dir}/${repo}/${pkgname}" pull
+ fi
+ done < $pkgfile
+ IFS="$OLDIFS"
+done
+# TODO: update all single package directories
+# TODO: update all AUR package directories