Ticket #56: buildrepo

File buildrepo, 1.8 KB (added by Joachim Langenbach, 14 years ago)

Script to build repository for multi binary packages with release files for each architecture

Line 
1#!/bin/bash
2
3# which architectures are used
4ARCHS=("i386" "amd64" "ia64")
5
6# creates the relase file for each architecture, which contains informations about the repository
7# this is not the same as the Release file at the end of this script
8function makeRelease () {
9 echo " Release"
10 if [ -z "${1}" ]
11 then
12 echo " Please call with a Architecture as first argument"
13 exit 1
14 fi
15 if [ "${1}" = "Source" ]
16 then
17 # we have a source mirror here
18 RELFILE="dists/10.04/contrib/source/Release"
19 else
20 RELFILE="dists/10.04/contrib/binary-${1}/Release"
21 fi
22 if [ ! -e "${RELFILE}" ]; then
23 echo "Archive: unstable" > "${RELFILE}"
24 echo "Component: contrib" >> "${RELFILE}"
25 echo "Origin: EngSaS" >> "${RELFILE}"
26 echo "Label: Engineering Solutions and Services Langenbach" >> "${RELFILE}"
27 echo "Architecture: ${1}" >> "${RELFILE}"
28 fi
29}
30
31# the fisrt parameter is the directory, which contains the repository
32# related to pb it's the distribution folder like ubuntu
33if [ ! -d "${1}" ]
34then
35 echo "Please set an directory";
36 exit 1;
37fi
38
39CURDIR=`pwd`
40cd "${1}"
41
42for ARCH in ${ARCHS[*]}
43do
44 echo "Processing $ARCH"
45
46 # Packages.* erzeugen
47 echo " Packages.gz|bz2"
48 apt-ftparchive packages "10.04" | gzip > "dists/10.04/contrib/binary-$ARCH/Packages.gz"
49 apt-ftparchive packages "10.04" | bzip2 > "dists/10.04/contrib/binary-$ARCH/Packages.bz2"
50
51 # Contents erzeugen
52 echo " Contents-$ARCH.gz"
53 apt-ftparchive contents "10.04" | gzip > "dists/10.04/Contents-$ARCH.gz"
54
55 # Release file
56 makeRelease "${ARCH}"
57
58 i=$[$i+1]
59done
60
61# Source packages
62echo "Source"
63echo " Source.gz"
64apt-ftparchive sources "10.04" | gzip > "dists/10.04/contrib/source/Sources.gz"
65makeRelease "Source"
66
67# release file
68echo "Release"
69apt-ftparchive release "dists/10.04" > "dists/10.04/Release"
70
71cd "${CURDIR}"
72exit 0;