Subversion Repositories SvarDOS

Rev

Rev 112 | Rev 148 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 112 Rev 134
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/bash
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
REPOROOTSRC='/srv/www/svarog386.viste.fr/repos-src/'
11
REPOROOTNOSRC='/srv/www/svarog386.viste.fr/repos-nosrc/'
12
REPOROOTNOSRC='/srv/www/svarog386.viste.fr/repos-nosrc/'
12
BUILDIDX='/root/fdnpkg-buildidx/buildidx'
13
BUILDIDX='/root/fdnpkg-buildidx/buildidx'
13
CDISODIR='/srv/www/svarog386.viste.fr/'
14
CDISODIR='/srv/www/svarog386.viste.fr/'
14
CDISODIRTEST='/srv/www/svarog386.viste.fr/test/'
15
CDISODIRTEST='/srv/www/svarog386.viste.fr/test/'
15
CDROOT='/root/svarog386/cdroot'
16
CDROOT='/root/svarog386/cdroot'
Line 17... Line 18...
17
CDROOTMICRO='/root/svarog386/cdrootmicro'
18
CDROOTMICRO='/root/svarog386/cdrootmicro'
18
CUSTFILES='/root/svarog386/files'
19
CUSTFILES='/root/svarog386/files'
19
 
20
 
20
### parameters block ends here ##############################################
21
### parameters block ends here ##############################################
21
 
22
 
-
 
23
# function to be called with the repository (short) name as argument
-
 
