Skip to Content.
Sympa Menu

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

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 (8719bd5d8bace9343774295ad90949f57c2854a1)
  • Date: Mon, 22 Jan 2007 09:28:46 -0600

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

usr/bin/quill | 59
+++++++++++++++++++---------------
var/lib/quill/ChangeLog | 12 ++++++
var/lib/quill/modules/libconflicts | 2 -
var/lib/quill/modules/libcore | 34 +++++++++++++------
var/lib/quill/modules/libdepends | 14 ++++----
var/lib/quill/modules/libdesktop | 8 ++--
var/lib/quill/modules/libdetails | 23 ++++++-------
var/lib/quill/modules/libfreshmeatxml | 4 +-
var/lib/quill/modules/libhistory | 13 ++++++-
var/lib/quill/modules/libprovides | 2 -
var/lib/quill/modules/libupdate | 44 ++++++++++++++++++++-----
var/lib/quill/version | 2 -
12 files changed, 144 insertions(+), 73 deletions(-)

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

* quill: fixed the multiversion check to actually look at the versions
added some more sanity checks
aded "Copy it back from under QUILL_GIT_DIR" option, removed wierd
gpg
fixed a mistake from yesterday regarding substitution with hashes
made putting the spell back in the grimoire clear the spelldir
first too
* libcore: added error_msg and query_msg and made use of 'em in all
modules
* libdetails: fixed hunt_src_dir() header
* libhistory: made add_history_entry fully comformant with our
standard
* libupdate: added copy_from_git; now we can sync all three ways
* version: 0.1.13, first 0.2 release candidate

diff --git a/usr/bin/quill b/usr/bin/quill
index 8107fed..15e54d9 100755
--- a/usr/bin/quill
+++ b/usr/bin/quill
@@ -82,7 +82,7 @@ while [[ -n $1 ]]; do
--reconfigure|-r) QUILL_MODE="reconfigure" ;;
--help|-h) quill_help ;;
--version|-v) quill_version ;;
- *) message "${PROBLEM_COLOR}Invalid parameter
$1$DEFAULT_COLOR"
+ *) error_msg "Invalid parameter $1"
quill_help 102 ;;
esac
fi
@@ -102,7 +102,7 @@ quill_rc

# we should do some quillrc sanity checking someday
[[ ! -d $QUILL_SPELL_DIR ]] &&
- echo "Bad QUILL_SPELL_DIR ($QUILL_SPELL_DIR)!" &&
+ error_msg "Bad QUILL_SPELL_DIR ($QUILL_SPELL_DIR)!" &&
echo "Try running quill -r" &&
exit 7

@@ -144,9 +144,9 @@ then
while true; do
actions=('Update the spell to a newer version' \
'Manage patches' \
- 'Convert to gpg signing' \
'Add a SCM version' \
'Copy it under QUILL_GIT_DIR' \
+ 'Copy it back from under QUILL_GIT_DIR' \
'Copy it back to the grimoire' \
'Try it out' \
'Quit' )
@@ -155,7 +155,7 @@ then

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

- if [[ $ANSWER != ${actions[4]} && $ANSWER != ${actions[5]} && $ANSWER !=
${actions[6]} ]]
+ if [[ $ANSWER != ${actions[3]} && $ANSWER != ${actions[4]} && $ANSWER !=
${actions[5]} && $ANSWER != ${actions[6]} ]]
then
#copy spell over and move there
codex_get_spell_paths $(codex_find_spell_by_name $SPELL_NAME)
@@ -170,6 +170,7 @@ then
#fetch current versions, ignoring SCM ones
versions=( $(sed -n 's/\s*\<VERSION=//p' DETAILS |
grep -Eiv '\$[(]date *+|cvs|svn|tla|git|scm' | sort |
uniq) )
+ [[ -z ${versions[@]} ]] && error_msg "No versions to update!" &&
continue
message "Current relevant version(s): ${versions[@]}"

update_counter="${#versions[@]}"
@@ -179,12 +180,13 @@ then
if query "Do you want to update $version?" y
then
query_spell_version
+ [[ -z $SPELL_VERSION ]] && error_msg "Empty VERSION!" &&
continue 2

