[SM-Commit] GIT changes to master quill by Jaka Kranjc (bcd8aedcd2eaf6f676081c00788cac0a8944952a)

Jaka Kranjc scm at mail.sourcemage.org
Sun Aug 6 08:49:58 EDT 2006


GIT changes to master quill by Jaka Kranjc <lynxlynxlynx at sourcemage.org>:

 usr/bin/quill                      |   21 ++++++++++-----------
 var/lib/quill/ChangeLog            |   24 +++++++++++++++---------
 var/lib/quill/modules/libbuild     |    2 +-
 var/lib/quill/modules/libcore      |   30 ++++++++++++++++--------------
 var/lib/quill/modules/libdetails   |   20 ++++++++++----------
 var/lib/quill/modules/libinstall   |    2 +-
 var/lib/quill/modules/libpre_build |    2 +-
 var/lib/quill/modules/libprepare   |    2 +-
 8 files changed, 55 insertions(+), 48 deletions(-)

New commits:
commit bcd8aedcd2eaf6f676081c00788cac0a8944952a
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    	* added a global EDITOR fallback and removed the single ones
    	  removed trailing white space
    	* quill: removed CURRENTPWD, wasn't used
    	* libcore::quil_rc: refactored; reconfiguration saves previous settings

diff --git a/usr/bin/quill b/usr/bin/quill
index 240949c..6a8c4f1 100755
--- a/usr/bin/quill
+++ b/usr/bin/quill
@@ -5,10 +5,10 @@ ## @Copyright Copyright 2006 Andrew "rus
 ## @Copyright Copyright 2006 SourceMage GNU/Linux
 ## @License GPL v2 or higher
 ##
-## @ToDo Add option to use upstream gpg signature as included or 
+## @ToDo Add option to use upstream gpg signature as included or
 ## @ToDo downloadable .sig file
 ## @ToDo Put a multiversion option
-## @ToDo single line or multiline depending on the length of line if 
+## @ToDo single line or multiline depending on the length of line if
 ## @ToDo <80 single else multi
 ## @ToDo Interface to add CONFIGURE options
 ## @ToDo Automated bugcli submissions of spells
@@ -18,9 +18,8 @@ ## @ToDo Add cmdline options to make it 
 ## @ToDo Add a better configuration interface(dialog based I hope)
 ## @ToDo Make it possible to also update spells using quill
 ## @ToDo Make quill the be-all for spells
-## @ToDo Make quill interface with both sorcery and grimoire to get 
+## @ToDo Make quill interface with both sorcery and grimoire to get
 ## @ToDo functions
-## @ToDo make it possible to reconfigure quill without lossing existing settings
 ##
 ## Asks the user in simple questions about generating a spell.
 ## @Globals BUILDISON, INSTALLISON, PREBUILDISON, TRIGGERSISON
@@ -29,7 +28,7 @@ ## @Globals SPELL_SRC_URL, SPELL_LICENSE
 ## @Globals SPELL_DESCRIPTION, SPELL_DEPENDENCIES, SPELL_OPTIONAL_DEPENDENCIES,
 ## @Globals SPELL_CONFLICTS, HISOTRY_DATE, SPELL_DATE, SPELL_SRC_FILE,
 ## @Globals SPELL_SANITIZED_FILE_NAME, SPELL_MD5_UNPACKED, SPELL_VERSION,
-## @Globals CURRENTPWD, i, j, n, BUILD_DTFILE, DTFILE_MENUENTRY, DTFILE_EXEC
+## @Globals i, j, n, BUILD_DTFILE, DTFILE_MENUENTRY, DTFILE_EXEC
 ## @Globals DTFILE_MENUPATH, DTFILE_ICON, DTFILE_TERM, SPELL_SRC_DIR
 ##
 ## @Thanks BearPerson, dufflebunk, afrayedknot
@@ -41,7 +40,7 @@ QUILL_VERSION="$(< /var/lib/quill/versio
 #---
 ## really basic stuff that should be loaded and set
 . /var/lib/sorcery/modules/libmedia
-LOCAL_MEDIA_CONFIG=/etc/sorcery/local/media source /etc/sorcery/media 
+LOCAL_MEDIA_CONFIG=/etc/sorcery/local/media source /etc/sorcery/media
 function message() { echo -e "$@"; }
 ## end of skeletal prerequisites - we get the rest later
 
@@ -50,7 +49,6 @@ do
   . $i
 done
 QUILL_MODE="apprentice"
-CURRENTPWD="$PWD"
 HISTORY_DATE="$(date +%Y-%m-%d)"
 #---
 ## Not really a function it's supposed to parse the command line parameters
