Subversion Repositories SvarDOS

Rev

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

Rev 52 Rev 63
1
#!/bin/sh
1
#!/bin/sh
2
#
2
#
3
# This script generates indexes of Svarog386 repositories and builds the ISO
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
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.
5
# modified, added or removed from any of the repositories.
6
#
6
#
7
 
7
 
8
### parameters block starts here ############################################
8
### parameters block starts here ############################################
9
 
9
 
10
REPOROOT=/srv/www/svarog386.viste.fr/repos/
10
REPOROOT=/srv/www/svarog386.viste.fr/repos/
11
REPOROOTNOSRC=/srv/www/svarog386.viste.fr/repos-nosrc/
11
REPOROOTNOSRC=/srv/www/svarog386.viste.fr/repos-nosrc/
12
BUILDIDX=/root/fdnpkg-buildidx/buildidx
12
BUILDIDX=/root/fdnpkg-buildidx/buildidx
13
CDISODIR='/srv/www/svarog386.viste.fr/'
13
CDISODIR='/srv/www/svarog386.viste.fr/'
14
CDROOT='/root/svarog386/cdroot'
14
CDROOT='/root/svarog386/cdroot'
15
CDROOTNOSRC='/root/svarog386/cdrootnosrc'
15
CDROOTNOSRC='/root/svarog386/cdrootnosrc'
16
CDROOTMICRO='/root/svarog386/cdrootmicro'
16
CDROOTMICRO='/root/svarog386/cdrootmicro'
17
CUSTFILES='/root/svarog386/files'
17
CUSTFILES='/root/svarog386/files'
18
 
18
 
19
### parameters block ends here ##############################################
19
### parameters block ends here ##############################################
20
 
20
 
21
# remember where we are, so we can return there once all is done
21
# remember where we are, so we can return there once all is done
22
origdir=`pwd`
22
origdir=`pwd`
23
 
23
 
24
# clone the repositories into future 'no source' versions
24
# clone the repositories into future 'no source' versions
25
echo "cloning $REPOROOT to $REPOROOTNOSRC..."
25
echo "cloning $REPOROOT to $REPOROOTNOSRC..."
26
rsync -a --delete $REPOROOT $REPOROOTNOSRC
26
rsync -a --delete $REPOROOT $REPOROOTNOSRC
27
if [ $? -ne 0 ] ; then exit 1 ; fi
27
if [ $? -ne 0 ] ; then exit 1 ; fi
28
 
28
 
