Skip to Content.
Sympa Menu

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

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 (a33e6fdc808f56184bc62510e8f181ab9fc814b3)
  • Date: Sun, 4 Nov 2007 07:50:36 -0600

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

usr/bin/quill | 56
+++++++++++++++++++++++++++++++++++++---
var/lib/quill/ChangeLog | 7 +++++
var/lib/quill/modules/libgpg | 16 ++++++-----
var/lib/quill/modules/libupdate | 12 ++++----
var/lib/quill/version | 2 -
5 files changed, 75 insertions(+), 18 deletions(-)

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

* libgpg: colorized the remove sigs prompts
* libupdate: fixed the changed update_counter logic, uppercased
* quill: accompanying fix for update_counter, new select_list
backport and some comments

diff --git a/usr/bin/quill b/usr/bin/quill
index 8746712..972d90d 100755
--- a/usr/bin/quill
+++ b/usr/bin/quill
@@ -13,6 +13,7 @@
## @Globals SPELL_DEPENDENCIES SPELL_OPTIONAL_DEPENDENCIES SPELL_CONFLICTS
## @Globals SPELL_PROVIDES PREPAREISON PREBUILDISON BUILDISON SPELL_SRC_FILE
## @Globals INSTALLISON BS BUILD_DTFILE SPELL_SRC_URL QUILL_ORIG_TARGET
+## @Globals UPDATE_COUNTER
##
## @Thanks BearPerson, dufflebunk, afrayedknot
## @Thanks To all testers
@@ -199,12 +200,57 @@ function url_ftp_verify() {
fi
}

