Skip to Content.
Sympa Menu

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

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 (690b9aca5032ad8500a221b9f1445ab83d78bc08)
  • Date: Sun, 5 Nov 2006 12:49:26 -0600

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

usr/bin/quill | 123 ++++++-
usr/bin/quill-old | 561
----------------------------------
var/lib/quill/ChangeLog | 14
var/lib/quill/modules/libconfigure | 18 -
var/lib/quill/modules/libcore | 5
var/lib/quill/modules/libdetails | 9
var/lib/quill/modules/libfreshmeatxml | 17 -
var/lib/quill/modules/libhistory | 33 ++
var/lib/quill/modules/libtriggers | 0
9 files changed, 173 insertions(+), 607 deletions(-)

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

beginnings of update mode and miscellanaea

note to self: update first to avoid conflicts, duh!

diff --git a/usr/bin/quill b/usr/bin/quill
index 180bdc8..46c73a5 100755
--- a/usr/bin/quill
+++ b/usr/bin/quill
@@ -56,14 +56,15 @@ while [ -n "$1" ]; do
[[ -z $2 ]] &&
message "${PROBLEM_COLOR}Missing parameter$DEFAULT_COLOR"
&&
quill_help 101
- export QUILL_FMXML_MODE="on"; export QUILL_FMXML_PARAM="$2"
+ export QUILL_FMXML_MODE="on"; export QUILL_TARGET="$2"
shift 2 ;;
--perlcpan|-c)
[[ -z $2 ]] &&
message "${PROBLEM_COLOR}Missing parameter$DEFAULT_COLOR"
&&
quill_help 101
- export QUILL_CPAN_MODE="on"; export QUILL_CPAN_PARAM="$2"
+ export QUILL_CPAN_MODE="on"; export QUILL_TARGET="$2"
shift 2 ;;
+ --update|-u) export QUILL_UPDATE="on" QUILL_TARGET="$2"; shift 2 ;;
--apprentice|-a) export QUILL_MODE="apprentice"; shift 1 ;;
--mage|-m) export QUILL_MODE="mage"; shift 1 ;;
--wizard|-w) export QUILL_MODE="wizard"; shift 1 ;;
@@ -92,6 +93,11 @@ QUILL_SPELL_DIR=~/.sourcemage/spells
QUILL_TMP_DIR=~/.sourcemage/tmp

quill_rc
+# we should do some quillrc sanity checking someday
+[[ ! -d $QUILL_SPELL_DIR ]] &&
+ echo "PEBKAC: bad QUILL_SPELL_DIR ($QUILL_SPELL_DIR)" &&
+ exit 7
+
PROMPT_DELAY="31557807"
BUILD_API=2
load_build_api
@@ -104,21 +110,102 @@ #---
## Questions and stuff

