Subversion Repositories SvarDOS

Rev

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

Rev 63 Rev 66
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, and publish it also stand-alone
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
cp $CDROOT/boot.img $CDISODIR/
-
 
40
if [ $? -ne 0 ] ; then exit 1 ; fi
39
 
41
 
40
# now strip the sources from the 'no source' clone
42
# now strip the sources from the 'no source' clone
41
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
43
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
42
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "source/*" ';'
44
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "source/*" ';'
43
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
45
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
44
 
46
 
45
# refresh all repositories
47
# refresh all repositories
46
$BUILDIDX $REPOROOT/core && $BUILDIDX $REPOROOTNOSRC/core
48
$BUILDIDX $REPOROOT/core && $BUILDIDX $REPOROOTNOSRC/core
47
if [ $? -ne 0 ] ; then exit 1 ; fi
49
if [ $? -ne 0 ] ; then exit 1 ; fi
48
$BUILDIDX $REPOROOT/devel && $BUILDIDX $REPOROOTNOSRC/devel
50
$BUILDIDX $REPOROOT/devel && $BUILDIDX $REPOROOTNOSRC/devel
49
if [ $? -ne 0 ] ; then exit 1 ; fi
51
if [ $? -ne 0 ] ; then exit 1 ; fi
50
$BUILDIDX $REPOROOT/drivers && $BUILDIDX $REPOROOTNOSRC/drivers
52
$BUILDIDX $REPOROOT/drivers && $BUILDIDX $REPOROOTNOSRC/drivers
51
if [ $? -ne 0 ] ; then exit 1 ; fi
53
if [ $? -ne 0 ] ; then exit 1 ; fi
52
$BUILDIDX $REPOROOT/edit && $BUILDIDX $REPOROOTNOSRC/edit
54
$BUILDIDX $REPOROOT/edit && $BUILDIDX $REPOROOTNOSRC/edit
53
if [ $? -ne 0 ] ; then exit 1 ; fi
55
if [ $? -ne 0 ] ; then exit 1 ; fi
54
$BUILDIDX $REPOROOT/emulatrs && $BUILDIDX $REPOROOTNOSRC/emulatrs
56
$BUILDIDX $REPOROOT/emulatrs && $BUILDIDX $REPOROOTNOSRC/emulatrs
55
if [ $? -ne 0 ] ; then exit 1 ; fi
57
if [ $? -ne 0 ] ; then exit 1 ; fi
56
$BUILDIDX $REPOROOT/games && $BUILDIDX $REPOROOTNOSRC/games
58
$BUILDIDX $REPOROOT/games && $BUILDIDX $REPOROOTNOSRC/games
57
if [ $? -ne 0 ] ; then exit 1 ; fi
59
if [ $? -ne 0 ] ; then exit 1 ; fi
58
$BUILDIDX $REPOROOT/net && $BUILDIDX $REPOROOTNOSRC/net
60
$BUILDIDX $REPOROOT/net && $BUILDIDX $REPOROOTNOSRC/net
59
if [ $? -ne 0 ] ; then exit 1 ; fi
61
if [ $? -ne 0 ] ; then exit 1 ; fi
60
$BUILDIDX $REPOROOT/packers && $BUILDIDX $REPOROOTNOSRC/packers
62
$BUILDIDX $REPOROOT/packers && $BUILDIDX $REPOROOTNOSRC/packers
61
if [ $? -ne 0 ] ; then exit 1 ; fi
63
if [ $? -ne 0 ] ; then exit 1 ; fi
62
$BUILDIDX $REPOROOT/sound && $BUILDIDX $REPOROOTNOSRC/sound
64
$BUILDIDX $REPOROOT/sound && $BUILDIDX $REPOROOTNOSRC/sound
63
if [ $? -ne 0 ] ; then exit 1 ; fi
65
if [ $? -ne 0 ] ; then exit 1 ; fi
64
$BUILDIDX $REPOROOT/util && $BUILDIDX $REPOROOTNOSRC/util
66
$BUILDIDX $REPOROOT/util && $BUILDIDX $REPOROOTNOSRC/util
65
if [ $? -ne 0 ] ; then exit 1 ; fi
67
if [ $? -ne 0 ] ; then exit 1 ; fi
66
 
68
 
