aboutsummaryrefslogtreecommitdiffstats
path: root/check_for_translation_work.sh
blob: faadf3eaca28d5012a1e2a3b2a7ef480af8691c5 (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
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
#!/bin/bash
# turn tracing on with /bin/bash -x
#
# Check for translation work by checking out / updating from SVN and
# displaying the project name when your language.po has fuzzy strings or
# empty string messages.
#
# Remco Rijnders, 2012
# Filip Komar, 30.04.2012 added svn_method choice & quiet_mode from svn
# 			 , 03.05.2012 added check_po_syntax choice & copying_po
# 			 , 04.05.2012 changed svn quiet to only grep language_file and *.pot file, added logging
# 			 , 15.06.2012 added web pages for translation, added _ in variable_names
# 			 , 21.06.2012 added mga2
# 			 , 23.06.2012 added mkdir, diff
# 			 , 27.06.2012 filename spaces refactoring, some bug solving
# 			 , 28.06.2012 some more bug solving
# 			 , 29.06.2012 added diff to working translation
# 			 , 03.07.2012 added checking for new pot files in svn
#
#
# Features:
# -it's very configurable
# -it logs all important actions
# -it operates on list of "translation projects" in svn (including web pages)
# -svn checkout or update as needed on every single project
# -verbose checking for fuzzy and untranslated strings or just statistics (numbers of translated, fuzzy and untranslated strings) if required
# -checking the syntax of po file from svn if required
# -checking the syntax of pot file from svn if required
# -copying the *.pot file, *.po file and web page files for editing in working directory if required
# -testing for differences of *.po file from working copy if required
# -testing for differences of *.pot file from working copy if required
# -searching for new *.pot files in svn





# TODO:
# implement --password ARG to simplify svn authentication if used
# simplify web copying part
# more tests if target folder exist
#
# How to svn co single file (file.pot):
# svn checkout $url_of_big_dir $target_dir --depth=empty
# svn up $target_dir/$file_you_want
# testing web pages checkout
# better documentation
#
# Configuration:
language_code=sl
user=filip

# use existing folders
svn_folder="/home/filip/Dokumenti/Prevodi programov/Mageia/svn_anonymous"
working_translations_folder="/home/filip/Dokumenti/Prevodi programov/Mageia"

# choose svn method (user or anonymous)
#svn_method="svn+ssh://$user@"
svn_method="svn://"

# choose quiet mode or normal
#quiet_mode="-q"
quiet_mode=""

# set checking syntax of po files with 1
check_po_syntax=1

# set checking syntax of pot files with 1
check_pot_syntax=0

# set checking of fuzzy and untranslated strings with 1
check_fuzzy_and_untranslated=0

# set copying of po files with 1
copying_po=1

# set copying of web page files with 1
copying_wp=1

# set copying options (-i: interactive, -v: verbose, -u: update, -r: recursive)
copy_options="-ivur"

# choose log filename
log_filename="updated_translations_in_svn"
log_folder="$svn_folder"
logfile="$svn_folder/$log_filename"
# switch of logging by uncommenting following line
#logfile="/dev/null"

# set debug with 1
debug=0

# set searching for new *.pot files in svn with 1
searching_for_new_pot_files_in_svn=0

# if you do have svn commit access, change the protocol from svn:// to svn+ssh://USERNAME@ in the projects array for easier committing...
declare -A projects
declare -A web_pages
projects[control-center]="svn.mageia.org/svn/soft/control-center/trunk/po/"
if [ ! $debug -eq 1 ]; then
	projects[desktop-common-data]="svn.mageia.org/svn/soft/desktop-common-data/trunk/po/"
	projects[drak3d]="svn.mageia.org/svn/soft/drak3d/trunk/po/"
	projects[drakguard]="svn.mageia.org/svn/soft/drakguard/trunk/po/"
	projects[draklive-install]="svn.mageia.org/svn/soft/draklive-install/trunk/po/"
	projects[drakmenustyle]="svn.mageia.org/svn/soft/drakmenustyle/trunk/po/"
	projects[drakpxelinux]="svn.mageia.org/svn/soft/drakpxelinux/trunk/po/"
	projects[drakwizard]="svn.mageia.org/svn/soft/drakwizard/trunk/po/"
	projects[drakx-kbd-mouse-x11]="svn.mageia.org/svn/soft/drakx-kbd-mouse-x11/trunk/po/"
	projects[drakx-net]="svn.mageia.org/svn/soft/drakx-net/trunk/po/"
	projects[drakx_help]="svn.mageia.org/svn/soft/drakx/trunk/perl-install/install/help/po/" # new
	projects[drakx_install]="svn.mageia.org/svn/soft/drakx/trunk/perl-install/install/share/po/"
	projects[drakx_share]="svn.mageia.org/svn/soft/drakx/trunk/perl-install/share/po/"
	projects[drakx_standalone]="svn.mageia.org/svn/soft/drakx/trunk/perl-install/standalone/po/"
#	projects[epoll]="forge.ipsl.jussieu.fr/epoll/svn/"
	projects[identity]="svn.mageia.org/svn/soft/identity/CatDap/trunk/lib/CatDap/I18N/"
	projects[indexhtml_about]="svn.mageia.org/svn/soft/indexhtml/trunk/about/po/"
	projects[indexhtml]="svn.mageia.org/svn/soft/indexhtml/trunk/po/"
	projects[kde4-splash-mga]="svn.mageia.org/svn/soft/kde4-splash-mga/trunk/po/"
#	not needed after finished translation	mageia-kde4-config/trunk/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.classicPanel/metadata.desktop
#	not needed after finished translation	mageia-kde4-config/trunk/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.defaultPanel/metadata.desktop
	projects[mageia-gfxboot-theme_help-boot]="svn.mageia.org/svn/soft/theme/mageia-gfxboot-theme/trunk/help-boot/" # new
	projects[mageia-gfxboot-theme_help-install]="svn.mageia.org/svn/soft/theme/mageia-gfxboot-theme/trunk/help-install/" # new
	projects[mageia-gfxboot-theme]="svn.mageia.org/svn/soft/theme/mageia-gfxboot-theme/trunk/po/"
	projects[mageia-kde-translation]="svn.mageia.org/svn/soft/mageia-kde-translation/trunk/po/"
	projects[mgaonline]="svn.mageia.org/svn/soft/mgaonline/trunk/po/" # new
	projects[rpmdrake]="svn.mageia.org/svn/soft/rpmdrake/trunk/po/"
	projects[system-config-printer]="svn.mageia.org/svn/soft/system-config-printer/trunk/po/"
	projects[transfugdrake]="svn.mageia.org/svn/soft/transfugdrake/trunk/po/"
	projects[urpmi]="svn.mageia.org/svn/soft/rpm/urpmi/trunk/po/"
#	is this alive: usbdumper/trunk/po/liveusb-creator.pot
	projects[userdrake2]="svn.mageia.org/svn/soft/userdrake2/trunk/po/"

#	BRANCH 2:
	projects[control-center_mga2]="svn.mageia.org/svn/soft/control-center/branches/2/po/"
#2?	projects[desktop-common-data_mga2]="svn.mageia.org/soft/desktop-common-data/tags/1:2-4/po/"
#	N/A		projects[drak3d_mga2]="svn.mageia.org/svn/soft/drak3d/branches/2/po/"
#	N/A		projects[drakguard_mga2]="svn.mageia.org/svn/soft/drakguard/branches/2/po/"
	projects[draklive-install_mga2]="svn.mageia.org/svn/soft/draklive-install/branches/2/po/"
#	N/A		projects[drakmenustyle_mga2]="svn.mageia.org/svn/soft/drakmenustyle/branches/2/po/"
#	N/A		projects[drakpxelinux_mga2]="svn.mageia.org/svn/soft/drakpxelinux/branches/2/po/"
#	N/A		projects[drakwizard_mga2]="svn.mageia.org/svn/soft/drakwizard/branches/2/po/"
#	N/A		projects[drakx-kbd-mouse-x11_mga2]="svn.mageia.org/svn/soft/drakx-kbd-mouse-x11/branches/2/po/"
	projects[drakx-net_mga2]="svn.mageia.org/svn/soft/drakx-net/branches/2/po/"
	projects[drakx_help_mga2]="svn.mageia.org/svn/soft/drakx/branches/2/perl-install/install/help/po/"
	projects[drakx_install_mga2]="svn.mageia.org/svn/soft/drakx/branches/2/perl-install/install/share/po/"
	projects[drakx_share_mga2]="svn.mageia.org/svn/soft/drakx/branches/2/perl-install/share/po/"
	projects[drakx_standalone_mga2]="svn.mageia.org/svn/soft/drakx/branches/2/perl-install/standalone/po/"
#?	projects[identity_mga2]="svn.mageia.org/svn/soft/identity/CatDap/branches/live/lib/CatDap/I18N/"
#	N/A		projects[indexhtml_mga2]="svn.mageia.org/svn/soft/indexhtml/branches/2/po/"
#	N/A		projects[kde4-splash-mga_mga2]="svn.mageia.org/svn/soft/kde4-splash-mga/branches/2/po/"
	projects[mageia-gfxboot-theme_help-boot_mga2]="svn.mageia.org/svn/soft/theme/mageia-gfxboot-theme/branches/2/help-boot/" # new
	projects[mageia-gfxboot-theme_help-install_mga2]="svn.mageia.org/svn/soft/theme/mageia-gfxboot-theme/branches/2/help-install/" # new
	projects[mageia-gfxboot-theme_mga2]="svn.mageia.org/svn/soft/theme/mageia-gfxboot-theme/branches/2/po/"
#	mageia-kde4-config/branches/2/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.classicPanel/metadata.desktop
#	mageia-kde4-config/branches/2/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.defaultPanel/metadata.desktop
#	N/A		projects[mageia-kde-translation_mga2]="svn.mageia.org/svn/soft/mageia-kde-translation/branches/2/po/"
#	N/A		projects[rpmdrake_mga2]="svn.mageia.org/svn/soft/rpmdrake/branches/2/po/"
#	N/A		projects[system-config-printer_mga2]="svn.mageia.org/svn/soft/system-config-printer/branches/2/po/"
#	N/A		projects[transfugdrake_mga2]="svn.mageia.org/svn/soft/transfugdrake/branches/2/po/"
	projects[urpmi_mga2]="svn.mageia.org/svn/soft/rpm/urpmi/branches/2/po/"
#	N/A		projects[userdrake2_mga2]="svn.mageia.org/svn/soft/userdrake2/branches/2/po/"

#	BRANCH 1:
#	not "cleaned" yet
#	control-center/branches/1/po/drakconf.pot
#	desktop-common-data/tags/1:2-4/po/desktop-common-data.pot
#	drak3d/branches/1/po/drak3d.pot
#	drakguard/branches/1/po/drakguard.pot
#	draklive-install/branches/1/po/draklive-install.pot
#	drakmenustyle/branches/1/po/drakmenustyle.pot
#	drakpxelinux/branches/1/po/drakpxelinux.pot
#	drakwizard/branches/1/po/drakwizard.pot
#	drakx/branches/1/perl-install/install/help/po/DrakX-help.pot
#	drakx/branches/1/perl-install/install/share/po/DrakX.pot
#	drakx/branches/1/perl-install/share/po/libDrakX.pot
#	drakx/branches/1/perl-install/standalone/po/libDrakX-standalone.pot
#	drakx-kbd-mouse-x11/branches/1/po/drakx-kbd-mouse-x11.pot
#	drakx-net/branches/1/po/drakx-net.pot
#	indexhtml/branches/1/about/po/index.pot
#	indexhtml/branches/1/po/indexhtml.pot
#	kde4-splash-mga/branches/1/po/kde4-splash-mga.pot
#	mageia-kde-translation/branches/1/po/mageia-kde-translation.pot
#	mgaonline/branches/1/po/mdkonline.pot
#	rpm/urpmi/branches/1/po/urpmi.pot
#	rpmdrake/branches/1/po/rpmdrake.pot
#	system-config-printer/branches/1/po/system-config-printer.pot
#	theme/mageia-gfxboot-theme/branches/1/po/bootloader.pot
#	transfugdrake/branches/1/po/transfugdrake.pot
#	userdrake2/branches/1/po/userdrake.pot
#	userdrake2/tags/1.13.3/po/userdrake.pot

#	WEB PAGES:
	web_pages[web_page_navigation]="svn.mageia.org/svn/web/www/trunk/_nav/langs/"
	web_pages[web_page_navigation_2]="svn.mageia.org/svn/web/nav/langs/"
	web_pages[web_page_english]="svn.mageia.org/svn/web/www/trunk/en/"
	web_pages[web_page_my_language]="svn.mageia.org/svn/web/www/trunk/$language_code/"
	web_pages[web_pages_lang]="svn.mageia.org/svn/web/www/trunk/langs/"
fi


#pwd # debug
#echo 1 # debug
# save pwd to saved_dir
saved_dir=$(pwd)

mv "$logfile"_this_run.log "$logfile"_previous_run.log
separator="-----------------------------------------------------"

echo "" | tee -a "$logfile"_this_run.log
echo "" | tee -a "$logfile"_this_run.log
date | tee -a "$logfile"_this_run.log
echo "SW files:" | tee -a "$logfile"_this_run.log

#	echo about checking the syntax of po file if required
	if [ $check_po_syntax -eq 1 ]; then
		echo "Syntax of $language_code.po in svn will be tested."
	fi

#	echo about copying the *.pot file and $language_code.po for editing in apropriate directory if required
	if [ $copying_po -eq 1 ]; then
		echo "Files *.pot and $language_code.po  will be copied into apropriate directory."
	fi

# Check out / update project files
for project_name in "${!projects[@]}"
do
	echo $separator | tee -a "$logfile"_this_run.log
	echo Working on: \'$project_name\' from \'${projects[$project_name]}\'. | tee -a "$logfile"_this_run.log
	if [ -d $project_name ]; then
		cd "$svn_folder/$project_name"
#		svn up $quiet_mode $project_name
#		just echo $language_code.po or *.pot file line if they are updated
		svn up | grep -E "$language_code.po|[\.]pot" | tee -a "$logfile"_this_run.log
#		svn up $project_name | tee -a "$logfile"_this_run.log #2
#		echo -n "" # debug
	else
		cd "$svn_folder"
#		svn co -q ${projects[$project_name]} $project_name
#		svn co $quiet_mode $svn_method${projects[$project_name]} $project_name
#		just echo $language_code.po or *.pot file line if they are updated
		svn co $svn_method${projects[$project_name]} $project_name | grep -E "$language_code.po|[\.]pot" | tee -a "$logfile"_this_run.log
#		echo -n "" # debug
		cd "$svn_folder/$project_name"
	fi
#	pwd # debug
#	echo 3 # debug

#	verbose checking for fuzzy and untranslated strings
	if [ $check_fuzzy_and_untranslated -eq 1 ]; then
		msgattrib $language_code.po --only-fuzzy --no-obsolete
		msgattrib $language_code.po --untranslated --no-obsolete
	fi

#	checking the syntax of po file if required
	if [ $check_po_syntax -eq 1 ]; then
		if [ -f $language_code.po ]; then
			msgfmt --statistics --verbose -c $language_code.po -o $language_code.po.mo 2>&1 | tee -a "$logfile"_this_run.log
			rm $language_code.po.mo
		else
			echo "File $language_code.po is not present in $project_name. Automatic test is not possible." | tee -a "$logfile"_this_run.log
		fi
#		checking the syntax of po file if required
		if [ $check_pot_syntax -eq 1 ]; then
			if [ -f *.pot ]; then
				msgfmt -c *.pot -o pot.mo 2>&1 | tee -a "$logfile"_this_run.log
				rm pot.mo
			else
				echo "File *.pot is not present in $project_name. Automatic test is not possible." | tee -a "$logfile"_this_run.log
			fi
		fi
	fi

#	copying the *.pot file and $language_code.po for editing in working directory if required
	if [ $copying_po -eq 1 ]; then
		if [ ! -d "$working_translations_folder/$project_name/" ]; then
			mkdir -v "$working_translations_folder/$project_name/" | tee -a "$logfile"_this_run.log
		fi
		if [ -f $language_code.po ]; then
#			testing for differences of *.po file from working copy
			if [ -f "$working_translations_folder/$project_name/$language_code.po" ]; then
				diff -q $language_code.po "$working_translations_folder/$project_name/$language_code.po" | tee -a "$logfile"_this_run.log
			fi
			cp $copy_options $language_code.po "$working_translations_folder/$project_name/" | tee -a "$logfile"_this_run.log
		else
			echo "File $language_code.po is not present in $project_name. Copying is not possible." | tee -a "$logfile"_this_run.log
		fi
		if [ -f *.pot ]; then
#			testing for differences of *.pot file from working copy
			if [ -f "$working_translations_folder/$project_name/"*.pot ]; then
				diff -q *.pot "$working_translations_folder/$project_name/"*.pot | tee -a "$logfile"_this_run.log
			fi
			cp $copy_options *.pot "$working_translations_folder/$project_name/" | tee -a "$logfile"_this_run.log
#			set -x # turn tracing on with set -x
			cd "$working_translations_folder/$project_name/"
			if [ -f *.pot_$language_code.po ]; then
#				creating new_pot_lang.po from latest *.pot file 
				msgmerge -q *.pot_$language_code.po *.pot > new_pot_$language_code.po # msgmerge *.pot_lang.po *.pot > new_pot_lang.po
#				comparing new_pot_lang.po from working copy
				diff -q *.pot_$language_code.po new_pot_$language_code.po | tee -a "$logfile"_this_run.log
#				diff -q $language_code.po new_pot_$language_code.po | tee -a "$logfile"_this_run.log
				diff_exit_status_1=${PIPESTATUS[0]} # this reads and remembers exit status of first command in pipe (diff in this case)
#				if [ $? -eq 0 ]; then
				if [ $diff_exit_status_1 -eq 0 ]; then # no differences
					rm new_pot_$language_code.po # remove resulting file
#					echo Between *.pot_$language_code.po and new_pot_$language_code.po there are no differences.
				else
					if [ $diff_exit_status_1 -eq 1 ]; then # there are differences
						echo Replace existing file *.pot_$language_code.po with new_pot_$language_code.po in $project_name since there are differences. | tee -a "$logfile"_this_run.log
					else
						echo There was an error in diff between *.pot_$language_code.po and new_pot_$language_code.po in $project_name.
					fi
				fi
#				comparing svn lang.po from working copy lang.po
				if [ -f $language_code.po ]; then
					diff -q *.pot_$language_code.po $language_code.po | tee -a "$logfile"_this_run.log
					diff_exit_status_2=${PIPESTATUS[0]} # this reads and remembers exit status of first command in pipe (diff in this case)
	#				if [ $? -eq 0 ]; then
					if [ $diff_exit_status_2 -eq 1 ]; then # there are differences
						echo New commit will be needed when the file *.pot_$language_code.po is ready in $project_name. | tee -a "$logfile"_this_run.log
					else
						if [ $diff_exit_status_2 -eq 2 ]; then # there was an error
							echo There was an error in diff between file *.pot_$language_code.po and $language_code.po in $project_name.
						fi
					fi
				fi
			else
				echo "File *.pot_$language_code.po is not present in $project_name. Comparing is not possible." | tee -a "$logfile"_this_run.log
			fi
#			set +x # turn tracing off with set +x
		else
			echo "File *.pot is not present in $project_name. Copying is not possible." | tee -a "$logfile"_this_run.log
		fi
#		echo "Files *.pot and $language_code.po copied into $working_translations_folder/$project_name/."
	fi
	cd "$svn_folder/"
	echo "" | tee -a "$logfile"_this_run.log
done

# Check out / update web_page files
echo "web page files:" | tee -a "$logfile"_this_run.log
for web_page_name in "${!web_pages[@]}"
do
	echo $separator | tee -a "$logfile"_this_run.log
	echo Working on: "$web_page_name" from "${web_pages[$web_page_name]}". | tee -a "$logfile"_this_run.log # \'
#	turn tracing on with set -x
#	set -x
	if [ -d "$svn_folder/$web_page_name/" ]; then
		cd "$svn_folder/$web_page_name"
#		svn up $quiet_mode $web_page_name
#		just echo $language_code.lang or *.php file line if they are updated
		svn up | grep -E "$language_code.lang|en.lang|[\.]php" | tee -a "$logfile"_this_run.log
#		echo -n "" # debug
	else
		cd "$svn_folder/"
#		svn co -q ${web_pages[$web_page_name]} $web_page_name
#		svn co $quiet_mode $svn_method${web_pages[$web_page_name]} $web_page_name
#		just echo $language_code.lang or *.php file line if they are updated
		svn co $svn_method${web_pages[$web_page_name]} $web_page_name | grep -E "$language_code.lang|en.lang|[\.]php" | tee -a "$logfile"_this_run.log
		echo -n "" | tee -a "$logfile"_this_run.log
		cd "$svn_folder/$web_page_name"
	fi
	echo "" | tee -a "$logfile"_this_run.log
done


#copying the *.php file and $language_code.lang for editing in upper directory if required
if [ $copying_wp -eq 1 ]; then
	echo $separator | tee -a "$logfile"_this_run.log
#	echo about copying the *.php file and $language_code.lang for editing in upper directory if required
	echo "Web files will be copied (updated) into working translations directory."
	cd "$svn_folder"
	cp $copy_options ./web_page_english/index.php "$working_translations_folder/web_page_english/" | tee -a "$logfile"_this_run.log
	cp $copy_options ./web_page_english/2/download_index.php "$working_translations_folder/web_page_english/2/" | tee -a "$logfile"_this_run.log
	cp $copy_options ./web_page_english/2/index.php "$working_translations_folder/web_page_english/2/" | tee -a "$logfile"_this_run.log
	cp $copy_options ./web_page_english/2/nav.php "$working_translations_folder/web_page_english/2/" | tee -a "$logfile"_this_run.log
	cp $copy_options ./web_page_english/about/index.php "$working_translations_folder/web_page_english/about/" | tee -a "$logfile"_this_run.log
	cp $copy_options ./web_page_english/for-pc/index.php "$working_translations_folder/web_page_english/for-pc/" | tee -a "$logfile"_this_run.log
	cp $copy_options ./web_page_english/for-server/index.php "$working_translations_folder/web_page_english/for-server/" | tee -a "$logfile"_this_run.log
	cp $copy_options ./web_page_english/map/index.php "$working_translations_folder/web_page_english/map/" | tee -a "$logfile"_this_run.log
	cp $copy_options ./web_page_english/support/index.php "$working_translations_folder/web_page_english/support/" | tee -a "$logfile"_this_run.log
	cp $copy_options ./web_page_my_language/about/2010-sept-announcement.html "$working_translations_folder/web_page_my_language/about/" | tee -a "$logfile"_this_run.log
	cp $copy_options ./web_pages_lang/en/* "$working_translations_folder/web_pages_lang/en/" | tee -a "$logfile"_this_run.log
	cp $copy_options ./web_pages_lang/$language_code/* "$working_translations_folder/web_pages_lang/$language_code/" | tee -a "$logfile"_this_run.log
	cp $copy_options ./web_page_navigation/fr.lang "$working_translations_folder/web_page_navigation/" | tee -a "$logfile"_this_run.log
	cp $copy_options ./web_page_navigation/$language_code.lang "$working_translations_folder/web_page_navigation/" | tee -a "$logfile"_this_run.log
fi
# turn tracing off with set +x
# set +x

diff -rq "$svn_folder/web_page_navigation" "$svn_folder/web_page_navigation_2" | grep -E ".lang" | tee -a "$logfile"_this_run.log

if [ $searching_for_new_pot_files_in_svn -eq 1 ]; then
	echo $separator | tee -a "$logfile"_this_run.log
	echo "Searching for new *.pot files in svn." | tee -a "$logfile"_this_run.log
	mv "$log_folder"/new_svn_list_of_pot_files "$log_folder"/old_svn_list_of_pot_files # -f
	svn list -R svn://svn.mageia.org/svn/soft/ > "$log_folder"/svn_list
	cat "$log_folder"/svn_list | grep [\.]pot > "$log_folder"/new_svn_list_of_pot_files
#	svn list -R svn://svn.mageia.org/svn/soft/ | grep [\.]pot > new_svn_list_of_pot_files
	diff new_svn_list_of_pot_files old_svn_list_of_pot_files | tee -a "$logfile"_this_run.log
	if [ ${PIPESTATUS[0]} -eq 0 ]; then # this reads exit status of first command in pipe
		echo "No new *.pot files found." | tee -a "$logfile"_this_run.log
	fi
	echo "" | tee -a "$logfile"_this_run.log
fi


# append this_run_log to full_log
cat "$logfile"_this_run.log >> "$logfile"_full.log
echo "" | tee -a "$logfile".log
echo $separator | tee -a "$logfile".log
echo "Differences from last run:" | tee -a "$logfile".log
# show only differences and log them
diff "$logfile"_this_run.log "$logfile"_previous_run.log | tee -a "$logfile".log

# restore saved_dir
cd "$saved_dir"
pwd