Subversion Repositories SvarDOS

Rev

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

Rev 24 Rev 25
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
 
17
 
18
### parameters block ends here ##############################################
18
### parameters block ends here ##############################################
19
 
19
 
20
# remember where we are, so we can return there once all is done
20
# remember where we are, so we can return there once all is done
21
origdir=`pwd`
21
origdir=`pwd`
22
 
22
 
23
# clone the repositories into future 'no source' versions
23
# clone the repositories into future 'no source' versions
24
echo "cloning $REPOROOT to $REPOROOTNOSRC..."
24
echo "cloning $REPOROOT to $REPOROOTNOSRC..."
25
rsync -a --delete $REPOROOT $REPOROOTNOSRC
25
rsync -a --delete $REPOROOT $REPOROOTNOSRC
26
if [ $? -ne 0 ] ; then exit 1 ; fi
26
if [ $? -ne 0 ] ; then exit 1 ; fi
27
 
27
 
28
# sync the boot.img file from full version to nosrc and micro
28
# sync the boot.img file from full version to nosrc and micro
29
cp $CDROOT/boot.img $CDROOTNOSRC/
29
cp $CDROOT/boot.img $CDROOTNOSRC/
30
if [ $? -ne 0 ] ; then exit 1 ; fi
30
if [ $? -ne 0 ] ; then exit 1 ; fi
31
cp $CDROOT/boot.img $CDROOTMICRO/
31
cp $CDROOT/boot.img $CDROOTMICRO/
32
if [ $? -ne 0 ] ; then exit 1 ; fi
32
if [ $? -ne 0 ] ; then exit 1 ; fi
33
 
33
 
34
# now strip the sources from the 'no source' clone
34
# now strip the sources from the 'no source' clone
35
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
35
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
36
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "source/*" ';'
36
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "source/*" ';'
37
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
37
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
38
 
38
 
39
# refresh all repositories
39
# refresh all repositories
40
cd "$REPOROOT"
-
 
41
rm listing.txt
-
 
42
$BUILDIDX $REPOROOT/base && $BUILDIDX $REPOROOTNOSRC/base
40
$BUILDIDX $REPOROOT/base && $BUILDIDX $REPOROOTNOSRC/base
43
if [ $? -ne 0 ] ; then exit 1 ; fi
41
if [ $? -ne 0 ] ; then exit 1 ; fi
44
$BUILDIDX $REPOROOT/devel && $BUILDIDX $REPOROOTNOSRC/devel
42
$BUILDIDX $REPOROOT/devel && $BUILDIDX $REPOROOTNOSRC/devel
45
if [ $? -ne 0 ] ; then exit 1 ; fi
43
if [ $? -ne 0 ] ; then exit 1 ; fi
46
$BUILDIDX $REPOROOT/drivers && $BUILDIDX $REPOROOTNOSRC/drivers
44
$BUILDIDX $REPOROOT/drivers && $BUILDIDX $REPOROOTNOSRC/drivers
47
if [ $? -ne 0 ] ; then exit 1 ; fi
45
if [ $? -ne 0 ] ; then exit 1 ; fi
48
$BUILDIDX $REPOROOT/edit && $BUILDIDX $REPOROOTNOSRC/edit
46
$BUILDIDX $REPOROOT/edit && $BUILDIDX $REPOROOTNOSRC/edit
49
if [ $? -ne 0 ] ; then exit 1 ; fi
47
if [ $? -ne 0 ] ; then exit 1 ; fi
50
$BUILDIDX $REPOROOT/emulatrs && $BUILDIDX $REPOROOTNOSRC/emulatrs
48
$BUILDIDX $REPOROOT/emulatrs && $BUILDIDX $REPOROOTNOSRC/emulatrs
51
if [ $? -ne 0 ] ; then exit 1 ; fi
49
if [ $? -ne 0 ] ; then exit 1 ; fi
52
$BUILDIDX $REPOROOT/games && $BUILDIDX $REPOROOTNOSRC/games
50
$BUILDIDX $REPOROOT/games && $BUILDIDX $REPOROOTNOSRC/games
53
if [ $? -ne 0 ] ; then exit 1 ; fi
51
if [ $? -ne 0 ] ; then exit 1 ; fi
54
$BUILDIDX $REPOROOT/net && $BUILDIDX $REPOROOTNOSRC/net
52
$BUILDIDX $REPOROOT/net && $BUILDIDX $REPOROOTNOSRC/net
55
if [ $? -ne 0 ] ; then exit 1 ; fi
53
if [ $? -ne 0 ] ; then exit 1 ; fi
56
$BUILDIDX $REPOROOT/packers && $BUILDIDX $REPOROOTNOSRC/packers
54
$BUILDIDX $REPOROOT/packers && $BUILDIDX $REPOROOTNOSRC/packers
57
if [ $? -ne 0 ] ; then exit 1 ; fi
55
if [ $? -ne 0 ] ; then exit 1 ; fi
58
$BUILDIDX $REPOROOT/sound && $BUILDIDX $REPOROOTNOSRC/sound
56
$BUILDIDX $REPOROOT/sound && $BUILDIDX $REPOROOTNOSRC/sound
59
if [ $? -ne 0 ] ; then exit 1 ; fi
57
if [ $? -ne 0 ] ; then exit 1 ; fi
60
$BUILDIDX $REPOROOT/util && $BUILDIDX $REPOROOTNOSRC/util
58
$BUILDIDX $REPOROOT/util && $BUILDIDX $REPOROOTNOSRC/util
61
if [ $? -ne 0 ] ; then exit 1 ; fi
59
if [ $? -ne 0 ] ; then exit 1 ; fi
62
 