quill_welcome
-if [[ "${QUILL_MODE}" == "apprentice" ]] ||
- [[ "${QUILL_MODE}" == "mage" ]] ||
- [[ "${QUILL_MODE}" == "wizard" ]]
+if [[ "$QUILL_FMXML_MODE" == "on" ]]
then
- if [[ "${QUILL_FMXML_MODE}" == "on" ]]
- then
- QUILL_FMXML_SPELL="$QUILL_FMXML_PARAM"
- quill_fmxml_core $QUILL_FMXML_PARAM
- fi
- if [[ "${QUILL_CPAN_MODE}" == "on" ]]
- then
- QUILL_CPAN_SPELL="$QUILL_CPAN_PARAM"
- quill_cpan_core $QUILL_CPAN_PARAM
- fi
+ # fetches SPELL_NAME, SPELL_DESC_NAME, SPELL_SRC_URL, SPELL_URL,
+ # SPELL_LICENSE and both descriptions
+ quill_fmxml_core $QUILL_TARGET
+
+ # creates SPELL_VERSION and SPELL_SRC_FILE (to be SOURCE)
+ parse_spell_source_file_info
+fi
+
+if [[ "$QUILL_CPAN_MODE" == "on" ]]
+then
+ quill_cpan_core $QUILL_TARGET
+fi
+
+if [[ "$QUILL_UPDATE" == "ion" ]]
+then
+ 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" )
+ message "${QUERY_COLOR}What do you want to do?$DEFAULT_COLOR"
+ select_list ANSWER "" "${actions[@]}"
+
+ [[ $ANSWER == "Quit" ]] && exit 0
+
+ #copy spell over and move there
+ rm -fr $QUILL_SPELL_DIR/$SPELL_NAME
+ cp -rv $(codex_find_spell_by_name $SPELL_NAME) $QUILL_SPELL_DIR
+ cd $QUILL_SPELL_DIR/$SPELL_NAME
+
+ case "$ANSWER" in
+ "${actions[0]}") #"Update the spell to a newer version"
+ #fetch current versions, ignoring SCM ones
+ versions=( $(sed -n 's/\s*\<VERSION=//p' DETAILS |
+ grep -Eiv '\$[(]date *+|cvs|svn|tla|git|scm') )
+ message "Current relevant version(s): ${versions[@]}"
+
+ #suggest the new one from fm and/or ask for input
+ for version in "${versions[@]}"
+ do
+ if query "Do you want to update $version?" y
+ then
+ query_spell_version
+
+ #save versions
+ sed -i "s/\<VERSION=$version/VERSION=$SPELL_VERSION/" DETAILS
+
+ #check that source urls are ok
+ #if not ask for fixed ones
+ #download
+ #get hashes
+ #save hashes
+ #restore patchlevel
+
+ fi
+ done
+#update HISTORY
+#copy the spell back to the grimoire?
+
+ echo ++"$ANSWER"++ ;;
+ "${actions[1]}") #"Manage patches"
+#update patchlevel?
+#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"
+#update patchlevel?
+#update HISTORY
+#copy the spell back to the grimoire?
+ echo ++"$ANSWER"++ ;;
+ "${actions[4]}") #"Try it out"
+#check if there is anything to try out
+ #if not just continue
+#copy the spell back to the grimoire
+#cast
+ echo ++"$ANSWER"++ ;;
+ esac
+
+ done
+ exit 0
+else
query_spell_name
query_spell_source_url
query_spell_license
@@ -187,8 +274,10 @@ then
add_provides
fi

- parse_spell_source_file_info
-
+ if [[ "$QUILL_FMXML_MODE" != "on" ]]
+ then
+ parse_spell_source_file_info
+ fi
show_spell_source_file_info

