Subversion Repositories general

Rev

Rev 1330 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1330 Rev 1331
1
#!/bin/sh
1
#!/bin/sh
2
 
2
 
3
# define dirs
3
# define dirs
4
build_dir="$project_dir/build"
4
build_dir="$project_dir/build"
5
 
5
 
6
if [ ! -d "$build_dir" ] ; then
-
 
7
	echo "Build dir '$build_dir' not found" >> /dev/stderr
-
 
8
	exit 1
-
 
9
fi
-
 
10
 
-
 
11
# read meta data
6
# read meta data
12
[ -f "$common_dir/meta.xml" ]        && $(xsltproc "$common_dir/meta.xsl" "$common_dir/meta.xml")
7
[ -f "$common_dir/meta.xml" ]        && $(xsltproc "$common_dir/meta.xsl" "$common_dir/meta.xml")
13
[ -f "$common_dir/meta_local.xml" ]  && $(xsltproc "$common_dir/meta.xsl" "$common_dir/meta_local.xml")
8
[ -f "$common_dir/meta_local.xml" ]  && $(xsltproc "$common_dir/meta.xsl" "$common_dir/meta_local.xml")
14
[ -f "$project_dir/meta.xml" ]       && $(xsltproc "$common_dir/meta.xsl" "$project_dir/meta.xml")
9
[ -f "$project_dir/meta.xml" ]       && $(xsltproc "$common_dir/meta.xsl" "$project_dir/meta.xml")
15
[ -f "$project_dir/meta_local.xml" ] && $(xsltproc "$common_dir/meta.xsl" "$project_dir/meta_local.xml")
10
[ -f "$project_dir/meta_local.xml" ] && $(xsltproc "$common_dir/meta.xsl" "$project_dir/meta_local.xml")
16
$(xsltproc "$common_dir/id.xsl"   "$project_dir/src/install.rdf")
11
$(xsltproc "$common_dir/id.xsl"   "$project_dir/src/install.rdf")
17
 
12
 
18
if [ -z "$META_xpiName" ] ; then
13
if [ -z "$META_xpiName" ] ; then
19
	echo "xpiName not defined in meta.xml" >> /dev/stderr
14
	echo "xpiName not defined in meta.xml" >> /dev/stderr
20
	exit 2
15
	exit 2
21
fi
16
fi
22
if [ -z "$META_webDir" ] ; then
17
if [ -z "$META_webDir" ] ; then
23
	echo "webDir not defined in meta.xml" >> /dev/stderr
18
	echo "webDir not defined in meta.xml" >> /dev/stderr
24
	exit 2
19
	exit 2
25
fi
20
fi
26
if [ -z "$META_keyDir" ] ; then
21
if [ -z "$META_keyDir" ] ; then
27
	echo "keyDir not defined in meta.xml" >> /dev/stderr
22
	echo "keyDir not defined in meta.xml" >> /dev/stderr
28
	exit 2
23
	exit 2
29
fi
24
fi
30
if [ -z "$META_spockExec" ] ; then
25
if [ -z "$META_spockExec" ] ; then
31
	echo "spock not defined in meta.xml" >> /dev/stderr
26
	echo "spock not defined in meta.xml" >> /dev/stderr
32
	exit 2
27
	exit 2
33
fi
28
fi
34
if [ -z "$META_id" ] ; then
29
if [ -z "$META_id" ] ; then
35
	echo "id of the exception is unknown" >> /dev/stderr
30
	echo "id of the exception is unknown" >> /dev/stderr
36
	exit 2
31
	exit 2
37
fi
32
fi
38
 
33
 
39
# convert paths to abs
34
# convert paths to abs
40
[ -z "${META_keyDir%%/*}" ]    || META_keyDir="$project_dir/$META_keyDir"
35
[ -z "${META_keyDir%%/*}" ]    || META_keyDir="$project_dir/$META_keyDir"
41
[ -z "${META_spockExec%%/*}" ] || META_spockExec="$project_dir/$META_spockExec"
36
[ -z "${META_spockExec%%/*}" ] || META_spockExec="$project_dir/$META_spockExec"
42
 
37
 
43
# cleanup
38
# cleanup
-
 
39
mkdir -p "$build_dir"
44
rm -f "$build_dir"/*
40
rm -f "$build_dir"/*
45
 
41
 
46
(cd "$project_dir/src"; find . -not -path '*/.svn*' | zip -q -@ "$build_dir/$META_xpiName" )
42
(cd "$project_dir/src"; find . -not -path '*/.svn*' | zip -q -@ "$build_dir/$META_xpiName" )
47
 
43
 
48
xsltproc --stringparam dir "$project_dir" "$common_dir/update.xsl" "$project_dir/src/install.rdf" \
44
xsltproc --stringparam dir "$project_dir" "$common_dir/update.xsl" "$project_dir/src/install.rdf" \
49
	> "$build_dir/update.rdf_unsigned"
45
	> "$build_dir/update.rdf_unsigned"
50
 
46
 
51
"$META_spockExec" "$build_dir/update.rdf_unsigned" -i "urn:mozilla:extension:$META_id" \
47
"$META_spockExec" "$build_dir/update.rdf_unsigned" -i "urn:mozilla:extension:$META_id" \
52
	-d "$META_keyDir" -f "$build_dir/$META_xpiName" \
48
	-d "$META_keyDir" -f "$build_dir/$META_xpiName" \
53
	> "$build_dir/update.rdf" \
49
	> "$build_dir/update.rdf" \
54
	&& rm "$build_dir/update.rdf_unsigned"
50
	&& rm "$build_dir/update.rdf_unsigned"
55
 
51
 
56
case "$META_deployMethod" in
52
case "$META_deployMethod" in
57
	scp)
53
	scp)
58
		echo scp "$build_dir/*" "$META_webDir"
54
		scp "$build_dir"/* "$META_webDir"
59
		;;
55
		;;
60
	\*)
56
	cp)
61
		[ -z "${META_webDir%%/*}" ]    || META_webDir="$project_dir/$META_webDir"
57
		[ -z "${META_webDir%%/*}" ]    || META_webDir="$project_dir/$META_webDir"
62
		echo cp "$build_dir/*" "$META_webDir"
58
		cp "$build_dir"/* "$META_webDir"
-
 
59
		;;
-
 
60
	\*)
-
 
61
		echo "Unknown deployMethod" >> /dev/stderr
-
 
62
		exit 2
63
		;;
63
		;;
64
esac
64
esac
65
 
65