Bug#166319: apt: Fixes for gcc-3.2
Package: apt
Version: 0.5.4
Severity: important
Tags: patch
I have written a patch for apt (against current CVS) to make it compile
with gcc 3.2. Please review and reply.
Index: algorithms.cc
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/deity/apt/apt-pkg/algorithms.cc,v
retrieving revision 1.41
diff -u -r1.41 algorithms.cc
--- algorithms.cc 26 Apr 2002 05:36:20 -0000 1.41
+++ algorithms.cc 25 Oct 2002 12:18:13 -0000
@@ -75,8 +75,8 @@
PkgIterator Pkg =3D Sim.FindPkg(iPkg.Name());
Flags[Pkg->ID] =3D 1;
=
- cout << "Inst ";
- Describe(Pkg,cout,false);
+ std::cout << "Inst ";
+ Describe(Pkg,std::cout,false);
Sim.MarkInstall(Pkg,false);
=
// Look for broken conflicts+predepends.
@@ -96,7 +96,7 @@
{
if ((Sim[End] & pkgDepCache::DepGInstall) =3D=3D 0)
{
- cout << " [" << I.Name() << " on " << Start.TargetPkg().Name() << =
']';
+ std::cout << " [" << I.Name() << " on " << Start.TargetPkg().Name(=
) << ']';
if (Start->Type =3D=3D pkgCache::Dep::Conflicts)
_error->Error("Fatal, conflicts violated %s",I.Name());
} =
@@ -107,7 +107,7 @@
if (Sim.BrokenCount() !=3D 0)
ShortBreaks();
else
- cout << endl;
+ std::cout << std::endl;
return true;
}
/*}}}*/
@@ -125,7 +125,7 @@
// Sim.MarkInstall(Pkg,false);
if (Sim[Pkg].InstBroken() =3D=3D true)
{
- cout << "Conf " << Pkg.Name() << " broken" << endl;
+ std::cout << "Conf " << Pkg.Name() << " broken" << std::endl;
=
Sim.Update();
=
@@ -137,26 +137,26 @@
continue;
=
if (D->Type =3D=3D pkgCache::Dep::Obsoletes)
- cout << " Obsoletes:" << D.TargetPkg().Name();
+ std::cout << " Obsoletes:" << D.TargetPkg().Name();
else if (D->Type =3D=3D pkgCache::Dep::Conflicts)
- cout << " Conflicts:" << D.TargetPkg().Name();
+ std::cout << " Conflicts:" << D.TargetPkg().Name();
else
- cout << " Depends:" << D.TargetPkg().Name();
+ std::cout << " Depends:" << D.TargetPkg().Name();
} =
- cout << endl;
+ std::cout << std::endl;
=
_error->Error("Conf Broken %s",Pkg.Name());
} =
else
{
- cout << "Conf "; =
- Describe(Pkg,cout,false);
+ std::cout << "Conf "; =
+ Describe(Pkg,std::cout,false);
}
=
if (Sim.BrokenCount() !=3D 0)
ShortBreaks();
else
- cout << endl;
+ std::cout << std::endl;
=
return true;
}
@@ -172,15 +172,15 @@
Flags[Pkg->ID] =3D 3;
Sim.MarkDelete(Pkg);
if (Purge =3D=3D true)
- cout << "Purg ";
+ std::cout << "Purg ";
else
- cout << "Remv ";
- Describe(Pkg,cout,false);
+ std::cout << "Remv ";
+ Describe(Pkg,std::cout,false);
=
if (Sim.BrokenCount() !=3D 0)
ShortBreaks();
else
- cout << endl;
+ std::cout << std::endl;
=
return true;
}
@@ -190,18 +190,18 @@
/* */
void pkgSimulate::ShortBreaks()
{
- cout << " [";
+ std::cout << " [";
for (PkgIterator I =3D Sim.PkgBegin(); I.end() =3D=3D false; I++)
{
if (Sim[I].InstBroken() =3D=3D true)
{
if (Flags[I->ID] =3D=3D 0)
- cout << I.Name() << ' ';
+ std::cout << I.Name() << ' ';
/* else
- cout << I.Name() << "! ";*/
+ std::cout << I.Name() << "! ";*/
} =
}
- cout << ']' << endl;
+ std::cout << ']' << std::endl;
}
/*}}}*/
// ApplyStatus - Adjust for non-ok packages /*{{{*/
@@ -603,7 +603,7 @@
if ((Flags[P->ID] & Protected) =3D=3D Protected)
{
if (Debug =3D=3D true)
- clog << " Reinst Failed because of protected " << P.Name() << e=
ndl;
+ std::clog << " Reinst Failed because of protected " << P.Name()=
<< std::endl;
Fail =3D true;
} =
else
@@ -614,7 +614,7 @@
if (DoUpgrade(P) =3D=3D false)
{
if (Debug =3D=3D true)
- clog << " Reinst Failed because of " << P.Name() << endl;
+ std::clog << " Reinst Failed because of " << P.Name() << std::en=
dl;
Fail =3D true;
}
else
@@ -632,7 +632,7 @@
break;
=
if (Debug =3D=3D true)
- clog << " Reinst Failed early because of " << Start.TargetPkg().Nam=
e() << endl;
+ std::clog << " Reinst Failed early because of " << Start.TargetPkg(=
).Name() << std::endl;
Fail =3D true;
} =
}
@@ -656,7 +656,7 @@
} =
=
if (Debug =3D=3D true)
- clog << " Re-Instated " << Pkg.Name() << endl;
+ std::clog << " Re-Instated " << Pkg.Name() << std::endl;
return true;
}
/*}}}*/
@@ -704,7 +704,7 @@
while (Again =3D=3D true);
=
if (Debug =3D=3D true)
- clog << "Starting" << endl;
+ std::clog << "Starting" << std::endl;
=
MakeScores();
=
@@ -723,13 +723,13 @@
if (Scores[(*K)->ID] !=3D 0)
{
pkgCache::PkgIterator Pkg(Cache,*K);
- clog << Scores[(*K)->ID] << ' ' << Pkg.Name() <<
+ std::clog << Scores[(*K)->ID] << ' ' << Pkg.Name() <<
' ' << (pkgCache::Version *)Pkg.CurrentVer() << ' ' << =
- Cache[Pkg].InstallVer << ' ' << Cache[Pkg].CandidateVer << endl;
+ Cache[Pkg].InstallVer << ' ' << Cache[Pkg].CandidateVer << std::endl;
} */
=
if (Debug =3D=3D true)
- clog << "Starting 2" << endl;
+ std::clog << "Starting 2" << std::endl;
=
/* Now consider all broken packages. For each broken package we either
remove the package or fix it's problem. We do this once, it should
@@ -752,7 +752,7 @@
(Flags[I->ID] & ReInstateTried) =3D=3D 0)
{
if (Debug =3D=3D true)
- clog << " Try to Re-Instate " << I.Name() << endl;
+ std::clog << " Try to Re-Instate " << I.Name() << std::endl;
unsigned long OldBreaks =3D Cache.BrokenCount();
pkgCache::Version *OldVer =3D Cache[I].InstallVer;
Flags[I->ID] &=3D ReInstateTried;
@@ -768,14 +768,14 @@
} =
else
if (Debug =3D=3D true)
- clog << "Re-Instated " << I.Name() << " (" << OldBreaks << " vs " << C=
ache.BrokenCount() << ')' << endl;
+ std::clog << "Re-Instated " << I.Name() << " (" << OldBreaks << " vs "=
<< Cache.BrokenCount() << ')' << std::endl;
}
=
if (Cache[I].InstallVer =3D=3D 0 || Cache[I].InstBroken() =3D=3D false)
continue;
=
if (Debug =3D=3D true)
- cout << "Investigating " << I.Name() << endl;
+ std::cout << "Investigating " << I.Name() << std::endl;
=
// Isolate the problem dependency
PackageKill KillList[100];
@@ -800,7 +800,7 @@
if ((Flags[I->ID] & Protected) !=3D Protected)
{
if (Debug =3D=3D true)
- clog << " Or group remove for " << I.Name() << endl;
+ std::clog << " Or group remove for " << I.Name() << std::endl;
Cache.MarkDelete(I);
Change =3D true;
} =
@@ -808,7 +808,7 @@
if (OldEnd =3D=3D LEnd && OrOp =3D=3D OrKeep)
{
if (Debug =3D=3D true)
- clog << " Or group keep for " << I.Name() << endl;
+ std::clog << " Or group keep for " << I.Name() << std::endl;
Cache.MarkKeep(I);
Change =3D true;
}
@@ -840,7 +840,7 @@
}
=
if (Debug =3D=3D true)
- clog << "Package " << I.Name() << " has broken dep on " << Start.T=
argetPkg().Name() << endl;
+ std::clog << "Package " << I.Name() << " has broken dep on " << St=
art.TargetPkg().Name() << std::endl;
=
/* Look across the version list. If there are no possible
targets then we keep the package and bail. This is necessary
@@ -870,8 +870,8 @@
pkgCache::PkgIterator Pkg =3D Ver.ParentPkg();
=
if (Debug =3D=3D true)
- clog << " Considering " << Pkg.Name() << ' ' << (int)Scores[Pkg->ID] =
<<
- " as a solution to " << I.Name() << ' ' << (int)Scores[I->ID] << endl;
+ std::clog << " Considering " << Pkg.Name() << ' ' << (int)Scores[Pkg-=
>ID] <<
+ " as a solution to " << I.Name() << ' ' << (int)Scores[I->ID] << std::=
endl;
=
/* Try to fix the package under consideration rather than
fiddle with the VList package */
@@ -908,7 +908,7 @@
Cache.MarkInstall(I,false);
=
if (Debug =3D=3D true)
- clog << " Holding Back " << I.Name() << " rather than change " << Star=
t.TargetPkg().Name() << endl;
+ std::clog << " Holding Back " << I.Name() << " rather than change " <<=
Start.TargetPkg().Name() << std::endl;
} =
else
{ =
@@ -918,7 +918,7 @@
if (InOr =3D=3D false)
{
if (Debug =3D=3D true)
- clog << " Removing " << I.Name() << " rather than change " << St=
art.TargetPkg().Name() << endl;
+ std::clog << " Removing " << I.Name() << " rather than change " =
<< Start.TargetPkg().Name() << std::endl;
Cache.MarkDelete(I);
if (Counter > 1)
{
@@ -949,7 +949,7 @@
continue;
=
if (Debug =3D=3D true)
- clog << " Added " << Pkg.Name() << " to the remove list" << endl;
+ std::clog << " Added " << Pkg.Name() << " to the remove list" << s=
td::endl;
=
LEnd->Pkg =3D Pkg;
LEnd->Dep =3D End;
@@ -980,12 +980,12 @@
Cache.MarkInstall(I,false);
=
if (Debug =3D=3D true)
- clog << " Holding Back " << I.Name() << " because I can't find " <=
< Start.TargetPkg().Name() << endl;
+ std::clog << " Holding Back " << I.Name() << " because I can't fin=
d " << Start.TargetPkg().Name() << std::endl;
} =
else
{
if (Debug =3D=3D true)
- clog << " Removing " << I.Name() << " because I can't find " << St=
art.TargetPkg().Name() << endl;
+ std::clog << " Removing " << I.Name() << " because I can't find " =
<< Start.TargetPkg().Name() << std::endl;
if (InOr =3D=3D false)
Cache.MarkDelete(I);
}
@@ -1014,14 +1014,14 @@
J->Dep->Type =3D=3D pkgCache::Dep::Obsoletes)
{
if (Debug =3D=3D true)
- clog << " Fixing " << I.Name() << " via remove of " << J->Pkg.Name() <=
< endl;
+ std::clog << " Fixing " << I.Name() << " via remove of " << J->Pkg.Nam=
e() << std::endl;
Cache.MarkDelete(J->Pkg);
}
}
else
{
if (Debug =3D=3D true)
- clog << " Fixing " << I.Name() << " via keep of " << J->Pkg.Name()=
<< endl;
+ std::clog << " Fixing " << I.Name() << " via keep of " << J->Pkg.N=
ame() << std::endl;
Cache.MarkKeep(J->Pkg);
}
=
@@ -1036,7 +1036,7 @@
}
=
if (Debug =3D=3D true)
- clog << "Done" << endl;
+ std::clog << "Done" << std::endl;
=
if (Cache.BrokenCount() !=3D 0)
{
@@ -1065,7 +1065,7 @@
unsigned long Size =3D Cache.Head().PackageCount;
=
if (Debug =3D=3D true) =
- clog << "Entering ResolveByKeep" << endl;
+ std::clog << "Entering ResolveByKeep" << std::endl;
=
MakeScores();
=
@@ -1094,7 +1094,7 @@
if ((Flags[I->ID] & Protected) =3D=3D 0)
{
if (Debug =3D=3D true)
- clog << "Keeping package " << I.Name() << endl;
+ std::clog << "Keeping package " << I.Name() << std::endl;
Cache.MarkKeep(I);
if (Cache[I].InstBroken() =3D=3D false)
{
@@ -1125,7 +1125,7 @@
while (true)
{
if (Debug =3D=3D true)
- clog << "Package " << I.Name() << " has broken dep on " << Start.T=
argetPkg().Name() << endl;
+ std::clog << "Package " << I.Name() << " has broken dep on " << St=
art.TargetPkg().Name() << std::endl;
=
// Look at all the possible provides on this package
SPtrArray<pkgCache::Version *> VList =3D Start.AllTargets();
@@ -1142,7 +1142,7 @@
if ((Flags[I->ID] & Protected) =3D=3D 0)
{
if (Debug =3D=3D true)
- clog << " Keeping Package " << Pkg.Name() << " due to dep" << endl;
+ std::clog << " Keeping Package " << Pkg.Name() << " due to dep" <<=
std::endl;
Cache.MarkKeep(Pkg);
}
=
-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux asterix 2.4.19-k7 #1 Sun Oct 6 20:29:56 EST 2002 i686
Locale: LANG=3Dde_DE@euro, LC_CTYPE=3Dde_DE@euro (ignored: LC_ALL set)
Versions of packages apt depends on:
ii libc6 2.3.1-3 GNU C Library: Shared librarie=
s an
ii libstdc++2.10-glibc2.2 1:2.95.4-12 The GNU stdc++ library
-- no debconf information
Reply to: