Skip to Content.
Sympa Menu

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

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <scm AT mail.sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master quill by Jaka Kranjc (105de10af7890a85eb6edbf5be4466daf89227f7)
  • Date: Wed, 17 Jan 2007 16:05:48 -0600

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

usr/bin/quill | 102
+++++++++++++++++++++++++++++-------------
var/lib/quill/ChangeLog | 6 ++
var/lib/quill/modules/libcore | 25 ++++++----
3 files changed, 92 insertions(+), 41 deletions(-)

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

almost there

diff --git a/usr/bin/quill b/usr/bin/quill
index b7724cc..eb21496 100755
--- a/usr/bin/quill
+++ b/usr/bin/quill
@@ -122,21 +122,21 @@ fi

if [[ "$QUILL_UPDATE" == "on" ]]
then
+ SPELL_NAME=$QUILL_TARGET
+ if ! codex_does_spell_exist $SPELL_NAME
+ then
+ message "${PROBLEM_COLOR}$SPELL_NAME is not a spell!$DEFAULT_COLOR"
+ exit 6
+ fi
while true; do
- SPELL_NAME=$QUILL_TARGET
- if ! codex_does_spell_exist $SPELL_NAME
- then
- message "${PROBLEM_COLOR}$SPELL_NAME is not a spell!$DEFAULT_COLOR"
- exit 6
- fi
-
- actions=("Update the spell to a newer version" \
- "Manage patches" \
- "Convert to gpg signing" \
- "Add a \$SCM version" \
- "Try it out" \
- "Quit" )
- query_list "What do you want to do?" ANSWER "${actions[0]}"
"${actions[@]}"
+ actions=('Update the spell to a newer version' \
+ 'Manage patches' \
+ 'Convert to gpg signing' \
+ 'Add a SCM version' \
+ 'Copy it under QUILL_GIT_DIR' \
+ 'Try it out' \
+ 'Quit' )
+ query_list "What do you want to do?" ANSWER "${actions[6]}"
"${actions[@]}"

[[ $ANSWER == "Quit" ]] && exit 0

@@ -212,10 +212,22 @@ then

#reparse the possibly new source urls and company
get_sources_and_urls
+ echo

#download; we are not a grimoire so some hacking is needed
- echo
- summon -r <<< "$sources_and_urls"
+ # also workaround sorcery bug #13412
+ to_summon="$sources_and_urls"
+ for source in $sources
+ do
+ [[ -e $SOURCE_CACHE/$source ]] &&
+ to_summon="$(sed "/^$source /d" <<< "$to_summon")"
+ done
+ if [[ -z $to_summon ]]
+ then
+ message "Nothing new to summon, all sources found."
+ else
+ summon -r <<< "$to_summon"
+ fi

# ask for SECURITY_PATCHing
update_patchlevel SECURITY_PATCH
@@ -252,8 +264,6 @@ then
fi
fi

- #it is either a SOURCE_HASH or the user wants to replace
SOURCE_GPG
-
# SOURCE_GPG usually has unexpanded variables, while we have
the expanded
if ! grep -q $current_check DETAILS.orig
then # looks like it is expanded
@@ -281,34 +291,39 @@ then
continue
fi

- echo sed -ir
"s/^(\s*)SOURCE${i}_(GPG|HASH)=$current_check\s*$/\1SOURCE${i}_HASH=$hash/"
DETAILS
-sed -ir
"s/^(\s*)SOURCE${i}_(GPG|HASH)=$current_check\s*$/\1SOURCE${i}_HASH=$hash/"
DETAILS
-#exit
-# sed -ir
s/^(\s*)SOURCE_(GPG|HASH)=gnu.gpg:$SOURCE.sig:UPSTREAM_KEY\s*$/\1SOURCE_HASH=b341b5b172472338ff2bcffe569f3a0796defe1d326eb85ce52daeff5ce1fb0c9304ec10052c604cadea4056f58f50d11c302ba02b979e88e1d9f112e614b7a9/
DETAILS
-# sed: -e expression #1, char 206: invalid reference \1 on `s' command's RHS
-# Do you want to replace SOURCE3_GPG with a hash? [n] y
-# sed -ir
s/^(\s*)SOURCE3_(GPG|HASH)=sha512:e7ee7a09880d19dea3d2c0d498631ee9d269738e7acdeba0a346da3b8bd0629628582973de33e6ac0c913e8c691806a50e07d520d6f6d078b76a3e74b9b61fd7\s*$/\1SOURCE3_HASH=e7ee7a09880d19dea3d2c0d498631ee9d269738e7acdeba0a346da3b8bd0629628582973de33e6ac0c913e8c691806a50e07d520d6f6d078b76a3e74b9b61fd7/
DETAILS
-# sed: -e expression #1, char 311: invalid reference \1 on `s' command's RHS
+ #it is either a SOURCE_HASH or the user wants to replace
SOURCE_GPG
+echo "+$current_check++"
+ sed -i
"s/^\(\s*\)SOURCE${i}_[^=]*=['\"]*${current_check}['\"]*\s*$/\1SOURCE${i}_HASH=sha512:$hash/"
DETAILS
+
+ # remove sigs, trying not to touch any that are still needed
+ if ! grep -q "VERSION=$version";
+ then
+ [[ -e *$version*.sig ]] && rm *$version*.sig
+ fi

[[ ! $i ]] && i=1
let i+=1
done

+ echo
#update HISTORY
add_history_entries "DETAILS: updated ${if_var:-spell} to
$SPELL_VERSION"
-
+ echo
fi
done

- message "Time for review and custom modifications"
+ echo
sleep 1
- quill_edit
+ rm DETAILS.orig
+ if query "Do you want to review the update or add custom
modifications?" y
+ then
+ quill_edit
+ fi
echo

