Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Ismael Luceno (18250c7436922b7a2f8994bb825a4a4dda05a309)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Ismael Luceno (18250c7436922b7a2f8994bb825a4a4dda05a309)
  • Date: Tue, 31 May 2011 22:28:56 -0500

GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:

ChangeLog | 1 +
FUNCTIONS | 1 +
hg_download.function | 44
++++++++++++++++++++++++++++++++++++++++++++
python-pypi/scrapy/DETAILS | 12 ++++++++++++
python-pypi/scrapy/DOWNLOAD | 5 +++++
python-pypi/scrapy/HISTORY | 1 +
python-pypi/scrapy/PREPARE | 6 ++++++
7 files changed, 70 insertions(+)

New commits:
commit 18250c7436922b7a2f8994bb825a4a4dda05a309
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

scrapy: add scm version

commit 46bbcbf55036ddddabeb7bc0cf7e2114dbd0eb66
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

hg_download.function: hg download handler

Mostly copied from pymsnt.

diff --git a/ChangeLog b/ChangeLog
index 606935a..32ff7f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
2011-05-31 Ismael Luceno <ismael AT sourcemage.org>
* python-pypi/w3lib: new spell, Library of web-relatedfunctions
* python-pypi/scrapy: new spell, A high-level Python Screen Scraping
framework
+ * hg_download.function: hg download handler (mostly copied from
pymsnt)

2011-05-31 Treeve Jelbert <treeve AT sourcemage.org>
* python-pypi/geraldo: new spell, python reporting engine
diff --git a/FUNCTIONS b/FUNCTIONS
index 6e26adc..00cab13 100755
--- a/FUNCTIONS
+++ b/FUNCTIONS
@@ -720,3 +720,4 @@ fi