24
function dorepo {
-
 
25
  repodir=$1
-
 
26
  # switch to repo's dir
-
 
27
  cd $REPOROOT/$repodir
-
 
28
  # duplicate all zip files as zib
-
 
29
  for f in *.zip
-
 
30
  do
-
 
31
  cp -p $f `basename -s .zip $f`.zib
-
 
32
  done
-
 
33
  # now strip the sources from the 'zib' versions
-
 
34
  find $REPOROOT/$repodir -iname '*.zib' -exec zip "{}" -d "SOURCE/*" ';'
-
 
35
  find $REPOROOT/$repodir -iname '*.zib' -exec zip "{}" -d "source/*" ';'
-
 
36
  find $REPOROOT/$repodir -iname '*.zib' -exec zip "{}" -d "Source/*" ';'
-
 
37
 
-
 
38
  # build idx for the full (net) repo
-
 
39
  $BUILDIDX $REPOROOT/$repodir
-
 
40
  # copy listing into the global listing
-
 
41
  cat $REPOROOT/$repodir/listing.txt >> $CDISODIR/listing.txt
-
 
42
 
-
 
43
  # compute links for the 'no source' version
-
 
44
  mkdir -p $REPOROOTNOSRC/$repodir
-
 
45
  cd $REPOROOTNOSRC/$repodir
-
 
46
  if [ $? -ne 0 ] ; then exit 1 ; fi
-
 
47
  rm *.zip *.zib
-
 
48
  for f in $REPOROOT/$repodir/*.zib
-
 
49
  do
-
 
50
  ln -s "$f" `basename -s .zib $f`.zip
-
 
51
  done
-
 
52
  # build idx for the 'no source' version
-
 
53
  $BUILDIDX $REPOROOTNOSRC/$repodir
-
 
54
 
-
 
55
  # compute links for the 'with source' (but no zib) version
-
 
56
  mkdir -p $REPOROOTSRC/$repodir
-
 
57
  cd $REPOROOTSRC/$repodir
-
 
58
  if [ $? -ne 0 ] ; then exit 1 ; fi
-
 
59
  rm *.zip *.zib
-
 
60
  for f in $REPOROOT/$repodir/*.zip
-
 
61
  do
-
 
62
  ln -s "$f" `basename $f`
-
 
63
  done
-
 
64
  # build idx for the 'no source' version
-
 
65
  $BUILDIDX $REPOROOTSRC/$repodir
-
 
66
}
-
 
67
 
-
 
68
### actual code flow starts here ############################################
-
 
69
 
-
 
70
 
22
TESTMODE=0
71
TESTMODE=0
23
if [ "x$1" = "xprod" ]; then
72
if [ "x$1" = "xprod" ]; then
24
  TESTMODE=0
73
  TESTMODE=0
25
elif [ "x$1" = "xtest" ]; then
74
elif [ "x$1" = "xtest" ]; then
26
  TESTMODE=1
75
  TESTMODE=1
Line 32... Line 81...
32
fi
81
fi
33
 
82
 
34
# remember where we are, so we can return there once all is done
83
# remember where we are, so we can return there once all is done
35
origdir=`pwd`
84
origdir=`pwd`
36
 
85
 
37
# clone the repositories into future 'no source' versions
-
 
38
echo "cloning $REPOROOT to $REPOROOTNOSRC..."
-
 
39
rsync -a --delete $REPOROOT $REPOROOTNOSRC
-
 
40
if [ $? -ne 0 ] ; then exit 1 ; fi
-
 
41
 
-
 
42
# build the boot floppy image first
86
# build the boot floppy image first
43
cp $CUSTFILES/bootmini.img $CDROOT/boot.img
87
cp $CUSTFILES/bootmini.img $CDROOT/boot.img
44
export MTOOLS_NO_VFAT=1
88
export MTOOLS_NO_VFAT=1
45
mcopy -sQm -i $CDROOT/boot.img $CUSTFILES/floppy/* ::/
89
mcopy -sQm -i $CDROOT/boot.img $CUSTFILES/floppy/* ::/
46
 
90
 
Line 50... Line 94...
50
cp $CDROOT/boot.img $CDROOTMICRO/
94
cp $CDROOT/boot.img $CDROOTMICRO/
51
if [ $? -ne 0 ] ; then exit 1 ; fi
95
if [ $? -ne 0 ] ; then exit 1 ; fi
52
cp $CDROOT/boot.img $CDISODIR/
96
cp $CDROOT/boot.img $CDISODIR/
53
if [ $? -ne 0 ] ; then exit 1 ; fi
97
if [ $? -ne 0 ] ; then exit 1 ; fi
54
 
98
 
55
# now strip the sources from the 'no source' clone
-
 
56
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
-
 
57
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "source/*" ';'
99
# remove the 'human' listing (will be regenerated in a short moment)
58
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
100
rm $CDISODIR/listing.txt
59
 
101
 
60
# refresh all repositories
102
# process all repos (also builds the listing.txt file)
61
$BUILDIDX $REPOROOT/core && $BUILDIDX $REPOROOTNOSRC/core
-
 
62
if [ $? -ne 0 ] ; then exit 1 ; fi
103
dorepo core
63
$BUILDIDX $REPOROOT/devel && $BUILDIDX $REPOROOTNOSRC/devel
-
 
64
if [ $? -ne 0 ] ; then exit 1 ; fi
104
dorepo devel
65
$BUILDIDX $REPOROOT/drivers && $BUILDIDX $REPOROOTNOSRC/drivers
-
 
66
if [ $? -ne 0 ] ; then exit 1 ; fi
105
dorepo drivers
67
$BUILDIDX $REPOROOT/edit && $BUILDIDX $REPOROOTNOSRC/edit
-
 
68
if [ $? -ne 0 ] ; then exit 1 ; fi
106
dorepo edit
69
$BUILDIDX $REPOROOT/emulatrs && $BUILDIDX $REPOROOTNOSRC/emulatrs
-
 
70
if [ $? -ne 0 ] ; then exit 1 ; fi
107
dorepo emulatrs
71
$BUILDIDX $REPOROOT/games && $BUILDIDX $REPOROOTNOSRC/games
-
 
72
if [ $? -ne 0 ] ; then exit 1 ; fi
108
dorepo games
73
$BUILDIDX $REPOROOT/net && $BUILDIDX $REPOROOTNOSRC/net
-
 
74
if [ $? -ne 0 ] ; then exit 1 ; fi
109
dorepo net
75
$BUILDIDX $REPOROOT/packers && $BUILDIDX $REPOROOTNOSRC/packers
-
 
76
if [ $? -ne 0 ] ; then exit 1 ; fi
110
dorepo packers
77
$BUILDIDX $REPOROOT/sound && $BUILDIDX $REPOROOTNOSRC/sound
-
 
78
if [ $? -ne 0 ] ; then exit 1 ; fi
111
dorepo sound
79
$BUILDIDX $REPOROOT/util && $BUILDIDX $REPOROOTNOSRC/util
-
 
80
if [ $? -ne 0 ] ; then exit 1 ; fi
112
dorepo util
81
 
113
 
82
# recompute the listing.txt file
-
 
83
rm $CDISODIR/listing.txt
-
 
84
cat $REPOROOT/core/listing.txt >> $CDISODIR/listing.txt
-
 
85
cat $REPOROOT/devel/listing.txt >> $CDISODIR/listing.txt
-
 
86
cat $REPOROOT/drivers/listing.txt >> $CDISODIR/listing.txt
-
 
87
cat $REPOROOT/edit/listing.txt >> $CDISODIR/listing.txt
-
 
88
cat $REPOROOT/emulatrs/listing.txt >> $CDISODIR/listing.txt
-
 
89
cat $REPOROOT/games/listing.txt >> $CDISODIR/listing.txt
-
 
90
cat $REPOROOT/net/listing.txt >> $CDISODIR/listing.txt
-
 
91
cat $REPOROOT/packers/listing.txt >> $CDISODIR/listing.txt
-
 
92
cat $REPOROOT/sound/listing.txt >> $CDISODIR/listing.txt
-
 
93
cat $REPOROOT/util/listing.txt >> $CDISODIR/listing.txt
-
 
94
 
114
 
95
# compute a filename for the ISO files and build it
115
# compute a filename for the ISO files and build it
96
DATESTAMP=`date +%Y%m%d-%H%M`
116
DATESTAMP=`date +%Y%m%d-%H%M`
97
CDISO="$CDISODIR/svarog386-full-$DATESTAMP.iso"
117
CDISO="$CDISODIR/svarog386-full-$DATESTAMP.iso"
98
CDISONOSRC="$CDISODIR/svarog386-nosrc-$DATESTAMP.iso"
118
CDISONOSRC="$CDISODIR/svarog386-nosrc-$DATESTAMP.iso"