Subversion Repositories SvarDOS

Rev

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

Rev 44 Rev 52
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
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
31
export MTOOLS_NO_VFAT=1
48
mcopy -i $CDROOT/boot.img $CUSTFILES/nls/*.* ::/NLS/
32
mcopy -sQm -i $CDROOT/boot.img $CUSTFILES/floppy/* ::/
49
 
33
 
50
# 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
51
cp $CDROOT/boot.img $CDROOTNOSRC/
35
cp $CDROOT/boot.img $CDROOTNOSRC/
52
if [ $? -ne 0 ] ; then exit 1 ; fi
36
if [ $? -ne 0 ] ; then exit 1 ; fi
53
cp $CDROOT/boot.img $CDROOTMICRO/
37
cp $CDROOT/boot.img $CDROOTMICRO/
54
if [ $? -ne 0 ] ; then exit 1 ; fi
38
if [ $? -ne 0 ] ; then exit 1 ; fi
55
 
39
 
56
# now strip the sources from the 'no source' clone
40
# now strip the sources from the 'no source' clone
57
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
41
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
58
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "source/*" ';'
42
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "source/*" ';'
59
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
43
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
60
 
44
 
61
# refresh all repositories
45
# refresh all repositories
62
$BUILDIDX $REPOROOT/base && $BUILDIDX $REPOROOTNOSRC/base
46
$BUILDIDX $REPOROOT/core && $BUILDIDX $REPOROOTNOSRC/core
63
if [ $? -ne 0 ] ; then exit 1 ; fi
47
if [ $? -ne 0 ] ; then exit 1 ; fi
64
$BUILDIDX $REPOROOT/devel && $BUILDIDX $REPOROOTNOSRC/devel
48
$BUILDIDX $REPOROOT/devel && $BUILDIDX $REPOROOTNOSRC/devel
65
if [ $? -ne 0 ] ; then exit 1 ; fi
49
if [ $? -ne 0 ] ; then exit 1 ; fi
66
$BUILDIDX $REPOROOT/drivers && $BUILDIDX $REPOROOTNOSRC/drivers
50
$BUILDIDX $REPOROOT/drivers && $BUILDIDX $REPOROOTNOSRC/drivers
67
if [ $? -ne 0 ] ; then exit 1 ; fi
51
if [ $? -ne 0 ] ; then exit 1 ; fi
68
$BUILDIDX $REPOROOT/edit && $BUILDIDX $REPOROOTNOSRC/edit
52
$BUILDIDX $REPOROOT/edit && $BUILDIDX $REPOROOTNOSRC/edit
69
if [ $? -ne 0 ] ; then exit 1 ; fi
53
if [ $? -ne 0 ] ; then exit 1 ; fi
70
$BUILDIDX $REPOROOT/emulatrs && $BUILDIDX $REPOROOTNOSRC/emulatrs
54
$BUILDIDX $REPOROOT/emulatrs && $BUILDIDX $REPOROOTNOSRC/emulatrs
71
if [ $? -ne 0 ] ; then exit 1 ; fi
55
if [ $? -ne 0 ] ; then exit 1 ; fi
72
$BUILDIDX $REPOROOT/games && $BUILDIDX $REPOROOTNOSRC/games
56
$BUILDIDX $REPOROOT/games && $BUILDIDX $REPOROOTNOSRC/games
73
if [ $? -ne 0 ] ; then exit 1 ; fi
57
if [ $? -ne 0 ] ; then exit 1 ; fi
74
$BUILDIDX $REPOROOT/net && $BUILDIDX $REPOROOTNOSRC/net
58
$BUILDIDX $REPOROOT/net && $BUILDIDX $REPOROOTNOSRC/net
75
if [ $? -ne 0 ] ; then exit 1 ; fi
59
if [ $? -ne 0 ] ; then exit 1 ; fi
76
$BUILDIDX $REPOROOT/packers && $BUILDIDX $REPOROOTNOSRC/packers
60
$BUILDIDX $REPOROOT/packers && $BUILDIDX $REPOROOTNOSRC/packers
77
if [ $? -ne 0 ] ; then exit 1 ; fi
61
if [ $? -ne 0 ] ; then exit 1 ; fi
78
$BUILDIDX $REPOROOT/sound && $BUILDIDX $REPOROOTNOSRC/sound
62
$BUILDIDX $REPOROOT/sound && $BUILDIDX $REPOROOTNOSRC/sound
79
if [ $? -ne 0 ] ; then exit 1 ; fi
63
if [ $? -ne 0 ] ; then exit 1 ; fi
80
$BUILDIDX $REPOROOT/util && $BUILDIDX $REPOROOTNOSRC/util
64
$BUILDIDX $REPOROOT/util && $BUILDIDX $REPOROOTNOSRC/util
81
if [ $? -ne 0 ] ; then exit 1 ; fi
65
if [ $? -ne 0 ] ; then exit 1 ; fi
82
 
66
 
83
# recompute the listing.txt file
67
# recompute the listing.txt file
84
rm $CDISODIR/listing.txt
68
rm $CDISODIR/listing.txt
85
cat $REPOROOT/base/listing.txt >> $CDISODIR/listing.txt
69
cat $REPOROOT/core/listing.txt >> $CDISODIR/listing.txt
86
cat $REPOROOT/devel/listing.txt >> $CDISODIR/listing.txt
70
cat $REPOROOT/devel/listing.txt >> $CDISODIR/listing.txt
87
cat $REPOROOT/drivers/listing.txt >> $CDISODIR/listing.txt
71
cat $REPOROOT/drivers/listing.txt >> $CDISODIR/listing.txt
88
cat $REPOROOT/edit/listing.txt >> $CDISODIR/listing.txt
72
cat $REPOROOT/edit/listing.txt >> $CDISODIR/listing.txt
89
cat $REPOROOT/emulatrs/listing.txt >> $CDISODIR/listing.txt
73
cat $REPOROOT/emulatrs/listing.txt >> $CDISODIR/listing.txt
90
cat $REPOROOT/games/listing.txt >> $CDISODIR/listing.txt
74
cat $REPOROOT/games/listing.txt >> $CDISODIR/listing.txt
91
cat $REPOROOT/net/listing.txt >> $CDISODIR/listing.txt
75
cat $REPOROOT/net/listing.txt >> $CDISODIR/listing.txt
92
cat $REPOROOT/packers/listing.txt >> $CDISODIR/listing.txt
76
cat $REPOROOT/packers/listing.txt >> $CDISODIR/listing.txt
93
cat $REPOROOT/sound/listing.txt >> $CDISODIR/listing.txt
77
cat $REPOROOT/sound/listing.txt >> $CDISODIR/listing.txt
94
cat $REPOROOT/util/listing.txt >> $CDISODIR/listing.txt
78
cat $REPOROOT/util/listing.txt >> $CDISODIR/listing.txt
95
 
79
 
96
# compute a filename for the ISO files and build it
80
# compute a filename for the ISO files and build it
97
DATESTAMP=`date +%Y%m%d-%H%M`
81
DATESTAMP=`date +%Y%m%d-%H%M`
98
CDISO="$CDISODIR/svarog386-full-$DATESTAMP.iso"
82
CDISO="$CDISODIR/svarog386-full-$DATESTAMP.iso"
99
CDISONOSRC="$CDISODIR/svarog386-nosrc-$DATESTAMP.iso"
83
CDISONOSRC="$CDISODIR/svarog386-nosrc-$DATESTAMP.iso"
100
CDISOMICRO="$CDISODIR/svarog386-micro-$DATESTAMP.iso"
84
CDISOMICRO="$CDISODIR/svarog386-micro-$DATESTAMP.iso"
101
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 -o $CDISO.tmp $CDROOT
102
if [ $? -ne 0 ] ; then exit 1 ; fi
86
if [ $? -ne 0 ] ; then exit 1 ; fi
103
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 -o $CDISONOSRC.tmp $CDROOTNOSRC
104
if [ $? -ne 0 ] ; then exit 1 ; fi
88
if [ $? -ne 0 ] ; then exit 1 ; fi
105
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 -o $CDISOMICRO.tmp $CDROOTMICRO
106
if [ $? -ne 0 ] ; then exit 1 ; fi
90
if [ $? -ne 0 ] ; then exit 1 ; fi
107
mv $CDISO.tmp $CDISO
91
mv $CDISO.tmp $CDISO
108
mv $CDISONOSRC.tmp $CDISONOSRC
92
mv $CDISONOSRC.tmp $CDISONOSRC
109
mv $CDISOMICRO.tmp $CDISOMICRO
93
mv $CDISOMICRO.tmp $CDISOMICRO
110
 
94
 
111
# 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
112
echo "computing md5 sums..."
96
echo "computing md5 sums..."
113
cd `dirname $CDISO`
97
cd `dirname $CDISO`
114
md5sum `basename $CDISO` > $CDISO.md5
98
md5sum `basename $CDISO` > $CDISO.md5
115
 
99
 
116
cd `dirname $CDISONOSRC`
100
cd `dirname $CDISONOSRC`
117
md5sum `basename $CDISONOSRC` > $CDISONOSRC.md5
101
md5sum `basename $CDISONOSRC` > $CDISONOSRC.md5
118
 
102
 
119
cd `dirname $CDISOMICRO`
103
cd `dirname $CDISOMICRO`
120
md5sum `basename $CDISOMICRO` > $CDISOMICRO.md5
104
md5sum `basename $CDISOMICRO` > $CDISOMICRO.md5
121
 
105
 
122
# 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
123
echo "cleaning up old versions..."
107
echo "cleaning up old versions..."
124
ls -tp $CDISODIR/svarog386-*-*.iso* | tail -n +17 | xargs -I {} rm -- {}
108
ls -tp $CDISODIR/svarog386-*-*.iso* | tail -n +17 | xargs -I {} rm -- {}
125
 
109
 
126
cd "$origdir"
110
cd "$origdir"
127
 
111
 
128
echo "all done!"
112
echo "all done!"
129
 
113
 
130
exit 0
114
exit 0
131
 
115