@@ -59,7 +57,7 @@ while  [  -n  "$1"  ];  do
   if  echo  "" $1  |  grep  -q  "^ -";  then
     case  $1  in
       --fmxml|-f)
-                  [[ -z $2 ]] && 
+                  [[ -z $2 ]] &&
                   message "${PROBLEM_COLOR}Missing parameter$DEFAULT_COLOR" &&
                   quill_help
                   export QUILL_FMXML_MODE="on"; export QUILL_FMXML_PARAM="$2"
@@ -79,6 +77,7 @@ while  [  -n  "$1"  ];  do
 done
 unset -f message
 . /etc/sorcery/config
+EDITOR=${EDITOR:-nano}
 
 QUILL_HOME_DIR=~/.sourcemage/quill
 QUILL_QUILLRC=${QUILL_HOME_DIR}/quillrc
@@ -161,8 +160,8 @@ then
   # add && where appropriate in DEPENDS
   if [[ ${SPELL_OPTIONAL_DEPENDENCIES} != "" ]] || [[ ${SPELL_DEPENDENCIES} != "" ]]
   then
-    sed -e 's/^ *$//' -e 's/[^\\]$/& \&\&/' DEPENDS | tac | 
-      awk '{ if (removed!=1){ if (sub("&&$","") > 0){ removed=1 }}; print }' | 
+    sed -e 's/^ *$//' -e 's/[^\\]$/& \&\&/' DEPENDS | tac |
+      awk '{ if (removed!=1){ if (sub("&&$","") > 0){ removed=1 }}; print }' |
       tac > temporary-DEPENDS
     mv temporary-DEPENDS DEPENDS
   fi
@@ -243,7 +242,7 @@ then
     quill_final_put_in_grimoire
   fi
 fi
-cd ${CURRENTPWD}
+
 #---
 ##
 ## This software is free software; you can redistribute it and/or modify
diff --git a/var/lib/quill/ChangeLog b/var/lib/quill/ChangeLog
index 7ad272c..d7f367e 100644
--- a/var/lib/quill/ChangeLog
+++ b/var/lib/quill/ChangeLog
@@ -1,3 +1,9 @@
+2006-08-06 Jaka Kranjc <lynxlynxlynx at sourcemage.org>
+	* added a global EDITOR fallback and removed the single ones
+	  removed trailing white space
+	* quill: removed CURRENTPWD, wasn't used
+	* libcore::quil_rc: refactored, reconfiguration saves previous settings
+
 2006-08-06 Andraž "ruskie" Levstik <ruskie at mages.ath.cx>
 	* version: another bugfix release 0.1.2, uped to 0.1.3
 	* libcore: a bug reported by lalo, need to create dir first before touching
@@ -55,7 +61,7 @@
 	* libfreshmeatxml: add check for non-exsisting projects; fix indentation
 
 2006-07-23 Jaka Kranjc <lynxlynxlynx at sourcemage.org>
-	* install.sh: added INSTALL_ROOT support, ensured it is ran from where 
+	* install.sh: added INSTALL_ROOT support, ensured it is ran from where
 	              it is expected to, simplified the copying/removing logic
 	* libfreshmeatxml: grab non-abbreviated licenses too, fix bad color
 	* libcore: implemented the missing quill_help, fix bad color
@@ -93,12 +99,12 @@
 
 2006-02-12 Juuso Alasuutari <juuso.alasuutari at tamperelainen.org>
 	* quill: edited ToDo list
-	* libdetails: added substitute_with_variables, a generic 
-	  function to substitute any variables with variable names in a 
-	  given variable string. edited 
-	  substitute_with_mirror_variables to accept any variable, not 
-	  only SPELL_SRC_URL. edited substitute_url_variables to use 
-	  these two edits. added query_spell_signature to query for 
+	* libdetails: added substitute_with_variables, a generic
+	  function to substitute any variables with variable names in a
+	  given variable string. edited
+	  substitute_with_mirror_variables to accept any variable, not
+	  only SPELL_SRC_URL. edited substitute_url_variables to use
+	  these two edits. added query_spell_signature to query for
 	  possible upstream signature key.
 
 
@@ -115,9 +121,9 @@
 	  substitute_with_mirror_variables
 
 2006-01-25 Juuso Alasuutari <juuso.alasuutari at tamperelainen.org>
-	* libdetails: removed function set_src_dir, now hunt_src_dir 
+	* libdetails: removed function set_src_dir, now hunt_src_dir
 	  sets SPELL_SRC_DIR and is also has more safety checks
