New commits:
commit c3c12e1970e13542961b0dee1f41f5a4f70f989e
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
config, libsorcery: be a bit more smart about setting the pager #15793
(since the way the grimoire handles it has changed)
based on a patch by PyroBor
diff --git a/ChangeLog b/ChangeLog
index 29c5e03..3dd8f0f 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
2010-12-30 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libtrack, common: newer installwatch has a different log variable
#13873
* libsummon: skip some more files in source_sanity
+ * config, libsorcery: be a bit more smart about setting the pager
#15793
2010-10-19 Bor Kraljič <pyrobor AT ver.si>
* libsummon: moved sanity check of source to right after download
(#15886)
diff --git a/etc/sorcery/config b/etc/sorcery/config
index 20d92c2..1a808f0 100755
--- a/etc/sorcery/config
+++ b/etc/sorcery/config
@@ -68,13 +68,6 @@ FORCE_BASESYSTEM_DEPENDS=${FORCE_BASESYSTEM_DEPENDS:-off}
URL_HTTP_FTP_TIMEOUT=${URL_HTTP_FTP_TIMEOUT:=90}
- # pager info
- # -R: display color codes properly
- # -E: quit at eof (otherwise scribe pauses on empty
updates)
- # -X: dont do screen init and deinit, gaze install
- # of a small spell is effectively useless otherwise as
the
- # screen is cleared afterwards.
- PAGER=${PAGER:=less -R -F -X -f}
FILEPROG=${FILEPROG:=file}
DIALOGPROG=${DIALOGPROG:=dialog}
#---------------------------------------------------------------------
+## Sets the most appropriate params for PAGER
+## @Globals PAGER
+#---------------------------------------------------------------------
+function set_pager() {
+ if [[ -z $PAGER ]]; then
+ # pager info
+ # -R: display color codes properly
+ # -F: quit on one-screenfull of data (otherwise scribe pauses on empty
updates)
+ # -X: dont do screen init and deinit, gaze install
+ # of a small spell is effectively useless otherwise as the
+ # screen is cleared afterwards.
+ # -f: force it, since we may not be dealing with a regular file
+ PAGER="less -R -F -X -f"
+ return
+ fi
+
+ local pager_prog
+ local pager_params=${PAGER#* }
+ smgl_basename "${PAGER%% *}" pager_prog
+
+ # TODO: add any needed options for the rest of the pagers
+ case $pager_prog in
+ less) PAGER="less -R -F -X -f $pager_params" ;;
+ most) PAGER="most $pager_params" ;;
+ w3m) PAGER="w3m $pager_params" ;;
+ more) PAGER="more $pager_params";;
+ *) ;;
+ esac
+}
+
+#---------------------------------------------------------------------
##
## This software is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
[SM-Commit] GIT changes to master sorcery by Jaka Kranjc (c3c12e1970e13542961b0dee1f41f5a4f70f989e),
Jaka Kranjc, 12/30/2010