~ubuntu-branches/ubuntu/hardy/debootstrap/hardy-backports

« back to all changes in this revision

Viewing changes to scripts/debian/potato

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador, Otavio Salvador, Guillem Jover, Frans Pop, Joey Hess
  • Date: 2010-02-21 23:11:06 UTC
  • mto: (0.1.7 maverick)
  • mto: This revision was merged to the branch mainline in revision 33.
  • Revision ID: james.westby@ubuntu.com-20100221231106-leq9wi54r2kbxyjk
Tags: 1.0.21
[ Otavio Salvador ]
* Apply patch from Clint Adams <schizo@debian.org> to add support for
  gz/bz2/xz data.tar (closes: #458663).

[ Guillem Jover ]
* Refactor deb extractors into two new functions.
* Use dpkg-deb if available instead of ar (closes: #557296).
* Add an --extractor option to override the automatic extractor selection.

[ Otavio Salvador ]
* Document new --extractor option in manpage.
* Apply patch from Vagrant Cascadian <vagrant+bugs@freegeek.org> not
  fail if resolv.conf is a broken symlink (closes: #390647).

[ Frans Pop ]
* Use tab indentation in scripts/debian/sid to reduce its size (relevant
  for Debian Installer).
* Add apt to base packages for the buildd variant as it is no longer marked
  Build-Essential.

[ Otavio Salvador ]
* Apply patch from Andres Salomon <dilinger@collabora.co.uk> to honor
  --components when using mirror_style 'main' (closes: #561283).
* Apply patch from Andres Salomon <dilinger@collabora.co.uk> to fix
  iteration through components in download_main (closes: #561298).

[ Joey Hess ]
* Allow the suite to be stable, testing, or unstable when debootstrapping
  Debian. Closes: #288109
* Make scripts directory in source tree look like installed directory,
  and add a section to README explaining an easy way to run
  debootstrap w/o installing it. Closes: #345762
* Convert rules file to use dh with overrides.
* Remove binary-basedebs target from debian/rules.
  This target has been broken in multiple ways since 2007. While I
  accidentially partially fixed it with the above changes, this is evidence
  it's dead code that can be safely removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
mirror_style release
2
 
download_style apt var-state
3
 
 
4
 
LIBC=libc6
5
 
if [ "$ARCH" = alpha ]; then
6
 
  LIBC="libc6.1"
7
 
fi
8
 
 
9
 
work_out_debs () {
10
 
    required="base-files base-passwd bash bsdutils debconf-tiny debianutils diff dpkg e2fsprogs fileutils findutils grep gzip hostname ldso libc6 libdb2 libgdbmg1 libncurses5 libnewt0 libpam-modules libpam-runtime libpam0g libpopt0 libreadline4 libstdc++2.10 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-5.005-base perl-base procps sed shellutils slang1 sysklogd sysvinit tar textutils update util-linux whiptail"
11
 
 
12
 
    base="adduser ae apt base-config elvis-tiny fbset fdutils gettext-base console-data console-tools console-tools-libs libdb2 libwrap0 locales modconf netbase ftp ppp pppconfig pump tasksel tcpd textutils telnet xviddetect"
13
 
 
14
 
    without_package () {
15
 
        echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
16
 
    }
17
 
 
18
 
    case $ARCH in
19
 
      "alpha")
20
 
        required="$(without_package "libc6" "$required") libc6.1"
21
 
        ;;
22
 
      "i386")
23
 
        base="$base fdflush isapnptools lilo mbr pciutils pcmcia-cs psmisc setserial syslinux"
24
 
        ;;
25
 
       *)
26
 
        # other arches may have special needs not yet represented here
27
 
        # oh well, Potato is old
28
 
    esac
29
 
}
30
 
 
31
 
first_stage_install () {
32
 
    extract $required
33
 
 
34
 
    :> "$TARGET/var/lib/dpkg/status"
35
 
    echo > "$TARGET/var/lib/dpkg/available"
36
 
 
37
 
    setup_etc
38
 
    echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
39
 
    chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
40
 
 
41
 
    setup_devices
42
 
 
43
 
    x_feign_install () {
44
 
        local pkg=$1
45
 
        local deb="$(debfor $pkg)"
46
 
        local ver="$(
47
 
            ar -p "$TARGET/$deb" control.tar.gz | zcat |
48
 
                tar -O -xf - control ./control 2>/dev/null |
49
 
                grep -i ^Version: | sed -e 's/[^:]*: *//' | head -n 1
50
 
        )"
51
 
 
52
 
        mkdir -p "$TARGET/var/lib/dpkg/info"
53
 
 
54
 
echo \
55
 
"Package: $pkg
56
 
Version: $ver
57
 
Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
58
 
 
59
 
        touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
60
 
    }
61
 
 
62
 
    x_feign_install dpkg
63
 
 
64
 
    if [ -e "$TARGET/usr/bin/perl-5.005.dist" ]; then
65
 
        mv "$TARGET/usr/bin/perl-5.005.dist" "$TARGET/usr/bin/perl-5.005"
66
 
    fi
67
 
    if [ ! -e "$TARGET/usr/bin/perl" ]; then
68
 
        ln -sf perl-5.005 "$TARGET/usr/bin/perl"
69
 
    fi
70
 
}
71
 
 
72
 
second_stage_install () {
73
 
    x_core_install () {
74
 
        in_target dpkg --force-depends --install $(debfor "$@")
75
 
    }
76
 
 
77
 
    export DEBIAN_FRONTEND=Noninteractive
78
 
 
79
 
    setup_proc
80
 
    ln "$TARGET/sbin/ldconfig.new" "$TARGET/sbin/ldconfig"
81
 
    in_target /sbin/ldconfig
82
 
 
83
 
    x_core_install base-files base-passwd ldso
84
 
    x_core_install dpkg
85
 
 
86
 
    ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
87
 
    x_core_install $LIBC
88
 
 
89
 
    smallyes '' | x_core_install perl-5.005-base
90
 
    x_core_install mawk
91
 
    x_core_install debconf-tiny
92
 
 
93
 
    in_target dpkg-preconfigure $(debfor $required $base)
94
 
 
95
 
    repeatn 5 in_target dpkg --force-depends --unpack $(debfor $required)
96
 
 
97
 
    mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
98
 
    cp "$TARGET/bin/true" "$TARGET/sbin/start-stop-daemon"
99
 
 
100
 
    setup_dselect_method apt
101
 
 
102
 
    in_target dpkg --configure --pending --force-configure-any --force-depends
103
 
 
104
 
    smallyes '' | repeatn 5 in_target dpkg --force-auto-select --force-overwrite --skip-same-version --install $(debfor $base)
105
 
 
106
 
    mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
107
 
}