Subversion Repositories SvarDOS

Rev

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

Rev 649 Rev 732
1
#!/bin/sh
1
#!/bin/sh
2
#
2
#
3
# this script looks for the presence of /tmp/svardos_repo_changed.flag file
3
# this script looks for the presence of /tmp/svardos_repo_changed.flag file
4
# and rebuilds the packages index if it exists (then deletes the flag).
4
# and rebuilds the packages index if it exists (then deletes the flag).
5
#
5
#
6
# it is supposed to be called periodically from within a cron job.
6
# it is supposed to be called periodically from within a cron job.
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
FLAGFILE="/tmp/svardos_repo_changed.flag"
13
SVNREPODIR="/srv/svardos"
13
SVNREPODIR="/srv/svardos"
14
 
14
 
15
# if flag does not exist, exit
15
# if flag does not exist, exit
16
if [ ! -f "$FLAGFILE" ] ; then
16
if [ ! -f "$FLAGFILE" ] ; then
17
  exit 0
17
  exit 0
18
fi
18
fi
19
 
19
 
20
 
20
 
21
# repo changed! delete the flag file, refresh the local copy of the repo and rebuild packages index
21
# repo changed! delete the flag file, refresh the local copy of the repo and rebuild packages index
22
rm "$FLAGFILE"
22
rm "$FLAGFILE"
23
svn up "$SVNREPODIR"
23
svn up "$SVNREPODIR"
24
php "$SVNREPODIR/buildidx/buildidx.php" "$SVNREPODIR/packages/"
24
php "$SVNREPODIR/buildidx/buildidx.php" "$SVNREPODIR/packages/" > "$SVNREPODIR/packages/_buildidx.log"
25
 
25
 
26
exit 0
26
exit 0
27
 
27