-	* libdetails: added function substitute_url_variables that 
+	* libdetails: added function substitute_url_variables that
 	  sanitizes SPELL_SRC_URL. still missing support for e.g.
 	  sourceforge urls
 	* libdetails: lots of documentation added
diff --git a/var/lib/quill/modules/libbuild b/var/lib/quill/modules/libbuild
index dadeb11..e7a776a 100644
--- a/var/lib/quill/modules/libbuild
+++ b/var/lib/quill/modules/libbuild
@@ -25,7 +25,7 @@ function add_build() {
      else
        echo "default_build" > BUILD
      fi
-     ${EDITOR:-nano} BUILD
+     $EDITOR BUILD
    fi
 
 }
diff --git a/var/lib/quill/modules/libcore b/var/lib/quill/modules/libcore
index 586320f..f03dee9 100644
--- a/var/lib/quill/modules/libcore
+++ b/var/lib/quill/modules/libcore
@@ -35,7 +35,7 @@ function hash_get() {
 
 #---
 ## @Synopsis Get's gurus info and stuff and puts it into
-## @Synopsis ~/.sourcemage/quillrc or reads it from there
+## @Synopsis $QUILL_QUILLRC or reads it from there
 #---
 
 function quill_rc() {
@@ -56,17 +56,19 @@ function quill_rc() {
   if [[ ! -f ${QUILL_QUILLRC} ]] ||
      [[ $QUILL_MODE == reconfigure ]]
   then
-    mkdir -p ~/.sourcemage/quill
-    touch ${QUILL_QUILLRC}
-    message "${PROBLEM_COLOR}This will create a ${QUILL_QUILLRC} file for you${DEFAULT_COLOR}"
-    message "${QUERY_COLOR}Please enter your name for the HISTORY entry.${DEFAULT_COLOR}"
-    read "GURU_NAME"
-    message "${QUERY_COLOR}Please enter your email for the HISTORY entry.${DEFAULT_COLOR}"
-    read "GURU_EMAIL"
-    message "${QUERY_COLOR}Where do you want to store generated spells(absolute path).${DEFAULT_COLOR}"
-    read "QUILL_SPELL_DIR"
+    mkdir -p $QUILL_HOME_DIR
+    touch $QUILL_QUILLRC
+    local quill_version=$QUILL_VERSION # can get overridden by the sourcing
+    . $QUILL_QUILLRC # get the contents if there are any (for defaults)
+    message "${PROBLEM_COLOR}This will (re)create ${QUILL_QUILLRC} for you${DEFAULT_COLOR}"
+    query_string GURU_NAME "${QUERY_COLOR}Please enter your name for the HISTORY entries.${DEFAULT_COLOR}" "$GURU_NAME"
+    query_string GURU_EMAIL "${QUERY_COLOR}Please enter your email for the HISTORY entries.${DEFAULT_COLOR}" "$GURU_EMAIL"
+    query_string QUILL_SPELL_DIR "${QUERY_COLOR}Where do you want to store generated spells (absolute path)?${DEFAULT_COLOR}" "$QUILL_SPELL_DIR"
     message "Thank you. Now generating ${QUILL_QUILLRC}"
-    echo -e "QUILL_VERSION=\"${QUILL_VERSION}\"\nGURU_NAME=\"${GURU_NAME}\"\nGURU_EMAIL=\"${GURU_EMAIL}\"\nQUILL_SPELL_DIR=\"${QUILL_SPELL_DIR}\"" > ${QUILL_QUILLRC}
+    echo -e "QUILL_CONFIG_VERSION=\"${quill_version}\"" \
+            "\nGURU_NAME=\"${GURU_NAME}\"" \
+            "\nGURU_EMAIL=\"${GURU_EMAIL}\"" \
+            "\nQUILL_SPELL_DIR=\"${QUILL_SPELL_DIR}\"" > $QUILL_QUILLRC
     exit 0
   else
      . ${QUILL_QUILLRC}
@@ -119,7 +121,7 @@ ## @Synopsis function to put the spell i
 #---
 function quill_final_put_in_grimoire() {
   message "You have selected to put the spell into the grimoire"
-  message "Please note there will also be a spell tarball(if so desired) in" 
+  message "Please note there will also be a spell tarball(if so desired) in"
   message "${USER_HOME}/${QUILL_SPELLDIR} as will be a spelldir"
   message "-----------------------------------------------------------------------------"
   message "Into which grimoire do you wish to put the spell(FULL path to it):"
@@ -147,14 +149,14 @@ #---
 function quill_help() {
   message "USAGE: quill [OPTIONS]
 
-OPTIONS:  
+OPTIONS:
   --fmxml, -f <SPELL>		get spell data from Freshmeat if possible
   --apprentice, -a		apprentice mode	(default)
   --mage, -m			mage mode (advanced)
   --wizard, -w			wizard mode (expert)(DOES NOTHING FOR NOW)
   --help, -h			display this help
   --version, -v			display version
-  --reconfigure, -r			reconfigure settings(DOES NOT WORK YET)
+  --reconfigure, -r		reconfigure settings
 "
   exit 1
 }
diff --git a/var/lib/quill/modules/libdetails b/var/lib/quill/modules/libdetails
index 0eaed63..fb1441d 100644
--- a/var/lib/quill/modules/libdetails
+++ b/var/lib/quill/modules/libdetails
@@ -75,7 +75,7 @@ if ! test -f $description ||
   test -s $description ||
   echo "Please enter a description of the spell here" > $description
 
-  ${EDITOR:-nano} $description
+  $EDITOR $description
 fi
 }
 
@@ -99,10 +99,10 @@ function show_spell_source_file_info(){
 }
 
 #---
-## @Synopsis Substitute any number of expanded variables in given string 
-## @Synopsis with corresponding variable names, store resulting string 
-## @Synopsis in $SUBSTITUTIONS. $1 is target variable, $2 and so on are 
-## @Synopsis variables to substitute with var names. Omit $, give only 
+## @Synopsis Substitute any number of expanded variables in given string
+## @Synopsis with corresponding variable names, store resulting string
+## @Synopsis in $SUBSTITUTIONS. $1 is target variable, $2 and so on are
+## @Synopsis variables to substitute with var names. Omit $, give only
 ## @Synopsis var names. Example:
 ## @Synopsis substitute_with_variables SPELL_SRC_URL SPELL VERSION
 #---
@@ -119,8 +119,8 @@ fi
 }
 
 #---
-## @Synopsis Process SPELL_SRC_URL: Subsitute expanded with escaped 
-## @Synopsis SPELL and VERSION, Substitute mirror urls with mirror url 
+## @Synopsis Process SPELL_SRC_URL: Subsitute expanded with escaped
+## @Synopsis SPELL and VERSION, Substitute mirror urls with mirror url
 ## @Synopsis variables.
 #---
 function substitute_url_variables(){
@@ -131,9 +131,9 @@ function substitute_url_variables(){
 }
 
 #---
-## @Synopsis Substitute download mirror urls with variable names in 
-## @Synopsis given variable. Store resulting string in 
-## @Synopsis SUBSTITUTIONS. Urls and variables are parsed from contents 
+## @Synopsis Substitute download mirror urls with variable names in
+## @Synopsis given variable. Store resulting string in
+## @Synopsis SUBSTITUTIONS. Urls and variables are parsed from contents
 ## @Synopsis of /etc/sorcery/mirrors/. Example:
 ## @Synopsis substitute_with_mirror_variables SPELL_SRC_URL
 #---
diff --git a/var/lib/quill/modules/libinstall b/var/lib/quill/modules/libinstall
index 1dffcd7..46b28f5 100644
--- a/var/lib/quill/modules/libinstall
+++ b/var/lib/quill/modules/libinstall
@@ -16,7 +16,7 @@ then
   else
     echo "default_install" > INSTALL
   fi
-  ${EDITOR:-nano} INSTALL
+  $EDITOR INSTALL
 fi
 }
 
diff --git a/var/lib/quill/modules/libpre_build b/var/lib/quill/modules/libpre_build
index 662a499..9e0b42d 100644
--- a/var/lib/quill/modules/libpre_build
+++ b/var/lib/quill/modules/libpre_build
@@ -22,7 +22,7 @@ function add_pre_build()
   else
     echo "default_pre_build" > PRE_BUILD
   fi
-  ${EDITOR:-nano} PRE_BUILD
+  $EDITOR PRE_BUILD
 }
 #---
 ##
diff --git a/var/lib/quill/modules/libprepare b/var/lib/quill/modules/libprepare
index 344379a..2035bb6 100644
--- a/var/lib/quill/modules/libprepare
+++ b/var/lib/quill/modules/libprepare
@@ -16,7 +16,7 @@ if [[ "${PREPAREISON}" == "PREPARE, " ]]
 then
   touch PREPARE
   chmod +x PREPARE
-  ${EDITOR:-nano} PREPARE
+  $EDITOR PREPARE
 fi
 }
 #---



More information about the SM-Commit mailing list