Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20fbadbc95 | ||
|
|
e42fb4f61c | ||
|
|
459cbbf8e7 |
No files matched your search
@@ -5,7 +5,10 @@
|
|||||||
# targets degrade to a no-op when msgfmt/scdoc are missing, so the tree stays
|
# targets degrade to a no-op when msgfmt/scdoc are missing, so the tree stays
|
||||||
# usable for development without the build dependencies installed.
|
# usable for development without the build dependencies installed.
|
||||||
|
|
||||||
VERSION := 1.0.0
|
# Overridable so a packager can pass the version it is actually building
|
||||||
|
# (`make VERSION=$pkgver`). The literal below is the fallback for builds
|
||||||
|
# straight from a checkout, and is what a release tag has to carry.
|
||||||
|
VERSION ?= 1.0.3
|
||||||
|
|
||||||
PREFIX ?= /usr
|
PREFIX ?= /usr
|
||||||
DESTDIR ?=
|
DESTDIR ?=
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ msgstr ""
|
|||||||
msgid "Quit"
|
msgid "Quit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Press Enter to continue..."
|
msgid "Press any key to continue..."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. Commands
|
#. Commands
|
||||||
|
|||||||
@@ -135,8 +135,8 @@ msgstr "Aktuelle Bedingungen anzeigen"
|
|||||||
msgid "Quit"
|
msgid "Quit"
|
||||||
msgstr "Beenden"
|
msgstr "Beenden"
|
||||||
|
|
||||||
msgid "Press Enter to continue..."
|
msgid "Press any key to continue..."
|
||||||
msgstr "Zum Fortfahren Enter drücken …"
|
msgstr "Zum Fortfahren eine Taste drücken …"
|
||||||
|
|
||||||
#. Commands
|
#. Commands
|
||||||
msgid "Automatic updates are on."
|
msgid "Automatic updates are on."
|
||||||
|
|||||||
@@ -170,7 +170,9 @@ cau_do_status() {
|
|||||||
|
|
||||||
cau_do_run() {
|
cau_do_run() {
|
||||||
cau_need_root
|
cau_need_root
|
||||||
exec "$CAU_LIBEXECDIR/cachy-auto-update-run" "$@"
|
# Not exec'd: this is also called from the menu, which has to survive the
|
||||||
|
# run and redraw afterwards.
|
||||||
|
"$CAU_LIBEXECDIR/cachy-auto-update-run" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
cau_do_log() {
|
cau_do_log() {
|
||||||
|
|||||||
@@ -40,6 +40,13 @@ if [[ $EUID -ne 0 ]]; then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Force a neutral locale here rather than relying on the unit's Environment=,
|
||||||
|
# so a run started by hand behaves exactly like one started by the timer.
|
||||||
|
# pacman failures are classified by matching its output, and on a German system
|
||||||
|
# that output is German. Text aimed at a person does not come through here - a
|
||||||
|
# notification is rendered in the recipient's own locale by cau_msg_in.
|
||||||
|
export LC_ALL=C LANGUAGE=
|
||||||
|
|
||||||
# Re-exec under an inhibitor so a suspend or shutdown cannot land in the middle
|
# Re-exec under an inhibitor so a suspend or shutdown cannot land in the middle
|
||||||
# of a pacman transaction and leave the database half-written. Done before
|
# of a pacman transaction and leave the database half-written. Done before
|
||||||
# anything else so the whole pass is covered, including the lock.
|
# anything else so the whole pass is covered, including the lock.
|
||||||
|
|||||||
+17
-4
@@ -145,7 +145,11 @@ cau_ui_menu() {
|
|||||||
printf ' [q] %s\n' "$(cau_msg "Quit")"
|
printf ' [q] %s\n' "$(cau_msg "Quit")"
|
||||||
printf '\n > '
|
printf '\n > '
|
||||||
|
|
||||||
read -r choice || { printf '\n'; return 0; }
|
# One keypress, no Enter. -s keeps the raw character out of the
|
||||||
|
# display so the echo below is the only thing printed, and a failing
|
||||||
|
# read means EOF (Ctrl-D, or a script piping input) - that quits.
|
||||||
|
read -rsn1 choice || { printf '\n'; return 0; }
|
||||||
|
printf '%s\n' "$choice"
|
||||||
|
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
1)
|
1)
|
||||||
@@ -163,13 +167,22 @@ cau_ui_menu() {
|
|||||||
3) cau_do_run --force; cau_pause ;;
|
3) cau_do_run --force; cau_pause ;;
|
||||||
4) cau_do_log; cau_pause ;;
|
4) cau_do_log; cau_pause ;;
|
||||||
5) cau_ui_status_conditions; cau_pause ;;
|
5) cau_ui_status_conditions; cau_pause ;;
|
||||||
q|Q|'') return 0 ;;
|
q|Q) return 0 ;;
|
||||||
|
$'\e')
|
||||||
|
# Arrow keys and friends arrive as ESC [ X. Swallow the rest so
|
||||||
|
# one keypress does not redraw the menu three times. Escape is
|
||||||
|
# deliberately not a quit key: that would make a stray arrow
|
||||||
|
# key close the menu.
|
||||||
|
read -rsn2 -t 0.05 _ 2>/dev/null || true
|
||||||
|
;;
|
||||||
|
# Anything else, Enter included, just redraws.
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
cau_pause() {
|
cau_pause() {
|
||||||
printf '\n %s' "$(cau_msg "Press Enter to continue...")"
|
printf '\n %s' "$(cau_msg "Press any key to continue...")"
|
||||||
read -r _ || true
|
read -rsn1 _ || true
|
||||||
|
printf '\n'
|
||||||
}
|
}
|
||||||
+10
-3
@@ -76,9 +76,16 @@ cau_pacman_update() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CAU_PACMAN_COUNT="$(grep -c . <<< "$CAU_PACMAN_PENDING")"
|
if [[ -n $CAU_PACMAN_PENDING ]]; then
|
||||||
[[ $CAU_PACMAN_COUNT =~ ^[0-9]+$ ]] || CAU_PACMAN_COUNT=0
|
CAU_PACMAN_COUNT="$(grep -c . <<< "$CAU_PACMAN_PENDING")"
|
||||||
cau_info "Updating $CAU_PACMAN_COUNT repository package(s)"
|
[[ $CAU_PACMAN_COUNT =~ ^[0-9]+$ ]] || CAU_PACMAN_COUNT=0
|
||||||
|
cau_info "Updating $CAU_PACMAN_COUNT repository package(s)"
|
||||||
|
else
|
||||||
|
# checkupdates is unavailable, so the list is unknown and pacman is
|
||||||
|
# asked to work it out itself.
|
||||||
|
CAU_PACMAN_COUNT=0
|
||||||
|
cau_info "Running a full system upgrade (pending list unavailable)"
|
||||||
|
fi
|
||||||
|
|
||||||
mapfile -t flags < <(cau_pacman_flags)
|
mapfile -t flags < <(cau_pacman_flags)
|
||||||
log="$(mktemp)" || return 1
|
log="$(mktemp)" || return 1
|
||||||
|
|||||||
Reference in new issue
Block a user