Projet

Général

Profil

apt-eole.diff

Emmanuel GARETTE, 03/02/2012 21:19

Télécharger (1,58 ko)

Voir les différences:

/usr/bin/apt-eole 2012-02-03 20:57:28.240538960 +0100
1 1
#!/bin/bash
2 2
export UCF_FORCE_CONFFNEW=YES
3 3
export DEBIAN_FRONTEND=noninteractive
4
CDROM_PATH="/cdrom"
5
OPTION_CDROM="-o=Dir::Media::MountPath=$CDROM_PATH"
4 6

  
5 7
if [ "$1" == "install-conteneur" ]; then
6 8
    CONTENEUR=$2
......
18 20
    [ "$cpath" = "" ] && echo "Conteneur $CONTENEUR inconnu" && exit 1
19 21
    cd /var/cache/apt/archives
20 22
    echo "Telechargement des paquets"
21
    chroot $cpath /usr/bin/apt-get --print-uris --no-install-recommends install $PAQUET -y -q --force-yes|grep "^'http://"|cut -d"'" -f2|grep "\.deb$" | while read url; do
23
    chroot $cpath /usr/bin/apt-get $OPTION_CDROM --print-uris --no-install-recommends install $PAQUET -y -q --force-yes|grep "^'http://"|cut -d"'" -f2|grep "\.deb$" | while read url; do
22 24
        wget -qc $url
23 25
        if [ "$?" != "0" ]; then
24 26
            EchoRouge "Impossible de télécharger $url"
......
41 43
    [ "$cpath" = "" ] && echo "Conteneur $CONTENEUR inconnu" && exit 1
42 44
    sourceslist="/etc/apt/sources.list"
43 45
    aptcachedir="/var/lib/apt/lists/"
44
    /usr/bin/apt-get update
46
    /usr/bin/apt-get $OPTION_CDROM update
45 47
    /usr/bin/rsync -a ${aptcachedir}* ${cpath}${aptcachedir}
46 48
    /bin/cp -f ${sourceslist} ${cpath}${sourceslist}
47 49
elif [ "$1" == "install" ]; then
48
    apt-get -o Dpkg::Options::="--force-confnew" --no-install-recommends -q -y $*
50
    apt-get $OPTION_CDROM -o Dpkg::Options::="--force-confnew" --no-install-recommends -q -y $*
49 51
    exit $?
50 52
elif [ "$1" == "remove" ]; then
51 53
    apt-get --purge $*