Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] PERFORCE change 77256 by Andra?? "ruskie" Levstik for review

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Perforce Review Daemon <p4review AT smee.org>
  • To: "Andraž " ruskie " Levstik" <ruskie AT mages.ath.cx>, "Andrew Stitt" <a AT t.armory.com>, "Arjan Bouter" <abouter AT sourcemage.org>, "Arwed von Merkatz" <v.merkatz AT gmx.net>, "SM-Commit Daemon" <sm-commit AT lists.ibiblio.org>, "David Michael Leo Brown Jr." <dmlb2000 AT gmail.com>, "David Kowis" <dkowis+smgl-p4 AT shlrm.org>, "duane_malcolm" <d.malcolm AT auckland.ac.nz>, "Eric Sandall" <eric AT sandall.us>, "Jason Flatt" <jflatt AT sourcemage.org>, "Jeremy Blosser" <jblosser AT sourcemage.org>, "Juuso Alasuutari" <iuso AT sourcemage.org>, "Ladislav Hagara" <ladislav.hagara AT unob.cz>, "Robin Cook" <rcook AT wyrms.net>, "Thibaut Fernagut" <t.fernagut AT h0m3.be>, "vladimir_marek" <vlmarek AT volny.cz>
  • Subject: [SM-Commit] PERFORCE change 77256 by Andra?? "ruskie" Levstik for review
  • Date: Tue, 4 Apr 2006 21:05:01 +0100 (BST)

Change 77256 by andraž_levstik AT omega.mages.ath.cx on 2006/04/04 21:04:42

Made it workable and installable... it's not done yet...
By tomorrow evening I hope to have ATLEOST mage mode 100% working
and ready for 0.5 version of quill

Affected files ...

... //sgl/misc/quill/install.sh#1 add
... //sgl/misc/quill/usr/bin/quill#16 edit
... //sgl/misc/quill/var/lib/quill/ChangeLog#12 edit
... //sgl/misc/quill/var/lib/quill/modules/libcore#8 edit
... //sgl/misc/quill/var/lib/quill/modules/libdepends#4 edit
... //sgl/misc/quill/var/lib/quill/modules/libdetails#13 edit
... //sgl/misc/quill/var/lib/quill/modules/libfreshmeatxml#5 edit
... //sgl/misc/quill/var/lib/quill/modules/libhistory#4 edit
... //sgl/misc/quill/var/lib/quill/modules/libinstall#4 edit
... //sgl/misc/quill/var/lib/quill/modules/libprepare#4 edit
... //sgl/misc/quill/var/lib/quill/modules/libprovides#4 edit

Differences ...

==== //sgl/misc/quill/usr/bin/quill#16 (xtext) ====

@@ -1,24 +1,23 @@
-//sgl/misc/quill/usr/bin/quill#8 - edit change 73413 (xtext)
#!/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
+## @License GPL v2 or higher
##
## @ToDo Add option to use upstream gpg signature as included or
## @ToDo downloadable .sig file
## @ToDo Put a multiversion option
## @ToDo Make an option to edit all the existing files after generation
-## @ToDo Make configuring optional depends a must
-## @ToDo Add logic to quill to make it possible to use optional_depends
+## @ToDo Make configuring optional depends a must - DONE
+## @ToDo Add logic to quill to make it possible to use optional_depends
- DONE
## @ToDo single line or multiline depending on the length of line if
## @ToDo <80 single else multi
## @ToDo Interface to add CONFIGURE options
## @ToDo Automated bugcli submissions of spells
## @ToDo Make a tar.bz2 of the spell immediately
## @ToDo Automatic inclusion into a grimoire when finished
-## @ToDo Make it use the ~/.sourcemage dir for config
+## @ToDo Make it use the ~/.sourcemage dir for config - DONE
## @ToDo Add cmdline options to make it possible to autoscript it
## @ToDo Add a better configuration interface(dialog based I hope)
## @ToDo Make it possible to also update spells using quill
@@ -43,15 +42,14 @@
#---

#---
-## @Synopsis md5_unpack function taken from md5unpack script
-##
-#---
-
-#---
## Some basic stuff that should be loaded and set
. /etc/sorcery/config
+for i in $(ls -1 /var/lib/quill/modules/lib*)
+do
+. $i
+done
QUILL_MODE="apprentice"
-CURRENTPWD=$(pwd)
+CURRENTPWD="$(pwd)"