60
 
-
 
61
# recompute the listing.txt file
-
 
62
rm $CDISODIR/listing.txt
-
 
63
cat $REPOROOT/base/listing.txt >> $CDISODIR/listing.txt
-
 
64
cat $REPOROOT/devel/listing.txt >> $CDISODIR/listing.txt
-
 
65
cat $REPOROOT/drivers/listing.txt >> $CDISODIR/listing.txt
-
 
66
cat $REPOROOT/edit/listing.txt >> $CDISODIR/listing.txt
-
 
67
cat $REPOROOT/emulatrs/listing.txt >> $CDISODIR/listing.txt
-
 
68
cat $REPOROOT/games/listing.txt >> $CDISODIR/listing.txt
-
 
69
cat $REPOROOT/net/listing.txt >> $CDISODIR/listing.txt
-
 
70
cat $REPOROOT/packers/listing.txt >> $CDISODIR/listing.txt
-
 
71
cat $REPOROOT/sound/listing.txt >> $CDISODIR/listing.txt
-
 
72
cat $REPOROOT/util/listing.txt >> $CDISODIR/listing.txt
-
 
73
 
63
# compute a filename for the ISO files and build it
74
# compute a filename for the ISO files and build it
64
DATESTAMP=`date +%Y%m%d-%H%M`
75
DATESTAMP=`date +%Y%m%d-%H%M`
65
CDISO="$CDISODIR/svarog386-full-$DATESTAMP.iso"
76
CDISO="$CDISODIR/svarog386-full-$DATESTAMP.iso"
66
CDISONOSRC="$CDISODIR/svarog386-nosrc-$DATESTAMP.iso"
77
CDISONOSRC="$CDISODIR/svarog386-nosrc-$DATESTAMP.iso"
67
CDISOMICRO="$CDISODIR/svarog386-micro-$DATESTAMP.iso"
78
CDISOMICRO="$CDISODIR/svarog386-micro-$DATESTAMP.iso"
68
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISO.tmp $CDROOT
79
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISO.tmp $CDROOT
69
if [ $? -ne 0 ] ; then exit 1 ; fi
80
if [ $? -ne 0 ] ; then exit 1 ; fi
70
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISONOSRC.tmp $CDROOTNOSRC
81
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISONOSRC.tmp $CDROOTNOSRC
71
if [ $? -ne 0 ] ; then exit 1 ; fi
82
if [ $? -ne 0 ] ; then exit 1 ; fi
72
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISOMICRO.tmp $CDROOTMICRO
83
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISOMICRO.tmp $CDROOTMICRO
73
if [ $? -ne 0 ] ; then exit 1 ; fi
84
if [ $? -ne 0 ] ; then exit 1 ; fi
74
mv $CDISO.tmp $CDISO
85
mv $CDISO.tmp $CDISO
75
mv $CDISONOSRC.tmp $CDISONOSRC
86
mv $CDISONOSRC.tmp $CDISONOSRC
76
mv $CDISOMICRO.tmp $CDISOMICRO
87
mv $CDISOMICRO.tmp $CDISOMICRO
77
 
88
 
78
# compute the MD5 of the ISO files, taking care to include only the filename in it
89
# compute the MD5 of the ISO files, taking care to include only the filename in it
79
echo "computing md5 sums..."
90
echo "computing md5 sums..."
80
cd `dirname $CDISO`
91
cd `dirname $CDISO`
81
md5sum `basename $CDISO` > $CDISO.md5
92
md5sum `basename $CDISO` > $CDISO.md5
82
 
93
 
83
cd `dirname $CDISONOSRC`
94
cd `dirname $CDISONOSRC`
84
md5sum `basename $CDISONOSRC` > $CDISONOSRC.md5
95
md5sum `basename $CDISONOSRC` > $CDISONOSRC.md5
85
 
96
 
86
cd `dirname $CDISOMICRO`
97
cd `dirname $CDISOMICRO`
87
md5sum `basename $CDISOMICRO` > $CDISOMICRO.md5
98
md5sum `basename $CDISOMICRO` > $CDISOMICRO.md5
88
 
99
 
89
cd "$origdir"
100
cd "$origdir"
90
 
101
 
91
echo "all done!"
102
echo "all done!"
92
 
103
 
93
exit 0
104
exit 0
94
 
105