jamesturk / photon

C++ API for development of OpenGL accelerated applications/games. [abandoned]

This URL has Read+Write access

jamesturk (author)
Sun May 13 08:18:37 -0700 2007
commit  002cc1b5e0bece87c5aafd8dee580f063881e10c
tree    1d8d116e928f222cd5c089231602060ff1b80637
parent  4f3a81d4bde1a05bfcd8ec28e024fd1784af6140
photon / release.sh
100755 104 lines (85 sloc) 3.062 kb
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
#!/bin/bash
 
# This file is part of Photon (http://photon.sourceforge.net)
# Copyright (C) 2004-2005 James Turk
#
# Author:
# James Turk (jpt2433@rit.edu)
#
# Version:
# $Id: release.sh,v 1.5 2005/08/19 05:42:51 cozman Exp $
 
major=0
minor=0
release=2
suffix=""
 
cvsTag="release-${major}_${minor}_${release}${suffix}"
dirName="photon-${major}.${minor}.${release}" # after 0.1 drop ${release}
srcPkgName="photon-${major}.${minor}.${release}${suffix}-src.tar.bz2"
 
# procedure to abort on errorcodes
check_errs()
{
  # Parameter 1 is the return code
  # Parameter 2 is text to display on failure.
  if [ "${1}" -ne "0" ]; then
echo "ERROR : ${2}"
    # as a bonus, make our script exit with the right error code.
    exit ${1}
  fi
}
 
# pre mode is run when preparing for a release
if [[ "${1}" = "pre" ]]; then
    # first checkout a fresh copy from CVS
    echo "Attempting to check fresh copy of photon out from CVS..."
    rm -rf ./photon
    cvs -z3 -d:ext:cozman@cvs.sourceforge.net:/cvsroot/photon co -P photon
    check_errs $? "Obtaining photon via CVS failed"
 
    cd photon
    check_errs $? "No photon directory?! Cannot proceed."
 
    # run all scons targets
    scons
    check_errs $? "Building photon library failed, aborting."
    scons tests
    check_errs $? "Building photon tests failed, aborting."
    scons docs
    check_errs $? "Building photon docs failed, aborting."
    echo "All scons tests succeeded!"
    
    echo "\nTime for some sanity checks, then run release.sh"
    
elif [[ "${1}" = "release" ]]; then
    # first checkout a fresh copy from CVS
    echo "Attempting to check fresh copy of photon out from CVS..."
    rm -rf ./photon
    cvs -z3 -d:ext:cozman@cvs.sourceforge.net:/cvsroot/photon co -P photon
    check_errs $? "Obtaining photon via CVS failed"
 
    cd photon
    check_errs $? "No photon directory?! Cannot proceed."
 
    echo "Tagging current CVS as ${cvsTag}"
    cvs rtag ${cvsTag} photon
    check_errs $? "Tagging photon in CVS failed"
    
    echo "Attempting to export ${cvsTag} tagged copy of photon"
    cd .. # go up a directory before attempting second checkout
    cvs -z3 -d:ext:cozman@cvs.sourceforge.net:/cvsroot/photon export -r ${cvsTag} -d ${dirName} photon
    check_errs $? "${cvsTag} export failed"
 
    cd ${dirName}
    check_errs $? "No photon directory?! Cannot proceed."
    
    scons docs
    check_errs $? "Building photon docs failed, aborting."
 
    # remove non-essential files
    rm -rf .sconf_temp/
    rm -rf docs/.cvsignore
    rm -rf include/.sconsign
    rm -rf include/*/.sconsign
    rm -rf include/*/*/.sconsign
    rm -rf ndoc/
    rm -rf ndoc/.cvsignore
    rm -rf .cvsignore
    rm -rf config.log
    rm -rf RELEASE-HOWTO.txt
    rm -rf release.sh
    
    # rename directory for packaging
    cd ..
    tar cjf ${srcPkgName} ${dirName}/
    check_errs $? "Failed to create source package."
    
    echo "Automated portion of release complete, put it up on sourceforge and relax."
else
echo "Usage: ./release.sh {pre|release}"
fi
 
exit