Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (91c06aaa30f41969650d252e439da40f9a3a0b40)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (91c06aaa30f41969650d252e439da40f9a3a0b40)
  • Date: Wed, 14 Sep 2011 16:36:23 -0500

GIT changes to master sorcery by Jaka Kranjc <lynxlynxlynx AT sourcemage.org>:

ChangeLog | 3 +
usr/sbin/gaze | 108
++++++++++++++++++++++++++++++++++++++
var/lib/sorcery/modules/libtablet | 30 ++++++++++
3 files changed, 141 insertions(+)

New commits:
commit 91c06aaa30f41969650d252e439da40f9a3a0b40
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

gaze: improved the result display of gaze tablet

commit e2d772edd8659d14e22713caf0badccd1a8f70f6
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

added changelog entry for the last commit

commit d37deddef33c152dbe5a1a40fec055d04394d1a4
Author: Bor Kraljič <pyrobor AT ver.si>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

gaze: added command gaze tablet that show information from spell tablet
files

commit 132f7de5b32739117f6b2ff009777009ce10b1ba
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

libtablet: add roots and section name accessors

diff --git a/ChangeLog b/ChangeLog
index 938f4a3..1574c41 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,9 +2,12 @@
* config: unset GREP_OPTIONS in case the user set it to something bad
* libstage: ensure the install log is sorted #33
* gaze: only search for files in gaze-from
+ added tablet subcommand that shows various spell tablet bits #10440
+ improved the result display of gaze tablet
* libcast, cast: rather dispel conflicts during cast_spell
* alter.8: updated, adaptation of work from Donald Johnson #15478
* libmisc: use read -e for the second portion of query_string (#10707)
+ * libtablet: add roots and section name accessors

2011-08-18 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* gaze: fixed gaze from not finding "[", fixes #41
diff --git a/usr/sbin/gaze b/usr/sbin/gaze
index 82178a0..4c756ba 100755
--- a/usr/sbin/gaze
+++ b/usr/sbin/gaze
@@ -121,6 +121,10 @@ checkmd5s [spell|section] Print a md5 check of
spells

system-info Show information about a Source Mage system

+tablet spell <option> Show spell information from tablet.
+ Options: info, depends, sub_depends,
spell_config
+ rsub_depends, roots, dirs, all
+
show-held Shows all held spells.

show-exiled Shows all exiled spells.
@@ -1878,6 +1882,109 @@ function figure_installed()

#---------------------------------------------------------------------
##
+## display spell information from tablet
+## @param spell
+## @param command (info, depends, sub_depends, spell_config, rsub_depends,
roots, dirs, all)
+## @Stdout information of spell from tablet
+#---------------------------------------------------------------------
+function gaze_tablet() {
+ local spell=$1
+ local command=$2
+ local spell spell_directory spell_depends section_name version
+ local patchlevel security_patch spell_persistent_config sub_depends
build_api
+ local file
+ [[ -z $spell ]] && return 1
+ if ! spell_ok $spell ;then
+ message "${SPELL_COLOR}$spell${PROBLEM_COLOR} isn't installed!" \
+ "${DEFAULT_COLOR}"
+ return 1
+ fi
+ # get spell_directory that is used in all comands
+ tablet_find_spell_dir $spell spell_directory
+
+ function gaze_tablet_display() {
+ message "${PROBLEM_COLOR}---{ $2: $3 }---${DEFAULT_COLOR}"
+ if [[ -d $1 ]]; then
+ message "Not a file, skipping ..."
+ elif [[ -s $1 && $(file -b --mime-encoding $1) == binary ]]; then
+ message "Binary file, skipping ..."
+ else
+ cat $1
+ fi
+ }
+ function gaze_tablet_sub() {
+ local command=$1
+ local cat_file=${command}_file
+ tablet_get_$command $spell_directory ${cat_file}
+ gaze_tablet_display "${!cat_file}" "$spell" "$command"
+ }
+
+ case $command in
+ info)
+ tablet_get_section_name $spell_directory section_name
+ tablet_get_version $spell_directory version
+ tablet_get_patchlevel $spell_directory patchlevel
+ tablet_get_security_patch $spell_directory security_patch
+ tablet_get_build_api $spell_directory build_api
+ # not in all tablets yet
+ tablet_get_grimoire_name $spell_directory grimoire_name
+ # basic information (section & version)
+ message "${MESSAGE_COLOR}grimoire / section / spell: ${SPELL_COLOR}" \
+ "$grimoire_name / $section_name / $spell${DEFAULT_COLOR}"
+ message "${MESSAGE_COLOR}version / patchlevel / security
patchlevel:${VERSION_COLOR} $version /" \
+ "$patchlevel / $security_patch${DEFAULT_COLOR}"
+ message "${MESSAGE_COLOR}Build API:${VERSION_COLOR}
$build_api${DEFAULT_COLOR}"
+ ;;
+ depends)
+ gaze_tablet_sub depends
+ ;;
+ spell_config)
+ gaze_tablet_sub persistent_config
+ ;;
+ sub_depends)
+ gaze_tablet_sub sub_depends
+ ;;
+ rsub_depends)
+ gaze_tablet_sub rsub_depends
+ ;;
+ roots)
+ gaze_tablet_sub roots
+ ;;
+ spell-files)
+ for file in $spell_directory/spell/* ;do
+ gaze_tablet_display "$file" "$spell" "${file##*/}"
+ done
+ ;;
+ dirs)
+ message "${MESSAGE_COLOR}Tablet dir:${DEFAULT_COLOR} $spell_directory"
+ message "${MESSAGE_COLOR}Grimoire dir:${DEFAULT_COLOR}
$spell_directory/grimoire"
+ message "${MESSAGE_COLOR}Section dir:${DEFAULT_COLOR}
$spell_directory/section"
+ message "${MESSAGE_COLOR}Spell dir:${DEFAULT_COLOR}
$spell_directory/spell"
+ ;;
+ all)
+ gaze_tablet $spell info
+ gaze_tablet_sub depends
+ gaze_tablet_sub persistent_config
+ gaze_tablet_sub rsub_depends
+ gaze_tablet_sub sub_depends
+ gaze_tablet_sub roots
+ gaze_tablet $spell spell-files
+ gaze_tablet $spell dirs
+ ;;
+ *)
+ gaze_tablet $spell info
+ gaze_tablet_sub depends
+ gaze_tablet_sub persistent_config
+ gaze_tablet_sub rsub_depends
+ gaze_tablet_sub sub_depends
+ ;;
+ esac
+
+}
+
+
+#---------------------------------------------------------------------
+##
## displays various information about a Source Mage system
##
#---------------------------------------------------------------------
@@ -2329,6 +2436,7 @@ parse() {
license) shift; gaze_show_license $@ ;;
alien) alien ;;
system-info) gaze_system_info ;;
+ tablet) shift; gaze_tablet $1 $2 ;;
activity) display $ACTIVITY_LOG ;;
from) shift; show_from "$@" ;;
newer) newer $2 ;;
diff --git a/var/lib/sorcery/modules/libtablet
b/var/lib/sorcery/modules/libtablet
index 20f6441..4cdbe60 100755
--- a/var/lib/sorcery/modules/libtablet
+++ b/var/lib/sorcery/modules/libtablet
@@ -256,6 +256,21 @@ function tablet_get_grimoire_file() {
return 0
}