#save the chosen version
sed -i
"s/\<VERSION=['\"]*${version}['\"]*\s*$/VERSION=$SPELL_VERSION/" DETAILS

#check for multiversion spells
- if [[ $(grep -cE "\<SOURCE.?=" DETAILS) != 1 ]]
+ if [[ $(grep -cE "\<VERSION=" DETAILS) != 1 ]]
then #we have a problem
message "Oh dear, detected a multiversion spell. Going to cat
DETAILS for you "
message "and then you will tell me which variable I need to
set, so I can get "
@@ -220,7 +222,7 @@ then
then
message "SOURCE${i}_URL[0] is ok!"
else
- message "SOURCE${i}_URL[0] is broken! Fix it manually."
+ error_msg "SOURCE${i}_URL[0] is broken! Fix it manually."
sleep 2
quill_edit DETAILS
fi
@@ -247,13 +249,17 @@ then
else
if ! summon -r <<< "$to_summon"
then
- message "${PROBLEM_COLOR}Summoning failed, aborting
update!$DEFAULT_COLOR"
+ error_msg "Summoning failed, aborting update!"
query "Do you want to edit DETAILS? (you can retry the
update)" n && quill_edit DETAILS
continue 2
fi
fi
echo

+ #update HISTORY - already here, so that the patchlevels come
later
+ add_history_entries "DETAILS: updated ${if_var:-spell} to
$SPELL_VERSION"
+ echo
+
# ask for SECURITY_PATCHing
update_patchlevel SECURITY_PATCH

@@ -280,17 +286,12 @@ then
if ! grep -Eq "(^(sha(512|256|1)|md5):.*|UPSTREAM_KEY)" <<<
"$current_check"
then #it is a non-upstream gpg
echo "SOURCE${i}_GPG=$current_check"
- if query "Do you want to replace SOURCE${i}_GPG with a
hash?" n
+ if ! query "Do you want to replace SOURCE${i}_GPG with a
hash?" n
then
#TODO: else sign it and continue
[[ ! $i ]] && i=1
let i+=1
continue
- else
- message "Here is the hash for SOURCE$i anyway, if you need
it later: $hash"
- [[ ! $i ]] && i=1
- let i+=1
- continue
fi
else
# UPSTREAM_HASH is rare and probably not fetched - ignoring
@@ -323,7 +324,7 @@ then
fi
if ! grep -q $current_check DETAILS.orig
then # give up
- message "Giving up, you'll have to update
SOURCE${i}_(GPG|HASH) yourself."
+ error_msg "Giving up, you'll have to update
SOURCE${i}_(GPG|HASH) yourself."
[[ ! $i ]] && i=1
let i+=1
continue
@@ -348,9 +349,6 @@ then
done

