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