Subversion Repositories SvarDOS

Rev

Rev 732 | Rev 854 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 732 Rev 850
Line 7... Line 7...
7
#
7
#
8
# the /tmp/svardos_repo_changed.flag file is expected to be created by an
8
# the /tmp/svardos_repo_changed.flag file is expected to be created by an
9
# svn post-commit hook whenever something in the svn repo changes.
9
# svn post-commit hook whenever something in the svn repo changes.
10
 
10
 
11
 
11
 
12
FLAGFILE="/tmp/svardos_repo_changed.flag"
12
REPOFLAGFILE="/tmp/svardos_repo_changed.flag"
-
 
13
REBUILDFLAGFILE="/tmp/svardos_rebuild_please.flag"
13
SVNREPODIR="/srv/svardos"
14
SVNREPODIR="/srv/svardos"
14
 
15
 
15
# if flag does not exist, exit
16
# exit if repo did not change
16
if [ ! -f "$FLAGFILE" ] ; then
17
if [ ! -f "$REPOFLAGFILE" ] ; then
17
  exit 0
18
  exit 0
18
fi
19
fi
19
 
20
 
-
 
21
# delete the flag files as soon as possible to limit the time of possible
-
 
22
# collisions
-
 
23
rm "$REPOFLAGFILE"
-
 
24
 
-
 
25
NEEDTOREBUILD=0
-
 
26
if [ -f "$REBUILDFLAGFILE" ] ; then
-
 
27
  rm "$REBUILDFLAGFILE"
-
 
28
  NEEDTOREBUILD=1
-
 
29
fi
-
 
30
 
20
 
31
 
21
# repo changed! delete the flag file, refresh the local copy of the repo and rebuild packages index
32
# refresh the local copy of the repo and rebuild packages index
22
rm "$FLAGFILE"
-
 
23
svn up "$SVNREPODIR"
33
svn up "$SVNREPODIR"
24
php "$SVNREPODIR/buildidx/buildidx.php" "$SVNREPODIR/packages/" > "$SVNREPODIR/packages/_buildidx.log"
34
php "$SVNREPODIR/buildidx/buildidx.php" "$SVNREPODIR/packages/" > "$SVNREPODIR/packages/_buildidx.log"
25
 
35
 
-
 
36
# do I need to rebuild the install images as well?
-
 
37
if [ "$NEEDTOREBUILD" -ne 0 ] ; then
-
 
38
  cd "$SVNREPODIR"
-
 
39
  ./build.sh "website/download/" > "website/download/0000_lastbuild.log" 2>&1
-
 
40
fi
-
 
41
 
26
exit 0
42
exit 0