Browse Source

implement CVS support; as it leaks many features, only authentication to pserver is supported

master
belliash 7 years ago
parent
commit
5e573e339a
1 changed files with 28 additions and 1 deletions
  1. 28
    1
      libraries/repositories

+ 28
- 1
libraries/repositories View File

@@ -60,11 +60,35 @@ function mirrorRsync() {
60 60
 function prepareWrappers() {
61 61
 	run "cp ${EZROOT}/files/ssh_wrapper.sh ${BINDIR}/ssh_wrapper.sh" || return 1
62 62
 	run "chmod +x ${BINDIR}/ssh_wrapper.sh" || return 1
63
+	export CVS_PASSFILE="${TEMPDIR}/cvspass"
63 64
 	export GIT_SSH="${BINDIR}/ssh_wrapper.sh"
64 65
 	export SVN_SSH="${BINDIR}/ssh_wrapper.sh"
65 66
 	return 0
66 67
 }
67 68
 
69
+#-------------------------------------------------------------------------------
70
+# Downloads or updates specified CVS repository
71
+# Parameters: %dest_directory% %address% %module%
72
+#-------------------------------------------------------------------------------
73
+function pullCvs() {
74
+	local DIRECTORY="${1}"
75
+	local ADDRESS="${2}"
76
+	local MODULE="${3}"
77
+	if [ -d ${DIRECTORY} ]; then
78
+		cd ${DIRECTORY}
79
+		run "cvs update" || return 1
80
+	else
81
+		touch ${CVS_PASSFILE}
82
+		cd ${TEMPDIR}
83
+		run "cvs -q -f -z3 -d:pserver:anonymous:@${ADDRESS} login" || return 1
84
+		run "cvs -q -f -z3 -d:pserver:anonymous@${ADDRESS} checkout \
85
+			-P ${MODULE}" || return 1
86
+		run "mv ${MODULE} ${DIRECTORY}" || return 1
87
+		rm -f ${CVS_PASSFILE}
88
+	fi
89
+	return 0
90
+}
91
+
68 92
 #-------------------------------------------------------------------------------
69 93
 # Downloads or updates specified GIT repository
70 94
 # Parameters: %dest_directory% %address% [%branch%]
@@ -115,11 +139,14 @@ function pullMercurial() {
115 139
 
116 140
 #-------------------------------------------------------------------------------
117 141
 # Synchronizes specified repository regardless its protocol
118
-# Parameters: %dest_directory% %protocol% %address% [%branch%]
142
+# Parameters: %dest_directory% %protocol% %address% [%branch%/%module%]
119 143
 #-------------------------------------------------------------------------------
120 144
 function pullRepository() {
121 145
 	for ((i=0; $i<${FETCHTRIES}; i++)); do
122 146
 		case "${2}" in
147
+			[Cc][Vv][Ss])
148
+				pullCvs "${1}" "${3}" "${4}" && return 0
149
+				;;
123 150
 			[Gg][Ii][Tt])
124 151
 				pullGit "${1}" "${3}" "${4}" && return 0
125 152
 				;;

Loading…
Cancel
Save