- if [[ "${PREPAREISON}" == "PREPARE, " ]]
+ if [[ -f ${QUILL_SPELL_DIR}/${SPELL_NAME}/PREPARE ]]
then
add_prepare
fi
@@ -456,12 +456,12 @@ else
#- add_configure
#-fi
- if [[ "${PREBUILDISON}" == "PRE_BUILD, " ]]
+ if [[ -f ${QUILL_SPELL_DIR}/${SPELL_NAME}/PRE_BUILD ]]
then
add_pre_build
fi
- if [[ "${BUILDISON}" == "BUILD, " ]]
+ if [[ -f ${QUILL_SPELL_DIR}/${SPELL_NAME}/BUILD ]]
then
if [[ -e $QUILL_TMP_DIR/${SPELL_SRC_FILE:-uag1au234gaugua} ]]
then
@@ -477,7 +477,7 @@ else
fi
fi
- if [[ "${INSTALLISON}" == "INSTALL, " ]]
+ if [[ -f ${QUILL_SPELL_DIR}/${SPELL_NAME}/INSTALL ]]
then
if [[ -z $BS ]]; then
add_install
@@ -500,7 +500,7 @@ else
#- add_triggers
#-fi
- if [[ "${BUILD_DTFILE}" != "" ]]
+ if [[ -f ${QUILL_SPELL_DIR}/${SPELL_NAME}/desktop/${SPELL_NAME}.desktop ]]
then
add_desktop_file
fi
diff --git a/var/lib/quill/ChangeLog b/var/lib/quill/ChangeLog
index 242f44f..0625aff 100644
--- a/var/lib/quill/ChangeLog
+++ b/var/lib/quill/ChangeLog
@@ -1,3 +1,36 @@
+2007-09-15 Andraž "ruskie" Levstik <ruskie AT mages.ath.cx>
+ * quill: use the new way of checking for file existance
+ * libbuild: removed unenecassry variables,
+ added touching of file, don't assume we are in the correct dir
+ * libconflicts: removed unenecassry variables,
+ added touching of file, don't assume we are in the correct dir
+ * libcopy: removed unenecassry variables,
+ added touching of file, don't assume we are in the correct dir
+ * libcore: removed unenecassry variables,
+ added touching of file, don't assume we are in the correct dir
+ * libdepends: removed unenecassry variables,
+ added touching of file, don't assume we are in the correct dir
+ * libdesktop: removed unenecassry variables,
+ added touching of file, don't assume we are in the correct dir
+ * libdetails: removed unenecassry variables,
+ added touching of file, don't assume we are in the correct dir
+ * libhistory: removed unenecassry variables,
+ added touching of file, don't assume we are in the correct dir
+ * libinstall: removed unenecassry variables,
+ added touching of file, don't assume we are in the correct dir
+ * libpre_build: removed unenecassry variables,
+ added touching of file, don't assume we are in the correct dir
+ * libprepare: removed unenecassry variables,
+ added touching of file, don't assume we are in the correct dir
+ * libprovides: removed unenecassry variables,
+ added touching of file, don't assume we are in the correct dir
+ * libupdate: removed unenecassry variables,
+ added touching of file, don't assume we are in the correct dir
+ * site_handlers/libperlcpan: removed unenecassry variables,
+ added touching of file, don't assume we are in the correct dir
+ * site_handlers/librubyraa: removed unenecassry variables,
+ added touching of file, don't assume we are in the correct dir
+
2007-09-14 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libcore: added a sanity check to quill_final_put_in_grimoire
* quill: source the site handlers from their new home
diff --git a/var/lib/quill/modules/libbuild b/var/lib/quill/modules/libbuild
index eb73f1c..9ca469f 100644
--- a/var/lib/quill/modules/libbuild
+++ b/var/lib/quill/modules/libbuild
@@ -3,12 +3,12 @@
#---
##
-## @Globals QUILL_FETCH_MODE BUILDISON
+## @Globals QUILL_FETCH_MODE
function query_spell_build() {
if [[ "$QUILL_FETCH_MODE" != "cpan" ]]; then
if query "Will you be adding a custom BUILD file:" "n"
then
- BUILDISON="BUILD, "
+ touch $QUILL_SPELL_DIR/$SPELL_NAME/BUILD
fi
fi
}
@@ -21,12 +21,12 @@ function add_build() {
else
if query "Do you want the default_build function dumped into the BUILD
file" "n"
then
- dump_default_function build | sed -e 's:\( --[^hb]\): \\\n \1:g' -e
"s:&& make:\&\&\nmake:" >> BUILD
+ dump_default_function build | sed -e 's:\( --[^hb]\): \\\n \1:g' -e
"s:&& make:\&\&\nmake:" >> ${QUILL_SPELL_DIR}/${SPELL_NAME}/BUILD
else
- echo "default_build &&" >> BUILD
+ echo "default_build &&" >> ${QUILL_SPELL_DIR}/${SPELL_NAME}/BUILD
fi
fi
- $EDITOR BUILD
+ $EDITOR ${QUILL_SPELL_DIR}/${SPELL_NAME}/BUILD
}
#---
@@ -297,9 +295,9 @@ function check_source_urls() {
fi
# some urls may contain other expanded vars that we are not
aware of
- if grep -q "$oldest_su" DETAILS
+ if grep -q "$oldest_su" ${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS
then # all is fine
- sed -i "s,$oldest_su,$su," DETAILS
+ sed -i "s,$oldest_su,$su,"
${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS
else
error_msg "Couldn't find $oldest_su in DETAILS,"
error_msg "probably due to it containing nonstandard variables"
@@ -308,13 +306,13 @@ function check_source_urls() {
add_history_entry "DETAILS: Changed SOURCE${i}_URL[$mirror_num]
extension"
else
substitute_with_variables source "$SPELL_NAME" {SPELL}
"$SPELL_VERSION" {VERSION}
- sed -i "s,$old_source,$source," DETAILS
+ sed -i "s,$old_source,$source,"
${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS
# we don't know if the SOURCE is expanded or not, trying just
both extremes
substitute_with_variables old_source "$SPELL_NAME" {SPELL}
"$SPELL_VERSION" {VERSION}
- sed -i "s,$old_source,$source," DETAILS
+ sed -i "s,$old_source,$source,"
${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS
# and with the beautiful syntax last
old_source="$(tr -d "{}" <<< "$old_source")"
- sed -i "s,$old_source,$source," DETAILS
+ sed -i "s,$old_source,$source,"
${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS
add_history_entry "DETAILS: Changed SOURCE${i} extension"
fi
rc=0
@@ -322,7 +320,7 @@ function check_source_urls() {
# if they are still not ok ask for fixed ones
error_msg "SOURCE${i}_URL[$mirror_num] is hopelessly broken! Fix
it manually."
sleep 2
- quill_edit DETAILS
+ quill_edit ${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS
add_history_entry "DETAILS: Fixed SOURCE${i}_URL[$mirror_num]"
rc=1
fi
@@ -467,17 +465,17 @@ function check_executable_bits(){
#---
function check_description_wrap(){
@@ -506,7 +504,7 @@ function summon_sources() {
else
if ! summon -r <<< "$to_summon"; then
error_msg "Summoning failed, aborting update!"
- query "Do you want to edit DETAILS? (you can retry the update)" n &&
quill_edit DETAILS
+ query "Do you want to edit DETAILS? (you can retry the update)" n &&
quill_edit ${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS
continue 2 || return 1
fi
fi
@@ -524,7 +522,7 @@ function inc_to_unique_src_num() {
local name="$1" num
num=$(
- eval ${version_switch:-:}; . DETAILS &> /dev/null
+ eval ${version_switch:-:}; . ${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS &>
/dev/null
# the numbers are alphabetically sorted, which is not good enough in the
# rare case where there are more than 9 sources - so we resort to
resorting
get_source_nums | sort -n | tail -n1
diff --git a/var/lib/quill/modules/libdepends
b/var/lib/quill/modules/libdepends
index 666c0ed..6b0233b 100644
--- a/var/lib/quill/modules/libdepends
+++ b/var/lib/quill/modules/libdepends
@@ -23,20 +23,19 @@ function query_spell_optional_dependencies() {
}
##
-## @Globals DEPENDSISON SPELL_DEPENDENCIES
+## @Globals SPELL_DEPENDENCIES
function add_dependencies() {
local i
- touch DEPENDS
- DEPENDSISON="DEPENDS, "
+ touch ${QUILL_SPELL_DIR}/${SPELL_NAME}/DEPENDS
for i in ${SPELL_DEPENDENCIES}
do
- echo "depends ${i}" >> DEPENDS
+ echo "depends ${i}" >> ${QUILL_SPELL_DIR}/${SPELL_NAME}/DEPENDS
done
}
##
-## @Globals DEPENDSISON SPELL_OPTIONAL_DEPENDENCIES
+## @Globals SPELL_OPTIONAL_DEPENDENCIES
function add_optional_dependencies() {
local dep dep_count
local SPELL_OPTIONAL_DEPENDENCIES_ENABLED[0]=""
@@ -44,8 +43,7 @@ function add_optional_dependencies() {
local SPELL_OPTIONAL_DEPENDENCIES_DESCRIPTION[0]=""
dep_count=${#SPELL_OPTIONAL_DEPENDENCIES[*]}
- touch DEPENDS
- DEPENDSISON="DEPENDS, "
+ touch ${QUILL_SPELL_DIR}/${SPELL_NAME}/DEPENDS
for ((dep=0; dep < $dep_count; dep++))
do
query_msg "${SPELL_OPTIONAL_DEPENDENCIES[$dep]} needs a ./configure
enable option"
@@ -55,10 +53,10 @@ function add_optional_dependencies() {
query_msg "${SPELL_OPTIONAL_DEPENDENCIES[$dep]} needs a description"
read SPELL_OPTIONAL_DEPENDENCIES_DESCRIPTION[$dep]
message "Done.\n"
}
diff --git a/var/lib/quill/modules/libhistory
b/var/lib/quill/modules/libhistory
index 6147992..204a6c0 100644
--- a/var/lib/quill/modules/libhistory
+++ b/var/lib/quill/modules/libhistory
@@ -12,8 +12,9 @@ function add_history()
message "Generating HISTORY file ..."
files=$(echo * | sed -e 's, \S*\.sign* , ,g; s, \S*\.asc , ,g' -e 's/ /,
/g')
- echo > HISTORY
- sed -i "1 s%^.*$%$title\n\t* ${files/HISTORY/}, HISTORY: $1\n%" HISTORY
+ echo > ${QUILL_SPELL_DIR}/${SPELL_NAME}/HISTORY
+ sed -i "1 s%^.*$%$title\n\t* ${files/HISTORY/}, HISTORY: $1\n%" \
+ ${QUILL_SPELL_DIR}/${SPELL_NAME}/HISTORY
message "Done."
@@ -29,31 +30,38 @@ function add_history_entry()
{
local title="$HISTORY_DATE $GURU_NAME <$GURU_EMAIL>" file
- if [[ ! -e HISTORY ]]; then
+ if [[ ! -e ${QUILL_SPELL_DIR}/${SPELL_NAME}/HISTORY ]]; then
error_msg "Spell is missing a HISTORY file!"
- [[ -e DETAILS.orig ]] && mv DETAILS.orig ..
+ [[ -e ${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS.orig ]] &&
+ mv ${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS.orig \
+ ${QUILL_TMP_DIR}/${SPELL_NAME}-DETAILS.orig
add_history "added missing HISTORY file"
- [[ -e ../DETAILS.orig ]] && mv ../DETAILS.orig .
+ [[ -e ${QUILL_TMP_DIR}/${SPELL_NAME}-DETAILS.orig ]] &&
+ mv ${QUILL_TMP_DIR}/${SPELL_NAME}-DETAILS.orig \
+ ${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS.orig
fi
- if grep -q "$title" HISTORY;
+ if grep -q "$title" ${QUILL_SPELL_DIR}/${SPELL_NAME}/HISTORY;
then
# check if we already have an entry for the same file
file="${1%%:*}"
- if [[ -z $(sed -n "1,/^\s*$/ s%\* $file:%&%p" HISTORY) ]]
+ if [[ -z $(sed -n "1,/^\s*$/ s%\* $file:%&%p" \
+ ${QUILL_SPELL_DIR}/${SPELL_NAME}/HISTORY) ]]
then # we don't
- sed -i "/$title/ a\\\t* $1" HISTORY
+ sed -i "/$title/ a\\\t* $1" ${QUILL_SPELL_DIR}/${SPELL_NAME}/HISTORY
else
# we do, but first check that the new addition is unique
- if ! sed -n "1,/^\s*$/p" HISTORY | grep -qF "* $1"
+ if ! sed -n "1,/^\s*$/p" ${QUILL_SPELL_DIR}/${SPELL_NAME}/HISTORY | \
+ grep -qF "* $1"
then
sed -i "1,/^\s*$/ {
/\* $file:/ a\\\t ${1#*:}
- }" HISTORY
+ }" ${QUILL_SPELL_DIR}/${SPELL_NAME}/HISTORY
fi
fi
else # first time today
- sed -i "1 s%^.*$%$title\n\t* $1\n\n&%" HISTORY
+ sed -i "1 s%^.*$%$title\n\t* $1\n\n&%" \
+ ${QUILL_SPELL_DIR}/${SPELL_NAME}/HISTORY
fi
}
@@ -96,7 +104,7 @@ function add_user_history_entries()
echo
if [[ $modified == "1" ]]; then
query "Do you want to review the HISTORY changes?" n &&
- quill_edit HISTORY
+ quill_edit ${QUILL_SPELL_DIR}/${SPELL_NAME}/HISTORY
echo
SPELL_UPDATED=y
fi
diff --git a/var/lib/quill/modules/libinstall
b/var/lib/quill/modules/libinstall
index 6880e6e..4eea173 100644
--- a/var/lib/quill/modules/libinstall
+++ b/var/lib/quill/modules/libinstall
@@ -6,23 +6,23 @@
## @Globals EDITOR
function add_install()
{
- touch INSTALL
+ touch ${QUILL_SPELL_DIR}/${SPELL_NAME}/INSTALL
if query "Do you want the default_install function dumped into the INSTALL
file" "n"
then
- dump_default_function install > INSTALL
+ dump_default_function install > ${QUILL_SPELL_DIR}/${SPELL_NAME}/INSTALL
else
- echo "default_install &&" > INSTALL
+ echo "default_install &&" > ${QUILL_SPELL_DIR}/${SPELL_NAME}/INSTALL
fi
- $EDITOR INSTALL
+ $EDITOR ${QUILL_SPELL_DIR}/${SPELL_NAME}/INSTALL
}
##
-## @Globals INSTALLISON
+## @Globals
function query_spell_install()
{
if query "Will you be adding a custom INSTALL file:" "n"
then
- INSTALLISON="INSTALL, "
+ touch ${QUILL_SPELL_DIR}/${SPELL_NAME}/INSTALL
fi
}
##
-## @Globals PREBUILDISON
+## @Globals
function query_spell_pre_build()
{
if query "Will you be adding a custom PRE_BUILD file:" "n"
then
- PREBUILDISON="PRE_BUILD, "
+ touch ${QUILL_SPELL_DIR}/${SPELL_NAME}/PRE_BUILD
fi
}
@@ -20,15 +20,15 @@ function add_pre_build()
cp ${QUILL_TMP_DIR}/${SPELL_NAME}-PRE_BUILD \
${QUILL_SPELL_DIR}/${SPELL_NAME}/PRE_BUILD
else
- touch PRE_BUILD
+ touch ${QUILL_SPELL_DIR}/${SPELL_NAME}/PRE_BUILD
if query "Do you want the default_pre_build function dumped into the
PRE_BUILD file" "n"
then
- dump_default_function pre_build | sed "s:&&:\&\&\n:g" > PRE_BUILD
+ dump_default_function pre_build | sed "s:&&:\&\&\n:g" >
${QUILL_SPELL_DIR}/${SPELL_NAME}/PRE_BUILD
else
- echo "default_pre_build &&" > PRE_BUILD
+ echo "default_pre_build &&" >
${QUILL_SPELL_DIR}/${SPELL_NAME}/PRE_BUILD
fi
fi
- $EDITOR PRE_BUILD
+ $EDITOR ${QUILL_SPELL_DIR}/${SPELL_NAME}/PRE_BUILD
}
#---
##
diff --git a/var/lib/quill/modules/libprepare
b/var/lib/quill/modules/libprepare
index b43910c..4fb15b6 100644
--- a/var/lib/quill/modules/libprepare
+++ b/var/lib/quill/modules/libprepare
@@ -3,12 +3,12 @@
#---
##
-## @Globals PREPAREISON
+## @Globals
function query_spell_prepare()
{
if query "Will you be adding a PREPARE file:" "n"
then
- PREPAREISON="PREPARE, "
+ touch ${QUILL_SPELL_DIR}/${SPELL_NAME}/PREPARE
fi
}
#---
@@ -65,7 +65,7 @@ function update_patchlevel_sub()
add_history_entry "DETAILS: $1++"
else
new_value=$(( current_value + 1 ))
- count=$(grep -c "^[^#]*$1=['\"]*${current_value}['\"]* *$" DETAILS)
+ count=$(grep -c "^[^#]*$1=['\"]*${current_value}['\"]* *$"
${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS)
if (( $count > 1 ))
then
echo
@@ -75,9 +75,9 @@ function update_patchlevel_sub()
fi
if [[ $action == remove ]]
then #PATCHLEVEL removal on version updates
- sed -i "/^[^#]*$1=['\"]*${current_value}['\"]*/d" DETAILS
+ sed -i "/^[^#]*$1=['\"]*${current_value}['\"]*/d"
${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS
else
- sed -i "/^[^#]*$1=['\"]*${current_value}['\"]*/ s,=.*$,=$new_value,"
DETAILS
+ sed -i "/^[^#]*$1=['\"]*${current_value}['\"]*/ s,=.*$,=$new_value,"
${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS
add_history_entry "DETAILS: $1++"
fi
fi
@@ -93,7 +93,7 @@ function update_patchlevel_sub()
function count_spaces()
{
local count spaces eq_col
- eq_col=$(awk -F '=' '{ if($1)print length($1) }' DETAILS | sort | uniq -c
| sort -n | sed -n '$ s,^\s*\S*\s,,p')
+ eq_col=$(awk -F '=' '{ if($1)print length($1) }'
${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS | sort | uniq -c | sort -n | sed -n
'$ s,^\s*\S*\s,,p')
count=$(( $eq_col - ${#1} ))
for (( i=0 ; i<$count; i++ )) ; do
spaces="$spaces "
@@ -116,8 +116,8 @@ function multiversion_check()
message "and then you will tell me which variable I need to set, so I
can get "
message "to the correct version ($version)."
sleep 3
- cat DETAILS
- suggestions=$(sed -n 's,[{}],,g; s,^.*if.*$\([A-Za-z_]*\).*$,\1,p'
DETAILS)
+ cat ${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS
+ suggestions=$(sed -n 's,[{}],,g; s,^.*if.*$\([A-Za-z_]*\).*$,\1,p'
${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS)
[[ ! -z $suggestions ]] && query_msg "Perhaps it is one of these:"
$suggestions
query_string version_switch "${QUERY_COLOR}Please enter the appropriate
variable. Example: UGU_DEVEL=y${DEFAULT_COLOR} "
fi
@@ -153,7 +153,7 @@ function version_bump() {
[[ -z $SPELL_VERSION ]] && error_msg "Empty VERSION!" && continue 2
#save the chosen version
- sed -i "s/\sVERSION=['\"]*${version}['\"]*\s*$/ VERSION=$SPELL_VERSION/"
DETAILS
+ sed -i "s/\sVERSION=['\"]*${version}['\"]*\s*$/ VERSION=$SPELL_VERSION/"
${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS
SPELL_UPDATED=y
#check for multiversion spells
@@ -182,7 +182,7 @@ function version_bump() {
update_patchlevel PATCHLEVEL skip remove
# remove UPDATED if any
- sed -i "/^\s*UPDATED=/d" DETAILS
+ sed -i "/^\s*UPDATED=/d" ${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS
#get hashes and save them, removing any previous hash/gpg
i=
@@ -207,7 +207,7 @@ function version_bump() {
# MD5? These contain no :
if ! grep -q ":" <<< "$current_check"; then
new_value=$(count_spaces SOURCE${i}_HASH)
- sed -i
"s/^.*MD5\[${i:-0}\]=['\"]*${current_check}['\"]*\s*$/${new_value}SOURCE${i}_HASH=sha512:$hash/"
DETAILS
+ sed -i
"s/^.*MD5\[${i:-0}\]=['\"]*${current_check}['\"]*\s*$/${new_value}SOURCE${i}_HASH=sha512:$hash/"
${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS
remove_old_sigs "$version"
upstream_gpg_ad
@@ -253,7 +253,7 @@ function version_bump() {
#it is either a SOURCE_HASH or the user wants to replace SOURCE_GPG
new_value=$(count_spaces SOURCE${i}_HASH)
- sed -i
"s/^.*SOURCE${i}_[^=]*=['\"]*${current_check}.*['\"]*\s*$/${new_value}SOURCE${i}_HASH=sha512:$hash/"
DETAILS
+ sed -i
"s/^.*SOURCE${i}_[^=]*=['\"]*${current_check}.*['\"]*\s*$/${new_value}SOURCE${i}_HASH=sha512:$hash/"
${QUILL_SPELL_DIR}/${SPELL_NAME}/DETAILS
# remove sigs, trying not to touch any that are still needed
remove_old_sigs "$version"
@@ -280,7 +280,7 @@ function main_update_loop() {
local version versions=()