Subversion Repositories SvarDOS

Rev

Rev 26 | Rev 52 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mv_fox 1
#!/bin/sh
11 mv_fox 2
#
3
# This script generates indexes of Svarog386 repositories and builds the ISO
4
# CD images. It should be executed each time that a package file have been
5
# modified, added or removed from any of the repositories.
6
#
2 mv_fox 7
 
11 mv_fox 8
### parameters block starts here ############################################
9
 
2 mv_fox 10
REPOROOT=/srv/www/svarog386.viste.fr/repos/
16 mv_fox 11
REPOROOTNOSRC=/srv/www/svarog386.viste.fr/repos-nosrc/
2 mv_fox 12
BUILDIDX=/root/fdnpkg-buildidx/buildidx
11 mv_fox 13
CDISODIR='/srv/www/svarog386.viste.fr/'
14
CDROOT='/root/svarog386/cdroot'
16 mv_fox 15
CDROOTNOSRC='/root/svarog386/cdrootnosrc'
24 mv_fox 16
CDROOTMICRO='/root/svarog386/cdrootmicro'
44 mv_fox 17
CUSTFILES='/root/svarog386/files'
2 mv_fox 18
 
11 mv_fox 19
### parameters block ends here ##############################################
20
 
21
# remember where we are, so we can return there once all is done
22
origdir=`pwd`
23
 
16 mv_fox 24
# clone the repositories into future 'no source' versions
25
echo "cloning $REPOROOT to $REPOROOTNOSRC..."
26
rsync -a --delete $REPOROOT $REPOROOTNOSRC
2 mv_fox 27
if [ $? -ne 0 ] ; then exit 1 ; fi
16 mv_fox 28
 