get_spell_source
diff --git a/usr/bin/quill-old b/usr/bin/quill-old
deleted file mode 100755
index a234725..0000000
--- a/usr/bin/quill-old
+++ /dev/null
@@ -1,561 +0,0 @@
-#!/bin/bash
-#---
-## @Synopsis Spell creator script for SourceMage GNU/Linux
-## @Copyright Copyright 2005 Andrew "ruskie" Levstik <ruskie AT mages.ath.cx>
-## @Copyright Copyright 2005 SourceMage GNU/Linux
-## @License GPL v2
-##
-## @ToDo figure out how to do conversions to proper url variables
-## @ToDo put a CVS/SVN option
-## @ToDo make an option to edit all the existing files after generation
-## @ToDo make configuring optional depends a must
-##
-## Asks the user in simple questions about generating a spell.
-## @Globals BUILDISON, INSTALLISON, PREBUILDISON, TRIGGERSISON
-## @Globals SPELL_HISTORY_NAME, SPELL_HISTORY_EMAIL, SPELL_NAME,
-## @Globals SPELL_SRC_URL, SPELL_LICENSE, SPELL_URL, SPELL_SHORT_DESCRIPTION,
-## @Globals SPELL_DESCRIPTION, SPELL_DEPENDENCIES,
SPELL_OPTIONAL_DEPENDENCIES,
-## @Globals SPELL_CONFLICTS, HISOTRY_DATE, SPELL_DATE, SPELL_SRC_FILE,
-## @Globals SPELL_SANITIZED_FILE_NAME, SPELL_MD5_UNPACKED, SPELL_VERSION,
-## @Globals CURRENTPWD, i, j, n, BUILD_DTFILE, DTFILE_MENUENTRY, DTFILE_EXEC
-## @Globals DTFILE_MENUPATH, DTFILE_ICON, DTFILE_TERM, SPELL_SRC_DIR
-##
-## @Thanks BearPerson, dufflebunk, afrayedknot
-## @Thanks To all testers
-## @Contribution abouter
-##
-#---
-
-QUILL_QUILLRC=~/.sourcemage/quill/quillrc
-QUILL_OLD_QUILLRC=~/.quillrc
-QUILL_TMP_DIR=~/.sourcemage/tmp
-
-function md5_unpack() {
-
- gpg --print-md sha512 ${1} | \
- tr -d " " | \
- tr "A-Z" "a-z" | \
- tr "\n" " " | \
- sed "s/ //g" | \
- cut -d: -f2
-
-}
-
-function grab_from_xml() {
- xml_grep --text_only "$1" "$FRESHMEAT_FILE"
-}
-
-
-function hunt_src_url() {
- local URL
- local SPELL_NAME=$1
- URL=$(curl -I "$2" 2>/dev/null|grep Location|awk '{print $2}'|sed
's/\r//g')
- # hacky attempt to get source url from sourceforge
- if echo $URL|grep -q sourceforge; then
- curl "$URL" 2>/dev/null|tr '<>' '\n\n'|grep http|grep sourceforge|grep
download|grep -i $SPELL_NAME|
- cut -f2 -d\"|cut -f1 -d?|head -n 1
- else
- echo $URL
- fi
-}
-
-function check_if_tarball(){
-if [[ -z `tar tf "${QUILL_TMP_DIR}/${SPELL_SRC_FILE}" 2>&1 | grep "^tar: " |
head -n1` ]]; then
- return 0
-else
- return 1
-fi
-}
-
-function hunt_src_dir(){
- tar tf "${QUILL_TMP_DIR}/${SPELL_SRC_FILE}" | sed -e
"s=${SPELL_NAME}=\$\{SPELL\}=g;s=${SPELL_VERSION}=\$\{VERSION\}=g;s=/.*$==g;q"
-}
-
-function set_src_dir(){
-if check_if_tarball
-then
- SPELL_SRC_DIR=$(hunt_src_dir)
- return 0
-else
- SPELL_SRC_DIR="\${SPELL}-\${VERSION}"
- return 1
-fi
-}
-
-#---
-## Some basic stuff that should be loaded and set
-. /etc/sorcery/config
-#set -x
-#---
-## @Synopsis Get's gurus info and stuff and puts it into ~/.quillrc or reads
it from there
-#---
-
-function quill_rc() {
-
- mkdir -p ~/.sourcemage/quill
- 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}"
- cp ${QUILL_OLD_QUILLRC} ${QUILL_QUILLRC}
- if [[ -f ${QUILL_QUILLRC} ]]
- then
- message "${QUERY_COLOR}Removing ${QUILL_OLD_QUILLRC}${DEFAULT_COLOR}"
- rm ${QUILL_OLD_QUILLRC}
- else
- message "${PROBLEM_COLOR}Ugghhh... something went
wrong...${DEFAULT_COLOR}"
- fi
- fi
- if [[ -f ${QUILL_QUILLRC} ]]
- then
- . ${QUILL_QUILLRC}
- else
- touch ${QUILL_QUILLRC}
- message "${PROBLEM_COLOR}This will create a ${QUILL_QUILLRC} file for
you${DEFAULT_COLOR}"
- message "${QUERY_COLOR}Please enter your name for the HISTORY
entry.${DEFAULT_COLOR}"
- read "GURU_NAME"
- message "${QUERY_COLOR}Please enter your email for the HISTORY
entry.${DEFAULT_COLOR}"
- read "GURU_EMAIL"
- message "Thank you. Now generating ${QUILL_QUILLRC}"
- echo \
-"GURU_NAME=\"${GURU_NAME}\"
-GURU_EMAIL=\"${GURU_EMAIL}\"" > ${QUILL_QUILLRC}
-fi
-
-}
-quill_rc
-PROMPT_DELAY="4294967295"
-BUILD_API=2
-load_build_api
-mkdir -p $QUILL_TMP_DIR
-
-BUILDISON=""
-INSTALLISON=""
-PREBUILDISON=""
-TRIGGERSISON=""
-PREPAREISON=""
-PROVIDESISON=""
-CONFIGURE=""
-POSTINSTALLISON=""
-FINALISON=""
-
-
-if [[ $1 == --fmxml ]] && [[ $2 ]]; then
- FRESHMEAT_XML="$2"
- if ! which xml_grep &>/dev/null; then
- message "You need xml-twig with xml_grep installed to use freshmeat mode"
- exit 1
- fi
- if ! which curl &>/dev/null; then
- message "You need curl to use freshmeat mode"
- exit 1
- fi
- # if the argument looks like a url then use that, otherwise
- # assume the argument is the name of the spell and construct a
- # url for where we think freshmeat.net stores their xml data
- if echo $FRESHMEAT_XML|grep -q http://; then
- FRESHMEAT_XML_URL=$FRESHMEAT_XML
- else
-
FRESHMEAT_XML_URL=http://freshmeat.net/projects-xml/$FRESHMEAT_XML/${FRESHMEAT_XML}.xml
- fi
- # check if we already have the xml file, if we dont, download it
- if test -f ${QUILL_TMP_DIR}/$FRESHMEAT_XML.xml ; then
- FRESHMEAT_FILE=${QUILL_TMP_DIR}/${FRESHMEAT_XML}.xml
- else
- if ! wget $FRESHMEAT_XML_URL ; then
- message "Failed to get $FRESHMEAT_XML"
- exit 1
- else
- mv $FRESHMEAT_XML.xml ${QUILL_TMP_DIR}/${FRESHMEAT_XML}.xml
- fi
- FRESHMEAT_FILE=${QUILL_TMP_DIR}/${FRESHMEAT_XML}.xml
- fi
-fi
-
-
-## Down to here... from here it's question and answer time
-#---
-
-#---
-## Questions and stuff
-
-message "Welcome to SourceMage GNU/Linux quill - a spell creator script."
-message
"-----------------------------------------------------------------------------"
-message "This makes an immediately useable spell from some minor data."
-message "Does not create a \$SPELL-\$VERSION SOURCE construct but uses real
filename"
-message
"-----------------------------------------------------------------------------"
-message "If the spell does not use default compilation and installation you
will have"
-message "to fix the files yourself after the automatic creation is done."
-message
"-----------------------------------------------------------------------------"
-message "${PROBLEM_COLOR}Any lists i.e. dependnecies and optional
dependencies should be"
-message "space delimited and not coma delimited${DEFAULT_COLOR}"
-message
"-----------------------------------------------------------------------------"
-
-SPELL_NAME="$1"
-SPELL_SRC_URL="$2"
-SPELL_LICENSE="$3"
-SPELL_URL="$4"
-
-# fill in variables from xml file
-if [[ $FRESHMEAT_XML ]] ; then
- SPELL_NAME=$(grab_from_xml projectname_short "$FRESHMEAT_XML" |tr "A-Z"
"a-z")
- for each in url_bz2 url_tgz; do
- TMP=$(grab_from_xml $each)
- if [[ $TMP ]] ; then
- SPELL_SRC_URL=$(hunt_src_url "$SPELL_NAME" "$TMP")
- break
- fi
- done
- SPELL_URL=$(curl -I $(grab_from_xml url_homepage) 2>&1|grep Location|awk
'{print $2}'|sed 's/\r//g')
- SPELL_LICENSE=$(grab_from_xml license|awk '{print $NF}'|tr -d '()')
- SPELL_SHORT_DESCRIPTION=$(grab_from_xml desc_short|sed 's/\r//g')
- grab_from_xml desc_full|fmt > ${QUILL_TMP_DIR}/${SPELL_NAME}
-fi
-
-# for all the fields that could be filled in, check if they were filled in
-# and if so, give the user an opportunity to change the value
-
-if ! [[ $SPELL_NAME ]] ||
- ! query "Is $SPELL_NAME the proper spell name?" y; then
- message "${QUERY_COLOR}Please enter the spell name:${DEFAULT_COLOR}"
- read "SPELL_NAME"
-fi
-
-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}"
- read "SPELL_SRC_URL"
-fi
-
-if ! [[ $SPELL_LICENSE ]] ||
- ! query "Is $SPELL_LICENSE the proper license?" y; then
- message "${QUERY_COLOR}Please enter the license of the
spell:${DEFAULT_COLOR}"
- read "SPELL_LICENSE"
-fi
-
-if ! [[ $SPELL_URL ]] ||
- ! query "Is $SPELL_URL the proper website?" y; then
- message "${QUERY_COLOR}Please enter a website for the
spell:${DEFAULT_COLOR}"
- read "SPELL_URL"
-fi
-
-if ! [[ $SPELL_SHORT_DESCRIPTION ]] ||
- ! ( message "${QUERY_COLOR}Is${DEFAULT_COLOR}\n$SPELL_SHORT_DESCRIPTION"
- query "the proper short description?${DEFAULT_COLOR}" y ; ) ; then
- message "${QUERY_COLOR}Please enter a short description of the
spell:${DEFAULT_COLOR}"
- read "SPELL_SHORT_DESCRIPTION"
-fi
-
-if ! test -f ${QUILL_TMP_DIR}/${SPELL_NAME} ||
- ! ( message "${QUERY_COLOR}Is${DEFAULT_COLOR}"
- cat ${QUILL_TMP_DIR}/${SPELL_NAME}
- query "the proper long description?${DEFAULT_COLOR}" y ; ) ; then
- message "${QUERY_COLOR}Please enter a description of the
spell:${DEFAULT_COLOR}"
- sleep 2
- message "${PROBLEM_COLOR}!!!PRESS ENTER TO CONTINUE!!!${DEFAULT_COLOR}"
- read
- ${EDITOR:-nano} ${QUILL_TMP_DIR}/${SPELL_NAME}
-fi
-
-message "${QUERY_COLOR}Please enter the dependencies(non optional) of the
spell if any:${DEFAULT_COLOR}"
-read "SPELL_DEPENDENCIES"
-
-message "${QUERY_COLOR}Please enter the optional dependencies of the spell
if any:${DEFAULT_COLOR}"
-read "SPELL_OPTIONAL_DEPENDENCIES"
-
-message "${QUERY_COLOR}Please enter any conflicting spell names if
any:${DEFAULT_COLOR}"
-read "SPELL_CONFLICTS"
-
-message "${QUERY_COLOR}Please enter provides if any:${DEFAULT_COLOR}"
-read "SPELL_PROVIDES"
-
-if query "Will you be adding a PREPARE file:" "n"
-then
- PREPAREISON="PREPARE, "
-fi
-
-if query "Will you be adding a CONFIGURE file:" "n"
-then
- CONFIGUREISON="CONFIGURE, "
-fi
-
-if query "Will you be adding a custom PRE_BUILD file:" "n"
-then
- PREBUILDISON="PRE_BUILD, "
-fi
-
-if query "Will you be adding a custom BUILD file:" "n"
-then
- BUILDISON="BUILD, "
-fi
-
-if query "Will you be adding a custom INSTALL file:" "n"
-then
- INSTALLISON="INSTALL, "
-fi
-
-if query "Will you be adding a custom POST_INSTALL file${PROBLEM_COLOR}Not
advisable unless you consult the sorcery team first${DEFAULT_COLOR}:" "n"
-then
- POSTINSTALLISON="POST_INSTALL, "
-fi
-
-if query "Will you be adding a custom FINAL file:" "n"
-then
- FINALISON="FINAL, "
-fi
-
-if query "Will you be adding a TRIGGERS file:" "n"
-then
- TRIGGERSISON="TRIGGERS, "
-fi
-
-if query "Will you be adding a custom desktop file:" "n"
-then
- BUILD_DTFILE="desktop/${SPELL_NAME}.desktop, "
- DTFILE_MENUENTRY="${SPELL_NAME}"
- message "${QUERY_COLOR}Please enter the name of the
executable:${DEFAULT_COLOR}"
- 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}"
- read "DTFILE_MENUPATH"
- message "${QUERY_COLOR}Please enter the name of the icon, if it has
one:${DEFAULT_COLOR}"
- read "DTFILE_ICON"
- query "Does this app need to be started in an xterm?" "n" &&
DTFILE_TERM="True"
-fi
-
-## No questions after here !!!
-#---
-
-#---
-## Nothing but logic bellow here !!!
-
-CURRENTPWD=$(pwd)
-
-## Create spell directory and base files
-
-mkdir -p ${SPELL_NAME}
-cd ${SPELL_NAME}
-touch DETAILS
-chmod +x DETAILS
-DEPENDSISON=""
-CONFLICTSON=""
-
-## Get dependenceis sorted out
-
-if [[ "${SPELL_DEPENDENCIES}" != "" ]]
-then
- touch DEPENDS
- chmod +x DEPENDS
- DEPENDSISON="DEPENDS, "
- for i in ${SPELL_DEPENDENCIES}
- do
- echo "depends ${i}" >> DEPENDS
- done
-fi
-
-if [[ "${SPELL_OPTIONAL_DEPENDENCIES}" != "" ]]
-then
- touch DEPENDS
- chmod +x DEPENDS
- DEPENDSISON="DEPENDS, "
- for j in ${SPELL_OPTIONAL_DEPENDENCIES}
- do
- echo "optional_depends ${j} \"enabled-option\" \"disabled-option\"
\"description\"" >> DEPENDS
- done
-fi
-
-## Get conflicts and provides sorted out
-
-if [[ "${SPELL_CONFLICTS}" != "" ]]
-then
- touch CONFLICTS
- chmod +x CONFLICTS
- CONFLICTSISON="CONFLICTS, "
- for n in ${SPELL_CONFLICTS}
- do
- echo "conflicts ${n}" >> CONFLICTS
- done
-fi
-
-if [[ "${SPELL_PROVIDES}" != "" ]]
-then
- touch PROVIDES
- chmod +x PROVIDES
- PROVIDESISON="PROVIDES, "
- for n in ${SPELL_PROVIDES}
- do
- echo "provides ${n}" >> PROVIDES
- done
-fi
-
-## Get source filename from the URI
-
-SPELL_SRC_FILE=$(expr "$SPELL_SRC_URL" : '.*/\(.*\)')
-
-
-SPELL_SANITIZED_FILE_NAME=$(expr "$SPELL_SRC_FILE" : '\(.*\)[-|_][0-9]')
-echo "Sanitized filename: $SPELL_SANITIZED_FILE_NAME"
-SPELL_VERSION=$(expr "$SPELL_SRC_FILE" :
"${SPELL_SANITIZED_FILE_NAME}[-|_]\(.*\)\.tar")
-echo "Version: ${SPELL_VERSION}"
-echo "URL: ${SPELL_SRC_URL}"
-
-## Download the source
-
-cd ${QUILL_TMP_DIR}
-wget "${SPELL_SRC_URL}"
-cd ${CURRENTPWD}
-cd ${SPELL_NAME}
-
-## Get md5 of the uncompressed source
-
-SPELL_MD5_UNPACKED="$(md5_unpack ${QUILL_TMP_DIR}/${SPELL_SRC_FILE})"
-
-
-SPELL_DATE=$(date +%Y%m%d)
-HISTORY_DATE=$(date +%Y-%m-%d)
-
-## Parse source directory name
-
-set_src_dir
-
-#Generate DETAILS
-
-message "Generating DETAILS file..."
-
-echo \
-" SPELL=${SPELL_NAME}
- VERSION=${SPELL_VERSION}
- SOURCE=${SPELL_SRC_FILE}
- SOURCE_URL[0]=${SPELL_SRC_URL}
- SOURCE_HASH=sha512:${SPELL_MD5_UNPACKED}
-SOURCE_DIRECTORY=\${BUILD_DIRECTORY}/${SPELL_SRC_DIR}
- WEB_SITE=${SPELL_URL}
- ENTERED=${SPELL_DATE}
- UPDATED=${SPELL_DATE}
- LICENSE[0]=${SPELL_LICENSE}
- BUILD_API=2
- SHORT=\"${SPELL_SHORT_DESCRIPTION}\"
-cat << EOF
-$(cat ${QUILL_TMP_DIR}/$SPELL_NAME |fmt -u -w80)
-EOF" > DETAILS
-rm ${QUILL_TMP_DIR}/$SPELL_NAME
-
-message "Done..."
-
-if [[ "${PREPAREISON}" == "PREPARE, " ]]
-then
- touch PREPARE
- chmod +x PREPARE
- ${EDITOR:-nano} PREPARE
-fi
-
-if [[ "${CONFIGUREISON}" == "CONFIGURE, " ]]
-then
- touch CONFIGURE
- chmod +x CONFIGURE
- ${EDITOR:-nano} CONFIGURE
-fi
-
-if [[ "${PREBUILDISON}" == "PRE_BUILD, " ]]
-then
- touch PRE_BUILD
- chmod +x PRE_BUILD
- if query "Do you want the default_pre_build function dumped into the
PRE_BUILD file" "n"
- then
- (declare -f real_default_pre_build | tail -n -2 | head -n 1 | sed
"s:&&:\&\&\n:g") > PRE_BUILD
- else
- echo "default_pre_build" > PRE_BUILD
- fi
- ${EDITOR:-nano} PRE_BUILD
-fi
-
-if [[ "${BUILDISON}" == "BUILD, " ]]
-then
- touch BUILD
- chmod +x BUILD
- if query "Do you want the default_build function dumped into the BUILD
file" "n"
- then
- (declare -f real_default_build | tail -n -2 | head -n 1 | sed
's:\(.\{20,41\}\)--:\1\\\n --:g' | sed "s:&&:\&\&\n:g") > BUILD
- else
- echo "default_build" > BUILD
- fi
- ${EDITOR:-nano} BUILD
-fi
-
-if [[ "${INSTALLISON}" == "INSTALL, " ]]
-then
- touch INSTALL
- chmod +x INSTALL
- if query "Do you want the default_install function dumped into the INSTALL
file" "n"
- then
- (declare -f real_default_install | tail -n -2 | head -n 1) > INSTALL
- else
- echo "default_install" > INSTALL
- fi
- ${EDITOR:-nano} INSTALL
-fi
-
-if [[ "${POSTINSTALLISON}" == "POST_INSTALL, " ]]
-then
- touch POST_INSTALL
- chmod +x POST_INSTALL
- if query "Do you want the default_post_install function dumped into the
POST_INSTALL file" "n"
- then
- (let i=0 ; declare -f real_default_post_install | while read line ; do
(( $i > 2 )) && echo $line ; let i++ ; done | grep -v "}" ) > POST_INSTALL
- else
- echo "default_post_install" > POST_INSTALL
- fi
- ${EDITOR:-nano} POST_INSTALL
-fi
-
-if [[ "${TRIGGERSISON}" == "TRIGGERS, " ]]
-then
- touch TRIGGERS
- chmod +x TRIGGERS
- ${EDITOR:-nano} TRIGGERS
-fi
-
-if [[ "${BUILD_DTFILE}" != "" ]]
-then
- mkdir -p desktop
- cd desktop
- echo "[Desktop Entry]" >> ${SPELL_NAME}.desktop
- echo "Encoding=UTF-8" >> ${SPELL_NAME}.desktop
- echo "Version=${SPELL_VERSION}" >> ${SPELL_NAME}.desktop
- echo "Name=${DTFILE_MENUENTRY}" >> ${SPELL_NAME}.desktop
- echo "Type=Application" >> ${SPELL_NAME}.desktop
- echo "Comment=${SPELL_SHORT_DESCRIPTION}" >> ${SPELL_NAME}.desktop
- echo "Exec=${DTFILE_EXEC}" >> ${SPELL_NAME}.desktop
- echo "Icon=${DTFILE_ICON}" >> ${SPELL_NAME}.desktop
- echo "Categories=${DTFILE_MENUPATH}" >> ${SPELL_NAME}.desktop
- echo "Term=${DTFILE_TERM}" >> ${SPELL_NAME}.desktop
- cd ..
-fi
-
-message "Generating HISTORY file..."
-
-echo \
-"${HISTORY_DATE} ${GURU_NAME} <${GURU_EMAIL}>
- * DETAILS,
${PROVIDESISON}${DEPENDSISON}${CONFIGUREISON}${PREPAREISON}${CONFLICTSISON}${PREBUILDISON}${BUILDISON}${INSTALLISON}${POSTINSTALLISON}${TRIGGERSISON}${FINALISON}HISTORY${BUILD_DTFILE}:
created spell" > HISTORY
-
-message "Done..."
-
-cd ${CURRENTPWD}
-
-#---

