Skip to Content.
Sympa Menu

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

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 (21323f4966894ec36aa568e44b030632dc16dbab)
  • Date: Sun, 23 Jul 2006 12:39:01 -0500

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

install.sh | 66
+++++++++-------------------------
usr/bin/quill | 25 ++++++++++--
var/lib/quill/ChangeLog | 11 +++++
var/lib/quill/modules/libcore | 19 +++++++++
var/lib/quill/modules/libfreshmeatxml | 8 +++-
5 files changed, 73 insertions(+), 56 deletions(-)

New commits:
commit 21323f4966894ec36aa568e44b030632dc16dbab
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

install.sh: added INSTALL_ROOT support, ensured it is ran from where
it is expected to, simplified the copying/removing logic
libfreshmeatxml: grab non-abbreviated licenses too, fix bad color
libcore: implemented the missing quill_help, fix bad color
quill: fix infinite loop on bad/missing parameter -> print help
add && to DEPENDS #10481
simplified the sourcing loop
add missing quote

diff --git a/install.sh b/install.sh
index d3ea957..6fd45f0 100755
--- a/install.sh
+++ b/install.sh
@@ -1,52 +1,22 @@
#!/bin/bash
-if [[ "$1" == "install" ]]
-then
-mkdir -vp /usr
-mkdir -vp /usr/bin
-mkdir -vp /var
-mkdir -vp /var/lib
-mkdir -vp /var/lib/quill
-mkdir -vp /var/lib/quill/modules
-cp -v ./usr/bin/quill /usr/sbin/quill
-cp -v ./var/lib/quill/modules/libprovides /var/lib/quill/modules/libprovides
-cp -v ./var/lib/quill/modules/libdetails /var/lib/quill/modules/libdetails
-cp -v ./var/lib/quill/modules/libconflicts
/var/lib/quill/modules/libconflicts
-cp -v ./var/lib/quill/modules/libconfigure
/var/lib/quill/modules/libconfigure
-cp -v ./var/lib/quill/modules/libfinal /var/lib/quill/modules/libfinal
-cp -v ./var/lib/quill/modules/libbuild /var/lib/quill/modules/libbuild
-cp -v ./var/lib/quill/modules/libcore /var/lib/quill/modules/libcore
-cp -v ./var/lib/quill/modules/libhistory /var/lib/quill/modules/libhistory
-cp -v ./var/lib/quill/modules/libpre_build
/var/lib/quill/modules/libpre_build
-cp -v ./var/lib/quill/modules/libpre_install
/var/lib/quill/modules/libpre_install
-cp -v ./var/lib/quill/modules/libtriggers /var/lib/quill/modules/libtriggers
-cp -v ./var/lib/quill/modules/libinstall /var/lib/quill/modules/libinstall
-cp -v ./var/lib/quill/modules/libprepare /var/lib/quill/modules/libprepare
-cp -v ./var/lib/quill/modules/libdepends /var/lib/quill/modules/libdepends
-cp -v ./var/lib/quill/modules/libdesktop /var/lib/quill/modules/libdesktop
-cp -v ./var/lib/quill/modules/libfreshmeatxml
/var/lib/quill/modules/libfreshmeatxml
-cp -v ./var/lib/quill/modules/libpost_install
/var/lib/quill/modules/libpost_install
-cp -v ./var/lib/quill/ChangeLog /var/lib/quill/ChangeLog
+
+if [[ $2 ]] ; then
+ INSTALL_ROOT="$2"
+else
+ INSTALL_ROOT=""
+fi
+
+if [[ "$1" == "install" ]]; then
+ if [[ "$0" != "./install.sh" ]]; then
+ echo "This script must be ran from the quill checkout dir!"
+ exit 1
+ fi
+ mkdir -vp $INSTALL_ROOT/usr/bin
+ mkdir -vp $INSTALL_ROOT/var/lib/quill/modules
+ cp -r usr var $INSTALL_ROOT/
fi

-if [[ "$1" == "uninstall" ]]
-then
-rm -v /usr/bin/quill
-rm -v /var/lib/quill/modules/libprovides
-rm -v /var/lib/quill/modules/libdetails
-rm -v /var/lib/quill/modules/libconflicts
-rm -v /var/lib/quill/modules/libconfigure
-rm -v /var/lib/quill/modules/libfinal
-rm -v /var/lib/quill/modules/libbuild
-rm -v /var/lib/quill/modules/libcore
-rm -v /var/lib/quill/modules/libhistory
-rm -v /var/lib/quill/modules/libpre_build
-rm -v /var/lib/quill/modules/libpre_install
-rm -v /var/lib/quill/modules/libtriggers
-rm -v /var/lib/quill/modules/libinstall
-rm -v /var/lib/quill/modules/libprepare
-rm -v /var/lib/quill/modules/libdepends
-rm -v /var/lib/quill/modules/libdesktop
-rm -v /var/lib/quill/modules/libfreshmeatxml
-rm -v /var/lib/quill/modules/libpost_install
-rm -v /var/lib/quill/ChangeLog
+if [[ "$1" == "uninstall" ]]; then
+ rm -v $INSTALL_ROOT/usr/bin/quill
+ rm -rv $INSTALL_ROOT/var/lib/quill/
fi
diff --git a/usr/bin/quill b/usr/bin/quill
index 7c1f19a..d547276 100755
--- a/usr/bin/quill
+++ b/usr/bin/quill
@@ -44,25 +44,31 @@ #---
#---
## Some basic stuff that should be loaded and set
. /etc/sorcery/config
-for i in $(ls -1 /var/lib/quill/modules/lib*)
+for i in /var/lib/quill/modules/lib*
do
-. $i
+ . $i
done
QUILL_MODE="apprentice"
CURRENTPWD="$(pwd)"
-HISTORY_DATE="$(date +%Y-%m-%d)
+HISTORY_DATE="$(date +%Y-%m-%d)"
#---
## Not really a function it's supposed to parse the command line parameters
#---
while [ -n "$1" ]; do
if echo "" $1 | grep -q "^ -"; then
case $1 in
- --fmxml|-f) export QUILL_FMXML_MODE="on"; export
QUILL_FMXML_PARAM="$2"; shift 2 ;;
+ --fmxml|-f)
+ [[ -z $2 ]] &&
+ message "${PROBLEM_COLOR}Missing parameter$DEFAULT_COLOR"
&&
+ quill_help
+ 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 ;;
+ *) message "${PROBLEM_COLOR}Invalid parameter
$1$DEFAULT_COLOR"
+ quill_help ;;
esac
else
shift
@@ -143,6 +149,15 @@ then
add_optional_dependencies
fi

