~ubuntu-branches/ubuntu/lucid/ltsp/lucid

« back to all changes in this revision

Viewing changes to server/plugins/ltsp-build-client/Debian/010-manage-mirror

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Graber
  • Date: 2010-01-04 19:20:29 UTC
  • mfrom: (111.1.39 upstream)
  • Revision ID: james.westby@ubuntu.com-20100104192029-8kisjo9jwe3ix1ps
Tags: 5.1.99-0ubuntu1
* New upstream version (5.1.99)
 * Implement nbd-proxy for more stability
 * Force netcat to wait for data
 * Properly save/restore IFS
 * Lots of code cleanup
 * Implement vendor specific functions in ltsp-build-client
 * Update translations
 * Optimize localapps rc.d scripts
 * Update add_mirrors and make use of it
 * Implement a caching infrastructure
 * Add Fat client support for Ubuntu
 * Get rid of some awk calls
 * Respect ltsp-build-client.conf defaults
 * Speed up boot process by starting more functions in background
 * Fix tty/vt detection for flickerless boot
 * Make ltsp-build-client usage more consistent.
 * Improve ltsp-logout-action
 *
 * LOTS of other changes and fixes I forgot.

* Get rid of USPLASH=y
* Add two upstart jobs to force a reboot (avoid squashfs errors)
* Trigger update-initramfs post install
* Depend on pciutils and usbutils (as no longer in minimal)
* Move tftpd-hpa from depend to recommend
* Drop dependency on openssh-client | ssh in ltsp-server

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
case "$MODE" in
2
2
    commandline)
3
 
        add_option "mirror" "`eval_gettext "Set the mirror location"`" "regular" "true"
 
3
        add_option "mirror" "`eval_gettext "set the mirror location"`" "regular" "true"
4
4
        add_option "early-mirror" "`eval_gettext "add a mirror, which takes priority over the default mirror"`" "advanced" "true"
5
5
        add_option "extra-mirror" "`eval_gettext "add a mirror, with lower priority than the default mirror"`" "advanced" "true"
6
 
        add_option "security-mirror" "`eval_gettext "add a security mirror"`" "advanced" "true"
7
6
        ;;
8
7
    configure)
9
8
        if [ -n "$option_mirror_value" ]; then
15
14
        if [ -n "$option_extra_mirror_value" ]; then
16
15
            EXTRA_MIRROR="$option_extra_mirror_value"
17
16
        fi
18
 
        if [ -n "$option_security_mirror_value" ]; then
19
 
            SECURITY_MIRROR="$option_security_mirror_value"
20
 
        fi
21
17
        ;;
22
18
    after-install)
23
 
        add_mirror() {
24
 
            # add a mirror to the chroot's sources.list
25
 
            mirror="$1"
26
 
            type="$2"
27
 
            if [ -n "$mirror" ]; then
28
 
                if [ -z "$(echo $mirror | awk '{print $2}')" ]; then
29
 
                    if [ "$type" = "security" ]; then
30
 
                        mirror="$mirror $DIST/updates $COMPONENTS"
31
 
                    else
32
 
                        mirror="$mirror $DIST $COMPONENTS"
33
 
                    fi
34
 
                fi
35
 
                echo "deb $mirror" >> $ROOT/etc/apt/sources.list
36
 
                case $mirror in
37
 
                    file:///*) dir="$(echo $mirror | awk '{print $1}' | sed -e 's,^file://,,g')"      
38
 
                        mkdir -p $ROOT/$dir
39
 
                        chroot_mount $dir $dir --bind
40
 
                        ;;
41
 
                esac  
42
 
            fi
43
 
        }
44
 
        
45
 
        add_multiple_mirrors() {
46
 
            # feed a list of comma-separated mirrors, add them to sources.list
47
 
            mirror_list="$1"
48
 
            if [ -z "$(echo $mirror_list | grep ,)" ] ; then
49
 
                # only one mirror specified
50
 
                add_mirror "$mirror_list"
51
 
            else
52
 
                OIFS=$IFS
53
 
                IFS=,
54
 
                for mirror in $mirror_list; do
55
 
                    if [ -n "$mirror" ]; then
56
 
                        add_mirror "$mirror"
57
 
                    fi
58
 
                done
59
 
                unset IFS
60
 
                if [ -n "$OIFS" ]; then
61
 
                    IFS=$OIFS
62
 
                fi
63
 
            fi
64
 
        }
65
 
 
66
19
        sources_list="$ROOT/etc/apt/sources.list"
67
20
        if [ -f "$sources_list" ]; then
68
21
            debug "    - moving aside sources.list"
69
22
            mv -vf "$sources_list" "$sources_list".old
70
23
        fi
71
 
        add_multiple_mirrors "$EARLY_MIRROR"
72
 
        add_mirror "$MIRROR" 
73
 
        add_multiple_mirrors "$EXTRA_MIRROR"
74
 
        add_mirror "$SECURITY_MIRROR" security
 
24
        add_mirrors "$EARLY_MIRROR"
 
25
        add_mirrors "$MIRROR" 
 
26
        add_mirrors "$EXTRA_MIRROR"
 
27
        ;;
75
28
esac