-##

-## 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/ChangeLog b/var/lib/quill/ChangeLog
index c7b8e0e..848e793 100644
--- a/var/lib/quill/ChangeLog
+++ b/var/lib/quill/ChangeLog
@@ -1,3 +1,17 @@
+2006-11-05 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libcore: remove a bad message and add two mentioning update
capabilities
+ * libfreshmeatxml: no need to exit; use the variables that are there
+ * libconfigure, libfinal, libpost_install, libpre_install,
libtriggers: rm
+ empty files, they can be created when they are needed
+ * quill-old: removed
+ * quill: rearranged some code to make room for the update mode
+ added the beginnings of the update mode and lots of pseudocode
(disabled)
+ simplified and removed some vairables
+ added one simple check for good settings
+ FIXME take care of cpan mode too
+ * libhistory: added add_history_entry and add_history_entries
+ * libdetails: added query_spell_version
+
2006-08-19 Andra?? "ruskie" Levstik <ruskie AT mages.ath.cx>
* libdetails: changed smgl_basename to basename
* version: 0.1.9-20060819
diff --git a/var/lib/quill/modules/libconfigure
b/var/lib/quill/modules/libconfigure
deleted file mode 100644
index 5c54521..0000000
--- a/var/lib/quill/modules/libconfigure
+++ /dev/null
@@ -1,18 +0,0 @@
-#---
-##
-## 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/libcore b/var/lib/quill/modules/libcore
index 24ce00f..5afcef4 100644
--- a/var/lib/quill/modules/libcore
+++ b/var/lib/quill/modules/libcore
@@ -88,8 +88,8 @@ ## @Synopsis The welcome message for qui
function quill_welcome() {
message "Welcome to SourceMage GNU/Linux quill - a spell creator script."
message
"-----------------------------------------------------------------------------"
- message "This makes an immediately useable spell from some minor data."
- message "Does not create a \$SPELL-\$VERSION SOURCE construct but uses
real filename"
+ message "This makes an immediately useable spell from some minor data or "
+ message "updates an exsisting one.."
message
"-----------------------------------------------------------------------------"
message "The spell will be put into a grimoire/section you define(if you
choose to)"
message "and a tar.bz2 file will be created in $QUILL_SPELL_DIR."
@@ -209,6 +209,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)
--apprentice, -a apprentice mode (default)
--mage, -m mage mode (advanced)
--wizard, -w wizard mode (expert)(DOES NOTHING FOR NOW)
diff --git a/var/lib/quill/modules/libdetails
b/var/lib/quill/modules/libdetails
index 24cdb8e..ec01973 100644
--- a/var/lib/quill/modules/libdetails
+++ b/var/lib/quill/modules/libdetails
@@ -24,6 +24,15 @@ if ! [[ $SPELL_SRC_URL ]] ||
fi
}

