Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mdget « scripts - github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ff4f3b59bcfa66f4245ea9aad3896c4796cd293f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/usr/bin/env bash
version=
prefix=/usr/local
profile=stable
trunkRoot=svn+ssh://$USER@mono-cvs.ximian.com/source/trunk/monodevelop
branchesRoot=svn+ssh://$USER@mono-cvs.ximian.com/source/branches/monodevelop
tagsRoot=svn+ssh://$USER@mono-cvs.ximian.com/source/tags/monodevelop
destDirRoot=../..

sourceRoot=$branchesRoot

MSG=`mktemp`

usage ()
{
	echo ""
	echo "Usage : mdget [--profile=PROFILE] [--dir=DIRECTORY] [--tag] versionNumber"
	echo ""
	echo "Check outs a MonoDevelop branch or tag and the extras add-ins included"
	echo "in the specified profile (which is 'stable' by default)."
	echo ""
	echo "PROFILE is the profile that contains the list of packages to check out."
	echo ""
	echo "DIRECTORY is the root directory where MonoDevelop will be checked out."
	echo "Example: mdget --dir=/home/user/test 2.1"
	echo "This command will checkout the 2.1 branch to the directory:"
	echo "/home/user/test/monodevelop-2.1"
	echo "The output directory is ../.. by default."
	echo ""
	echo "When the --tag option is specified, a tag will be checked out,"
	echo "instead of a branch."
	echo ""
}

validate_profile ()
{
	test -z "$1" && return 0
	for c in `ls ../profiles`; do
		if [ "$c" = "$1" ]; then
			return 1
		fi
	done
	return 0
}

read_packages ()
{
	for p in `sed -e /#/d -e 's/ /,/g' < ../profiles/$profile` ; do
		path=`echo $p | cut -d ',' -f 1`
		packages="$packages $path"
	done
	return 0
}

while test x$1 != x; do
	case $1 in
		--profile=*)
			prof=`echo $1 | sed 's/--profile=//'`
			validate_profile "$prof"
			if [ $? -eq 1 ]; then
				profile=$prof
			else
				echo "Invalid profile name - $conf"
				usage
				exit 1
			fi
			;;
		--profile)
			shift
			prof=$1
			validate_profile "$prof"
			if [ $? -eq 1 ]; then
				profile=$prof
			else
				echo "Invalid profile name - $conf"
				usage
				exit 1
			fi
			;;
		--tag)
			shift
			sourceRoot=$tagsRoot
			;;
		--help)
			usage
			exit
			;;
		*)
			version=$1
			;;
	esac
	shift
done

if [ "$version" = "" ]; then
	usage
	exit
fi


read_packages

destDir=$destDirRoot/monodevelop-$version

echo ""
echo "MonoDevelop $version will be checked out from:"
echo "$sourceRoot/*/$version"
echo ""
echo "The following directories will be created:"

echo ""
for p in $packages; do
	echo "$destDir/$p"
done

while [[ 1 ]]
do 

	read -a RESPONSE  -p"Would you like to continue (Y)es/(N)o:  "
	if [[ $? != 0 ]]
	then
		RESPONSE="N"
	fi

	case $RESPONSE in
		"Y" | "y" | "yes" | "Yes")
		
			echo "Getting MonoDevelop $version ..."
			mkdir $destDir
			for p in $packages; do
				echo "svn co $sourceRoot/$p/$version $destDir/$p"
				svn co $sourceRoot/$p/$version $destDir/$p
			done
			cp ../configure $destDir/configure
			cp ../MonoDevelop.mdw $destDir/MonoDevelop.mdw
			cp ../Makefile $destDir/Makefile
			cp ../extras/extras.mdw $destDir/extras/extras.mdw
			mkdir $destDir/profiles
			cp ../profiles/$profile $destDir/profiles/all
			cp ../profiles/$profile $destDir/profiles/stable
			cp ../profiles/$profile $destDir/profiles/default
			exit 0
		;;
		
		"N" | "n" | "no" | "No")
			echo "Aborting..."
			exit 1
		;;
		*)
			# try again
		;;
	esac
done