+# add && where appropriate in DEPENDS
+if [[ ${SPELL_OPTIONAL_DEPENDENCIES} != "" ]] || [[ ${SPELL_DEPENDENCIES} !=
"" ]]
+then
+ sed -e 's/^ *$//' -e 's/[^\\]$/& \&\&/' DEPENDS | tac |
+ awk '{ if (removed!=1){ if (sub("&&$","") > 0){ removed=1 }}; print }' |
+ tac > temporary-DEPENDS
+ mv temporary-DEPENDS DEPENDS
+fi
+
#-if [[ "${SPELL_CONFLICTS}" != "" ]]
#-then
#- add_conflicts
diff --git a/var/lib/quill/ChangeLog b/var/lib/quill/ChangeLog
index 994b880..b303a2d 100644
--- a/var/lib/quill/ChangeLog
+++ b/var/lib/quill/ChangeLog
@@ -1,3 +1,14 @@
+2006-07-23 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * install.sh: added INSTALL_ROOT support, ensured it is ran from
where
+ it is expected to, simplified the copying/removing logic
+ * libfreshmeatxml: grab non-abbreviated licenses too, fix bad color
+ * libcore: implemented the missing quill_help, fix bad color
+ * quill: fix infinite loop on bad/missing parameter -> print help
+ add && to DEPENDS #10481
+ simplified the sourcing loop
+ add missing quote
+
+
2006-07-16 Andra?? "ruskie" Levstik <ruskie AT mages.ath.cx>
* var/lib/quill/modules/libdetails: change for global BUILD_API2
and remove ENETRED and UPDATED
diff --git a/var/lib/quill/modules/libcore b/var/lib/quill/modules/libcore
index cee665a..2645362 100644
--- a/var/lib/quill/modules/libcore
+++ b/var/lib/quill/modules/libcore
@@ -79,7 +79,7 @@ function quill_welcome() {
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 ~/spells ."
message
"-----------------------------------------------------------------------------"
- message "${WARNING_COLOR}Any lists i.e. dependencies and optional
dependencies should be"
+ message "${PROBLEM_COLOR}Any lists i.e. dependencies and optional
dependencies should be"
message "space delimited and not comma delimited!!!${DEFAULT_COLOR}"
message
"-----------------------------------------------------------------------------"
}
@@ -135,3 +135,20 @@ function quill_final_put_in_grimoire() {
scribe reindex ${QUILL_GRIM_NAME}
fi
}
+
+#---
+## @Synopsis function that displays help and exits
+#---
+function quill_help() {
+ message "USAGE: quill [OPTIONS]
+
+OPTIONS:
+ --fmxml, -f <SPELL> get spell data from Freshmeat if possible
+ --apprentice, -a apprentice mode (default)
+ --mage, -m mage mode (advanced)
+ --wizard, -w wizard mode (expert)
+ --help, -h display this help
+"
+ exit 1
+}
+
diff --git a/var/lib/quill/modules/libfreshmeatxml
b/var/lib/quill/modules/libfreshmeatxml
index d29961e..8368f4b 100644
--- a/var/lib/quill/modules/libfreshmeatxml
+++ b/var/lib/quill/modules/libfreshmeatxml
@@ -36,7 +36,7 @@ function quill_fmxml_core(){
FRESHMEAT_FILE=${1}.xml
else
if ! curl -o ${QUILL_TMP_DIR}/${1}.xml ${FRESHMEAT_XML_URL} ; then
- message "${ERROR_COLOR}Failed to get ${1}${DEFAULT_COLOR}"
+ message "${PROBLEM_COLOR}Failed to get ${1}${DEFAULT_COLOR}"
exit 1
fi
FRESHMEAT_FILE=$FRESHMEAT_FILE
@@ -55,7 +55,11 @@ if [[ $1 ]] ; then
done
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 $1|awk '{print $NF}'|tr
-d '()')
+
+ SPELL_LICENSE=$(quill_fmxml_grab_from_xml license $1)
+ if grep -q "(.*)" <<< "$SPELL_LICENSE"; then
+ SPELL_LICENSE=$(awk '{print $NF}' <<< "$SPELL_LICENSE" | tr -d '()')
+ fi
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



  • [SM-Commit] GIT changes to master quill by Jaka Kranjc (21323f4966894ec36aa568e44b030632dc16dbab), Jaka Kranjc, 07/23/2006

Archive powered by MHonArc 2.6.24.

Top of Page