#---
## Not really a function it's supposed to parse the command line parameters
@@ -59,20 +57,17 @@
while [ -n "$1" ]; do
if echo "" $1 | grep -q "^ -"; then
case $1 in
- --fmxml|-f) export QUILL_FMXML_MODE="on"; shift
1 ;;
- --apprentice|-a) export QUILL_MODE="apprentice";
shift 1 ;;
- --mage|-m) export QUILL_MODE="mage"; shift 1 ;;
- --wizard|-w) export QUILL_MODE="wizard"; shift 1
;;
- `echo $1 | grep "^--spell="`) SPELL_NAME=${1/"--spell="/""};
shift 1;;
- `echo $1 | grep "^--source_url="`)
SPELL_SRC_URL=${1/"--source_url="/""}; shift 1;;
- `echo $1 | grep "^--web_site="`) SPELL_URL=${1/"--web_site="/""};
shift 1;;
- `echo $1 | grep "^--license="`) SPELL_LICENSE=${1/"--license="/""};
shift 1;;
- `echo $1 | grep "^--short="`)
SPELL_SHORT_DESCRIPTION=${1/"--short="/""}; shift 1;;
- -h) quill_help
+ --fmxml|-f) export QUILL_FMXML_MODE="on"; export
QUILL_FMXML_PARAM="$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 ;;
+ --help|-h) quill_help ;;
+ *) true ;;
esac
else
shift
fi
+done

QUILL_HOME_DIR=~/.sourcemage/quill
QUILL_QUILLRC=${QUILL_HOME_DIR}/quillrc
@@ -96,8 +91,8 @@

if [[ "${QUILL_FMXML_MODE}" == "on" ]]
then
- QUILL_FMXML_SPELL="$@"
- quill_fmxml_core
+ QUILL_FMXML_SPELL="$QUILL_FMXML_PARAM"
+ quill_fmxml_core $QUILL_FMXML_PARAM
fi

query_spell_name
@@ -115,22 +110,23 @@
if [[ "${QUILL_MODE}" == "mage" ]] || [[ "${QUILL_MODE}" == "wizard" ]]
then
query_spell_prepare
-query_spell_conflicts
-query_spell_configure
+#-query_spell_conflicts
+#-query_spell_configure
query_spell_provides
-query_spell_final
-query_spell_triggers
-query_spell_solo
-query_spell_configs
-query_spell_volatiles
+#-query_spell_final
+#-query_spell_triggers
+#-query_spell_solo
+#-query_spell_configs
+#-query_spell_volatiles
if [[ "${QUILL_MODE}" == "wizard" ]]; then
- query_spell_pre_build
- query_spell_pre_install
- query_spell_post_install
- query_spell_pre_remove
- query_spell_post_remove
- query_spell_pre_resurrect
- query_spell_post_resurrect
+#- query_spell_pre_build
+#- query_spell_pre_install
+#- query_spell_post_install
+#- query_spell_pre_remove
+#- query_spell_post_remove
+#- query_spell_pre_resurrect
+#- query_spell_post_resurrect
+ true
fi
fi

@@ -147,10 +143,10 @@
add_optional_dependencies
fi

-if [[ "${SPELL_CONFLICTS}" != "" ]]
-then
- add_conflicts
-fi
+#-if [[ "${SPELL_CONFLICTS}" != "" ]]
+#-then
+#- add_conflicts
+#-fi

if [[ "${SPELL_PROVIDES}" != "" ]]
then
@@ -169,20 +165,20 @@

add_details

-if [[ "${PREPAREISON}" == "PREPARE, " ]]
-then
- add_prepare
-fi
+#-if [[ "${PREPAREISON}" == "PREPARE, " ]]
+#-then
+#- add_prepare
+#-fi

-if [[ "${CONFIGUREISON}" == "CONFIGURE, " ]]
-then
- add_configure
-fi
+#-if [[ "${CONFIGUREISON}" == "CONFIGURE, " ]]
+#-then
+#- add_configure
+#-fi

-if [[ "${PREBUILDISON}" == "PRE_BUILD, " ]]
-then
- add_pre_build
-fi
+#-if [[ "${PREBUILDISON}" == "PRE_BUILD, " ]]
+#-then
+#- add_pre_build
+#-fi

