File: installtools.sh

package info (click to toggle)
debian-cd 3.2.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,848 kB
  • sloc: sh: 6,129; perl: 4,129; makefile: 413
file content (74 lines) | stat: -rwxr-xr-x 2,278 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
# Install files in /install and some in /doc

set -e

if [ "$RELEASE_NOTES_LOCATION"x = ""x ] ; then
	export RELEASE_NOTES_LOCATION="https://www.debian.org/releases/$CODENAME"
fi

# The location of the tree for CD#1, passed in
DIR=$1
ARCHES="$2"
NUM_ARCHES=`echo $ARCHES | wc -w`

if [ "$OMIT_MANUAL" != 1 ]; then
	DOCDIR=doc
	MANTDIR=$TDIR/installguide

	for ARCH in $ARCHES
	do
		if [ $ARCH != source ] ; then
			if [ $NUM_ARCHES = 1 ] ; then
				INSTALLDIR=$DIR/$DOCDIR/manual
			else
				INSTALLDIR=$DIR/$DOCDIR/manual/$ARCH
			fi

            INSTALLGUIDE=$($BASEDIR/tools/catz $MIRROR/dists/$CODENAME/main/binary-$ARCH//Packages.*z* | \
                sed -n "s/Filename: \(pool\/main\/i\/installation-guide\/installation-guide-$ARCH.*deb\)$/\1/p" | sort | uniq)

            if [ -f "$MIRROR/$INSTALLGUIDE" ]; then
                rm -rf $MANTDIR
                # Extract documentation from package
                dpkg -x $MIRROR/$INSTALLGUIDE $MANTDIR || true
                if [ -d $MANTDIR/usr/share/doc/installation-guide-$ARCH/ ]; then
                    cd $MANTDIR/usr/share/doc/installation-guide-$ARCH
                    rm -f changelog* copyright
                    find . -name '*.gz' | xargs gunzip || true

                    mkdir -p $INSTALLDIR
                    if ! cp -a * $INSTALLDIR; then
                        echo "ERROR: Unable to copy installer documentation to CD."
                    fi
                else
                    echo "ERROR: installation-guide package not unpacked correctly."
               fi
            else
                echo "ERROR: package installation-guide-$ARCH not found."
            fi
		fi
	done
fi

if [ "$OMIT_RELEASE_NOTES"x = "1"x ]; then
	echo "  Omitting release notes, as requested"
else
	for ARCH in $ARCHES
	do
		if [ $ARCH != source ] ; then
			RN=$DIR/doc/release-notes
			mkdir -p $RN
			cd $RN
			echo "  Downloading most recent release notes for $ARCH"
			$WGET $RELEASE_NOTES_LOCATION/release-notes-$ARCH.tar.gz
			if [ -e release-notes-$ARCH.tar.gz ] ; then
				tar xzvf release-notes-$ARCH.tar.gz
				rm -f release-notes-$ARCH.tar.gz
				rm -f */*.ps
			else
				echo "    No release notes found at $RELEASE_NOTES_LOCATION/release-notes-$ARCH.tar.gz"
			fi
		fi
	done
fi