Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (0d56c9b49d2b82f696ab4ea3abd8ce5090e6674a)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (0d56c9b49d2b82f696ab4ea3abd8ce5090e6674a)
  • Date: Sat, 28 May 2011 04:21:21 -0500

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

ChangeLog | 3
usr/sbin/scribe | 2
var/lib/sorcery/modules/dl_handlers/dl_bzr | 84 +++++++++++++++++++
var/lib/sorcery/modules/libsummon | 2
var/lib/sorcery/modules/url_handlers/url_bzr | 114
+++++++++++++++++++++++++++
5 files changed, 203 insertions(+), 2 deletions(-)

New commits:
commit 0d56c9b49d2b82f696ab4ea3abd8ce5090e6674a
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

changelog entry for merged bzr support from Ismael Luceno #14856

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

bzr url handler

diff --git a/ChangeLog b/ChangeLog
index 8165abd..7911cd4 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2010-05-28 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libsummon, {dl,url}_bzr: merged bzr support from Ismael Luceno
#14856
+
2010-01-01 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libsorcery: avoid passing bad parameters when PAGER has none
* subroutines: avoid sourcing leftovers from failed patching attempts
diff --git a/usr/sbin/scribe b/usr/sbin/scribe
index 5c647bb..74712f0 100755
--- a/usr/sbin/scribe
+++ b/usr/sbin/scribe
@@ -256,7 +256,7 @@ function scribe_add_update_worker() {
fi

local tree_prefixes="rsync svn svn_http svn_https svn_ssh cvs smgl_tla"
- tree_prefixes="$tree_prefixes dir git git_http hg_http"
+ tree_prefixes="$tree_prefixes dir git git_http hg_http bzr"
if list_find "$tree_prefixes" "$prefix"; then
grim_target=$grim_name
else
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_bzr
b/var/lib/sorcery/modules/dl_handlers/dl_bzr
new file mode 100755
index 0000000..2939763
--- /dev/null
+++ b/var/lib/sorcery/modules/dl_handlers/dl_bzr
@@ -0,0 +1,84 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+##
+##=head1 COPYRIGHT
+##
+## Copyright 2004 by the Source Mage Team
+##
+##=head1 FUNCTIONS
+##
+##=over 4
+##
+#---------------------------------------------------------------------
+
+
+#---------------------------------------------------------------------
+##=item dl_bzr_get <url>
+##
+## Fetch the specified bzr url.
+##
+## This handler only supports tree downloads.
+##
+#---------------------------------------------------------------------
+function dl_bzr_get () {
+ dl_command_check bzr || return 254
+
+ local target=$1
+ local url_list=$2
+ local hints=$3
+ local dl_target=$4
+ local dl_type=$5
+ local url rc=0
+
+ [[ $target ]] &&
+ dl_connect || return 255
+
+ for url in $url_list; do
+ local URL BZR_ROOT BZR_DIRECTORY BZR_BRANCH
+ url_crack "$url" "$hints"
+ if [[ -z $BZR_DIRECTORY ]]
+ then
+ BZR_DIRECTORY=${target}
+ fi
+ if test -d $BZR_DIRECTORY; then
+ message "${MESSAGE_COLOR}Updating...${DEFAULT_COLOR}"
+ ( cd $BZR_DIRECTORY &&
+ echo bzr update &&
+ bzr update )
+ rc=$?
+ eval "$dl_target=\"$BZR_DIRECTORY\""
+ else
+ message "${MESSAGE_COLOR}Doing a lightweight
checkout...${DEFAULT_COLOR}"
+ echo bzr checkout --lightweight $BZR_ROOT $BZR_DIRECTORY
+ bzr checkout --lightweight $BZR_ROOT $BZR_DIRECTORY
+ rc=$?
+ eval "$dl_target=\"$BZR_DIRECTORY\""
+ fi
+ [[ $rc == 0 ]] && break
+ done
+ dl_disconnect
+
+ eval "$dl_type=\"tree\""
+ return $rc
+}
+
+#---------------------------------------------------------------------
+##=back
+##
+##=head1 LICENSE
+##
+## 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/sorcery/modules/libsummon
b/var/lib/sorcery/modules/libsummon
index d0ab985..3de9d2b 100755
--- a/var/lib/sorcery/modules/libsummon
+++ b/var/lib/sorcery/modules/libsummon
@@ -402,7 +402,7 @@ function unpack_for_update() {

# hard-coded list of url prefixes that generally download trees
local tree_prefixes="cvs dir rsync smgl_tla svn svn_http svn_ssh git"
- tree_prefixes="$tree_prefixes svn_https git_http hg_http"
+ tree_prefixes="$tree_prefixes svn_https git_http hg_http bzr"
local prefix=$(url_get_prefix $url_list)
if ! list_find "$hints" file &&
list_find "$hints" tree || list_find "$tree_prefixes" "$prefix" ; then
diff --git a/var/lib/sorcery/modules/url_handlers/url_bzr
b/var/lib/sorcery/modules/url_handlers/url_bzr
new file mode 100755
index 0000000..660ee0d
--- /dev/null
+++ b/var/lib/sorcery/modules/url_handlers/url_bzr
@@ -0,0 +1,114 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+##
+##=head1 SYNOPSIS
+##
+## Url handler functions for downloading bzr urls
+##
+##=head1 DESCRIPTION
+##
+## This file contains functions for downloading and verifying
+## bzr urls. This file uses the "bzr" program.
+##
+##=head1 COPYRIGHT
+##
+## Copyright 2002 by the Source Mage Team
+##
+##=head1 FUNCTIONS
+##
+##=over 4
+##
+#---------------------------------------------------------------------
+
+#---------------------------------------------------------------------
+##=item url_bzr_crack <url>
+##
+## Parse the specified bzr url.
+##
+## @Global URL
+## @Global BZR_ROOT
+## @Global BZR_DIRECTORY
+##
+#---------------------------------------------------------------------
+function url_bzr_crack() {
+ URL=$(url_strip_prefix "$1" bzr)
+ BZR_ROOT=bzr://$(echo $URL | cut -d: -f1)
+ BZR_DIRECTORY=$(echo $URL | cut -d: -f2)
+}
+
+#---------------------------------------------------------------------
+##=item url_bzr_bucketize <url>
+##
+## echoes the download handler - bzr
+##
+#---------------------------------------------------------------------
+function url_bzr_bucketize() {
+ echo bzr
+}
+
+#---------------------------------------------------------------------
+##=item url_bzr_verify <url>
+##
+## Verifies the specified bzr url. Returns true if the url exists
+## OR if the url is an empty string.
+##
+#---------------------------------------------------------------------
+function url_bzr_verify() {
+ local URL BZR_ROOT item
+ url_bzr_crack $1
+ for item in URL BZR_ROOT; do
+ if ! [[ ${!item} ]] ; then
+ return 1
+ fi
+ done
+}
+
+#---------------------------------------------------------------------
+##=item url_<prefix>_hostname <url>
+##
+## Gets the hostname out of the url
+#---------------------------------------------------------------------
+function url_bzr_hostname() {
+ echo $1|sed 's:^.*//\([^/]*\).*$:\1:'
+}
+
+#---------------------------------------------------------------------
+##=item url_bzr_netselect <url>
+##
+## Gets a netselect type output for the url
+##
+#---------------------------------------------------------------------
+function url_bzr_netselect() {
+ local tmp_hostname url_speed each
+
+ for each in "$@" ; do
+ tmp_hostname=$(url_bzr_hostname $each)
+ # since we had to pull the url apart to give netselect
+ # something it can understand we'll just pretend like
+ # multiple A records wont exist for this host...
+ url_speed=$(netselect -s 1 $tmp_hostname 2>/dev/null|awk '{print $1}')
+ [[ -n $url_speed ]] && echo "$url_speed $each"
+ done
+}
+
+
+#---------------------------------------------------------------------
+##=back
+##
+##=head1 LICENSE
+##
+## 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
+##
+#---------------------------------------------------------------------



  • [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (0d56c9b49d2b82f696ab4ea3abd8ce5090e6674a), Jaka Kranjc, 05/28/2011

Archive powered by MHonArc 2.6.24.

Top of Page