summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpuppetmaster <puppetmaster>2006-01-13 19:30:37 +0000
committerpuppetmaster <puppetmaster>2006-01-13 19:30:37 +0000
commit55b22344d95bd3304a3c13a85b8e3d8441e62b03 (patch)
treedc8dfc9153bfa549ab3e718ed600b532bb93eb60
parentUpdate to sorcery devel version (diff)
downloadsorcery-55b22344d95bd3304a3c13a85b8e3d8441e62b03.tar.gz
adding some new files
-rw-r--r--var/lib/sorcery/modules/url_handlers/url_svn_http131
-rw-r--r--var/lib/sorcery/modules/url_handlers/url_svn_https131
-rw-r--r--var/lib/sorcery/modules/url_handlers/url_svn_ssh127
3 files changed, 389 insertions, 0 deletions
diff --git a/var/lib/sorcery/modules/url_handlers/url_svn_http b/var/lib/sorcery/modules/url_handlers/url_svn_http
new file mode 100644
index 0000000..eac5c82
--- /dev/null
+++ b/var/lib/sorcery/modules/url_handlers/url_svn_http
@@ -0,0 +1,131 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+##
+##=head1 SYNOPSIS
+##
+## Url handler functions for parsing subversion over http urls.
+##
+##=head1 DESCRIPTION
+##
+## This file contains functions for parsing svn_http urls.
+##
+##=head1 SVN HTTP URL Format
+##
+## The sourcemage specific svn+ssh url is as follows:
+## specific format was invented:
+##
+## svn_http://SVNURL:DIR_NAME
+##
+## The above url will download the latest version of the specified
+## module (i.e., the HEAD revision). To specify a specific revision,
+## the following format can be used:
+##
+## svn://SVNURL:DIR_NAME:REVISION_TAG
+##
+## The SVNURL portion of the url will appear as a normal http url
+## sans http:// prefix.
+##
+## The DIR_NAME will be the tail element of the SOURCE_DIRECTORY.
+##
+## For more details, see the SVN manual at
+## http://svnbook.red-bean.com/svnbook/ch03s04.html
+## and url_svn.
+##
+##=head1 COPYRIGHT
+##
+## Copyright 2004 by the Source Mage Team
+## Copyright 2005 by the Source Mage Team
+##
+#---------------------------------------------------------------------
+
+#---------------------------------------------------------------------
+##=item url_svn_http_bucketize
+## @param url
+##
+## Outputs svn as that is the dl handler for svn_http:// urls
+#---------------------------------------------------------------------
+function url_svn_http_bucketize() {
+ echo svn
+}
+
+#---------------------------------------------------------------------
+##=item url_file_download <url>
+##
+## Parse the specified svn_http url.
+##
+## @Global URL
+## @Global SVN_ROOT
+## @Global SVN_MODULE
+## @Global SVN_TAG
+##
+#---------------------------------------------------------------------
+function url_svn_http_crack() {
+
+ URL=`url_strip_prefix "$1" svn_http`
+ SVN_ROOT=http://`echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#"`
+ local SVN_MODULE_TAG=`echo $URL | sed "s#^[^/]*[^:]*\(.*\)#\1#"`
+ SVN_MODULE=`echo $SVN_MODULE_TAG | cut -d : -f2`
+ local SVN_TAGNAME=`echo $SVN_MODULE_TAG | cut -d : -f3`
+ SVN_TAG=${SVN_TAGNAME:=HEAD}
+
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_http_is_valid <url>
+##
+## Ensure that all the fields that should be parsed out from a url
+## do indeed exist
+#---------------------------------------------------------------------
+function url_svn_http_is_valid() {
+ url_svn_is_valid "$@"
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_http_hostname <url>
+##
+## Get the hostname of the url
+##
+#---------------------------------------------------------------------
+function url_svn_http_hostname() {
+ echo $1|sed 's#^svn_http://\([^/:]*\)[/:].*$#\1#'
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_http_netselect <url>
+##
+## Gets a netselect type output for the url
+##
+#---------------------------------------------------------------------
+function url_svn_http_netselect() {
+ local tmp_hostname url_speed each
+
+ for each in "$@" ; do
+ tmp_hostname=$(url_svn_http_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
+##
+#---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/url_handlers/url_svn_https b/var/lib/sorcery/modules/url_handlers/url_svn_https
new file mode 100644
index 0000000..eac5c82
--- /dev/null
+++ b/var/lib/sorcery/modules/url_handlers/url_svn_https
@@ -0,0 +1,131 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+##
+##=head1 SYNOPSIS
+##
+## Url handler functions for parsing subversion over http urls.
+##
+##=head1 DESCRIPTION
+##
+## This file contains functions for parsing svn_http urls.
+##
+##=head1 SVN HTTP URL Format
+##
+## The sourcemage specific svn+ssh url is as follows:
+## specific format was invented:
+##
+## svn_http://SVNURL:DIR_NAME
+##
+## The above url will download the latest version of the specified
+## module (i.e., the HEAD revision). To specify a specific revision,
+## the following format can be used:
+##
+## svn://SVNURL:DIR_NAME:REVISION_TAG
+##
+## The SVNURL portion of the url will appear as a normal http url
+## sans http:// prefix.
+##
+## The DIR_NAME will be the tail element of the SOURCE_DIRECTORY.
+##
+## For more details, see the SVN manual at
+## http://svnbook.red-bean.com/svnbook/ch03s04.html
+## and url_svn.
+##
+##=head1 COPYRIGHT
+##
+## Copyright 2004 by the Source Mage Team
+## Copyright 2005 by the Source Mage Team
+##
+#---------------------------------------------------------------------
+
+#---------------------------------------------------------------------
+##=item url_svn_http_bucketize
+## @param url
+##
+## Outputs svn as that is the dl handler for svn_http:// urls
+#---------------------------------------------------------------------
+function url_svn_http_bucketize() {
+ echo svn
+}
+
+#---------------------------------------------------------------------
+##=item url_file_download <url>
+##
+## Parse the specified svn_http url.
+##
+## @Global URL
+## @Global SVN_ROOT
+## @Global SVN_MODULE
+## @Global SVN_TAG
+##
+#---------------------------------------------------------------------
+function url_svn_http_crack() {
+
+ URL=`url_strip_prefix "$1" svn_http`
+ SVN_ROOT=http://`echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#"`
+ local SVN_MODULE_TAG=`echo $URL | sed "s#^[^/]*[^:]*\(.*\)#\1#"`
+ SVN_MODULE=`echo $SVN_MODULE_TAG | cut -d : -f2`
+ local SVN_TAGNAME=`echo $SVN_MODULE_TAG | cut -d : -f3`
+ SVN_TAG=${SVN_TAGNAME:=HEAD}
+
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_http_is_valid <url>
+##
+## Ensure that all the fields that should be parsed out from a url
+## do indeed exist
+#---------------------------------------------------------------------
+function url_svn_http_is_valid() {
+ url_svn_is_valid "$@"
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_http_hostname <url>
+##
+## Get the hostname of the url
+##
+#---------------------------------------------------------------------
+function url_svn_http_hostname() {
+ echo $1|sed 's#^svn_http://\([^/:]*\)[/:].*$#\1#'
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_http_netselect <url>
+##
+## Gets a netselect type output for the url
+##
+#---------------------------------------------------------------------
+function url_svn_http_netselect() {
+ local tmp_hostname url_speed each
+
+ for each in "$@" ; do
+ tmp_hostname=$(url_svn_http_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
+##
+#---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/url_handlers/url_svn_ssh b/var/lib/sorcery/modules/url_handlers/url_svn_ssh
new file mode 100644
index 0000000..6c8ddb0
--- /dev/null
+++ b/var/lib/sorcery/modules/url_handlers/url_svn_ssh
@@ -0,0 +1,127 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+##
+##=head1 SYNOPSIS
+##
+## Url handler functions for parsing smgl specific subversion over ssh urls.
+##
+##=head1 SVN URL Format
+##
+## The sourcemage specific svn+ssh url is as follows:
+## specific format was invented:
+##
+## svn_ssh://SVNURL:DIR_NAME
+##
+## The above url will download the latest version of the specified
+## module (i.e., the HEAD revision). To specify a specific revision,
+## the following format can be used:
+##
+## svn://SVNURL:DIR_NAME:REVISION_TAG
+##
+## The SVNURL portion of the url will appear as a normal svn+ssh url
+## sans svn+ssh:// prefix.
+##
+## The DIR_NAME will be the tail element of the SOURCE_DIRECTORY.
+##
+## For more details, see the SVN manual at
+## http://svnbook.red-bean.com/svnbook/ch03s04.html
+## and url_svn.
+##
+##=head1 COPYRIGHT
+##
+## Copyright 2004 by the Source Mage Team
+## Copyright 2005 by the Source Mage Team
+##
+#---------------------------------------------------------------------
+
+#---------------------------------------------------------------------
+##=item url_svn_http_bucketize
+## @param url
+##
+## Outputs svn as that is the dl handler for svn_http:// urls
+#---------------------------------------------------------------------
+function url_svn_ssh_bucketize() {
+ echo svn
+}
+
+#---------------------------------------------------------------------
+##=item url_file_download <url>
+##
+## Parse the specified svn_ssh url.
+##
+## @Global URL
+## @Global SVN_ROOT
+## @Global SVN_MODULE
+## @Global SVN_TAG
+##
+#---------------------------------------------------------------------
+function url_svn_ssh_crack() {
+
+ URL=`url_strip_prefix "$1" svn_ssh`
+ SVN_ROOT=svn+ssh://`echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#"`
+ local SVN_MODULE_TAG=`echo $URL | sed "s#^[^/]*[^:]*\(.*\)#\1#"`
+ SVN_MODULE=`echo $SVN_MODULE_TAG | cut -d : -f2`
+ local SVN_TAGNAME=`echo $SVN_MODULE_TAG | cut -d : -f3`
+ SVN_TAG=${SVN_TAGNAME:=HEAD}
+
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_ssh_is_valid <url>
+##
+## Ensure that all the fields that should be parsed out from a url
+## do indeed exist
+#---------------------------------------------------------------------
+function url_svn_ssh_is_valid() {
+ url_svn_is_valid "$@"
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_ssh_hostname <url>
+##
+## Get the hostname of the url
+##
+#---------------------------------------------------------------------
+function url_svn_ssh_hostname() {
+ echo $1|sed 's#^svn_ssh://\([^/:]*\)[/:].*$#\1#'
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_ssh_netselect <url>
+##
+## Gets a netselect type output for the url
+##
+#---------------------------------------------------------------------
+function url_svn_ssh_netselect() {
+ local tmp_hostname url_speed each
+
+ for each in "$@" ; do
+ tmp_hostname=$(url_svn_ssh_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
+##
+#---------------------------------------------------------------------