echo
- #update HISTORY
- add_history_entries "DETAILS: updated ${if_var:-spell} to
$SPELL_VERSION"
- echo
else
let update_counter-=1
fi
@@ -378,26 +376,37 @@ then
#update HISTORY
#copy the spell back to the grimoire?
echo ++"$ANSWER"++ ;;
- "${actions[2]}") #"Convert to gpg signing"
-#update HISTORY?
-#copy the spell back to the grimoire?
- echo ++"$ANSWER"++ ;;
- "${actions[3]}") #"Add a \$SCM version"
+ "${actions[2]}") #"Add a \$SCM version"
#update patchlevel?
#update HISTORY
#copy the spell back to the grimoire?
echo ++"$ANSWER"++ ;;
- "${actions[4]}") #"Copy it to $QUILL_GIT_DIR"
+ "${actions[3]}") #"Copy it to $QUILL_GIT_DIR"
copy_to_git
;;
+ "${actions[4]}") #"Copy it back from under QUILL_GIT_DIR"
+ copy_from_git
+ ;;
"${actions[5]}") #"Copy it back to the grimoire"
codex_get_spell_paths $(codex_find_spell_by_name $SPELL_NAME)
if [[ ! -e $QUILL_SPELL_DIR/$SPELL_NAME ]]
then
- message "There is nothing to copy back!"
+ error_msg "There is nothing to copy back!"
+ continue
+ fi
+ if [[ ! -e $GRIMOIRE/$SECTION/$SPELL_NAME ]]
+ then
+ error_msg "Origin not found! Very severe!"
+ continue
+ fi
+
+ if [[ -w $GRIMOIRE/$SECTION/$SPELL_NAME && -w $GRIMOIRE/$SECTION ]]
+ then
+ rm -r "$GRIMOIRE/$SECTION/$SPELL_NAME"
else
- quill_final_put_in_grimoire $GRIMOIRE $SECTION no
+ su -c "rm -r '$GRIMOIRE/$SECTION/$SPELL_NAME'"
fi
+ quill_final_put_in_grimoire $GRIMOIRE $SECTION no
;;
"${actions[6]}") #"Try it out"
if query "Do you want to cast -r? (possibly needed for multiversion
spells)" n; then
diff --git a/var/lib/quill/ChangeLog b/var/lib/quill/ChangeLog
index 49f491a..ef43475 100644
--- a/var/lib/quill/ChangeLog
+++ b/var/lib/quill/ChangeLog
@@ -1,4 +1,16 @@
2007-01-21 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * quill: fixed the multiversion check to actually look at the versions
+ added some more sanity checks
+ aded "Copy it back from under QUILL_GIT_DIR" option, removed wierd
gpg
+ fixed a mistake from yesterday regarding substitution with hashes
+ made putting the spell back in the grimoire clear the spelldir
first too
+ * libcore: added error_msg and query_msg and made use of 'em in all
modules
+ * libdetails: fixed hunt_src_dir() header
+ * libhistory: made add_history_entry fully comformant with our
standard
+ * libupdate: added copy_from_git; now we can sync all three ways
+ * version: 0.1.13, first 0.2 release candidate
+
+2007-01-21 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* quill: improved version, hash matching and error handling
added reconfigure query to "Try it out"
skip upstream keys when asking for substitution with hashes
diff --git a/var/lib/quill/modules/libconflicts
b/var/lib/quill/modules/libconflicts
index 34bc306..9b3bf69 100644
--- a/var/lib/quill/modules/libconflicts
+++ b/var/lib/quill/modules/libconflicts
@@ -6,7 +6,7 @@
CONFLICTSISON=""

function query_spell_conflicts() {
- message "${QUERY_COLOR}Please enter any conflicting spell names if
any:${DEFAULT_COLOR}"
+ query_msg "Please enter all conflicting spell names if any:"
read "SPELL_CONFLICTS"
}

diff --git a/var/lib/quill/modules/libcore b/var/lib/quill/modules/libcore
index dabb7ea..f0bd360 100644
--- a/var/lib/quill/modules/libcore
+++ b/var/lib/quill/modules/libcore
@@ -9,7 +9,7 @@ function query_list()
{
local question="$1"
shift
- message "$question"
+ query_msg "$question"
select_list "$@"
}