67
# recompute the listing.txt file
69
# recompute the listing.txt file
68
rm $CDISODIR/listing.txt
70
rm $CDISODIR/listing.txt
69
cat $REPOROOT/core/listing.txt >> $CDISODIR/listing.txt
71
cat $REPOROOT/core/listing.txt >> $CDISODIR/listing.txt
70
cat $REPOROOT/devel/listing.txt >> $CDISODIR/listing.txt
72
cat $REPOROOT/devel/listing.txt >> $CDISODIR/listing.txt
71
cat $REPOROOT/drivers/listing.txt >> $CDISODIR/listing.txt
73
cat $REPOROOT/drivers/listing.txt >> $CDISODIR/listing.txt
72
cat $REPOROOT/edit/listing.txt >> $CDISODIR/listing.txt
74
cat $REPOROOT/edit/listing.txt >> $CDISODIR/listing.txt
73
cat $REPOROOT/emulatrs/listing.txt >> $CDISODIR/listing.txt
75
cat $REPOROOT/emulatrs/listing.txt >> $CDISODIR/listing.txt
74
cat $REPOROOT/games/listing.txt >> $CDISODIR/listing.txt
76
cat $REPOROOT/games/listing.txt >> $CDISODIR/listing.txt
75
cat $REPOROOT/net/listing.txt >> $CDISODIR/listing.txt
77
cat $REPOROOT/net/listing.txt >> $CDISODIR/listing.txt
76
cat $REPOROOT/packers/listing.txt >> $CDISODIR/listing.txt
78
cat $REPOROOT/packers/listing.txt >> $CDISODIR/listing.txt
77
cat $REPOROOT/sound/listing.txt >> $CDISODIR/listing.txt
79
cat $REPOROOT/sound/listing.txt >> $CDISODIR/listing.txt
78
cat $REPOROOT/util/listing.txt >> $CDISODIR/listing.txt
80
cat $REPOROOT/util/listing.txt >> $CDISODIR/listing.txt
79
 
81
 
80
# compute a filename for the ISO files and build it
82
# compute a filename for the ISO files and build it
81
DATESTAMP=`date +%Y%m%d-%H%M`
83
DATESTAMP=`date +%Y%m%d-%H%M`
82
CDISO="$CDISODIR/svarog386-full-$DATESTAMP.iso"
84
CDISO="$CDISODIR/svarog386-full-$DATESTAMP.iso"
83
CDISONOSRC="$CDISODIR/svarog386-nosrc-$DATESTAMP.iso"
85
CDISONOSRC="$CDISODIR/svarog386-nosrc-$DATESTAMP.iso"
84
CDISOMICRO="$CDISODIR/svarog386-micro-$DATESTAMP.iso"
86
CDISOMICRO="$CDISODIR/svarog386-micro-$DATESTAMP.iso"
85
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -V SVAROG386 -o $CDISO.tmp $CDROOT
87
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
88
if [ $? -ne 0 ] ; then exit 1 ; fi
87
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -V SVAROG386 -o $CDISONOSRC.tmp $CDROOTNOSRC
89
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
90
if [ $? -ne 0 ] ; then exit 1 ; fi
89
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -V SVAROG386 -o $CDISOMICRO.tmp $CDROOTMICRO
91
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
92
if [ $? -ne 0 ] ; then exit 1 ; fi
91
mv $CDISO.tmp $CDISO
93
mv $CDISO.tmp $CDISO
92
mv $CDISONOSRC.tmp $CDISONOSRC
94
mv $CDISONOSRC.tmp $CDISONOSRC
93
mv $CDISOMICRO.tmp $CDISOMICRO
95
mv $CDISOMICRO.tmp $CDISOMICRO
94
 
96
 
95
# compute the MD5 of the ISO files, taking care to include only the filename in it
97
# compute the MD5 of the ISO files, taking care to include only the filename in it
96
echo "computing md5 sums..."
98
echo "computing md5 sums..."
97
cd `dirname $CDISO`
99
cd `dirname $CDISO`
98
md5sum `basename $CDISO` > $CDISO.md5
100
md5sum `basename $CDISO` > $CDISO.md5
99
 
101
 
100
cd `dirname $CDISONOSRC`
102
cd `dirname $CDISONOSRC`
101
md5sum `basename $CDISONOSRC` > $CDISONOSRC.md5
103
md5sum `basename $CDISONOSRC` > $CDISONOSRC.md5
102
 
104
 
103
cd `dirname $CDISOMICRO`
105
cd `dirname $CDISOMICRO`
104
md5sum `basename $CDISOMICRO` > $CDISOMICRO.md5
106
md5sum `basename $CDISOMICRO` > $CDISOMICRO.md5
105
 
107
 
106
# delete all *.iso and *.md5 files, leaving only the 16 most recent
108
# delete all *.iso and *.md5 files, leaving only the 16 most recent
107
echo "cleaning up old versions..."
109
echo "cleaning up old versions..."
108
ls -tp $CDISODIR/svarog386-*-*.iso* | tail -n +17 | xargs -I {} rm -- {}
110
ls -tp $CDISODIR/svarog386-*-*.iso* | tail -n +17 | xargs -I {} rm -- {}
109
 
111
 
110
cd "$origdir"
112
cd "$origdir"
111
 
113
 
112
echo "all done!"
114
echo "all done!"
113
 
115
 
114
exit 0
116
exit 0
115
 
117