Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master quill by Jaka Kranjc (bc01035fbdc64b489711ec8028e072fcd4c6ace2)

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 quill by Jaka Kranjc (bc01035fbdc64b489711ec8028e072fcd4c6ace2)
  • Date: Sun, 31 May 2009 07:23:00 -0500

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

todo | 4 --
usr/bin/quill | 20 +++++++-----
var/lib/quill/ChangeLog | 11 ++++++
var/lib/quill/modules/libcore | 41 +++++++++++++++---------
var/lib/quill/modules/libgpg | 28 +++++++++-------
var/lib/quill/modules/libpatch | 66
++++++++++++++++++++++++++++++++++++++++
var/lib/quill/modules/libupdate | 13 -------
var/lib/quill/version | 2 -
8 files changed, 132 insertions(+), 53 deletions(-)

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

display all the available keyrings to everyone

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

libgpg: reset the source when changing the url #15198

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

added 'View changes/generate patch' to the main update menu

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

libupdate: print the path to the patch in gen_patch

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

* libcore: added quad_query to handle ask-yes/ask-no/yes/no defaults
changed options for patches, tarballing and review accordingly
* quill: use quad_query for patches, tarballing and review

diff --git a/todo b/todo
index 278aede..3829739 100644
--- a/todo
+++ b/todo
@@ -1,8 +1,4 @@
things that would be cool to have:
-new menu choices
- * 'Add another version'
- branches
- SCM: wierd versions; also needs the autoupdate stuff; only for -w

update mode:
* plug other linters at the end of the update and move them all in liblint
diff --git a/usr/bin/quill b/usr/bin/quill
index 8da7f9b..2ebdbfa 100755
--- a/usr/bin/quill
+++ b/usr/bin/quill
@@ -39,7 +39,7 @@ QUILL_SPELL_DIR=~/.sourcemage/spells
QUILL_TMP_DIR=~/.sourcemage/tmp
QUILL_LIB_DIR=/var/lib/quill
QUILL_MODULES=$QUILL_LIB_DIR/modules
-QUILL_OUR_CONFIG_VERSION=3
+QUILL_OUR_CONFIG_VERSION=4
QUILL_CONFIG_VERSION=$QUILL_OUR_CONFIG_VERSION

#---
@@ -154,7 +154,7 @@ then
'Deprecate the spell (also for renames)' \
'Manage/add PRE_BUILD and patches' \
'List/Edit/Remove/Add spell files' \
- '--NOOP--' \
+ 'View changes/generate patch' \
'--NOOP--' \
'Copy it here from the grimoire or QUILL_GIT_DIR' \
'Copy it under QUILL_GIT_DIR' \
@@ -203,14 +203,14 @@ then
check_description_wrap

rm DETAILS.orig
- if query "Do you want to review the update or add custom
modifications?" \
- ${QUILL_MODIFICATIONS:-n}
+ if quad_query "Do you want to review the update or add custom
modifications?" \
+ $QUILL_MODIFICATIONS
then
quill_edit
echo
fi
- if query "Do you want to generate a patch for the update?" \
- ${QUILL_GEN_PATCH:-n}
+ if quad_query "Do you want to generate a patch for the update?" \
+ $QUILL_GEN_PATCH
then
quill_generate_patch
fi
@@ -243,6 +243,12 @@ then
"${actions[6]}") # 'List/Edit/Remove/Add spell files'
file_menu
;;
+ "${actions[7]}") # 'View changes/generate patch'
+ patch_menu
+ ;;
+ "${actions[8]}") # NOOP
+ :
+ ;;
"${actions[9]}") #"Copy it here from the grimoire or QUILL_GIT_DIR"
ask_and_copy_over || continue
;;
@@ -489,7 +495,7 @@ else # no updates, we'll be making a spell
then
quill_edit
fi
- if query "Do you want to tarball the spell?" ${QUILL_TARBALL_SPELL:-n}
+ if quad_query "Do you want to tarball the spell?" $QUILL_TARBALL_SPELL
then
quill_final_tarball
fi
diff --git a/var/lib/quill/ChangeLog b/var/lib/quill/ChangeLog
index ef95a37..17a901a 100644
--- a/var/lib/quill/ChangeLog
+++ b/var/lib/quill/ChangeLog
@@ -1,3 +1,14 @@
+2009-05-31 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libcore: added quad_query to handle ask-yes/ask-no/yes/no defaults
+ changed options for patches, tarballing and review accordingly
+ * quill: use quad_query for patches, tarballing and review
+ added 'View changes/generate patch' to the update menu
+ * libupdate: print the path to the patch in gen_patch
+ * libpatch: added lib for displaying and dumping the changes
+ * libgpg: reset the source when changing the url #15198
+ separately display all the available keyrings to everyone
+ * version: 0.3.0-rc18, 0.3.0-rc19, 0.3.0-rc20, 0.3.0-rc21, 0.3.0-rc22
+
2009-04-23 Andraž "ruskie" Levstik <ruskie+f03a580f AT codemages.net>
* libcopy: added lookup so that grimoires not in
/var/lib/sorcery/codex get
properly setup
diff --git a/var/lib/quill/modules/libcore b/var/lib/quill/modules/libcore
index 318b7e7..34790e8 100644
--- a/var/lib/quill/modules/libcore
+++ b/var/lib/quill/modules/libcore
@@ -16,6 +16,26 @@ function query_list()
}

