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>
@@ -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"
}