@@ -61,16 +61,16 @@ function quill_hash_get() {
function quill_rc() {
if [[ -f ${QUILL_OLD_QUILLRC} ]]
then
- message "${QUERY_COLOR}With accordance to Source Mage standards
moving${DEFAULT_COLOR}"
- message "${QUERY_COLOR}${QUILL_OLD_QUILLRC} to
${QUILL_QUILLRC}${DEFAULT_COLOR}"
+ query_msg "With accordance to Source Mage standards moving"
+ query_msg "$QUILL_OLD_QUILLRC to $QUILL_QUILLRC"
mkdir -p ~/.sourcemage/quill
cp ${QUILL_OLD_QUILLRC} ${QUILL_QUILLRC}
if [[ -f ${QUILL_QUILLRC} ]]
then
- message "${QUERY_COLOR}Removing ${QUILL_OLD_QUILLRC}${DEFAULT_COLOR}"
+ query_msg "Removing $QUILL_OLD_QUILLRC"
rm ${QUILL_OLD_QUILLRC}
else
- message "${PROBLEM_COLOR}Ugghhh... something went
wrong...${DEFAULT_COLOR}"
+ error_msg "Ugghhh... something went wrong..."
fi
fi
if [[ ! -f ${QUILL_QUILLRC} ]] ||
@@ -80,7 +80,7 @@ function quill_rc() {
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}"
+ message "${MESSAGE_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"
@@ -142,7 +142,7 @@ function quill_final_tarball() {
cd ${QUILL_SPELL_DIR}
tar -jcvf ${SPELL_NAME}.tar.bz2 ${SPELL_NAME}
if [[ $? != 0 ]]; then
- message "Failed to create spell tarball"
+ error_msg "Failed to create spell tarball"
else
message "Spell tarball created successfully"
fi
@@ -199,7 +199,7 @@ function quill_final_put_in_grimoire() {
mkdir -p $QUILL_GRIM_NAME/$QUILL_SECT_NAME
cp -r $QUILL_SPELL_DIR/$SPELL_NAME $QUILL_GRIM_NAME/$QUILL_SECT_NAME/
if [[ $? != 0 ]]; then
- echo "Copying failed!"
+ error_msg "Copying failed!"
return 1
else
echo "Copying succeded."
@@ -242,7 +242,7 @@ function quill_purge() {
then
message "done."
else
- message "${PROBLEM_COLOR}failed!$DEFAULT_COLOR"
+ error_msg "failed!"
fi
exit $rc
}
@@ -289,12 +289,26 @@ Arjan 'abouter' Bouter
#---
function check_parameter() {
[[ -z $1 ]] &&
- message "${PROBLEM_COLOR}Missing parameter$DEFAULT_COLOR" &&
+ error_msg "Missing parameter" &&
quill_help 101 ||
QUILL_TARGET="$1"
}

#---
+## @Synopsis prints a colored error message
+#---
+function error_msg() {
+ message "$PROBLEM_COLOR$@$DEFAULT_COLOR"
+}
+
+#---
+## @Synopsis prints a colored query message
+#---
+function query_msg() {
+ message "$QUERY_COLOR$@$DEFAULT_COLOR"
+}
+
+#---
## @Synopsis function that displays help and exits
#---
function quill_help() {
diff --git a/var/lib/quill/modules/libdepends
b/var/lib/quill/modules/libdepends
index f54ae68..b0f8293 100644
--- a/var/lib/quill/modules/libdepends
+++ b/var/lib/quill/modules/libdepends
@@ -6,8 +6,8 @@ function query_spell_dependencies() {
if ! [[ $SPELL_DEPENDENCIES ]] ||
! query "Are \"${SPELL_DEPENDENCIES}\" the proper dependencies for this
spell" y
then
- message "${QUERY_COLOR}Please enter the dependencies(non optional) \
-of the spell if any:${DEFAULT_COLOR}"
+ query_msg "Please enter the dependencies(non optional) \
+of the spell if any:"
read "SPELL_DEPENDENCIES"
SPELL_DEPENDENCIES=$(tr ',' ' ' <<< "$SPELL_DEPENDENCIES")
SPELL_DEPENDENCIES=$(sort <<< "$SPELL_DEPENDENCIES")
@@ -16,8 +16,8 @@ fi
}

function query_spell_optional_dependencies() {
- message "${QUERY_COLOR}Please enter the optional dependencies of the \
-spell if any:${DEFAULT_COLOR}"
+ query_msg "Please enter the optional dependencies of the \
+spell if any:"
read -a "SPELL_OPTIONAL_DEPENDENCIES"
}

@@ -39,11 +39,11 @@ function add_optional_dependencies() {
NM=${#SPELL_OPTIONAL_DEPENDENCIES[*]}
for ((MN=0; MN < $NM; MN++))
do
- message "${QUERY_COLOR}${SPELL_OPTIONAL_DEPENDENCIES[$MN]} needs a
./configure enable option${DEFAULT_COLOR}"
+ query_msg "${SPELL_OPTIONAL_DEPENDENCIES[$MN]} needs a ./configure
enable option"
read SPELL_OPTIONAL_DEPENDENCIES_ENABLED[$MN]
- message "${QUERY_COLOR}${SPELL_OPTIONAL_DEPENDENCIES[$MN]} needs a
./configure disable option${DEFAULT_COLOR}"
+ query_msg "${SPELL_OPTIONAL_DEPENDENCIES[$MN]} needs a ./configure
disable option"
read SPELL_OPTIONAL_DEPENDENCIES_DISABLED[$MN]
- message "${QUERY_COLOR}${SPELL_OPTIONAL_DEPENDENCIES[$MN]} needs a
description${DEFAULT_COLOR}"
+ query_msg "${SPELL_OPTIONAL_DEPENDENCIES[$MN]} needs a description"
read SPELL_OPTIONAL_DEPENDENCIES_DESCRIPTION[$MN]

message "optional_depends ${SPELL_OPTIONAL_DEPENDENCIES[$MN]} \\" >>
DEPENDS
diff --git a/var/lib/quill/modules/libdesktop
b/var/lib/quill/modules/libdesktop
index 9992d83..7c01393 100644
--- a/var/lib/quill/modules/libdesktop
+++ b/var/lib/quill/modules/libdesktop
@@ -8,14 +8,14 @@ then
BUILD_DTFILE="desktop/${SPELL_NAME}.desktop, "
DTFILE_MENUENTRY="${SPELL_NAME}"

- message "${QUERY_COLOR}Please enter the name of the
executable:${DEFAULT_COLOR}"
+ query_msg "Please enter the name of the executable:"
read "DTFILE_EXEC"

- message "${QUERY_COLOR}Please enter the menupath separated and closed by
';'{DEFAULT_COLOR}"
- message "${QUERY_COLOR}example:
Applications;Editors;foobar;${DEFAULT_COLOR}"
+ query_msg "Please enter the menupath separated and closed by ';'"
+ message "example: Applications;Editors;foobar;"
read "DTFILE_MENUPATH"

- message "${QUERY_COLOR}Please enter the name of the icon, if it has
one:${DEFAULT_COLOR}"
+ query_msg "Please enter the name of the icon, if it has one:"
read "DTFILE_ICON"

query "Does this app need to be started in an xterm?" "n" &&
DTFILE_TERM="True"
diff --git a/var/lib/quill/modules/libdetails
b/var/lib/quill/modules/libdetails
index f44e90e..fda44d0 100644
--- a/var/lib/quill/modules/libdetails
+++ b/var/lib/quill/modules/libdetails
@@ -8,7 +8,7 @@
function query_spell_name(){
if ! [[ $SPELL_NAME ]] ||
! query "Is $SPELL_NAME the proper spell name?" y; then
- message "${QUERY_COLOR}Please enter the spell name:${DEFAULT_COLOR}"
+ query_msg "Please enter the spell name:"
read "SPELL_NAME"
fi
}
@@ -18,7 +18,7 @@ function query_spell_source_url(){
SPELL_SRC_URL=$(sed
"s,http://prdownloads.sourceforge.net,$SOURCEFORGE_URL,"; <<< $SPELL_SRC_URL)
if ! [[ $SPELL_SRC_URL ]] ||
! query "Is $SPELL_SRC_URL the proper source url?" y; then
- message "${QUERY_COLOR}Please enter the url of the source:${DEFAULT_COLOR}"
+ query_msg "Please enter the url of the source:"
read "SPELL_SRC_URL"
SPELL_SRC_URL=$(sed
"s,http://prdownloads.sourceforge.net,$SOURCEFORGE_URL,"; <<< $SPELL_SRC_URL)
fi
@@ -28,7 +28,7 @@ fi
function query_spell_version(){
if ! [[ $SPELL_VERSION ]] ||
! query "Is $SPELL_VERSION the proper spell version?" y; then
- message "${QUERY_COLOR}Please enter the new version:$DEFAULT_COLOR"
+ query_msg "Please enter the new version:"
read SPELL_VERSION
fi
}
@@ -36,12 +36,12 @@ function query_spell_version(){
function query_spell_signature(){
if [[ $SPELL_SIGNATURE ]] &&
! query "Is $SPELL_SIGNATURE the proper signature key url?" y; then
- message "${QUERY_COLOR}Please enter the url of the signature
key:${DEFAULT_COLOR}"
+ query_msg "Please enter the url of the signature key:"
read "SPELL_SIGNATURE"
fi
if ! [[ $SPELL_SIGNATURE ]]; then
if query "Do you want to use an upstream signature key?" n; then
- message "${QUERY_COLOR}Please enter the url of the signature
key:${DEFAULT_COLOR}"
+ query_msg "Please enter the url of the signature key:"
read "SPELL_SIGNATURE"
fi
fi
@@ -56,7 +56,7 @@ fi
function query_spell_license(){
if ! [[ $SPELL_LICENSE ]] ||
! query "Is $SPELL_LICENSE the proper license?" y; then
- message "${QUERY_COLOR}Please enter the license of the
spell:${DEFAULT_COLOR}"
+ query_msg "Please enter the license of the spell:"
read "SPELL_LICENSE"
fi
}
@@ -64,7 +64,7 @@ fi
function query_spell_url(){
if ! [[ $SPELL_URL ]] ||
! query "Is $SPELL_URL the proper website?" y; then
- message "${QUERY_COLOR}Please enter a website for the
spell:${DEFAULT_COLOR}"
+ query_msg "Please enter a website for the spell:"
read "SPELL_URL"
fi
}
@@ -73,7 +73,7 @@ function query_spell_short_description()
if ! [[ $SPELL_SHORT_DESCRIPTION ]] ||
! ( message "${QUERY_COLOR}Is${DEFAULT_COLOR}\n$SPELL_SHORT_DESCRIPTION"
query "the proper short description?" y ; ) ; then
- message "${QUERY_COLOR}Please enter a short description of the
spell:${DEFAULT_COLOR}"
+ query_msg "Please enter a short description of the spell:"
read "SPELL_SHORT_DESCRIPTION"
fi
}
@@ -81,7 +81,7 @@ fi
function query_spell_description(){
local description=${QUILL_TMP_DIR}/${SPELL_DESC_NAME:-${SPELL_NAME}}
if ! test -f $description ||
- ! ( message "${QUERY_COLOR}Is${DEFAULT_COLOR}"
+ ! ( query_msg "Is"
cat $description
query "the proper long description?" y ; ) ; then
test -s $description ||
@@ -158,9 +158,8 @@ fi

#---
## @Synopsis Assign to SPELL_SRC_DIR the source dir inside a tarball,
-## @return 0 if a tarball and has a src dir
-## @return 1 if a tarball but has no src dir
-## @return 2 if not a tarball.
+## @return 0 if a tarball
+## @return 1 if not a tarball.
#---
function hunt_src_dir(){
message "Checking what is in the tarball ..."
diff --git a/var/lib/quill/modules/libfreshmeatxml
b/var/lib/quill/modules/libfreshmeatxml
index 5b02414..4568f45 100644
--- a/var/lib/quill/modules/libfreshmeatxml
+++ b/var/lib/quill/modules/libfreshmeatxml
@@ -35,7 +35,7 @@ function quill_fmxml_core(){
FRESHMEAT_FILE=$QUILL_TMP_DIR/$1.xml
if ! test -f $FRESHMEAT_FILE; then
if ! curl -o $FRESHMEAT_FILE $FRESHMEAT_XML_URL; then
- message "${PROBLEM_COLOR}Failed to get ${1}${DEFAULT_COLOR}"
+ error_msg "Failed to get $1"
return 1
fi
fi
@@ -43,7 +43,7 @@ function quill_fmxml_core(){
# check that the project was found - exsists
local not_found='Error: project not found.'
if grep -q "$not_found" "$FRESHMEAT_FILE"; then
- message "$PROBLEM_COLOR$not_found$DEFAULT_COLOR"
+ error_msg "$not_found"
rm "$FRESHMEAT_FILE"
return 2
fi
diff --git a/var/lib/quill/modules/libhistory
b/var/lib/quill/modules/libhistory
index f6b98fc..2e05edc 100644
--- a/var/lib/quill/modules/libhistory
+++ b/var/lib/quill/modules/libhistory
@@ -20,11 +20,20 @@ message "Done."
#---
function add_history_entry()
{
- local title="$HISTORY_DATE $GURU_NAME <$GURU_EMAIL>"
+ local title="$HISTORY_DATE $GURU_NAME <$GURU_EMAIL>" file

if grep -q "$title" HISTORY;
then
- sed -i "/$title/ a\\\t* $1" HISTORY
+ # check if we already have an entry for the same file
+ file="${1%%:*}"
+ if [[ -z $(sed -n "1,/^\s*$/ s,\* $file:,&,p" HISTORY) ]]
+ then
+ sed -i "/$title/ a\\\t* $1" HISTORY
+ else
+ sed -i "1,/^\s*$/ {
+ /\* $file:/ a\\\t ${1#*:}
+ }" HISTORY
+ fi
else # first time
sed -i "1 s/^.*$/$title\n\t* $1\n\n&/" HISTORY
fi
diff --git a/var/lib/quill/modules/libprovides
b/var/lib/quill/modules/libprovides
index 2ce1aca..37f441e 100644
--- a/var/lib/quill/modules/libprovides
+++ b/var/lib/quill/modules/libprovides
@@ -6,7 +6,7 @@
PROVIDESISON=""

function query_spell_provides() {
- message "${QUERY_COLOR}Please enter provides if any:${DEFAULT_COLOR}"
+ query_msg "Please enter provides if any:"
read "SPELL_PROVIDES"
}

diff --git a/var/lib/quill/modules/libupdate b/var/lib/quill/modules/libupdate
index 0750043..ee55e81 100644
--- a/var/lib/quill/modules/libupdate
+++ b/var/lib/quill/modules/libupdate
@@ -61,7 +61,7 @@ function update_patchlevel_sub()
then
echo
message "Two or more $1 variables with the same value found."
- message "All will be changed - revert the bad ones manually."
+ error_msg "All will be changed - revert the bad ones manually."
echo
fi
if [[ $action == remove ]]
@@ -91,15 +91,15 @@ function count_spaces()
}

#---
-## @Synopsis Copies the spell to $QUILL_GIT_DIR
+## @Synopsis Finds the spell under $QUILL_GIT_DIR
#---
-function copy_to_git()
+function copy_git_sub()
{
if [[ -z $QUILL_GIT_DIR ]]
then
- message "$PROBLEM_COLOR\$QUILL_GIT_DIR is empty, run quill -r to set
it!$DEFAULT_COLOR"
+ error_msg "\$QUILL_GIT_DIR is empty, run quill -r to set it!"
echo
- continue
+ return 1
fi

# find where under $QUILL_GIT_DIR the spell actually is
@@ -107,18 +107,46 @@ function copy_to_git()
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"
+ error_msg "Couldn't find the spell, \$QUILL_GIT_DIR is probably bad!"
echo
- continue
+ return 1
fi
- GRIMOIRE2="${SECTION2%/*}"
+ GRIMOIRE2="${SECTION2%/*}" # full path
# we need just the name
SECTION2="${SECTION2##*/}"
+}
+
+#---
+## @Synopsis Copies the spell to $QUILL_GIT_DIR
+#---
+function copy_to_git()
+{
+ copy_git_sub || return 1

# we wipe it first, so we can handle any files that we deleted before
rm -r "$GRIMOIRE2/$SECTION2/$SPELL_NAME"/*

quill_final_put_in_grimoire "$GRIMOIRE2" "$SECTION2" no
+ unset GRIMOIRE2 SECTION2
+}
+
+#---
+## @Synopsis Copies the spell from $QUILL_GIT_DIR to $QUILL_SPELL_DIR
+#---
+function copy_from_git()
+{
+ copy_git_sub || return 1
+
+ # we wipe it first, so we can handle any files that were deleted
+ rm -r "$QUILL_SPELL_DIR/$SPELL_NAME"
+
+ if [[ -w $QUILL_SPELL_DIR ]]
+ then
+ cp -r "$GRIMOIRE2/$SECTION2/$SPELL_NAME" "$QUILL_SPELL_DIR"
+ else
+ su -c "cp -r '$GRIMOIRE2/$SECTION2/$SPELL_NAME' '$QUILL_SPELL_DIR'"
+ fi
+ unset GRIMOIRE2 SECTION2
}

#---
diff --git a/var/lib/quill/version b/var/lib/quill/version
index 0e24a92..7ac4e5e 100644
--- a/var/lib/quill/version
+++ b/var/lib/quill/version
@@ -1 +1 @@
-0.1.12
+0.1.13



  • [SM-Commit] GIT changes to master quill by Jaka Kranjc (8719bd5d8bace9343774295ad90949f57c2854a1), Jaka Kranjc, 01/22/2007

Archive powered by MHonArc 2.6.24.

Top of Page