Titan Core Initial Contribution
[deliverable/titan.core.git] / etc / download_stats / addDownloadStats.sh
1 #!/bin/bash
2
3 # Copyright (c) 2010 Mia-Software
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Eclipse Public License v1.0
6 # which accompanies this distribution, and is available at
7 # http://www.eclipse.org/legal/epl-v10.html
8 #
9 # Contributors:
10 # Nicolas Bros
11 # Ferenc Kovacs - Titan, Ericsson AB
12
13 XSLT_FILE=./addDownloadStats.xsl
14
15 if [ $# -ne 1 ]; then
16 echo "usage: $0 <update_site_location>"
17 exit
18 fi
19
20 if [ ! -d $1 ] ; then echo "not a directory"; exit 1; fi
21 if [ ! -f $1/artifacts.jar ] ; then echo "artifacts.jar not found"; exit 1; fi
22
23 echo "Adding download stats to repository"
24
25 cd $1
26 unzip artifacts.jar
27 mv artifacts.xml artifacts.xml.original
28 if grep p2.statsURI artifacts.xml.original ; then echo "p2.statsURI already defined: exiting"; exit 1; fi
29
30 xsltproc -o artifacts.xml $XSLT_FILE artifacts.xml.original
31 for L in `grep 'eclipsestats.php' artifacts.xml | cut -c 48- | rev | cut -c 4- | rev`; do
32 ln -s eclipsestats.php /proj/TTCN/www/ttcn/root/download/eclipse_stats/$L 2>/dev/null
33 done
34 zip artifacts.jar artifacts.xml
35 rm artifacts.xml
36
37 echo "done"
This page took 0.031279 seconds and 5 git commands to generate.