Subversion Repositories SvarDOS

Rev

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

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