Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] BZR Change 9 to test sorcery by Andrew Stitt <afrayedknot@thefrayedknot>

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: bzr AT mail.sourcemage.org
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] BZR Change 9 to test sorcery by Andrew Stitt <afrayedknot@thefrayedknot>
  • Date: Mon, 10 Apr 2006 14:40:03 -0500

------------------------------------------------------------
revno: 9
committer: Andrew Stitt <afrayedknot@thefrayedknot>
branch nick: test
timestamp: Mon 2006-04-10 12:33:34 -0700
message:
pull git handlers into test

=== added file 'var/lib/sorcery/modules/dl_handlers/dl_git'
--- /dev/null
+++ var/lib/sorcery/modules/dl_handlers/dl_git
@@ -0,0 +1,80 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+##
+##=head1 COPYRIGHT
+##
+## Copyright 2004 by the Source Mage Team
+##
+##=head1 FUNCTIONS
+##
+##=over 4
+##
+#---------------------------------------------------------------------
+
+
+#---------------------------------------------------------------------
+##=item dl_get_git <url>
+##
+## Fetch the specified git url.
+##
+## This handler only supports tree downloads.
+##
+#---------------------------------------------------------------------
+function dl_git_get () {
+ dl_command_check git || 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 GIT_ROOT GIT_DIRECTORY GIT_TAG
+ url_crack "$url" "$hints"
+ if test -d $GIT_DIRECTORY; then
+ message "${MESSAGE_COLOR}Running git pull...${DEFAULT_COLOR}"
+ echo git pull $GIT_ROOT
+ ( cd $GIT_DIRECTORY &&
+ git pull $GIT_ROOT )
+ rc=$?
+ eval "$dl_target=\"$GIT_DIRECTORY\""
+ else
+ message "${MESSAGE_COLOR}Running git clone...${DEFAULT_COLOR}"
+ echo git clone $GIT_ROOT $GIT_DIRECTORY
+ git clone $GIT_ROOT $GIT_DIRECTORY
+ rc=$?
+ eval "$dl_target=\"$GIT_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
+##
+#---------------------------------------------------------------------

=== added file 'var/lib/sorcery/modules/url_handlers/url_git'
--- /dev/null
+++ var/lib/sorcery/modules/url_handlers/url_git
@@ -0,0 +1,122 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+##
+##=head1 SYNOPSIS
+##
+## Url handler functions for downloading git urls
+##
+##=head1 DESCRIPTION
+##
+## This file contains functions for downloading and verifying
+## git urls. This file uses the "git" program.
+##
+##=head1 COPYRIGHT
+##
+## Copyright 2002 by the Source Mage Team
+##
+##=head1 FUNCTIONS
+##
+##=over 4
+##
+#---------------------------------------------------------------------
+
+#---------------------------------------------------------------------
+##=item url_git_crack <url>
+##
+## Parse the specified git url.
+##
+## @Global URL
+## @Global GIT_ROOT
+## @Global GIT_DIRECTORY
+## @Global GIT_TAG
+##
+#---------------------------------------------------------------------
+function url_git_crack() {
+
+ URL=`url_strip_prefix "$1" git`
+ GIT_ROOT=`echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#"`
+ GIT_ROOT=git://$GIT_ROOT
+ local GIT_DIRECTORY_TAG=`echo $URL | sed "s#^[^/]*[^:]*\(.*\)#\1#"`
+ GIT_DIRECTORY=`echo $GIT_DIRECTORY_TAG | cut -d : -f2`
+ local GIT_TAGNAME=`echo $GIT_DIRECTORY_TAG | cut -d : -f3`
+ GIT_TAG=${SVN_TAGNAME:=master}
+
+}
+
+#---------------------------------------------------------------------
+##=item url_git_bucketize <url>
+##
+## Verifies the specified git url. Returns true if the url exists
+## OR if the url is an empty string.
+##
+#---------------------------------------------------------------------
+function url_git_bucketize() {
+ echo git
+}
+
+#---------------------------------------------------------------------
+##=item url_git_verify <url>
+##
+## Verifies the specified git url. Returns true if the url exists
+## OR if the url is an empty string.
+##
+#---------------------------------------------------------------------
+function url_git_verify() {
+ local URL GIT_ROOT GIT_DIRECTORY GIT_TAG item
+ url_git_crack $1
+ for item in URL GIT_ROOT GIT_DIRECTORY GIT_TAG ; do
+ if ! [[ ${!item} ]] ; then
+ return 1
+ fi
+ done
+}
+
+#---------------------------------------------------------------------
+##=item url_<prefix>_hostname <url>
+##
+## Gets the hostname out of the url
+#---------------------------------------------------------------------
+function url_git_hostname() {
+ echo $1|sed 's:^.*//\([^/]*\).*$:\1:'
+}
+
+#---------------------------------------------------------------------
+##=item url_git_netselect <url>
+##
+## Gets a netselect type output for the url
+##
+#---------------------------------------------------------------------
+function url_git_netselect() {
+ local tmp_hostname url_speed each
+
+ for each in "$@" ; do
+ tmp_hostname=$(url_git_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
+##
+#---------------------------------------------------------------------

=== modified file 'usr/sbin/scribe'
--- usr/sbin/scribe
+++ usr/sbin/scribe
@@ -210,7 +210,7 @@
if [ -z "$from" ]; then
#from is empty - use the default
prefix=$(url_get_prefix $CODEX_URL)
- if list_find "rsync svn cvs smgl_tla dir" $prefix ; then
+ if list_find "rsync svn cvs smgl_tla dir git" $prefix ; then
grim_target=$grim_name
else
grim_target="$grim_name.tar.bz2"

=== modified file 'var/lib/sorcery/modules/libsummon'
--- var/lib/sorcery/modules/libsummon
+++ var/lib/sorcery/modules/libsummon
@@ -382,7 +382,7 @@
local _guess_type

# hard-coded list of url prefixes that generally download trees
- local tree_prefixes="cvs dir rsync smgl_tla svn"
+ local tree_prefixes="cvs dir rsync smgl_tla svn git"
local prefix=$(url_get_prefix $url_list)
if ! list_find "$hints" file &&
list_find "$hints" tree || list_find "$tree_prefixes" "$prefix" ; then




  • [SM-Commit] BZR Change 9 to test sorcery by Andrew Stitt <afrayedknot@thefrayedknot>, bzr, 04/10/2006

Archive powered by MHonArc 2.6.24.

Top of Page