. $GRIMOIRE/glselect.function
. $GRIMOIRE/bzr_download.function
+. $GRIMOIRE/hg_download.function
diff --git a/hg_download.function b/hg_download.function
new file mode 100755
index 0000000..7732c94
--- /dev/null
+++ b/hg_download.function
@@ -0,0 +1,44 @@
+#---------------------------------------------------------------------
+## Handler for downloading from mercurial URLs
+#---------------------------------------------------------------------
+function hg_checkout() {
+ unset URL HG_ROOT HG_MODULE HG_TAG
+ url_hg_crack $1
+ message "${MESSAGE_COLOR}Starting Mercurial checkout of" \
+ "${FILE_COLOR}$2${MESSAGE_COLOR}...${DEFAULT_COLOR}" &&
+ if [[ -f $SOURCE_CACHE/$2 ]]
+ then
+ message "${MESSAGE_COLOR}Previous source found
unpacking...${DEFAULT_COLOR}" &&
+ tar -jxf $SOURCE_CACHE/$2 &&
+ cd ${HG_MODULE} &&
+ message "${MESSAGE_COLOR}Running Mercurial update...${DEFAULT_COLOR}" &&
+ hg pull -u -r ${HG_TAG}
+ cd ..
+ message "${MESSAGE_COLOR}Done...${DEFAULT_COLOR}"
+ else
+ message "${MESSAGE_COLOR}Running initial Mercurial
clone...${DEFAULT_COLOR}" &&
+ hg clone -r${HG_TAG} "http://${HG_ROOT}"; ${HG_MODULE}
+ message "${MESSAGE_COLOR}Done...${DEFAULT_COLOR}"
+ fi &&
+ message "${MESSAGE_COLOR}Generating tarball...${DEFAULT_COLOR}" &&
+ tar -jcf $2 ${HG_MODULE} &&
+ mv $2 ${SOURCE_CACHE}/$2 &&
+ message "${MESSAGE_COLOR}Mercurial checkout complete...${DEFAULT_COLOR}"
+}
+
+function hg_download() {
+ hg_checkout "${SOURCE_URL}" "${SOURCE}"
+ if [ -n "${SOURCE2_URL}" ]
+ then
+ hg_checkout "${SOURCE2_URL}" "${SOURCE2}"
+ fi
+}
+
+function url_hg_crack() {
+ URL=$(url_strip_prefix "$1" hg_http)
+ HG_ROOT=$(echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#")
+ local HG_MODULE_TAG=$(echo $URL | sed "s#^[^/]*[^:]*\(.*\)#\1#")
+ HG_MODULE=$(echo $HG_MODULE_TAG | cut -d : -f2)
+ local HG_TAGNAME=$(echo $HG_MODULE_TAG | cut -d : -f3)
+ HG_TAG=${HG_TAGNAME:-tip}
+}
diff --git a/python-pypi/scrapy/DETAILS b/python-pypi/scrapy/DETAILS
index 322ecf6..cf6b611 100755
--- a/python-pypi/scrapy/DETAILS
+++ b/python-pypi/scrapy/DETAILS
@@ -1,10 +1,22 @@
SPELL=scrapy
SPELLX=Scrapy
+if [[ $SCRAPY_SCM == y ]]; then
+ if [[ "$SCRAPY_SCM_AUTOUPDATE" == "y" ]]; then
+ VERSION=$(date +%Y%m%d)
+ else
+ VERSION=scm
+ fi
+ SOURCE_IGNORE=volatile
+ SOURCE_URL[0]=hg_http://hg.scrapy.org/scrapy:$SPELL-scm
+ SOURCE=$SPELL-scm.tar.bz2
+SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-scm"
+else
VERSION=0.12.0.2542

SOURCE_HASH=sha512:b9346a3f723e241df5a6164d5f938f4c39e83fff7c275d450f6bea0de9686ccf6be26ce6b27e0ae9e7917495010ecb29c12f49091e26c858e51883cd4cab1507
SOURCE=$SPELLX-$VERSION.tar.gz
SOURCE_URL[0]=http://pypi.python.org/packages/source/S/$SPELLX/$SOURCE
SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELLX-$VERSION"
+fi
WEB_SITE=http://scrapy.org/
LICENSE[0]=BSD
UPDATED=20110531
diff --git a/python-pypi/scrapy/DOWNLOAD b/python-pypi/scrapy/DOWNLOAD
new file mode 100644
index 0000000..a11b9dc
--- /dev/null
+++ b/python-pypi/scrapy/DOWNLOAD
@@ -0,0 +1,5 @@
+if [[ "$SCRAPY_SCM" == "y" ]]; then
+ hg_download
+else
+ default_download
+fi
diff --git a/python-pypi/scrapy/HISTORY b/python-pypi/scrapy/HISTORY
index 6b244bf..3bbba7c 100644
--- a/python-pypi/scrapy/HISTORY
+++ b/python-pypi/scrapy/HISTORY
@@ -1,2 +1,3 @@
2011-05-31 Ismael Luceno <ismael AT sourcemage.org>
* DEPENDS, DETAILS: spell created
+ * DETAILS, DOWNLOAD, PREPARE: add scm version
diff --git a/python-pypi/scrapy/PREPARE b/python-pypi/scrapy/PREPARE
new file mode 100755
index 0000000..bde3381
--- /dev/null
+++ b/python-pypi/scrapy/PREPARE
@@ -0,0 +1,6 @@
+config_query SCRAPY_SCM "Do you want to use SCM version?" n
+if [[ "$SCRAPY_SCM" == "y" ]]; then
+ config_query SCRAPY_SCM_AUTOUPDATE \
+ "Automaticaly update the spell on sorcery queue/system-update?" \
+ "n"
+fi



  • [SM-Commit] GIT changes to master grimoire by Ismael Luceno (18250c7436922b7a2f8994bb825a4a4dda05a309), Ismael Luceno, 05/31/2011

Archive powered by MHonArc 2.6.24.

Top of Page