99install=1
1010pull=1
1111execdir=` pwd`
12- tmbase=$HOME /travelmapping
13- tmwebbase=/fast/www/tm
1412datestr=` date ' +%Y-%m-%d' `
15- graphdir=$HOME /temp/graphdata
16- graphdir=$tmwebbase /graphdata
1713# check for required command line args:
1814#
1915if [ " $# " -ne 2 ]; then
2016 echo " Usage: $0 archivename description"
2117 exit 1
2218fi
23- export HIGHWAY_DATA=$tmbase /HighwayData
19+
20+ # check default locations of TM repositories
21+ tmbasedir=$HOME
22+ if [[ -d $HOME /TravelMapping ]]; then
23+ tmbasedir=$HOME /TravelMapping
24+ elif [[ -d $HOME /travelmapping ]]; then
25+ tmbasedir=$HOME /travelmapping
26+ elif [[ -d $HOME /tm ]]; then
27+ tmbasedir=$HOME /tm
28+ fi
29+
30+ # check default locations of TM web server files
31+ tmwebdir=/fast/www/tm
32+ if [[ -d /var/www/html ]]; then
33+ tmwebdir=/var/www/html
34+ elif [[ -d /opt/local/www/apache2/html ]]; then
35+ tmwebdir=/opt/local/www/apache2/html
36+ fi
37+
38+ # make sure we have a valid location for tmbasedir and it has the two
39+ # needed repositories, and that they appear to be valid repositories
40+ if [[ ! -d $tmbasedir ]]; then
41+ echo " TravelMapping repository base directory $tmbasedir not found"
42+ exit 1
43+ else
44+ if [[ ! -d $tmbasedir /HighwayData ]]; then
45+ echo " TravelMapping/HighwayData repository not found in $tmbasedir "
46+ exit 1
47+ elif [[ ! -d $tmbasedir /HighwayData/.git ]]; then
48+ echo " TravelMapping/HighwayData in $tmbasedir does not appear to be a git repository"
49+ exit 1
50+ fi
51+ if [[ ! -d $tmbasedir /UserData ]]; then
52+ echo " TravelMapping/UserData repository not found in $tmbasedir "
53+ exit 1
54+ elif [[ ! -d $tmbasedir /UserData/.git ]]; then
55+ echo " TravelMapping/UserData in $tmbasedir does not appear to be a git repository"
56+ exit 1
57+ fi
58+ fi
59+
60+ if [[ ! -d $tmwebdir ]]; then
61+ echo " Web directory $tmwebdir does not exist"
62+ exit 1
63+ fi
64+ if [[ ! -f $tmwebdir /participate.php ]]; then
65+ echo " Web directory $tmwebdir does not appear to contain a TM web instance"
66+ exit 1
67+ fi
68+
69+ graphdir=$tmwebdir /graphdata
70+
71+ export HIGHWAY_DATA=$tmbasedir /HighwayData
2472echo " Creating graph archive set with date stamp $datestr "
2573echo " Archive name $1 , description: $2 "
26- archivedir=$tmwebbase /grapharchives/$1
74+ archivedir=$tmwebdir /grapharchives/$1
2775if [ -d $archivedir ]; then
2876 echo " Archive directory $archivedir exists, exiting"
2977 exit 1
@@ -34,8 +82,8 @@ echo "Copying existing graphs from $graphdir to $archivedir"
3482cp $graphdir /* .tmg $archivedir
3583
3684echo " Gathering repo head info"
37- hwydatavers=` (cd $tmbase /HighwayData; git show -s | head -n 1 | cut -f2 -d' ' )`
38- userdatavers=` (cd $tmbase /UserData; git show -s | head -n 1 | cut -f2 -d' ' )`
85+ hwydatavers=` (cd $tmbasedir /HighwayData; git show -s | head -n 1 | cut -f2 -d' ' )`
86+ userdatavers=` (cd $tmbasedir /UserData; git show -s | head -n 1 | cut -f2 -d' ' )`
3987dataprocvers=` git show -s | head -n 1 | cut -f2 -d' ' `
4088echo " Highway Data: $hwydatavers "
4189echo " User Data: $userdatavers "
0 commit comments