[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#41025: Upgrading pcmcia-cs when using ethernet card

Package: apt
Version: 0.3.11

I depend on a PCMCIA ethernet card for my network connection.  When
upgrading `pcmcia-cs' all PCMCIA services are (have to be?) shut down.
This effectively cuts my network connection.  As a result, ftp-ing the
package or accessing it on an remote file system is no longer possible
and the upgrade fails miserably.

I hacked up a little shell script (untested as of yet), that aims to
work around this without user intervention.  I use a local mirror of
either stable or unstable and an ftp archive as a backup of stable.
Note that `--download-only' will not get anything if the package to
get is on the NFS mounted file system.

#! /bin/sh
#  Updating pcmcia-cs is broken in apt, work-around.  First install
#  all dependencies.  Next try to download a copy of pcmcia-cs.  In
#  case it does not result in a package in /var/cache/apt/archives,
#  copy the version on the local mirror which is the newer version.
fs=/mnt/debian			# NFS mounted local mirror
depends="`apt-get --simulate install pcmcia-cs |
    grep ^Inst |
    sed -e 's/^Inst//' -e 's/\[.*$//' |
    sed -e 's/^ pcmcia-cs//'`"
apt-get install $depends >&4
apt-get --download-only install pcmcia-cs >&4
find /var/cache/apt/archives -name 'pcmcia-cs_*.deb' -exec ftp=yes
if test "$ftp" != yes
    arch="`dpkg --print-architecture`"
    #  This assumes there is only one line with $fs ...
    version="`grep $fs /etc/apt/sources.list | cut -d' ' -f3`"
    find $fs/dists/$version/binary-$arch/main \
	-name 'pcmcia-cs_*.deb' -exec cp \{} /tmp \;
umount $fs
/etc/init.d/pcmcia stop
if test "$ftp" = yes
    apt-get install pcmcia-cs >&4
    rm /var/cache/apt/archives/pcmcia-cs_*.deb
    dpkg --install /tmp/pcmcia-cs_*.deb >&4
    rm /tmp/pcmcia-cs_*.deb
/etc/init.d/pcmcia start
mount $fs

I am using potato with kernel 2.0.36.

Methinks the logic for a fix in apt-get should be along very similar
lines.  Hope this helps.
Olaf Meeuwissen                              Shinshu University, Japan

Reply to: