Line 1... |
Line 1... |
1 |
#!/bin/sh
|
1 |
#!/bin/bash
|
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 |
# bash is required because I use the internal bash "read" command.
|
11 |
|
12 |
|
12 |
REPOFLAGFILE="/tmp/svardos_repo_changed.flag"
|
13 |
REPOFLAGFILE="/tmp/svardos_repo_changed.flag"
|
13 |
REBUILDFLAGFILE="/tmp/svardos_rebuild_please.flag"
|
14 |
REBUILDFLAGFILE="/tmp/svardos_rebuild_please.flag"
|
14 |
SVNREPODIR="/srv/svardos"
|
15 |
SVNREPODIR="/srv/svardos"
|
15 |
|
16 |
|
Line 32... |
Line 33... |
32 |
# refresh the local copy of the repo and rebuild packages index
|
33 |
# refresh the local copy of the repo and rebuild packages index
|
33 |
svn up "$SVNREPODIR"
|
34 |
svn up "$SVNREPODIR"
|
34 |
rm -rf "$SVNREPODIR/packages/latest"
|
35 |
rm -rf "$SVNREPODIR/packages/latest"
|
35 |
php "$SVNREPODIR/buildidx/buildidx.php" "$SVNREPODIR/packages/" > "$SVNREPODIR/packages/_buildidx.log"
|
36 |
php "$SVNREPODIR/buildidx/buildidx.php" "$SVNREPODIR/packages/" > "$SVNREPODIR/packages/_buildidx.log"
|
36 |
|
37 |
|
- |
|
38 |
|
- |
|
39 |
###############################################################################
|
- |
|
40 |
# #
|
37 |
# build the ISO that contains all latest packages from the repo
|
41 |
# build the ISO that contains all latest packages from the repo #
|
- |
|
42 |
# (and make it bootable using latest STABLE boot floppy) #
|
- |
|
43 |
# #
|
- |
|
44 |
###############################################################################
|
- |
|
45 |
|
- |
|
46 |
read -r STABLE < "$SVNREPODIR/website/default_build.txt"
|
- |
|
47 |
unzip -o "$SVNREPODIR/website/download/$STABLE/svardos-$STABLE-floppy-2.88M.zip" disk1.img -d /tmp/
|
- |
|
48 |
mv /tmp/disk1.img "$SVNREPODIR/packages/latest/boot.img"
|
38 |
mkisofs -input-charset cp437 -iso-level 1 -f -V SVARDOS_REPO -o "$SVNREPODIR/website/repo/sv-repo.tmp" "$SVNREPODIR"/packages/latest/*
|
49 |
mkisofs -input-charset cp437 -b boot.img -hide boot.img -hide boot.catalog -iso-level 1 -f -V SVARDOS_REPO -o "$SVNREPODIR/website/repo/sv-repo.tmp" "$SVNREPODIR"/packages/latest/*
|
- |
|
50 |
rm -f "$SVNREPODIR/packages/latest/boot.img"
|
39 |
mv "$SVNREPODIR/website/repo/sv-repo.tmp" "$SVNREPODIR/website/repo/sv-repo.iso"
|
51 |
mv "$SVNREPODIR/website/repo/sv-repo.tmp" "$SVNREPODIR/website/repo/sv-repo.iso"
|
40 |
md5sum "$SVNREPODIR/website/repo/sv-repo.iso" > "$SVNREPODIR/website/repo/sv-repo.iso.md5"
|
52 |
md5sum "$SVNREPODIR/website/repo/sv-repo.iso" > "$SVNREPODIR/website/repo/sv-repo.iso.md5"
|
41 |
|
53 |
|
42 |
|
54 |
|
43 |
# do I need to rebuild the install images as well?
|
55 |
# do I need to rebuild the install images as well?
|