-
Notifications
You must be signed in to change notification settings - Fork 4
/
eos-update-extras
executable file
·47 lines (37 loc) · 1.23 KB
/
eos-update-extras
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
#!/bin/bash
# This program is meant to be executed between 'pacman -Sy' and 'pacman -Su' like:
# pacman -Sy && "this program" && pacman -Su
# Useful when special handling for certain update(s) are needed.
echo2() { echo "$@" >&2 ; }
WARN() { echo2 "==> $progname: warning: $1" ; }
Parameters() {
local arg
local update_first=() # these will be updated before others
while [ -n "$1" ] ; do
arg="$1"
case "$arg" in
--nvidia)
eos-kernel-nvidia-update-check $updates || WARN "'Nvidia & kernel' check failed."
;;
--keyrings | --keyring)
for arg in archlinux-keyring endeavouros-keyring ; do
echo "$updates" | grep "^$arg$" >/dev/null && update_first+=("$arg")
done
;;
*)
WARN "parameter '$arg' ignored."
;;
esac
shift
done
# Update certain packages before others.
[ ${#update_first[@]} -ne 0 ] && pacman -S --noconfirm "${update_first[@]}"
return 0
}
Main() {
local progname=${0##*/}
local updates=$(pacman -Quq) # available native updates
[ "$updates" = "" ] && return
Parameters "$@"
}
Main "$@"