message "Copying the spell back ..."
quill_final_put_in_grimoire $GRIMOIRE $SECTION no

- rm DETAILS.orig
echo
message "Done with updating the spell!"
echo
@@ -328,7 +343,32 @@ sed -ir "s/^(\s*)SOURCE${i}_(GPG|HASH)=$
#update HISTORY
#copy the spell back to the grimoire?
echo ++"$ANSWER"++ ;;
- "${actions[4]}") #"Try it out"
+ "${actions[4]}") #"Copy it to $QUILL_GIT_DIR"
+
+ if [[ -z $QUILL_GIT_DIR ]]
+ then
+ message "$PROBLEM_COLOR\$QUILL_GIT_DIR is empty, run quill -r to
set it!$DEFAULT_COLOR"
+ echo
+ continue
+ fi
+
+ # find where under $QUILL_GIT_DIR the spell actually is
+ # perhaps the section path is /home/navaden/sorcery/git/gnome1-libs
+ SECTION2=$(find "$QUILL_GIT_DIR" -name $SPELL_NAME -type d -printf
%h)
+ if [[ -z $SECTION2 ]]
+ then
+ message "${PROBLEM_COLOR}Couldn't find the spell, \$QUILL_GIT_DIR
is probably bad!$DEFAULT_COLOR"
+ echo
+ continue
+ fi
+ GRIMOIRE2="${SECTION2%/*}"
+ # we need just the name
+ SECTION2="${SECTION2##*/}"
+
+ quill_final_put_in_grimoire "$GRIMOIRE2" "$SECTION2" no
+ echo
+ ;;
+ "${actions[5]}") #"Try it out"
cast -c $SPELL_NAME
;;
esac
diff --git a/var/lib/quill/ChangeLog b/var/lib/quill/ChangeLog
index feffdd7..9159614 100644
--- a/var/lib/quill/ChangeLog
+++ b/var/lib/quill/ChangeLog
@@ -1,3 +1,9 @@
+2007-01-17 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * quill: further improvements in the update code, notably git copy
support
+ workaround sorcery bug #13412 - only summon when necesary
+ * libcore: added QUILL_GIT_DIR setting to quill_rc
+ quill_final_put_in_grimoire now handles writability better
+
2007-01-17 Andra?? "ruskie" Levstik <ruskie AT mages.ath.cx>
* libperlcpan: one minor fixup

diff --git a/var/lib/quill/modules/libcore b/var/lib/quill/modules/libcore
index b9839e4..344fe34 100644
--- a/var/lib/quill/modules/libcore
+++ b/var/lib/quill/modules/libcore
@@ -84,15 +84,19 @@ function quill_rc() {
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"
+ query_string QUILL_GIT_DIR "${QUERY_COLOR}Where is the dir that contains
your git grimoires if you have any (absolute path)?${DEFAULT_COLOR}"
"$QUILL_GIT_DIR"
message "Thank you. Now generating ${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
- mkdir -p $QUILL_SPELL_DIR
+ cat << QUA > $QUILL_QUILLRC
+ QUILL_CONFIG_VERSION="$quill_version"
+ GURU_NAME="$GURU_NAME"
+ GURU_EMAIL="$GURU_EMAIL"
+ QUILL_SPELL_DIR="$QUILL_SPELL_DIR"
+ QUILL_GIT_DIR="$QUILL_GIT_DIR"
+QUA
+ mkdir -p "$QUILL_SPELL_DIR" "$QUILL_GIT_DIR"
exit 0
else
- . ${QUILL_QUILLRC}
+ . $QUILL_QUILLRC
fi
}

@@ -162,7 +166,7 @@ function quill_set_executable_bit() {
## toggle interactivity and the third the reindexing of the
grimoire
##
## @param internal flag toggling interactivity - grimoire (canonical)
-## @param internal flag toggling interactivity - section
+## @param internal flag toggling interactivity - section name
## @param flag toggling scribe reindex, set it to "no" to toggle
#---
function quill_final_put_in_grimoire() {
@@ -198,7 +202,7 @@ function quill_final_put_in_grimoire() {
echo "Copying failed!"
return 1
else
- echo "Copying succeded"
+ echo "Copying succeded."
if [[ $1 != no ]]; then
echo
echo "Running scribe reindex on $QUILL_GRIM_NAME ..."
@@ -206,7 +210,8 @@ function quill_final_put_in_grimoire() {
fi
fi
}
- if [[ $UID == 0 ]]; then
+
+ if [[ -w $QUILL_GRIM_NAME && -w $QUILL_GRIM_NAME/$QUILL_SECT_NAME ]]; then
quill_final_put_in_grimoire_sub $3
else
export QUILL_GRIM_NAME QUILL_SECT_NAME QUILL_SPELL_DIR SPELL_NAME
@@ -271,7 +276,7 @@ USAGE: quill [OPTIONS]
OPTIONS:
--fmxml, -f <SPELL> get spell data from Freshmeat if possible
--perlcpan, -c <SPELL> get spell data from Perl-CPAN if
possible
- --update, -u <SPELL> update exsisting spell (DISABLED)
+ --update, -u <SPELL> update exsisting spell
--apprentice, -a apprentice mode (default)
--mage, -m mage mode (advanced)
--wizard, -w wizard mode (expert)(DOES NOTHING FOR NOW)



  • [SM-Commit] GIT changes to master quill by Jaka Kranjc (105de10af7890a85eb6edbf5be4466daf89227f7), Jaka Kranjc, 01/17/2007

Archive powered by MHonArc 2.6.24.

Top of Page