From 13e8426f800dd5e21e78fa6488b860e3f0467984 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 23 Aug 2005 08:03:51 +0000 Subject: * merged with apt--fixes--0 Patches applied: * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-7 * fixed incorrect man-page example * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-8 * changelog udpate * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-9 * we only need to check once for xmlto * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-10 * fix a bug in a man-page, fix a problem with overly long lines in apt-cdrom * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-11 * merged with apt--main--0 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-12 * fix a incorrect error message (it always added .gz regardless what was downloaded) * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-13 * merged with main * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-14 * added Hashsum support for file and cdrom * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-15 * added README.arch * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-16 * merged with main * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-17 * move the changelog to the right place * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-18 * Change pkgPolicy::Pin from private to protected * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-19 * added a default constructor for PrvIterator * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-20 * applied otavios patch to reread the statusFile on debSystem::Initialize * otavio@debian.org--2005/apt--fixes--0--patch-28 Reread status configuration, needed for clients using independent apt ... --- apt-pkg/cdrom.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apt-pkg/cdrom.cc') diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index ca74aa685..c067cf1ee 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -422,6 +422,9 @@ bool pkgCdrom::WriteSourceList(string Name,vector &List,bool Source) { F.getline(Buffer,sizeof(Buffer)); CurLine++; + if (F.fail() && !F.eof()) + return _error->Error(_("Line %u too long in source list %s."), + CurLine,File.c_str()); _strtabexpand(Buffer,sizeof(Buffer)); _strstrip(Buffer); -- cgit v1.2.3 From cdadf54b3ab67aed6e9ecf902aabf4cc9896ef9e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 12 Sep 2005 12:45:50 +0000 Subject: * fix apt-pkg/cdrom.cc to umount the cdrom again if anything fails --- apt-pkg/cdrom.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'apt-pkg/cdrom.cc') diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index c067cf1ee..ce1beb39b 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -567,7 +567,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log) string DFile = _config->FindFile("Dir::State::cdroms"); if (FileExists(DFile) == true) { - if (ReadConfigFile(Database,DFile) == false) + if (ReadConfigFile(Database,DFile) == false) return _error->Error("Unable to read the cdrom database %s", DFile.c_str()); } @@ -650,8 +650,11 @@ bool pkgCdrom::Add(pkgCdromStatus *log) log->Update(msg.str(), STEP_SCAN); } - if (List.size() == 0 && SourceList.size() == 0) + if (List.size() == 0 && SourceList.size() == 0) + { + UnmountCdrom(CDROM); return _error->Error("Unable to locate any package files, perhaps this is not a Debian Disc"); + } // Check if the CD is in the database string Name; @@ -687,7 +690,10 @@ bool pkgCdrom::Add(pkgCdromStatus *log) Name.empty() == true) { if(!log) + { + UnmountCdrom(CDROM); return _error->Error("No disc name found and no way to ask for it"); + } while(true) { if(!log->AskCdromName(Name)) { @@ -760,7 +766,10 @@ bool pkgCdrom::Add(pkgCdromStatus *log) { string::size_type Space = (*I).find(' '); if (Space == string::npos) + { + UnmountCdrom(CDROM); return _error->Error("Internal error"); + } if(log) { msg.str(""); @@ -774,7 +783,10 @@ bool pkgCdrom::Add(pkgCdromStatus *log) { string::size_type Space = (*I).find(' '); if (Space == string::npos) + { + UnmountCdrom(CDROM); return _error->Error("Internal error"); + } if(log) { msg.str(""); -- cgit v1.2.3