summaryrefslogtreecommitdiff
path: root/cmdline/apt-cdrom.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:53:54 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:53:54 +0000
commit6b8f78a12276e75d0da3578301d4da378963185f (patch)
tree473e093174a9056db068b6598d777f9acfce63b6 /cmdline/apt-cdrom.cc
parentdafaee5226bbd426cb91486b13c1dbd0d2163175 (diff)
Added wrecked symlink recovery
Author: jgg Date: 1999-05-29 04:59:52 GMT Added wrecked symlink recovery
Diffstat (limited to 'cmdline/apt-cdrom.cc')
-rw-r--r--cmdline/apt-cdrom.cc31
1 files changed, 26 insertions, 5 deletions
diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc
index 7d723ba66..49c7909dc 100644
--- a/cmdline/apt-cdrom.cc
+++ b/cmdline/apt-cdrom.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-cdrom.cc,v 1.23 1999/05/29 03:32:30 jgg Exp $
+// $Id: apt-cdrom.cc,v 1.24 1999/05/29 04:59:52 jgg Exp $
/* ######################################################################
APT CDROM - Tool for handling APT's CDROM database.
@@ -448,6 +448,7 @@ bool CopyPackages(string CDROM,string Name,vector<string> &List)
File = OrigPath + ChopDirs(File,Chop);
// See if the file exists
+ bool Mangled = false;
if (NoStat == false || Hits < 10)
{
// Attempt to fix broken structure
@@ -456,6 +457,8 @@ bool CopyPackages(string CDROM,string Name,vector<string> &List)
if (ReconstructPrefix(Prefix,OrigPath,CDROM,File) == false &&
ReconstructChop(Chop,*I,File) == false)
{
+ if (Debug == true)
+ clog << "Missed: " << File << endl;
NotFound++;
continue;
}
@@ -467,13 +470,31 @@ bool CopyPackages(string CDROM,string Name,vector<string> &List)
struct stat Buf;
if (stat(string(CDROM + Prefix + File).c_str(),&Buf) != 0)
{
- NotFound++;
- continue;
+ // Attempt to fix busted symlink support for one instance
+ string OrigFile = File;
+ string::size_type Start = File.find("binary-");
+ string::size_type End = File.find("/",Start+3);
+ if (Start != string::npos && End != string::npos)
+ {
+ File.replace(Start,End-Start,"binary-all");
+ Mangled = true;
+ }
+
+ if (Mangled == false ||
+ stat(string(CDROM + Prefix + File).c_str(),&Buf) != 0)
+ {
+ if (Debug == true)
+ clog << "Missed(2): " << OrigFile << endl;
+ NotFound++;
+ continue;
+ }
}
// Size match
if ((unsigned)Buf.st_size != Size)
{
+ if (Debug == true)
+ clog << "Wrong Size: " << File << endl;
WrongSize++;
continue;
}
@@ -485,7 +506,7 @@ bool CopyPackages(string CDROM,string Name,vector<string> &List)
// Copy it to the target package file
const char *Start;
const char *Stop;
- if (Chop != 0)
+ if (Chop != 0 || Mangled == true)
{
// Mangle the output filename
const char *Filename;
@@ -588,7 +609,7 @@ bool CopyPackages(string CDROM,string Name,vector<string> &List)
return _error->Error("No valid package records were found.");
if (NotFound + WrongSize > 10)
- cout << "Alot of package entires were discarded, perhaps this CD is funny?" << endl;
+ cout << "Alot of package entries were discarded, perhaps this CD is funny?" << endl;
return true;
}