-## Down to here... from here it's question and answer time
-#---
+# too many menu options for 1.13
+unset -f select_list &&
+function select_list()
+{
+ local i
+ local foo temp number
+ local returnvar=$1
+ local _default=$2
+ local stuff=()
+ local _default_num=0
+
+ shift 2
+ hash_unset select_list_hash
+ # see note in select_provider
+ stuff=(0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w
x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
+
+ let i=0
+ for foo in "$@"; do
+ message "\t$DEFAULT_COLOR(${stuff[$i]})
$SPELL_COLOR$foo$DEFAULT_COLOR"
+ hash_put select_list_hash "${stuff[$i]}" "$foo"
+ [[ "$foo" ]] && [[ "$foo" == "$_default" ]] &&
_default_num=${stuff[$i]}
+ let i++
+ done
+
+ local msgstr="\n${QUERY_COLOR}Which one do you want?
[$_default_num]$DEFAULT_COLOR "
+ select_list_sub "$returnvar" select_list_hash "$msgstr" "$_default_num"
+ hash_unset select_list_hash
+}
+
+unset -f select_list_sub &&
+function select_list_sub() {
+ local returnvar=$1
+ local hashname=$2
+ local msgstr=$3
+ local _default=$4
+
+ local _result _answer
+
+ while [[ ! $_result ]] ; do
+ message -n "$msgstr"
+ read -t $PROMPT_DELAY -n 1 _answer
+ [[ "$_answer" ]] || _answer=$_default
+ _result="$(hash_get $hashname $_answer)"
+ done
+ echo
+ eval $returnvar=\"$_result\"
+}
+

#---
## Questions and stuff
-
quill_welcome
if [[ ! -z $QUILL_FETCH_MODE ]]
then
@@ -256,6 +302,8 @@ then

main_update_loop version_bump

+ [[ $UPDATE_COUNTER == 0 ]] && continue # there were no updates
+
# check if WEB_SITE is reachable
WEB_SITE=$(. DETAILS &> /dev/null; echo $WEB_SITE)
if ! url_verify "$WEB_SITE" > /dev/null; then
@@ -354,7 +402,7 @@ then
esac

done
-else
+else # no updates, we'll be making a spell
SPELL_NAME=${SPELL_NAME:-$QUILL_TARGET}
query_spell_name
while codex_does_spell_exist $SPELL_NAME > /dev/null; do
diff --git a/var/lib/quill/ChangeLog b/var/lib/quill/ChangeLog
index d5ebbb9..622be50 100644
--- a/var/lib/quill/ChangeLog
+++ b/var/lib/quill/ChangeLog
@@ -1,3 +1,10 @@
+2007-11-04 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libgpg: colorized the remove sigs prompts
+ * libupdate: fixed the changed update_counter logic, uppercased
+ * quill: accompanying fix for update_counter, new select_list
+ backport and some comments
+ * version: 0.2.9-rc4
+
2007-09-18 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libcore, quill, libcopy: added QUILL_SUDO to the rest of the system
calls
* version: 0.2.9-rc3
diff --git a/var/lib/quill/modules/libgpg b/var/lib/quill/modules/libgpg
index e9a467f..bc9fd4c 100644
--- a/var/lib/quill/modules/libgpg
+++ b/var/lib/quill/modules/libgpg
@@ -1,11 +1,11 @@
#---
## @Synopsis Tries to change the source verification in favour of upstream
gpg
##
-## @Globals "version" "versions" SPELL_KEYRING SPELL_SIGNATURE SPELL_UPDATED
-## @Globals SPELL_NAME SPELL_VERSION
+## @Globals "version" SPELL_KEYRING SPELL_SIGNATURE SPELL_UPDATED
+## @Globals SPELL_NAME SPELL_VERSION UPDATE_COUNTER
#---
function convert_to_upstream_gpg() {
- local update_counter=${#versions[@]} source su i new_value new_su
new_source
+ local source su i new_value new_su new_source
local version_switch j ll ll_max mirrors num_of_mirrors
if query "Do you want to do it for $version?" y; then
multiversion_check
@@ -185,11 +185,9 @@ function convert_to_upstream_gpg() {
fi
sleep 2"
fi
-
else
- let update_counter-=1
+ let UPDATE_COUNTER--
fi
- [[ $update_counter == 0 ]] && continue 2 # there were no updates

}

@@ -393,7 +391,11 @@ function remove_old_sigs()
files=$(compgen -G "*$version*.sig" | tr '\n' ' ')
files="$files $(compgen -G "*$version*.asc" | tr '\n' ' ')"
files="$files $(compgen -G "*$version*.sign" | tr '\n' ' ')"
- [[ $files != " " ]] && rm -i $files
+ if [[ $files != " " ]]; then
+ echo -n $QUERY_COLOR
+ rm -i $files
+ echo -n $DEFAULT_COLOR
+ fi
fi

}
diff --git a/var/lib/quill/modules/libupdate b/var/lib/quill/modules/libupdate
index e368a32..9409384 100644
--- a/var/lib/quill/modules/libupdate
+++ b/var/lib/quill/modules/libupdate
@@ -142,12 +142,13 @@ function user_increment_patchlevel() {
## @Synopsis The core function that ties all the version update stuff
##
## @Globals SPELL_VERSION SPELL_UPDATED GURU_GPGKEY QUILL_SPELL_DIR "version"
-## @Globals "versions"
+## @Globals UPDATE_COUNTER
#---
function version_bump() {
- local update_counter="${#versions[@]}" version_switch
+ local version_switch
local sources_and_urls sources source_urls source
local hash current_check i new_value
+
if query "Do you want to update $version?" y; then
query_spell_version
[[ -z $SPELL_VERSION ]] && error_msg "Empty VERSION!" && continue 2
@@ -263,9 +264,8 @@ function version_bump() {

echo
else
- let update_counter-=1
+ let UPDATE_COUNTER--
fi
- [[ $update_counter == 0 ]] && continue 2 # there were no updates

}

@@ -274,7 +274,7 @@ function version_bump() {
## @Synopsis Loops over relevant spell versions and runs the passed command
## @Synopsis over each version
##
-## @Globals none
+## @Globals UPDATE_COUNTER
#---
function main_update_loop() {
local version versions=()
@@ -285,7 +285,7 @@ function main_update_loop() {
[[ -z ${versions[@]} ]] && error_msg "No versions to update!" && continue

message "Current relevant version(s): ${versions[@]}"
-
+ UPDATE_COUNTER="${#versions[@]}"
for version in "${versions[@]}"; do
$1
done
diff --git a/var/lib/quill/version b/var/lib/quill/version
index d26a8e4..af4c318 100644
--- a/var/lib/quill/version
+++ b/var/lib/quill/version
@@ -1 +1 @@
-0.2.9-rc3
+0.2.9-rc4



  • [SM-Commit] GIT changes to master quill by Jaka Kranjc (a33e6fdc808f56184bc62510e8f181ab9fc814b3), Jaka Kranjc, 11/04/2007

Archive powered by MHonArc 2.6.24.

Top of Page