-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepo_update.sh
More file actions
69 lines (63 loc) · 1.51 KB
/
Copy pathrepo_update.sh
File metadata and controls
69 lines (63 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
. <( curl -sL https://github.com/rern/rOS/raw/main/common.sh )
updateRepo() {
[[ ! $newer_only ]] && rm -f +R*
repo-add $newer_only -R $1.db.tar.xz *.pkg.tar.xz *.pkg.tar.zst
rm -f *.xz.old
}
if [[ $( uname -m ) == x86_64 ]]; then
manjaro=1
else
bar Mount REPO ...
mkdir -p BIG REPO
mount -t cifs //192.168.1.9/rern.github.io REPO -o username=guest,password=
[[ $? != 0 ]] && dialog.error_exit "Mount '\Z1REPO\Zn' failed."
#----------------------------------------------------------------------------
[[ ! $( ls REPO ) ]] && dialog.error_exit Repo empty: REPO
#----------------------------------------------------------------------------
fi
#........................
selected=$( dialog $opt_check '
\Z1Repository:\Z0
' 8 30 0 \
aarch64 on \
armv7h on \
armv6h off \
'' off \
Rebuild off )
#........................
if grep -q Rebuild <<< $selected; then
action=Rebuild
selected=$( grep -v Rebuild <<< $selected )
else
action=Update
newer_only=-n # newer only (deleted packages still exist in db)
fi
#........................
banner $action Repository
shopt -s nullglob # suppress error if no *.zst
for arch in $selected; do
if [[ $manjaro ]]; then
cd /home/x/GitHub/rern.github.io/$arch
else
dir_base=$PWD
cd $dir_base/REPO/$arch
fi
bar $arch
if [[ $arch == armv6h ]]; then
for dir in +R alarm core extra; do
bar $dir
cd $dir
updateRepo $dir
cd ..
done
else
updateRepo +R
fi
done
if [[ ! $manjaro ]]; then
cd $dir_base
umount -ql BIG REPO
rmdir BIG REPO
fi
bar Done