if cdrom not found then use online files

Bug #9003 reported by Kristof Vansant
34
Affects Status Importance Assigned to Milestone
apt (Debian)
Fix Released
Unknown
apt (Ubuntu)
Fix Released
Wishlist
Michael Vogt

Bug Description

if this is in the /etc/apt/sources.list

deb cdrom:[Ubuntu 4.10 _Warty Warthog_ - Unofficial i386 Binary-1 (20040915)]/
unstable main restricted

Then installing files that are on the cdrom fail.
Because I don't have the cdrom anymore.
I mean that apt-get should ask if it should download the file from an online
location, after trying the cdrom (and not finding the file or disc),

Otherwise you get the following result:

lupus@lupus ~ $ sudo apt-get install tla
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
  gawk libneon24
Suggested packages:
  ssh tla-doc
The following NEW packages will be installed:
  gawk libneon24 tla
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/1195kB of archives.
After unpacking 2773kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Media Change: Please insert the disc labeled
 'Ubuntu 4.10 _Warty Warthog_ - Unofficial i386 Binary-1 (20040915)'
in the drive '/cdrom/' and press enter

Media Change: Please insert the disc labeled
 'Ubuntu 4.10 _Warty Warthog_ - Unofficial i386 Binary-1 (20040915)'
in the drive '/cdrom/' and press enter

Media Change: Please insert the disc labeled
 'Ubuntu 4.10 _Warty Warthog_ - Unofficial i386 Binary-1 (20040915)'
in the drive '/cdrom/' and press enter

should be:
sorry disc not found do you wish to try the other sources? [Y/n]

maybe add an option that it just does it without asking

Revision history for this message
Michael Vogt (mvo) wrote :

This is debian bug #44135
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=44135). There is a patch
available. But it certainly needs review/testing. If the patch is used, synaptic
can fallback to the network too when "cancel" is clicked in the "please insert
cd" dialog.

Cheers,
 Michael

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Sat, 4 Sep 1999 18:11:58 +0200
From: Wichert Akkerman <email address hidden>
To: <email address hidden>
Subject: apt: doesn't fallback from cdrom to other source

Package: apt
Version: 0.3.4

apt refuses to fallback to http or another method when I don't have the
cdrom available.

Wichert.

-- System Information
Debian Release: 2.1
Kernel Version: Linux thunder 2.2.5 #1 Fri Apr 9 03:49:56 CEST 1999 i686 unknown

Versions of the packages apt depends on:
ii libc6 2.0.7.19981211 GNU C Library: shared libraries
ii libstdc++2.9 2.91.66-0slink The GNU stdc++ library (egcs version)

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Sat, 4 Sep 1999 18:58:14 -0600 (MDT)
From: Jason Gunthorpe <email address hidden>
To: <email address hidden>

severity 43650 normal
severity 44119 normal
severity 41091 wishlist
severity 43476 wishlist
severity 43555 wishlist
merge 42437 43555
severity 44135 wishlist

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <Pine.LNX.4.33.0106211116570.1828-100000@localhost>
Date: Thu, 21 Jun 2001 11:17:32 -0500 (CDT)
From: Adam Heath <email address hidden>
To: <email address hidden>
Subject: merging

severity 101851 wishlist
merge 101851 44135
thanks

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <1077797787.3213.485.camel@localhost>
Date: Thu, 26 Feb 2004 13:16:28 +0100
From: Thomas Hood <email address hidden>
To: <email address hidden>
Subject: merge

merge 44135 57869
thanks

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: 2 Dec 2004 14:44:10 +0100
From: "Michael Vogt" <email address hidden>
To: <email address hidden>
Subject: [patch] fix

--9amGYk9869ThD9tj
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline

Attached is a possible fix for the problem that apt will not fallback
to another method if no cdrom is available.

The patch is not perfect for i18n (because of the part in
acqprogress.cc). It dosn't matter for front-ends like synaptic as they
implement their own pkgAcquireProgress anyway but it does of course
for apt-get. We may just use the YnPrompt code from apt-get.cc here.

thanks,
 Michael

--
The first rule of holes is: when you find yourself in one, stop digging. - PJ
Linux is not The Answer. Yes is the answer. Linux is The Question. - Neo

--9amGYk9869ThD9tj
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: attachment; filename="apt-fix-44135.diff"

--- orig/apt-pkg/acquire-method.cc
+++ mod/apt-pkg/acquire-method.cc
@@ -271,7 +271,7 @@
      MyMessages.erase(MyMessages.begin());
   }

- return !StringToBool(LookupTag(Message,"Fail"),false);
+ return !StringToBool(LookupTag(Message,"Failed"),false);
       }

       Messages.push_back(Message);

