/[fai]/trunk/lib/get-config-dir-svn
ViewVC logotype

Contents of /trunk/lib/get-config-dir-svn

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4538 - (hide annotations) (download)
Thu Aug 30 08:24:18 2007 UTC (5 years, 8 months ago) by lange
File size: 1296 byte(s)
add svn+ssh support
1 lange 4033 #!/bin/bash
2    
3     # (c) 2002-2006 Henning Glawe <glaweh@debian.org>
4    
5     ### BEGIN SUBROUTINE INFO
6     # Provides-Var:
7     # Requires-Var: $FAI_CONFIG_SRC $FAI $LOGDIR
8     # Suggests-Var:
9     # Short-Description: get $FAI from an svn repository.
10     ### END SUBROUTINE INFO
11    
12     # matched string: "svn://user@host/svnpath"
13 lange 4296 # strings without user@ are processed below
14 lange 4033 protocol=$(expr match "$FAI_CONFIG_SRC" '\([^:]*\)://')
15     username=$(expr match "$FAI_CONFIG_SRC" '[^:]*://\([^@]*\)@')
16 lange 4064 svnpath=$(expr match "$FAI_CONFIG_SRC" '[^:]*://[^@]\+@\([^[:space:]]\+\)')
17 lange 4538 [ -n "$username" ] && user="--username $username"
18     [ -z "$username" ] && svnurl=$FAI_CONFIG_SRC # if no user is specified
19 lange 4033
20     case $protocol in
21     svn)
22     svnurl="svn://$svnpath"
23     ;;
24 lange 4538 svn+ssh)
25     svnurl="svn+ssh://$svnpath"
26     user=""
27     export SVN_SSH="ssh -l $username"
28     ;;
29 lange 4033 svn+file)
30     svnurl="file://$svnpath"
31     ;;
32     svn+http)
33     svnurl="http://$svnpath"
34     ;;
35     svn+https)
36     svnurl="https://$svnpath"
37     ;;
38     *)
39     echo "get-config-dir-svn: protocol $protocol not implemented"
40     exit 1
41     ;;
42     esac
43    
44    
45     if [ -d "$FAI/.svn" ] ; then
46     echo "Updating SVN in $FAI"
47     cd $FAI
48     svn up $user | grep -v 'Updated to revision' > $LOGDIR/getconf.log
49     else
50     echo "Checking out SVN"
51     svn co $user $svnurl $FAI | grep -v 'Checked out revision' > $LOGDIR/getconf.log
52     fi

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5