~ubuntu-branches/ubuntu/gutsy/debootstrap/gutsy-backports

« back to all changes in this revision

Viewing changes to sid.buildd

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson, warty
  • Date: 2004-10-13 00:02:10 UTC
  • Revision ID: james.westby@ubuntu.com-20041013000210-6kxir6wy5l3x0qm0
Tags: 0.2.39ubuntu22
[warty] Remove pcmcia-cs from Base.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
mirror_style release
 
2
download_style apt
 
3
 
 
4
work_out_debs () {
 
5
 
 
6
    required="base-files base-passwd bash bsdutils coreutils debianutils diff dpkg dselect e2fslibs e2fsprogs findutils gcc-3.3-base grep gzip hostname initscripts libacl1 libattr1 libblkid1 libc6 libcap1 libcomerr2 libdb1-compat libdb3 libgcc1 libncurses5 libpam-modules libpam-runtime libpam0g libss2 libstdc++5 libuuid1 login mawk mount ncurses-base ncurses-bin perl-base sed slang1a-utf8 sysv-rc sysvinit tar util-linux zlib1g"
 
7
 
 
8
    base="apt binutils cpio cpp cpp-3.3 dpkg-dev g++ g++-3.3 gcc gcc-3.3 libc6-dev libdb4.2 libgdbm3 libstdc++5-3.3-dev linux-kernel-headers make patch perl perl-modules $additional"
 
9
 
 
10
    without_package () {
 
11
        echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
 
12
    }
 
13
    subst_package () {
 
14
        echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' '
 
15
    }
 
16
 
 
17
    LIBC6=libc6
 
18
 
 
19
    case $ARCH in
 
20
        "alpha")
 
21
            required="$(subst_package "libc6" "libc6.1" "$required")"
 
22
            base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")"
 
23
            LIBC6="libc6.1"
 
24
            ;;
 
25
        "arm")
 
26
            ;;
 
27
        "i386")
 
28
            ;;
 
29
        "ia64")
 
30
            required="$(subst_package "libc6" "libc6.1" "$required")"
 
31
            base="$(without_package "libc6-dev" "libc6.1-dev" "$base")"
 
32
            LIBC6="libc6.1"
 
33
            ;;
 
34
        "m68k")
 
35
            ;;
 
36
        "powerpc")
 
37
            ;;
 
38
        "sparc")
 
39
            ;;
 
40
        "mips")
 
41
            ;;
 
42
        "mipsel")
 
43
            ;;
 
44
        "hppa")
 
45
            ;;
 
46
        s390|s390x)
 
47
            ;;
 
48
        sh*)
 
49
            ;;
 
50
        *)
 
51
            # who knows?
 
52
            ;;
 
53
    esac
 
54
 
 
55
    all_debs="$required $base"
 
56
 
 
57
    for x in $exclude; do
 
58
      all_debs="$(without_package "$x" "$all_debs")"
 
59
    done
 
60
    
 
61
}
 
62
 
 
63
install_debs () {
 
64
    first_stage_install
 
65
    second_stage_install
 
66
}
 
67
 
 
68
first_stage_install () {
 
69
    extract $required
 
70
 
 
71
    mkdir -p "$TARGET/var/lib/dpkg"
 
72
    : >"$TARGET/var/lib/dpkg/status"
 
73
    : >"$TARGET/var/lib/dpkg/available"
 
74
 
 
75
    setup_etc
 
76
    if [ ! -e "$TARGET/etc/fstab" ]; then
 
77
        echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
 
78
        chown 0.0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
 
79
    fi
 
80
 
 
81
    setup_proc
 
82
    setup_devices
 
83
 
 
84
    in_target /sbin/ldconfig
 
85
 
 
86
    p () {
 
87
        baseprog="$(($baseprog + ${1:-1}))"
 
88
    }
 
89
 
 
90
    x_feign_install () {
 
91
        local pkg="$1"
 
92
        local deb="$(debfor $pkg)"
 
93
        local ver="$(
 
94
            ar -p "$TARGET/$deb" control.tar.gz | zcat |
 
95
                tar -O -xf - control ./control 2>/dev/null |
 
96
                sed -ne 's/^Version: *//Ip' | head -n 1
 
97
        )"
 
98
 
 
99
        mkdir -p "$TARGET/var/lib/dpkg/info"
 
100
 
 
101
        echo \
 
102
"Package: $pkg
 
103
Version: $ver
 
104
Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
 
105
 
 
106
        touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
 
107
    }
 
108
 
 
109
    x_feign_install dpkg
 
110
}
 
111
 
 
112
second_stage_install () {
 
113
    x_core_install () {
 
114
        smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
 
115
    }
 
116
 
 
117
    DEBIAN_FRONTEND=noninteractive
 
118
    export DEBIAN_FRONTEND
 
119
 
 
120
    baseprog=0
 
121
    bases=40
 
122
 
 
123
    p; progress $baseprog $bases INSTBASE "Installing base system" #1
 
124
    info INSTCORE "Installing core packages..."
 
125
 
 
126
    p; progress $baseprog $bases INSTBASE "Installing base system" #2
 
127
    ln -sf mawk $TARGET/usr/bin/awk
 
128
    x_core_install base-files base-passwd
 
129
    p; progress $baseprog $bases INSTBASE "Installing base system" #3
 
130
    x_core_install dpkg
 
131
 
 
132
    if [ ! -e "$TARGET/etc/localtime" ]; then
 
133
        ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
 
134
    fi
 
135
 
 
136
    p; progress $baseprog $bases INSTBASE "Installing base system" #4
 
137
    x_core_install $LIBC6
 
138
 
 
139
    p; progress $baseprog $bases INSTBASE "Installing base system" #5
 
140
    x_core_install perl-base
 
141
    p; progress $baseprog $bases INSTBASE "Installing base system" #6
 
142
    rm $TARGET/usr/bin/awk
 
143
    x_core_install mawk
 
144
    p; progress $baseprog $bases INSTBASE "Installing base system" #7
 
145
 
 
146
    info UNPACKREQ "Unpacking required packages..."
 
147
 
 
148
    p; progress $baseprog $bases INSTBASE "Installing base system" #8
 
149
    smallyes '' | repeat 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages.  This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required)
 
150
    p 10; progress $baseprog $bases INSTBASE "Installing base system" #18
 
151
 
 
152
    info CONFREQ "Configuring required packages..."
 
153
 
 
154
    mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
 
155
    echo \
 
156
"#!/bin/sh
 
157
echo
 
158
echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
 
159
    chmod 755 "$TARGET/sbin/start-stop-daemon"
 
160
 
 
161
    setup_dselect_method apt
 
162
    #on_exit "in_target_nofail umount /dev/pts"
 
163
 
 
164
    p; progress $baseprog $bases INSTBASE "Installing base system" #19
 
165
    smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends
 
166
    p 10; progress $baseprog $bases INSTBASE "Installing base system" #29 
 
167
 
 
168
    info INSTBASE "Installing base packages..."
 
169
 
 
170
    p; progress $baseprog $bases INSTBASE "Installing base system" #30
 
171
    smallyes '' | repeat 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages.  This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base)
 
172
 
 
173
    smallyes '' | repeat 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages.  This will be attempted 5 times." "" dpkg  --force-confold --skip-same-version  --configure -a
 
174
 
 
175
    p 9; progress $baseprog $bases INSTBASE "Installing base system" #39
 
176
 
 
177
    mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
 
178
 
 
179
    progress $bases $bases INSTBASE "Installing base system" #40
 
180
    info BASESUCCESS "Base system installed successfully."
 
181
}