Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master quill by Ismael Luceno (e38a64bb03a854657636fff3a57cdd430c17690c)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master quill by Ismael Luceno (e38a64bb03a854657636fff3a57cdd430c17690c)
  • Date: Sat, 13 Aug 2016 23:24:05 +0000

GIT changes to master quill by Ismael Luceno <ismael AT sourcemage.org>:

var/lib/quill/modules/libupdate | 30 +++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)

New commits:
commit e38a64bb03a854657636fff3a57cdd430c17690c
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libupdate: Colorize multiversion_check suggestions

commit 48cefbc49f33e84889502f8bfdeb0cbfea3dce02
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libupdate: Improve multiversion_check suggestions

More comprehensive collection with de-duplication in a single command
invocation. Also, suppresses spell description.

diff --git a/var/lib/quill/modules/libupdate b/var/lib/quill/modules/libupdate
index 9dc8944..b998099 100644
--- a/var/lib/quill/modules/libupdate
+++ b/var/lib/quill/modules/libupdate
@@ -116,16 +116,32 @@ function count_spaces()
#---
function multiversion_check()
{
- local suggestions
if [[ ${#versions[@]} != 1 ]]
then #we have a problem
- message "Oh dear, detected a multiversion spell. Going to cat DETAILS
for you "
- message "and then you will tell me which variable I need to set, so I
can get "
- message "to the correct version ($version)."
+ message "$MESSAGE_COLOR"
+ message "Oh dear, detected a multiversion spell. Going to cat$FILE_COLOR
DETAILS$MESSAGE_COLOR for you"
+ message "and then you will tell me which variable I need to set, so I
can get"
+ message "to the correct version ($VERSION_COLOR$version$MESSAGE_COLOR)."
+ message "$DEFAULT_COLOR"
sleep 3
- cat DETAILS
- suggestions=$(sed -n 's,[{}],,g; s,^.*if.*$\([A-Za-z_]*\).*$,\1,p'
DETAILS)
- [[ ! -z $suggestions ]] && query_msg "Perhaps it is one of these:"
$suggestions
+ # suggestions
+ awk -vquery="$(echo -e $QUERY_COLOR)" -vnormal="$(echo -e
$DEFAULT_COLOR)" '
+ /^[\t ]*cat/ { exit } # Suppress description
+ { print }
+ function take(s) { gsub(/["${}]+/, "", s); S[s] }
+ /^[\t ]*case/ {
+ take($2)
+ while (getline == 1 && !/^[\t ]*esac/)
+ print
+ next
+ }
+ /^[\t ]*(el)?if +\[\[? +[^-]/ { take($3) }
+ END {
+ if (!length(S)) exit
+ for (i in S) s = s " " i
+ print query "\nPerhaps it is one of these:" normal s
+ }
+ ' DETAILS
query_string version_switch "${QUERY_COLOR}Please enter the appropriate
variable. Example: UGU_DEVEL=y${DEFAULT_COLOR} "
fi
}



  • [SM-Commit] GIT changes to master quill by Ismael Luceno (e38a64bb03a854657636fff3a57cdd430c17690c), Ismael Luceno, 08/13/2016

Archive powered by MHonArc 2.6.24.

Top of Page