| 1 | #!/bin/bash
|
|---|
| 2 |
|
|---|
| 3 | # which architectures are used
|
|---|
| 4 | ARCHS=("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
|
|---|
| 8 | function 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
|
|---|
| 33 | if [ ! -d "${1}" ]
|
|---|
| 34 | then
|
|---|
| 35 | echo "Please set an directory";
|
|---|
| 36 | exit 1;
|
|---|
| 37 | fi
|
|---|
| 38 |
|
|---|
| 39 | CURDIR=`pwd`
|
|---|
| 40 | cd "${1}"
|
|---|
| 41 |
|
|---|
| 42 | for ARCH in ${ARCHS[*]}
|
|---|
| 43 | do
|
|---|
| 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]
|
|---|
| 59 | done
|
|---|
| 60 |
|
|---|
| 61 | # Source packages
|
|---|
| 62 | echo "Source"
|
|---|
| 63 | echo " Source.gz"
|
|---|
| 64 | apt-ftparchive sources "10.04" | gzip > "dists/10.04/contrib/source/Sources.gz"
|
|---|
| 65 | makeRelease "Source"
|
|---|
| 66 |
|
|---|
| 67 | # release file
|
|---|
| 68 | echo "Release"
|
|---|
| 69 | apt-ftparchive release "dists/10.04" > "dists/10.04/Release"
|
|---|
| 70 |
|
|---|
| 71 | cd "${CURDIR}"
|
|---|
| 72 | exit 0;
|
|---|