--- orig/cmdline/acqprogress.cc
+++ mod/cmdline/acqprogress.cc
@@ -269,15 +269,26 @@
    if (Quiet <= 0)
       cout << '\r' << BlankLine << '\r';
    ioprintf(cout,_("Media Change: Please insert the disc labeled\n"
- " '%s'\n"
- "in the drive '%s' and press enter\n"),
- Media.c_str(),Drive.c_str());
+ " '%s'\n"
+ "in the drive '%s' and press enter to continue or 'c' to cancel.\n"),
+ Media.c_str(),Drive.c_str());

    char C = 0;
+ bool bStatus = true;
+
    while (C != '\n' && C != '\r')
+ {
+ if(C == 'c')
+ bStatus = false;
+
       read(STDIN_FILENO,&C,1);
-
- Update = true;
- return true;
+ }
+ if(bStatus == false)
+ return false;
+ else
+ {
+ Update = true;
+ return true;
+ }
 }
          /*}}}*/

--- orig/methods/cdrom.cc
+++ mod/methods/cdrom.cc
@@ -165,8 +165,7 @@
       if (MediaFail(Get.Host,CDROM) == false)
       {
   CurrentID = "FAIL";
- Fail(_("Wrong CD"),true);
- return true;
+ return _error->Error(_("Disk not found."));
       }
    }

--9amGYk9869ThD9tj--

Revision history for this message
Michael Vogt (mvo) wrote :

Matt pointed out that the patch will fail when EOF is returned from the read.
This needs to be fixed first.

Revision history for this message
Matt Zimmerman (mdz) wrote :

I think it would be preferable if we simply limited the number of retries (APT
already has a variable for this), such that if the user pressed enter a few
times without providing the CD, APT would fall back to the next source.

What do you think?

Revision history for this message
Michael Vogt (mvo) wrote :

*** Bug 13959 has been marked as a duplicate of this bug. ***

Revision history for this message
Michael Vogt (mvo) wrote :

Created an attachment (id=2405)
minimal patch to make this feature available in synaptic

Revision history for this message
Michael Vogt (mvo) wrote :

After experimenting with the patch (and the needed support in synaptic) I
noticed that if multiple files are to be fetched from a cdrom it will ask for
each of that files to enter the cdrom. This needs to be fixed before the patch
first.

Revision history for this message
Wouter Stomp (wouterstomp-deactivatedaccount) wrote :

Wouldn't it be better to always try to get them online first? No need to search
for the cd... :-) But could be a problem for dial-up users.

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Tue, 18 Oct 2005 02:32:05 -0700
From: Michael Vogt <email address hidden>
To: <email address hidden>
Cc: Michael Vogt <email address hidden>, APT Development Team <email address hidden>
Subject: Fixed in upload of apt 0.6.41.0exp1 to experimental

tag 250583 + fixed-in-experimental
tag 316318 + fixed-in-experimental
tag 325686 + fixed-in-experimental
tag 327456 + fixed-in-experimental
tag 44135 + fixed-in-experimental

quit

This message was generated automatically in response to an
upload to the experimental distribution. The .changes file follows.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Mon, 17 Oct 2005 17:16:45 +0200
Source: apt
Binary: apt-utils libapt-pkg-doc libapt-pkg-dev apt-doc apt
Architecture: source all i386
Version: 0.6.41.0exp1
Distribution: experimental
Urgency: low
Maintainer: APT Development Team <email address hidden>
Changed-By: Michael Vogt <email address hidden>
Description:
 apt - Advanced front-end for dpkg
 apt-doc - Documentation for APT
 apt-utils - APT utility programs
 libapt-pkg-dev - Development files for APT's libapt-pkg and libapt-inst
 libapt-pkg-doc - Documentation for APT development