if [[ "${BUILDISON}" == "BUILD, " ]]
then
@@ -194,15 +190,15 @@
add_install
fi

-if [[ "${POSTINSTALLISON}" == "POST_INSTALL, " ]]
-then
- add_post_install
-fi
+#-if [[ "${POSTINSTALLISON}" == "POST_INSTALL, " ]]
+#-then
+#- add_post_install
+#-fi

-if [[ "${TRIGGERSISON}" == "TRIGGERS, " ]]
-then
- add_triggers
-fi
+#-if [[ "${TRIGGERSISON}" == "TRIGGERS, " ]]
+#-then
+#- add_triggers
+#-fi

if [[ "${BUILD_DTFILE}" != "" ]]
then

==== //sgl/misc/quill/var/lib/quill/ChangeLog#12 (text) ====

@@ -1,3 +1,16 @@
+2006-01-21 Andraž "ruskie" Levstik <ruskie AT mages.ath.cx>
+ * install.sh: added install/deinstall script
+ * usr/bin/quill:commented out unused functions
+ added sourcing of modules
+ * var/lib/quill/modules/libcore: made it workable
+ * var/lib/quill/modules/libdepends: made it workable
+ * var/lib/quill/modules/libdetails: made it workable
+ * var/lib/quill/modules/libfreshmeatxml: made it workable
+ * var/lib/quill/modules/libhistory: made it workable
+ * var/lib/quill/modules/libinstall: made it workable
+ * var/lib/quill/modules/libprepare: made it workable
+ * var/lib/quill/modules/libprovides: made it workable
+
2006-02-12 Juuso Alasuutari <juuso.alasuutari AT tamperelainen.org>
* quill: edited ToDo list
* libdetails: added substitute_with_variables, a generic
@@ -35,7 +48,7 @@
2006-01-22 Juuso Alasuutari <juuso.alasuutari AT tamperelainen.org>
* quill: added cmdline flags for most main variables in DETAILS.

-2006-01-21 Andrew "ruskie" Levstik <ruskie AT mages.ath.cx>
+2006-01-21 Andraž "ruskie" Levstik <ruskie AT mages.ath.cx>
* quill: reverted the function parese parameters should be there but
not as function
* libcore: removed parse_parameteres and added some comments

@@ -60,10 +73,10 @@
* quill: added calls to functions check_if_tarball and
hunt_src_dir

-2005-11-13 Andrew "ruskie" Levstik <ruskie AT mages.ath.cx>
+2005-11-13 Andraž "ruskie" Levstik <ruskie AT mages.ath.cx>
* libcore: updated hash_get to use only sha512

-2005-09-11 Andrew "ruskie" Levstik <ruskie AT mages.ath.cx>
+2005-09-11 Andraž "ruskie" Levstik <ruskie AT mages.ath.cx>
* quill: added an improved quill_rc to support
the new naming of user ran guru tools also
added stubs to function calls for more advanced

==== //sgl/misc/quill/var/lib/quill/modules/libcore#8 (text) ====

@@ -135,4 +135,3 @@
scribe reindex ${QUILL_GRIM_NAME}
fi
}
-

==== //sgl/misc/quill/var/lib/quill/modules/libdepends#4 (text) ====

@@ -3,14 +3,14 @@
#---

function query_spell_dependencies() {
- message "${QUERY_COLOR}Please enter the dependencies(non optional)\
- of the spell if any:${DEFAULT_COLOR}"
+ message "${QUERY_COLOR}Please enter the dependencies(non optional) \
+of the spell if any:${DEFAULT_COLOR}"
read "SPELL_DEPENDENCIES"
}

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

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

-echo "optional_depends\
-\"${SPELL_OPTIONAL_DEPENDENCIES[$MN]}\" \
-\"${SPELL_OPTIONAL_DEPENDENCIES_ENABLED[$MN]}\" \
-\"${SPELL_OPTIONAL_DEPENDENCIES_DISABLED[$MN]}\" \
-\"${SPELL_OPTIONAL_DEPENDENCIES_DESCRIPTION[$MN]}\" >> DEPENDS
+echo "optional_depends \"${SPELL_OPTIONAL_DEPENDENCIES[$MN]}\"
\"${SPELL_OPTIONAL_DEPENDENCIES_ENABLED[$MN]}\"
\"${SPELL_OPTIONAL_DEPENDENCIES_DISABLED[$MN]}\"
\"${SPELL_OPTIONAL_DEPENDENCIES_DESCRIPTION[$MN]}\"" >> DEPENDS

