summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIsmael Luceno2010-12-29 05:32:10 -0200
committerIsmael Luceno2010-12-29 05:32:10 -0200
commit8795ab3c8b3bbaad19d2764c86b9892f5deddae4 (patch)
tree3ce1e9bd4ff9868cace4726d3f73dac9722028bf
parent440112bb38fc6017f7ac24c8f9ab92d42316ab3b (diff)
Move bzr_download function to it's own file, so it can be shared
and fix emacs download for tarball releases
-rwxr-xr-xFUNCTIONS1
-rw-r--r--bzr_download.function23
-rwxr-xr-xdisk/partimage-ng/DOWNLOAD18
-rw-r--r--disk/partimage-ng/HISTORY5
-rwxr-xr-xeditors/emacs/DOWNLOAD20
-rw-r--r--editors/emacs/HISTORY3
6 files changed, 35 insertions, 35 deletions
diff --git a/FUNCTIONS b/FUNCTIONS
index 5f7a08968d..6e26adc618 100755
--- a/FUNCTIONS
+++ b/FUNCTIONS
@@ -719,3 +719,4 @@ fi
}
. $GRIMOIRE/glselect.function
+. $GRIMOIRE/bzr_download.function
diff --git a/bzr_download.function b/bzr_download.function
new file mode 100644
index 0000000000..ebfac4653f
--- /dev/null
+++ b/bzr_download.function
@@ -0,0 +1,23 @@
+#---------------------------------------------------------------------
+## Handler for downloading from bzr URLs
+#---------------------------------------------------------------------
+function bzr_download() {
+ if [ $SOURCE_CACHE/$SOURCE ]
+ then
+ message "${MESSAGE_COLOR}Unpacking the source...${DEFAULT_COLOR}" &&
+ tar xjf $SOURCE_CACHE/$SOURCE &&
+ cd $SOURCE_DIRECTORY &&
+ message "${MESSAGE_COLOR}Updating...${DEFAULT_COLOR}" &&
+ echo bzr update &&
+ bzr update &&
+ cd -
+ else
+ message "${MESSAGE_COLOR}Doing a lightweight checkout...${DEFAULT_COLOR}" &&
+ echo bzr checkout --lightweight $SOURCE_URL $SOURCE_DIRECTORY &&
+ bzr checkout --lightweight $SOURCE_URL $SOURCE_DIRECTORY
+ fi &&
+
+ message "${MESSAGE_COLOR}Repacking the source...${DEFAULT_COLOR}" &&
+ tar cjf $SOURCE $SOURCE_DIRECTORY &&
+ mv $SOURCE $SOURCE_CACHE
+}
diff --git a/disk/partimage-ng/DOWNLOAD b/disk/partimage-ng/DOWNLOAD
index 85e5e94706..922adc2f66 100755
--- a/disk/partimage-ng/DOWNLOAD
+++ b/disk/partimage-ng/DOWNLOAD
@@ -1,21 +1,3 @@
-bzr_download() {
-local OLD
-OLD=$SOURCE_CACHE/$SOURCE
-if [[ -e $OLD ]];then
- echo unpacking old tarball
- tar xjf $OLD
- cd $SPELL
- echo updating source tree
- bzr update
- cd -
-else
- echo fetching source tree
- bzr checkout $SOURCE_URL $SPELL
-fi
-echo repacking tarball
-tar cjf $SOURCE $SPELL
-mv $SOURCE $OLD
-}
#if [[ $PART_VCS == y ]];then
bzr_download
#else
diff --git a/disk/partimage-ng/HISTORY b/disk/partimage-ng/HISTORY
index 48b398a3b5..807d409173 100644
--- a/disk/partimage-ng/HISTORY
+++ b/disk/partimage-ng/HISTORY
@@ -1,3 +1,6 @@
+2010-12-29 Ismael Luceno <ismael@sourcemage.org>
+ * DOWNLOAD: bzr_download function moved to it's own file
+
2010-10-11 Bor Kraljič <pyrobor@ver.si>
* DOWNLOAD: only PART_VCS can be downloaded
(other version is commented in DETAILS)
@@ -9,7 +12,7 @@
* PRE_BUILD, {hal,ntfs}.diff: deleted
* DEPENDS: rearrange
* PREPARE: give warning message
-
+
2009-11-21 Treeve Jelbert <treeve@sourcemage.org>
* DETAILS: PATCHLEVEL++
* ntfs.diff: added
diff --git a/editors/emacs/DOWNLOAD b/editors/emacs/DOWNLOAD
index 8de5d4321a..db3a81403d 100755
--- a/editors/emacs/DOWNLOAD
+++ b/editors/emacs/DOWNLOAD
@@ -1,18 +1,6 @@
-if [ $SOURCE_CACHE/$SOURCE ]
+if [ "$VCS" ]
then
- message "${MESSAGE_COLOR}Unpacking the source...${DEFAULT_COLOR}" &&
- tar xjf $SOURCE_CACHE/$SOURCE &&
- cd $SOURCE_DIRECTORY &&
- message "${MESSAGE_COLOR}Updating...${DEFAULT_COLOR}" &&
- echo bzr update &&
- bzr update &&
- cd -
+ bzr_download
else
- message "${MESSAGE_COLOR}Doing a lightweight checkout...${DEFAULT_COLOR}" &&
- echo bzr checkout --lightweight $SOURCE_URL $SOURCE_DIRECTORY &&
- bzr checkout --lightweight $SOURCE_URL $SOURCE_DIRECTORY
-fi &&
-
-message "${MESSAGE_COLOR}Repacking the source...${DEFAULT_COLOR}" &&
-tar cjf $SOURCE $SOURCE_DIRECTORY &&
-mv $SOURCE $SOURCE_CACHE
+ default_download
+fi
diff --git a/editors/emacs/HISTORY b/editors/emacs/HISTORY
index 7b00bd5f56..705f78c35c 100644
--- a/editors/emacs/HISTORY
+++ b/editors/emacs/HISTORY
@@ -1,3 +1,6 @@
+2010-12-29 Ismael Luceno <ismael@sourcemage.org>
+ * DOWNLOAD: bzr_download function moved to it's own file
+
2010-12-07 Ismael Luceno <ismael@sourcemage.org>
* DOWNLOAD: manually handle, until bzr support finds it's way into sorcery