Closes: 44135 250583 316318 325686 327456
Changes:
 apt (0.6.41.0exp1) experimental; urgency=low
 .
   * apt-pkg/cdrom.cc:
     - unmount the cdrom when apt failed to locate any package files
   * allow cdrom failures and fallback to other sources in that case
     (closes: #44135)
   * better error text when dpkg-source fails
   * Merge <email address hidden>/apt--main--0 up to patch-115:
     - patch-99: Added Galician translation
     - patch-100: Completed Danish translation (Closes: #325686)
     - patch-104: French translation completed
     - patch-109: Italian translation completed
     - patch-112: Swedish translation update
     - patch-115: Basque translation completed
   * applied french man-page update (thanks to Philippe Batailler)
     (closes: #316318, #327456)
   * fix leak in the mmap code, thanks to Daniel Burrows for the
     patch (closes: #250583)
   * added support for package index diffs
   * added support for i18n of the package descriptions
   * build from <email address hidden>/apt--debian-experimental--0
     (from http://people.debian.org/~mvo/arch)
Files:
 c0b89973b24579ed771c3e8176c4997b 797 admin important apt_0.6.41.0exp1.dsc
 16aacdb2ee3f44e780c4e227e2e4256b 1457119 admin important apt_0.6.41.0exp1.tar.gz
 9e970697bc80b2e258cc7f2421a7bad6 85040 doc optional apt-doc_0.6.41.0exp1_all.deb
 e5a51d4e490bd6637b281fb48da58f03 108346 doc optional libapt-pkg-doc_0.6.41.0exp1_all.deb
 aa10140f64e2aa267846b6479ae56065 1238484 base important apt_0.6.41.0exp1_i386.deb
 60b398630c8b760ee14545f9bb5952ad 79866 libdevel optional libapt-pkg-dev_0.6.41.0exp1_i386.deb
 e55f3d753e7b95ddec6b31fb7d97caf1 200082 admin important apt-utils_0.6.41.0exp1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDU9MVliSD4VZixzQRAkPDAKCSFhDl76ydbEFeRUDQhjgWIidL1gCgpGoy
gLrQTm8DDT2m9pT7fJNiSTc=
=eI/h
-----END PGP SIGNATURE-----

Revision history for this message
Debian Bug Importer (debzilla) wrote :
Download full text (4.3 KiB)

Message-Id: <email address hidden>
Date: Thu, 20 Oct 2005 02:47:08 -0700
From: Michael Vogt <email address hidden>
To: <email address hidden>
Subject: Bug#44135: fixed in apt 0.6.42

Source: apt
Source-Version: 0.6.42

We believe that the bug you reported is fixed in the latest version of
apt, which is due to be installed in the Debian FTP archive:

apt-doc_0.6.42_all.deb
  to pool/main/a/apt/apt-doc_0.6.42_all.deb
apt-utils_0.6.42_i386.deb
  to pool/main/a/apt/apt-utils_0.6.42_i386.deb
apt_0.6.42.dsc
  to pool/main/a/apt/apt_0.6.42.dsc
apt_0.6.42.tar.gz
  to pool/main/a/apt/apt_0.6.42.tar.gz
apt_0.6.42_i386.deb
  to pool/main/a/apt/apt_0.6.42_i386.deb
libapt-pkg-dev_0.6.42_i386.deb
  to pool/main/a/apt/libapt-pkg-dev_0.6.42_i386.deb
libapt-pkg-doc_0.6.42_all.deb
  to pool/main/a/apt/libapt-pkg-doc_0.6.42_all.deb

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Vogt <email address hidden> (supplier of updated apt package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Wed, 19 Oct 2005 22:02:09 +0200
Source: apt
Binary: apt-utils libapt-pkg-doc libapt-pkg-dev apt-doc apt
Architecture: source all i386
Version: 0.6.42
Distribution: unstable
Urgency: low
Maintainer: APT Development Team <email address hidden>
Changed-By: Michael Vogt <email address hidden>
Description:
 apt - Advanced front-end for dpkg
 apt-doc - Documentation for APT
 apt-utils - APT utility programs
 libapt-pkg-dev - Development files for APT's libapt-pkg and libapt-inst
 libapt-pkg-doc - Documentation for APT development
Closes: 44135 152129 250583 316638 324921 325686 327456 333299 334539 334656 334671 334714
Changes:
 apt (0.6.42) unstable; urgency=low
 .
   * apt-pkg/cdrom.cc:
     - unmount the cdrom when apt failed to locate any package files
   * allow cdrom failures and fallback to other sources in that case
     (closes: #44135)
   * better error text when dpkg-source fails
   * Merge <email address hidden>/apt--main--0 up to patch-115:
     - patch-99: Added Galician translation
     - patch-100: Completed Danish translation (Closes: #325686)
     - patch-104: French translation completed
     - patch-109: Italian translation completed
     - patch-112: Swedish translation update
     - patch-115: Basque translation completed (Closes: #333299)
   * applied french man-page update (thanks to Philippe Batailler)
     (closes: #316638, #327456)
   * fix leak in the mmap code, thanks to Daniel Burrows for the
     patch (closes: #250583)
   * support for apt-get [build-dep|source] -t (closes: #152129)
   * added "APT::Authentication::TrustCDROM" option to make the life
     for the installer people easier (closes: #334656)
   * fix crash in apt-ftparchive (thanks to Bastian ...

Read more...

Revision history for this message
Daniel Robitaille (robitaille) wrote :

Fixed in Debian in Oct 2005 with apt 0.6.42

Changed in apt:
status: Unconfirmed → Fix Released
Revision history for this message
Sarah Kowalik (hobbsee-deactivatedaccount) wrote :

If it was fixed in debian in apt 0.6.42 it should be fixed in edgy. current version apt 0.6.45ubuntu2

Changed in apt:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.