44 mv_fox 29
# build the boot floppy image first
30
cp $CUSTFILES/bootmini.img $CDROOT/boot.img
31
mcopy -i $CDROOT/boot.img $CUSTFILES/install.com ::/INSTALL.COM
32
mcopy -i $CDROOT/boot.img $CUSTFILES/autoexec.bat ::/AUTOEXEC.BAT
33
mcopy -i $CDROOT/boot.img $CUSTFILES/config.sys ::/CONFIG.SYS
34
mcopy -i $CDROOT/boot.img $CUSTFILES/display.exe ::/DISPLAY.EXE
35
mcopy -i $CDROOT/boot.img $CUSTFILES/fdnpkg.cfg ::/FDNPKG.CFG
36
mcopy -i $CDROOT/boot.img $CUSTFILES/mode.com ::/MODE.COM
37
mcopy -i $CDROOT/boot.img $CUSTFILES/ega.cpx ::/EGA.CPX
38
mcopy -i $CDROOT/boot.img $CUSTFILES/ega2.cpx ::/EGA2.CPX
39
mcopy -i $CDROOT/boot.img $CUSTFILES/ega3.cpx ::/EGA3.CPX
40
mcopy -i $CDROOT/boot.img $CUSTFILES/ega4.cpx ::/EGA4.CPX
41
mcopy -i $CDROOT/boot.img $CUSTFILES/ega5.cpx ::/EGA5.CPX
42
mcopy -i $CDROOT/boot.img $CUSTFILES/ega6.cpx ::/EGA6.CPX
43
mcopy -i $CDROOT/boot.img $CUSTFILES/ega7.cpx ::/EGA7.CPX
44
mcopy -i $CDROOT/boot.img $CUSTFILES/ega8.cpx ::/EGA8.CPX
45
mcopy -i $CDROOT/boot.img $CUSTFILES/ega9.cpx ::/EGA9.CPX
46
mcopy -i $CDROOT/boot.img $CUSTFILES/ega10.cpx ::/EGA10.CPX
47
mmd -i $CDROOT/boot.img ::/NLS
48
mcopy -i $CDROOT/boot.img $CUSTFILES/nls/*.* ::/NLS/
49
 
24 mv_fox 50
# sync the boot.img file from full version to nosrc and micro
16 mv_fox 51
cp $CDROOT/boot.img $CDROOTNOSRC/
2 mv_fox 52
if [ $? -ne 0 ] ; then exit 1 ; fi
24 mv_fox 53
cp $CDROOT/boot.img $CDROOTMICRO/
54
if [ $? -ne 0 ] ; then exit 1 ; fi
16 mv_fox 55
 
56
# now strip the sources from the 'no source' clone
57
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
58
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "source/*" ';'
59
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
60
 
61
# refresh all repositories
62
$BUILDIDX $REPOROOT/base && $BUILDIDX $REPOROOTNOSRC/base
2 mv_fox 63
if [ $? -ne 0 ] ; then exit 1 ; fi
16 mv_fox 64
$BUILDIDX $REPOROOT/devel && $BUILDIDX $REPOROOTNOSRC/devel
2 mv_fox 65
if [ $? -ne 0 ] ; then exit 1 ; fi
16 mv_fox 66
$BUILDIDX $REPOROOT/drivers && $BUILDIDX $REPOROOTNOSRC/drivers
2 mv_fox 67
if [ $? -ne 0 ] ; then exit 1 ; fi
16 mv_fox 68
$BUILDIDX $REPOROOT/edit && $BUILDIDX $REPOROOTNOSRC/edit
2 mv_fox 69
if [ $? -ne 0 ] ; then exit 1 ; fi
16 mv_fox 70
$BUILDIDX $REPOROOT/emulatrs && $BUILDIDX $REPOROOTNOSRC/emulatrs
2 mv_fox 71
if [ $? -ne 0 ] ; then exit 1 ; fi
16 mv_fox 72
$BUILDIDX $REPOROOT/games && $BUILDIDX $REPOROOTNOSRC/games
2 mv_fox 73
if [ $? -ne 0 ] ; then exit 1 ; fi
16 mv_fox 74
$BUILDIDX $REPOROOT/net && $BUILDIDX $REPOROOTNOSRC/net
2 mv_fox 75
if [ $? -ne 0 ] ; then exit 1 ; fi
16 mv_fox 76
$BUILDIDX $REPOROOT/packers && $BUILDIDX $REPOROOTNOSRC/packers
77
if [ $? -ne 0 ] ; then exit 1 ; fi
78
$BUILDIDX $REPOROOT/sound && $BUILDIDX $REPOROOTNOSRC/sound
79
if [ $? -ne 0 ] ; then exit 1 ; fi
80
$BUILDIDX $REPOROOT/util && $BUILDIDX $REPOROOTNOSRC/util
81
if [ $? -ne 0 ] ; then exit 1 ; fi
2 mv_fox 82
 
25 mv_fox 83
# recompute the listing.txt file
84
rm $CDISODIR/listing.txt
85
cat $REPOROOT/base/listing.txt >> $CDISODIR/listing.txt
86
cat $REPOROOT/devel/listing.txt >> $CDISODIR/listing.txt
87
cat $REPOROOT/drivers/listing.txt >> $CDISODIR/listing.txt
88
cat $REPOROOT/edit/listing.txt >> $CDISODIR/listing.txt
89
cat $REPOROOT/emulatrs/listing.txt >> $CDISODIR/listing.txt
90
cat $REPOROOT/games/listing.txt >> $CDISODIR/listing.txt
91
cat $REPOROOT/net/listing.txt >> $CDISODIR/listing.txt
92
cat $REPOROOT/packers/listing.txt >> $CDISODIR/listing.txt
93
cat $REPOROOT/sound/listing.txt >> $CDISODIR/listing.txt
94
cat $REPOROOT/util/listing.txt >> $CDISODIR/listing.txt
95
 
16 mv_fox 96
# compute a filename for the ISO files and build it
97
DATESTAMP=`date +%Y%m%d-%H%M`
98
CDISO="$CDISODIR/svarog386-full-$DATESTAMP.iso"
99
CDISONOSRC="$CDISODIR/svarog386-nosrc-$DATESTAMP.iso"
24 mv_fox 100
CDISOMICRO="$CDISODIR/svarog386-micro-$DATESTAMP.iso"
11 mv_fox 101
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISO.tmp $CDROOT
102
if [ $? -ne 0 ] ; then exit 1 ; fi
16 mv_fox 103
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISONOSRC.tmp $CDROOTNOSRC
104
if [ $? -ne 0 ] ; then exit 1 ; fi
24 mv_fox 105
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISOMICRO.tmp $CDROOTMICRO
106
if [ $? -ne 0 ] ; then exit 1 ; fi
11 mv_fox 107
mv $CDISO.tmp $CDISO
16 mv_fox 108
mv $CDISONOSRC.tmp $CDISONOSRC
24 mv_fox 109
mv $CDISOMICRO.tmp $CDISOMICRO
2 mv_fox 110
 
16 mv_fox 111
# compute the MD5 of the ISO files, taking care to include only the filename in it
112
echo "computing md5 sums..."
11 mv_fox 113
cd `dirname $CDISO`
114
md5sum `basename $CDISO` > $CDISO.md5
115
 
16 mv_fox 116
cd `dirname $CDISONOSRC`
117
md5sum `basename $CDISONOSRC` > $CDISONOSRC.md5
118
 
24 mv_fox 119
cd `dirname $CDISOMICRO`
120
md5sum `basename $CDISOMICRO` > $CDISOMICRO.md5
121
 
26 mv_fox 122
# delete all *.iso and *.md5 files, leaving only the 16 most recent
123
echo "cleaning up old versions..."
124
ls -tp $CDISODIR/svarog386-*-*.iso* | tail -n +17 | xargs -I {} rm -- {}
125
 
11 mv_fox 126
cd "$origdir"
127
 
16 mv_fox 128
echo "all done!"
129
 
2 mv_fox 130
exit 0