done
# "optional_depends ${j} \"enabled-option\" \"disabled-option\"
\"description\""

==== //sgl/misc/quill/var/lib/quill/modules/libdetails#13 (text) ====

@@ -67,14 +67,14 @@
}

function query_spell_description(){
-if ! test -f ${QUILL_TMP_DIR/${SPELL_NAME} ||
+if ! test -f ${QUILL_TMP_DIR}/${SPELL_NAME} ||
! ( message "${QUERY_COLOR}Is${DEFAULT_COLOR}"
- cat ${QUILL_TMP_DIR/${SPELL_NAME}
+ 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}"
message "${PROBLEM_COLOR}!!!PRESS ENTER TO CONTINUE!!!${DEFAULT_COLOR}"
read
- ${EDITOR:-nano} ${QUILL_TMP_DIR/${SPELL_NAME}
+ ${EDITOR:-nano} ${QUILL_TMP_DIR}/${SPELL_NAME}
fi
}

@@ -160,7 +160,7 @@
## @return 1 if not a tarball
#---
function check_if_tarball(){
-if [[ -z `tar tf "${QUILL_TMP_DIR}/${SPELL_SRC_FILE}" 2>&1 | grep "^tar: " |
head -n1` ]]; then
+if [[ -z $(tar tf "${QUILL_TMP_DIR}/${SPELL_SRC_FILE}" 2>&1 | grep "^tar: "
| head -n1) ]]; then
return 0
else
return 1
@@ -178,11 +178,12 @@
if check_if_tarball; then
SPELL_SRC_DIR=$(tar tf "${QUILL_TMP_DIR}/${SPELL_SRC_FILE}" | grep / | sed
-e "s=/.*$==g;q")
if [ -n "$SPELL_SRC_DIR" ]; then
- SPELL_SRC_DIR=${SPELL_SRC_DIR//${SPELL}/\${SPELL\}}
- SPELL_SRC_DIR=${SPELL_SRC_DIR//${VERSION}/\${VERSION\}}
+ SPELL_SRC_DIR=${SPELL_SRC_DIR//${SPELL}/\$\{SPELL\}}
+ SPELL_SRC_DIR=${SPELL_SRC_DIR//${VERSION}/\$\{VERSION\}}
return 0
else
return 1
+ fi
else
unset SPELL_SRC_DIR
return 2
@@ -207,7 +208,7 @@
SOURCE=${SPELL_SRC_FILE}
SOURCE_URL[0]=${SPELL_SRC_URL}
SOURCE_HASH=sha512:${QUILL_SPELL_HASH}
-SOURCE_DIRECTORY=\${BUILD_DIRECTORY}/${SPELL_SRC_DIR}
+SOURCE_DIRECTORY=\${BUILD_DIRECTORY}/\${SPELL}-\${VERSION}
WEB_SITE=${SPELL_URL}
ENTERED=${SPELL_DATE}
UPDATED=${SPELL_DATE}

==== //sgl/misc/quill/var/lib/quill/modules/libfreshmeatxml#5 (text) ====

@@ -1,9 +1,10 @@
+#set -x
#---
## @Synopsis libfreshmeatxml
#---

function quill_fmxml_grab_from_xml() {
- xml_grep --text_only "$1" "$FRESHMEAT_FILE"
+ xml_grep --text_only "$1" "${QUILL_TMP_DIR}/${2}.xml"
}


@@ -25,38 +26,37 @@
# 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 $QUILL_FMXML_SPELL|grep -q http://; then
- FRESHMEAT_XML_URL="${QUILL_FMXML_SPELL}"
+ if echo $1|grep -q http://; then
+ FRESHMEAT_XML_URL="$1"
else
-
FRESHMEAT_XML_URL=http://freshmeat.net/projects-xml/$QUILL_FMXML_SPELL/${QUILL_FMXML_SPELL}.xml
+ 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}/${QUILL_FMXML_SPELL}.xml ; then
- FRESHMEAT_FILE=${QUILL_FMXML_SPELL}.xml
+ if test -f ${QUILL_TMP_DIR}/${1}.xml ; then
+ FRESHMEAT_FILE=${1}.xml
else
- if ! curl -O ${FRESHMEAT_XML_URL} ; then
- message "${ERROR_COLOR}Failed to get
${QUILL_FMXML_SPELL}${DEFAULT_COLOR}"
+ if ! curl -o ${QUILL_TMP_DIR}/${1}.xml ${FRESHMEAT_XML_URL} ; then
+ message "${ERROR_COLOR}Failed to get ${1}${DEFAULT_COLOR}"
exit 1
fi
- FRESHMEAT_FILE=$FILE
+ FRESHMEAT_FILE=$FRESHMEAT_FILE
unset FILE
fi
-fi

# fill in variables from xml file
-if [[ $QUILL_FMXML_SPELL ]] ; then
- SPELL_NAME=$(quill_fmxml_grab_from_xml projectname_short|tr 'A-Z' 'a-z')
+if [[ $1 ]] ; then
+ SPELL_NAME=$(quill_fmxml_grab_from_xml projectname_short $1|tr 'A-Z' 'a-z')
for each in url_bz2 url_tgz; do
- TMP=$(quill_fmxml_grab_from_xml $each)
+ TMP=$(quill_fmxml_grab_from_xml $each $1)
if [[ $TMP ]] ; then
SPELL_SRC_URL=$(quill_fmxml_hunt_src_url $SPELL_NAME $TMP)
break
fi
done
- SPELL_URL=$(curl -I $(quill_fmxml_grab_from_xml url_homepage) 2>&1|\
+ SPELL_URL=$(curl -I $(quill_fmxml_grab_from_xml url_homepage $1) 2>&1|\
grep Location|awk '{print $2}'|sed 's/\r//g')
- SPELL_LICENSE=$(quill_fmxml_grab_from_xml license|awk '{print $NF}'|tr -d
'()')
- SPELL_SHORT_DESCRIPTION=$(quill_fmxml_grab_from_xml desc_short|sed
's/\r//g')
- quill_fmxml_grab_from_xml desc_full|fmt > ${QUILL_TMP_DIR}/${SPELL_NAME}
+ SPELL_LICENSE=$(quill_fmxml_grab_from_xml license $1|awk '{print $NF}'|tr
-d '()')
+ SPELL_SHORT_DESCRIPTION=$(quill_fmxml_grab_from_xml desc_short $1|sed
's/\r//g')
+ quill_fmxml_grab_from_xml desc_full $1 |fmt >
${QUILL_TMP_DIR}/${SPELL_NAME}
fi
}

==== //sgl/misc/quill/var/lib/quill/modules/libhistory#4 (text) ====

@@ -1,0 +1,11 @@
+function add_history()
+{
+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..."
+
+}

==== //sgl/misc/quill/var/lib/quill/modules/libinstall#4 (text) ====

@@ -1,0 +1,25 @@
+INSTALLISON=""
+
+function add_install()
+{
+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
+}
+
+function query_spell_install()
+{
+if query "Will you be adding a custom INSTALL file:" "n"
+then
+ INSTALLISON="INSTALL, "
+fi
+}

==== //sgl/misc/quill/var/lib/quill/modules/libprepare#4 (text) ====

@@ -1,0 +1,17 @@
+function query_spell_prepare()
+{
+if query "Will you be adding a PREPARE file:" "n"
+then
+ PREPAREISON="PREPARE, "
+fi
+}
+
+function add_prepare()
+{
+if [[ "${PREPAREISON}" == "PREPARE, " ]]
+then
+ touch PREPARE
+ chmod +x PREPARE
+ ${EDITOR:-nano} PREPARE
+fi
+}

==== //sgl/misc/quill/var/lib/quill/modules/libprovides#4 (text) ====

@@ -14,11 +14,10 @@
if [[ "${SPELL_PROVIDES}" != "" ]]
then
touch PROVIDES
- chmod +x PROVIDES
PROVIDESISON="PROVIDES, "
for n in ${SPELL_PROVIDES}
do
- echo "provides ${n}" >> PROVIDES
+ echo "${n}" >> PROVIDES
done
fi
}



  • [SM-Commit] PERFORCE change 77256 by Andra?? "ruskie" Levstik for review, Perforce Review Daemon, 04/04/2006

Archive powered by MHonArc 2.6.24.

Top of Page