+#---
+## return section name from tablet
+#---
+function tablet_get_section_name() {
+ local tb_dir=$1 tb_version value
+ tablet_get_tb_version $tb_dir tb_version
+ [[ $? != 0 ]] && return 1
+ case $tb_version in
+ 1) test -f $tb_dir/section_name && value=$(<$tb_dir/section_name) ||
return 2 ;;
+ *) return 3 ;;
+ esac
+ eval "$2=\"$value\""
+ return 0
+}
+
function tablet_get_grimoire_name() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
@@ -290,6 +305,21 @@ function tablet_get_grimoire_filter() {
tablet_get_grimoire_file $1 $2 $3
}

+#---
+## get path to roots
+#---
+function tablet_get_roots() {
+ local tb_dir=$1 tb_version value
+ tablet_get_tb_version $tb_dir tb_version
+ [[ $? != 0 ]] && return 1
+ case $tb_version in
+ 1) test -f $tb_dir/roots && value=$tb_dir/roots|| return 2 ;;
+ *) return 3 ;;
+ esac
+ eval "$2=\"$value\""
+ return 0
+}
+
function tablet_load_roots() {
local tb_dir=$1 tb_version
tablet_get_tb_version $tb_dir tb_version



  • [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (91c06aaa30f41969650d252e439da40f9a3a0b40), Jaka Kranjc, 09/14/2011

Archive powered by MHonArc 2.6.24.

Top of Page