Subversion Repositories SvarDOS

Rev

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

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