#---
+## @Synopsis an elaborate version of query for the quad option list
+## Skips the query if the default/saved answer is yes or no
+## $1 - the question
+## $2 - the contents of the variable with the default answer
+##
+## @Globals none
+#---
+function quad_query()
+{
+ local question="$1"
+ local variable="$2"
+
+ case $variable in
+ ask-yes) query "$question" y ;;
+ ask-no) query "$question" n ;;
+ *) [[ $variable == yes ]] ;;
+ esac
+}
+
+#---
## @Synopsis generate basic spell dir
##
## @Globals QUILL_SPELL_DIR SPELL_NAME DEPENDSISON CONFLICTSON
@@ -113,21 +133,12 @@ function quill_rc() {
if query "Do you use guru GPG signatures?" $saved ; then
query_list "${QUERY_COLOR}Please select one of the following keys as
the guru signing key${DEFAULT_COLOR}" GURU_GPGKEY "$GURU_GPGKEY" $(gpg -K |
sed -n "/^sec[^#]/ s,^sec\s*[^/]*/\(\S*\)\s.*$,\1,p")
fi
- if query "${QUERY_COLOR}Do you wish to always generate a spell
tarball?${DEFAULT_COLOR}" "${QUILL_TARBALL_SPELL:-n}" ; then
- QUILL_TARBALL_SPELL=y
- else
- QUILL_TARBALL_SPELL=n
- fi
- if query "${QUERY_COLOR}Do you want to always review
modifications?${DEFAULT_COLOR}" "${QUILL_MODIFICATIONS:-n}" ; then
- QUILL_MODIFICATIONS=y
- else
- QUILL_MODIFICATIONS=n
- fi
- if query "${QUERY_COLOR}Do you want to always generate a patch on
updates?${DEFAULT_COLOR}" "${QUILL_GEN_PATCH:-n}" ; then
- QUILL_GEN_PATCH=y
- else
- QUILL_GEN_PATCH=n
- fi
+
+ query_list "Do you wish to always generate a spell tarball?"
QUILL_TARBALL_SPELL "${QUILL_TARBALL_SPELL:-ask-no}" yes no ask-yes ask-no
+
+ query_list "Do you want to always review modifications?"
QUILL_MODIFICATIONS "${QUILL_MODIFICATIONS:-ask-yes}" yes no ask-yes ask-no
+
+ query_list "Do you want to always generate a patch on updates?"
QUILL_GEN_PATCH "${QUILL_GEN_PATCH:-ask-no}" yes no ask-yes ask-no

message "Thank you. Now generating ${QUILL_QUILLRC}"
cat << QUA > $QUILL_QUILLRC
diff --git a/var/lib/quill/modules/libgpg b/var/lib/quill/modules/libgpg
index 890d4bf..952a584 100644
--- a/var/lib/quill/modules/libgpg
+++ b/var/lib/quill/modules/libgpg
@@ -221,7 +221,7 @@ function guess_signature_url() {
## @Synopsis sets up SPELL_KEYRING, either from an exsisting or from
## @Synopsis a remote one
##
-## @Globals SPELL_KEYRING QUILL_MODE QUILL_SPELL_DIR SPELL_NAME
+## @Globals SPELL_KEYRING QUILL_SPELL_DIR SPELL_NAME
## @Globals QUILL_TMP_DIR
function quill_get_spell_keyring() {
# return if a previous pass already set it
@@ -230,23 +230,24 @@ function quill_get_spell_keyring() {
if query "Is the appropriate keyring already in the grimoire?" n; then
# list them as suggestions
codex_get_spell_paths $(codex_find_spell_by_name $SPELL_NAME)
- case $QUILL_MODE in
- apprentice)
- message "Here is a list of grimoire level keyrings:"
- find $GRIMOIRE -maxdepth 1 -iname "*.gpg" -printf "%P\n" ;;
- mage)
- message "Here is a list of grimoire and section level keyrings:"
- find $GRIMOIRE -maxdepth 2 -iname "*.gpg" -printf "%P\n" ;;
- wizard)
- message "Here is a list of all keyrings:"
- find $GRIMOIRE -iname "*.gpg" -printf "%P\n" ;;
- esac | grep -v gurus.gpg | column
+ message "Here is a list of grimoire level keyrings:"
+ find $GRIMOIRE -mindepth 1 -maxdepth 1 -iname "*.gpg" -printf "%P\n" |
grep -v gurus.gpg | column
+ echo
+
+ message "Here is a list of section level keyrings:"
+ find $GRIMOIRE -mindepth 2 -maxdepth 2 -iname "*.gpg" -printf "%P\n" |
column
+ echo
+
+ message "Here is a list of spell level keyrings:"
+ find $GRIMOIRE -mindepth 3 -maxdepth 3 -iname "*.gpg" -printf "%P\n" |
column
+ echo
+
shopt -s nullglob
query_string SPELL_KEYRING "Which of the above is the correct keyring? "
*.gpg
shopt -u nullglob

