sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[[SM-Commit] ] GIT changes to master sorcery by Ismael Luceno (bfc15982dec9c5ab84607b98c98493611c14ba8a)
- From: Ismael Luceno <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
- Subject: [[SM-Commit] ] GIT changes to master sorcery by Ismael Luceno (bfc15982dec9c5ab84607b98c98493611c14ba8a)
- Date: Fri, 30 Aug 2024 23:10:27 +0000
GIT changes to master sorcery by Ismael Luceno <ismael AT sourcemage.org>:
usr/sbin/scribe | 7 ++---
var/lib/sorcery/modules/libmedia | 6 ++--
var/lib/sorcery/modules/libtablet | 52
++++++++++++++++----------------------
3 files changed, 29 insertions(+), 36 deletions(-)
New commits:
commit bfc15982dec9c5ab84607b98c98493611c14ba8a
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>
libtablet: Simplify tablet_create_version_cache
* Sort output instead of input;
* Ignore missing page dirs, this may happen if installwatch fails to run
for non-staged spells, but we can at least use the version.
* Remove awk code, just make a list of broken spells in a file.
* Update error message.
commit 9744d4e1f166b692fac6cb46a1eb8802e6d3766b
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>
scribe: Fix colouring and excess white-space
commit e027b1c68f702c50ab0426724a923c3a80d4039d
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>
libmedia: Reset color with PROBLEM_COLOR
diff --git a/usr/sbin/scribe b/usr/sbin/scribe
index 59a4dbd..1bfb53a 100755
--- a/usr/sbin/scribe
+++ b/usr/sbin/scribe
@@ -345,7 +345,7 @@ scribe_add_update_worker() {
message "${MESSAGE_COLOR}Grimoire ${FILE_COLOR}\"$grimoire\"" \
"${MESSAGE_COLOR}successfully added to your
codex.${DEFAULT_COLOR}"
else
- message "${SPELL_COLOR}$grim_name
${MESSAGE_COLOR}updated!${DEFAULT_COLOR}"
+ message "${SPELL_COLOR}$grim_name$MESSAGE_COLOR updated!$DEFAULT_COLOR"
echo
grimoire_history $grimoire
fi
@@ -772,8 +772,9 @@ scribe_update() {
#include metadata
. $grimoire/GRIMOIRE
- message "${MESSAGE_COLOR}Updating grimoire ${SPELL_COLOR}$grim " \
- "${MESSAGE_COLOR}from ${FILE_COLOR}$FROM_URL${DEFAULT_COLOR}"
+ message "${MESSAGE_COLOR}Updating grimoire" \
+ "${SPELL_COLOR}$grim$MESSAGE_COLOR" \
+ "from ${FILE_COLOR}$FROM_URL${DEFAULT_COLOR}"
scribe_add_update_worker "$grimoire" "$FROM_URL" update ||
let rc++
done
diff --git a/var/lib/sorcery/modules/libmedia
b/var/lib/sorcery/modules/libmedia
index 7ba78db..b72747d 100755
--- a/var/lib/sorcery/modules/libmedia
+++ b/var/lib/sorcery/modules/libmedia
@@ -47,7 +47,7 @@ media_init() {
RESURRECT_COLOR="${GREEN}${BOLD}"
FILE_COLOR="${GREEN}${BOLD}"
SYMLINK_COLOR="${CYAN}${BOLD}"
- PROBLEM_COLOR="${RED}${BOLD}"
+ PROBLEM_COLOR="${DEFAULT_COLOR}${RED}${BOLD}"
MESSAGE_COLOR="${DEFAULT_COLOR}${CYAN}"
;;
@@ -60,7 +60,7 @@ media_init() {
RESURRECT_COLOR="${VIOLET}"
FILE_COLOR="${VIOLET}${BOLD}"
SYMLINK_COLOR="${CYAN}${BOLD}"
- PROBLEM_COLOR="${RED}${BOLD}"
+ PROBLEM_COLOR="${DEFAULT_COLOR}${RED}${BOLD}"
MESSAGE_COLOR="${DEFAULT_COLOR}${CYAN}"
;;
@@ -73,7 +73,7 @@ media_init() {
RESURRECT_COLOR="${GREEN}${BOLD}"
FILE_COLOR="${GREEN}${BOLD}"
SYMLINK_COLOR="${CYAN}${BOLD}"
- PROBLEM_COLOR="${RED}${BOLD}"
+ PROBLEM_COLOR="${DEFAULT_COLOR}${RED}${BOLD}"
MESSAGE_COLOR="${DEFAULT_COLOR}${CYAN}"
;;
esac
diff --git a/var/lib/sorcery/modules/libtablet
b/var/lib/sorcery/modules/libtablet
index 7b782a4..1d0681f 100755
--- a/var/lib/sorcery/modules/libtablet
+++ b/var/lib/sorcery/modules/libtablet
@@ -741,9 +741,9 @@ tablet_create_version_cache() {
local file="$1"
local page_dir
local spell version patchlevel security_patch updated
- local ok_spells="$(mktemp -u)"
+ local nok_spells="$(mktemp -u)"
- get_all_spells_with_status ok | sort | tee "$ok_spells" |
+ get_all_spells_with_status ok |
while read spell; do
# make sure we don't get any rare errors into our carefully crafted list
if tablet_find_spell_dir "$spell" page_dir > /dev/null; then
@@ -752,36 +752,28 @@ tablet_create_version_cache() {
tablet_get_security_patch "$page_dir" security_patch > /dev/null
tablet_get_updated "$page_dir" updated > /dev/null
else
- case "$spell" in
- alter|smgl-prelink|smgl-strip)
- version=$(installed_version "$spell")
- ;;
- *)
- continue
- ;;
- esac
+ printf '%s\n' "$spell" >> "$nok_spells"
+ version=$(installed_version "$spell")
+ unset patchlevel security_patch updated
fi
- echo "$spell ${version:-0} ${patchlevel:-0} ${security_patch:-0}
${updated:-0}"
- done > "$file"
- awk -v WARN="$PROBLEM_COLOR" -v NORMAL="$DEFAULT_COLOR" '
- FNR == 1 { do { bad[$0]; getline } while (FNR > 1) }
- { delete bad[$1] }
- END {
- if (!length(bad)) exit(0)
- print WARN "Spells with missing or corrupt tablet pages:"
- for (i in bad) print i
- print "please run cleanse --tablet and retry. If some spells have " \
- "unfixable tablet pages, recast them.\n" \
- "If you are ok with slower queueing of everything just run:\n" \
- "export OLD_QUEUING_METHOD=1 and you will not be bothered " \
- "again." NORMAL
- exit(1)
- }
- ' "$ok_spells" "$file" || {
- rm "$file" "$ok_spells"
+ printf '%s %s %d %d %d\n' "$spell" \
+ "${version:-0}" \
+ $((patchlevel)) \
+ $((security_patch)) \
+ $((updated))
+ done | sort > "$file"
+ if [ -s "$nok_spells" ]; then
+ error_message "${PROBLEM_COLOR}Spells with missing/corrupt tablet
pages:$SPELL_COLOR"
+ column "$nok_spells"
+ error_message "$PROBLEM_COLOR\nIncompete entries have been added,
queuing of updates will be"
+ error_message "inaccurate. To fix this please run 'cleanse --tablet' and
recast any"
+ error_message "spells with unfixable tablet pages, then retry; or
alternatively just"
+ error_message "export OLD_QUEUING_METHOD=1 in your environment (queueing
will be much"
+ error_message "slower) and you will not be bothered again.$DEFAULT_COLOR"
+ rm "$nok_spells"
return 1
- }
- rm "$ok_spells"
+ fi
+ rm "$nok_spells"
}
#---------------------------------------------------------------------
- [[SM-Commit] ] GIT changes to master sorcery by Ismael Luceno (bfc15982dec9c5ab84607b98c98493611c14ba8a), Ismael Luceno, 08/30/2024
Archive powered by MHonArc 2.6.24.