29
# build the boot floppy image first
29
# build the boot floppy image first
30
cp $CUSTFILES/bootmini.img $CDROOT/boot.img
30
cp $CUSTFILES/bootmini.img $CDROOT/boot.img
31
export MTOOLS_NO_VFAT=1
31
export MTOOLS_NO_VFAT=1
32
mcopy -sQm -i $CDROOT/boot.img $CUSTFILES/floppy/* ::/
32
mcopy -sQm -i $CDROOT/boot.img $CUSTFILES/floppy/* ::/
33
 
33
 
34
# sync the boot.img file from full version to nosrc and micro
34
# sync the boot.img file from full version to nosrc and micro
35
cp $CDROOT/boot.img $CDROOTNOSRC/
35
cp $CDROOT/boot.img $CDROOTNOSRC/
36
if [ $? -ne 0 ] ; then exit 1 ; fi
36
if [ $? -ne 0 ] ; then exit 1 ; fi
37
cp $CDROOT/boot.img $CDROOTMICRO/
37
cp $CDROOT/boot.img $CDROOTMICRO/
38
if [ $? -ne 0 ] ; then exit 1 ; fi
38
if [ $? -ne 0 ] ; then exit 1 ; fi
39
 
39
 
40
# now strip the sources from the 'no source' clone
40
# now strip the sources from the 'no source' clone
41
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
41
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
42
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "source/*" ';'
42
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "source/*" ';'
43
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
43
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
44
 
44
 
45
# refresh all repositories
45
# refresh all repositories
46
$BUILDIDX $REPOROOT/core && $BUILDIDX $REPOROOTNOSRC/core
46
$BUILDIDX $REPOROOT/core && $BUILDIDX $REPOROOTNOSRC/core
47
if [ $? -ne 0 ] ; then exit 1 ; fi
47
if [ $? -ne 0 ] ; then exit 1 ; fi
48
$BUILDIDX $REPOROOT/devel && $BUILDIDX $REPOROOTNOSRC/devel
48
$BUILDIDX $REPOROOT/devel && $BUILDIDX $REPOROOTNOSRC/devel
49
if [ $? -ne 0 ] ; then exit 1 ; fi
49
if [ $? -ne 0 ] ; then exit 1 ; fi
50
$BUILDIDX $REPOROOT/drivers && $BUILDIDX $REPOROOTNOSRC/drivers
50
$BUILDIDX $REPOROOT/drivers && $BUILDIDX $REPOROOTNOSRC/drivers
51
if [ $? -ne 0 ] ; then exit 1 ; fi
51
if [ $? -ne 0 ] ; then exit 1 ; fi
52
$BUILDIDX $REPOROOT/edit && $BUILDIDX $REPOROOTNOSRC/edit
52
$BUILDIDX $REPOROOT/edit && $BUILDIDX $REPOROOTNOSRC/edit
53
if [ $? -ne 0 ] ; then exit 1 ; fi
53
if [ $? -ne 0 ] ; then exit 1 ; fi
54
$BUILDIDX $REPOROOT/emulatrs && $BUILDIDX $REPOROOTNOSRC/emulatrs
54
$BUILDIDX $REPOROOT/emulatrs && $BUILDIDX $REPOROOTNOSRC/emulatrs
55
if [ $? -ne 0 ] ; then exit 1 ; fi
55
if [ $? -ne 0 ] ; then exit 1 ; fi
56
$BUILDIDX $REPOROOT/games && $BUILDIDX $REPOROOTNOSRC/games
56
$BUILDIDX $REPOROOT/games && $BUILDIDX $REPOROOTNOSRC/games
57
if [ $? -ne 0 ] ; then exit 1 ; fi
57
if [ $? -ne 0 ] ; then exit 1 ; fi
58
$BUILDIDX $REPOROOT/net && $BUILDIDX $REPOROOTNOSRC/net
58
$BUILDIDX $REPOROOT/net && $BUILDIDX $REPOROOTNOSRC/net
59
if [ $? -ne 0 ] ; then exit 1 ; fi
59
if [ $? -ne 0 ] ; then exit 1 ; fi
60
$BUILDIDX $REPOROOT/packers && $BUILDIDX $REPOROOTNOSRC/packers
60
$BUILDIDX $REPOROOT/packers && $BUILDIDX $REPOROOTNOSRC/packers
61
if [ $? -ne 0 ] ; then exit 1 ; fi
61
if [ $? -ne 0 ] ; then exit 1 ; fi
62
$BUILDIDX $REPOROOT/sound && $BUILDIDX $REPOROOTNOSRC/sound
62
$BUILDIDX $REPOROOT/sound && $BUILDIDX $REPOROOTNOSRC/sound
63
if [ $? -ne 0 ] ; then exit 1 ; fi
63
if [ $? -ne 0 ] ; then exit 1 ; fi
64
$BUILDIDX $REPOROOT/util && $BUILDIDX $REPOROOTNOSRC/util
64
$BUILDIDX $REPOROOT/util && $BUILDIDX $REPOROOTNOSRC/util
65
if [ $? -ne 0 ] ; then exit 1 ; fi
65
if [ $? -ne 0 ] ; then exit 1 ; fi
66
 
66
 
67
# recompute the listing.txt file
67
# recompute the listing.txt file
68
rm $CDISODIR/listing.txt
68
rm $CDISODIR/listing.txt
69
cat $REPOROOT/core/listing.txt >> $CDISODIR/listing.txt
69
cat $REPOROOT/core/listing.txt >> $CDISODIR/listing.txt
70
cat $REPOROOT/devel/listing.txt >> $CDISODIR/listing.txt
70
cat $REPOROOT/devel/listing.txt >> $CDISODIR/listing.txt
71
cat $REPOROOT/drivers/listing.txt >> $CDISODIR/listing.txt
71
cat $REPOROOT/drivers/listing.txt >> $CDISODIR/listing.txt
72
cat $REPOROOT/edit/listing.txt >> $CDISODIR/listing.txt
72
cat $REPOROOT/edit/listing.txt >> $CDISODIR/listing.txt
73
cat $REPOROOT/emulatrs/listing.txt >> $CDISODIR/listing.txt
73
cat $REPOROOT/emulatrs/listing.txt >> $CDISODIR/listing.txt
74
cat $REPOROOT/games/listing.txt >> $CDISODIR/listing.txt
74
cat $REPOROOT/games/listing.txt >> $CDISODIR/listing.txt
75
cat $REPOROOT/net/listing.txt >> $CDISODIR/listing.txt
75
cat $REPOROOT/net/listing.txt >> $CDISODIR/listing.txt
76
cat $REPOROOT/packers/listing.txt >> $CDISODIR/listing.txt
76
cat $REPOROOT/packers/listing.txt >> $CDISODIR/listing.txt
77
cat $REPOROOT/sound/listing.txt >> $CDISODIR/listing.txt
77
cat $REPOROOT/sound/listing.txt >> $CDISODIR/listing.txt
78
cat $REPOROOT/util/listing.txt >> $CDISODIR/listing.txt
78
cat $REPOROOT/util/listing.txt >> $CDISODIR/listing.txt
79
 
79
 
80
# compute a filename for the ISO files and build it
80
# compute a filename for the ISO files and build it
81
DATESTAMP=`date +%Y%m%d-%H%M`
81
DATESTAMP=`date +%Y%m%d-%H%M`
82
CDISO="$CDISODIR/svarog386-full-$DATESTAMP.iso"
82
CDISO="$CDISODIR/svarog386-full-$DATESTAMP.iso"
83
CDISONOSRC="$CDISODIR/svarog386-nosrc-$DATESTAMP.iso"
83
CDISONOSRC="$CDISODIR/svarog386-nosrc-$DATESTAMP.iso"
84
CDISOMICRO="$CDISODIR/svarog386-micro-$DATESTAMP.iso"
84
CDISOMICRO="$CDISODIR/svarog386-micro-$DATESTAMP.iso"
85
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISO.tmp $CDROOT
85
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -V SVAROG386 -o $CDISO.tmp $CDROOT
86
if [ $? -ne 0 ] ; then exit 1 ; fi
86
if [ $? -ne 0 ] ; then exit 1 ; fi
87
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISONOSRC.tmp $CDROOTNOSRC
87
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -V SVAROG386 -o $CDISONOSRC.tmp $CDROOTNOSRC
88
if [ $? -ne 0 ] ; then exit 1 ; fi
88
if [ $? -ne 0 ] ; then exit 1 ; fi
89
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISOMICRO.tmp $CDROOTMICRO
89
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -V SVAROG386 -o $CDISOMICRO.tmp $CDROOTMICRO
90
if [ $? -ne 0 ] ; then exit 1 ; fi
90
if [ $? -ne 0 ] ; then exit 1 ; fi
91
mv $CDISO.tmp $CDISO
91
mv $CDISO.tmp $CDISO
92
mv $CDISONOSRC.tmp $CDISONOSRC
92
mv $CDISONOSRC.tmp $CDISONOSRC
93
mv $CDISOMICRO.tmp $CDISOMICRO
93
mv $CDISOMICRO.tmp $CDISOMICRO
94
 
94
 
95
# compute the MD5 of the ISO files, taking care to include only the filename in it
95
# compute the MD5 of the ISO files, taking care to include only the filename in it
96
echo "computing md5 sums..."
96
echo "computing md5 sums..."
97
cd `dirname $CDISO`
97
cd `dirname $CDISO`
98
md5sum `basename $CDISO` > $CDISO.md5
98
md5sum `basename $CDISO` > $CDISO.md5
99
 
99
 
100
cd `dirname $CDISONOSRC`
100
cd `dirname $CDISONOSRC`
101
md5sum `basename $CDISONOSRC` > $CDISONOSRC.md5
101
md5sum `basename $CDISONOSRC` > $CDISONOSRC.md5
102
 
102
 
103
cd `dirname $CDISOMICRO`
103
cd `dirname $CDISOMICRO`
104
md5sum `basename $CDISOMICRO` > $CDISOMICRO.md5
104
md5sum `basename $CDISOMICRO` > $CDISOMICRO.md5
105
 
105
 
106
# delete all *.iso and *.md5 files, leaving only the 16 most recent
106
# delete all *.iso and *.md5 files, leaving only the 16 most recent
107
echo "cleaning up old versions..."
107
echo "cleaning up old versions..."
108
ls -tp $CDISODIR/svarog386-*-*.iso* | tail -n +17 | xargs -I {} rm -- {}
108
ls -tp $CDISODIR/svarog386-*-*.iso* | tail -n +17 | xargs -I {} rm -- {}
109
 
109
 
110
cd "$origdir"
110
cd "$origdir"
111
 
111
 
112
echo "all done!"
112
echo "all done!"
113
 
113
 
114
exit 0
114
exit 0
115
 
115