local kr_path=$(dirname $SPELL_KEYRING)
- if [[ $QUILL_MODE != apprentice && $kr_path != "." ]]; then
+ if [[ $kr_path != "." ]]; then
if [[ $kr_path != $SECTION && $kr_path != $SECTION/$SPELL_NAME ]]; then
message "Copying the keyring to the spell dir as it is not a
grimoire"
message "level one, from the same section nor from the same spell!\n"
@@ -295,6 +296,7 @@ function query_spell_signature(){
! query "Is $SPELL_SIGNATURE the proper signature url?" y; then
query_msg "Please enter the url of the signature:"
read "SPELL_SIGNATURE"
+ new_source=$(basename "$SPELL_SIGNATURE")
fi
while ! [[ $SPELL_SIGNATURE ]]; do
query_msg "Please enter the url of the signature or 'skip' to skip this
source:"
diff --git a/var/lib/quill/modules/libpatch b/var/lib/quill/modules/libpatch
new file mode 100644
index 0000000..abba614
--- /dev/null
+++ b/var/lib/quill/modules/libpatch
@@ -0,0 +1,66 @@
+#!/bin/bash
+#---
+## @Synopsis libpatch - patch/diff related functions
+#---
+
+#---
+## @Synopsis the main patch/change interface
+##
+## @Globals
+#---
+function patch_menu() {
+ local actions choice
+
+ actions=('View changes (unified diff)' \
+ 'Generate a patch' \
+ 'Return to the main menu' )
+ query_list "What do you want to do?" choice "Return to the main menu"
"${actions[@]}"
+
+ case "$choice" in
+ "${actions[0]}")
+ quill_generate_patch view ;;
+ "${actions[1]}")
+ quill_generate_patch ;;
+ "${actions[2]}")
+ return ;;
+ esac
+}
+
+#---
+## @Synopsis Generates a unified diff between the old and the new version
+## @Synopsis upon update
+## TODO: also allow diffing against the QUILL_GIT_DIR, not just the grimoire
+#---
+quill_generate_patch(){
+ local view_only=$1
+
+ codex_get_spell_paths $(codex_find_spell_by_name $SPELL_NAME)
+ if [[ $view_only ]]; then
+ diff -Nuars "$GRIMOIRE/$SECTION/$SPELL_NAME"
"$QUILL_SPELL_DIR/$SPELL_NAME" -x DETAILS.orig | $PAGER
+ else
+ diff -Nuar "$GRIMOIRE/$SECTION/$SPELL_NAME"
"$QUILL_SPELL_DIR/$SPELL_NAME" -x DETAILS.orig > \
+
"$QUILL_SPELL_DIR/$SPELL_NAME-$OLD_SPELL_VERSION-to-$SPELL_VERSION.patch"
+ message -n "The patch is available at "
+ message
"$QUILL_SPELL_DIR/$SPELL_NAME-$OLD_SPELL_VERSION-to-$SPELL_VERSION.patch"
+ sleep 2
+ fi
+ unset_spell_paths
+}
+
+#---
+##
+## 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
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This software is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this software; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+#---
diff --git a/var/lib/quill/modules/libupdate b/var/lib/quill/modules/libupdate
index b670725..b9c1cdf 100644
--- a/var/lib/quill/modules/libupdate
+++ b/var/lib/quill/modules/libupdate
@@ -363,19 +363,6 @@ function main_update_loop() {
}

#---
-## @Synopsis Generates a unified diff between the old and the new version
-## @Synopsis upon update
-##
-#---
-quill_generate_patch(){
- codex_get_spell_paths $(codex_find_spell_by_name $SPELL_NAME)
- message "Generating update patch"
- diff -Nuar "$GRIMOIRE/$SECTION/$SPELL_NAME" "$QUILL_SPELL_DIR/$SPELL_NAME"
> \
-
"$QUILL_SPELL_DIR/$SPELL_NAME-$OLD_SPELL_VERSION-to-$SPELL_VERSION.patch"
- unset_spell_paths
-}
-
-#---
##
## 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
diff --git a/var/lib/quill/version b/var/lib/quill/version
index 6e9d27f..773fbba 100644
--- a/var/lib/quill/version
+++ b/var/lib/quill/version
@@ -1 +1 @@
-0.3.0-rc17
+0.3.0-rc22



  • [SM-Commit] GIT changes to master quill by Jaka Kranjc (bc01035fbdc64b489711ec8028e072fcd4c6ace2), Jaka Kranjc, 05/31/2009

Archive powered by MHonArc 2.6.24.

Top of Page