This repository has been archived by the owner on Feb 10, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdev-helper
executable file
·198 lines (180 loc) · 6.24 KB
/
dev-helper
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#!/bin/bash
# This file is part of Archivematica.
#
# Copyright 2010-2012 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Archivematica 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 Archivematica. If not, see <http://www.gnu.org/licenses/>.
# @package Archivematica
# @author Joseph Perry <joseph@artefactual.com>
# @version svn: $Id$
cd `dirname $0`
fn_exists()
{
type $1 2>/dev/null | grep -q 'is a function'
}
colour () { "$@" 2>&1>&3|sed 's,.*,\x1B[31m&\x1B[0m,'>&2;} 3>&1
function svn-update() {
part="svn up"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
echo "Doing ${part} ..."
echo "Cleaning up..."
cd localDevSetup/
colour ./cleanup.sh
cd ..
SVNVERSION="`svnversion`"
echo "Updating from ${SVNVERSION}. Bringing latest changes to the working copy..."
svn update
echo "Integrating into environment..."
cd localDevSetup/
colour ./createLocalDevDirectories.sh
cd ..
else
echo "not going to ${part}"
fi
}
function package-update() {
part="update/install package requirements"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
echo "Going to ${part} ..."
cd localDevSetup/
colour sudo apt-get update
colour sudo ./installDependsFromDebianFile.py ./../src/archivematicaCommon/debian/control
#colour sudo ./installDependsFromDebianFile.py ./../src/createDublinCore/debian/control
colour sudo ./installDependsFromDebianFile.py ./../src/dashboard/debian/control
#./installDependsFromDebianFile.py ./../src/easy-extract/debian/control
colour sudo ./installDependsFromDebianFile.py ./../src/MCPClient/debian/control
colour sudo ./installDependsFromDebianFile.py ./../src/MCPrpcCLI/debian/control
colour sudo ./installDependsFromDebianFile.py ./../src/MCPServer/debian/control
colour #./installDependsFromDebianFile.py ./../src/metaPackage-forensic-tools/debian/control
colour #./installDependsFromDebianFile.py ./../src/metaPackage-shotgun/debian/control
colour sudo ./installDependsFromDebianFile.py ./../src/sanitizeNames/debian/control
colour sudo ./installDependsFromDebianFile.py ./../src/SIPCreationTools/debian/control
colour sudo ./installDependsFromDebianFile.py ./../src/transcoder/debian/control
colour sudo ./installDependsFromDebianFile.py ./../src/upload-qubit/debian/control
colour #./installDependsFromDebianFile.py ./../src/vm-includes/debian/control
colour sudo ./installDependsFromDebianFile.py ./../src/xubuntuGuiScriptsEditor/debian/control
cd ..
else
echo "Not going to ${part}."
fi
}
function recreate-db() {
part="recreate the databases"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
echo "Going to ${part} ..."
cd localDevSetup/
sudo stop archivematica-mcp-server
sudo stop archivematica-mcp-client
sudo apache2ctl stop
colour ./recreateDB.sh
cd ..
sudo start archivematica-mcp-server
sudo start archivematica-mcp-client
sudo apachectl start
else
echo "Not going to ${part}."
fi
}
function restart() {
part="restart archivematica services"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
echo "Going to ${part} ..."
sudo stop archivematica-mcp-server
sleep 1
sudo stop archivematica-mcp-client
sleep 1
if [ -e "/tmp/archivematicaMCPServerPID" ]
then
sudo kill -9 `cat /tmp/archivematicaMCPServerPID`
fi
sleep 3
sudo rm /tmp/archivematicaMCP*
colour sudo start archivematica-mcp-server
colour sudo start archivematica-mcp-client
colour sudo apache2ctl restart
else
echo "Not going to ${part}."
fi
}
function export-sampledata() {
part="export sample data to ~/sampledata"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
rev="`svn info | grep \"Revision: \" | awk -F " " '{print $2}'`"
echo Going to export to '~/'sampledata-$rev ...
colour svn export sampledata ~/sampledata-${rev}
else
echo "Not going to ${part}."
fi
}
function install-gui() {
part="re-create gui-scripts editor file"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
rm /home/$USER/.config/Thunar/uca.xml
tmp="`pwd`"
cd src/xubuntuGuiScriptsEditor/share
colour ./addArchivematicaGUIScripts.sh
cd "$tmp"
else
echo "Not going to ${part}."
fi
}
function update-qubit() {
part="update Qubit (trunk) and restart its qubit-sword service"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
sudo chmod -R 777 qubit-svn
colour svn update qubit-svn
sudo chmod -R 777 qubit-svn
colour sudo stop qubit-sword
colour sudo start qubit-sword
echo "Remember to activate sfSwordPlugin and restart Qubit database if necessary!"
else
echo "Not going to ${part}."
fi
}
function example() {
part="example"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
echo "Going to ${part} ..."
else
echo "Not going to ${part}"
fi
}
# Run only one function if given
if [ ! -z ${1} ]; then
${1}
exit
fi
svn-update
package-update
recreate-db
restart
export-sampledata
install-gui
update-qubit