File: export_shtml.sh

package info (click to toggle)
simplyhtml 0.13.1-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,632 kB
  • ctags: 2,105
  • sloc: java: 14,833; xml: 1,082; sh: 140; haskell: 34; makefile: 28
file content (43 lines) | stat: -rw-r--r-- 1,398 bytes parent folder | download | duplicates (3)
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
#!/bin/bash -x
# This small script can be used to export the SimplyHTML source tree from CVS
if [ $# -lt 1 ]
then
	echo "Usage: $0 <SimplyHTML version> [<RCS tag> [keep]]" >&2
	echo "Example: $0 0.7.9.rc4 fm_0_8_0_rc4" >&2
	echo "Example: $0 0.8.0+01  FM-0-8-0 keep" >&2
	echo "Use the 'keep' parameter to keep a complete copy." >&2
	exit 1
fi

simplyhtml_dir="simplyhtml-$1"
simplyhtml_tar="simplyhtml_$1"
if [ ! -d shtml ] && [ ! -d "${simplyhtml_dir}" ]
then # we don't want to overwrite anything...
	cvs -z3 -d:pserver:anonymous@simplyhtml.cvs.sourceforge.net:/cvsroot/simplyhtml export -r "$2" shtml || exit 1
	mv shtml "${simplyhtml_dir}" || exit 1
else
	echo "Directory 'shtml' or '${simplyhtml_dir}' exists." >&2
	exit 1
fi

### SAVE FIRST THE WHOLE SIMPLYHTML TREE ###
if [ -n "$3" ]
then
	mv ${simplyhtml_dir} ${simplyhtml_dir}.complete
	tar cvzf ${simplyhtml_tar}.complete.tar.gz \
		${simplyhtml_dir}.complete
	mv ${simplyhtml_dir}.complete ${simplyhtml_dir}
fi

### THEN CLEANUP THE SOURCE TREE ###
find ${simplyhtml_dir} -name \*.jar -o -name \*.zip | xargs rm -vf
rm -vfr ${simplyhtml_dir}/simplyhtml/windows-launcher

### CREATE ORIG.TAR.GZ ###
if [ -f "${simplyhtml_tar}.orig.tar.gz" ]
then
	mv -f "${simplyhtml_tar}.orig.tar.gz" "${simplyhtml_tar}.orig.tar.gz.BAK" \
		|| exit 1
fi
tar cvzf "${simplyhtml_tar}.orig.tar.gz" "${simplyhtml_dir}" || exit 1
rm -fr "${simplyhtml_dir}"