+# used in update mode only
+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"
+ read SPELL_VERSION
+ fi
+}
+
function query_spell_signature(){
if [[ $SPELL_SIGNATURE ]] &&
! query "Is $SPELL_SIGNATURE the proper signature key url?" y; then
diff --git a/var/lib/quill/modules/libfinal b/var/lib/quill/modules/libfinal
deleted file mode 100644
index e69de29..0000000
diff --git a/var/lib/quill/modules/libfreshmeatxml
b/var/lib/quill/modules/libfreshmeatxml
index bf89851..5b02414 100644
--- a/var/lib/quill/modules/libfreshmeatxml
+++ b/var/lib/quill/modules/libfreshmeatxml
@@ -30,23 +30,22 @@ function quill_fmxml_core(){
else
FRESHMEAT_XML_URL=http://freshmeat.net/projects-xml/${1}/${1}.xml
fi
+
# check if we already have the xml file, if we dont, download it
- if test -f ${QUILL_TMP_DIR}/${1}.xml ; then
- FRESHMEAT_FILE=${1}.xml
- else
- if ! curl -o ${QUILL_TMP_DIR}/${1}.xml ${FRESHMEAT_XML_URL} ; then
+ 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}"
- exit 1
+ return 1
fi
- FRESHMEAT_FILE=$FRESHMEAT_FILE
fi

# check that the project was found - exsists
local not_found='Error: project not found.'
- if grep -q "$not_found" "$QUILL_TMP_DIR/$1.xml"; then
+ if grep -q "$not_found" "$FRESHMEAT_FILE"; then
message "$PROBLEM_COLOR$not_found$DEFAULT_COLOR"
- rm "$QUILL_TMP_DIR/$1.xml"
- exit 2
+ rm "$FRESHMEAT_FILE"
+ return 2
fi

# fill in variables from xml file
diff --git a/var/lib/quill/modules/libhistory
b/var/lib/quill/modules/libhistory
index a9c9dc6..17e23b1 100644
--- a/var/lib/quill/modules/libhistory
+++ b/var/lib/quill/modules/libhistory
@@ -13,6 +13,39 @@ echo \
message "Done..."

}
+
+#---
+## @Synopsis Adds a new HISTORY entry. Uses idempotent date title handling.
+## @param entry without the leading tab, bullet and space
+#---
+function add_history_entry()
+{
+ local title="$HISTORY_DATE $GURU_NAME <$GURU_EMAIL>"
+
+ if grep -q "$title" HISTORY;
+ then
+ sed -i "/$title/ a\ * $1" HISTORY
+ else # first time
+ sed -i "1 s/^.*$/$title\n * $1\n\n&/" HISTORY
+ fi
+}
+
+#---
+## @Synopsis Adds new HISTORY entries.
+## @param entry without the leading tab, bullet and space
+#---
+function add_history_entries()
+{
+ local each
+ message "Updating HISTORY ..."
+
+ for each in "$@"; do
+ add_history_entry "$each"
+ done
+
+ message "Done ..."
+}
+
#---
##
## This software is free software; you can redistribute it and/or modify
diff --git a/var/lib/quill/modules/libpost_install
b/var/lib/quill/modules/libpost_install
deleted file mode 100644
index e69de29..0000000
diff --git a/var/lib/quill/modules/libpre_install
b/var/lib/quill/modules/libpre_install
deleted file mode 100644
index e69de29..0000000
diff --git a/var/lib/quill/modules/libtriggers
b/var/lib/quill/modules/libtriggers
deleted file mode 100644
index e69de29..0000000



  • [SM-Commit] GIT changes to master quill by Jaka Kranjc (690b9aca5032ad8500a221b9f1445ab83d78bc08), Jaka Kranjc, 11/05/2006

Archive powered by MHonArc 2.6.24.

Top of Page