2005-11-26 01:15:14 +03:00
--- apt-0.5.15cnc6/cmdline/apt-get.cc.orig 2005-11-25 16:23:26 +0000
+++ apt-0.5.15cnc6/cmdline/apt-get.cc 2005-11-25 19:12:14 +0000
2006-02-21 03:47:29 +03:00
@@ -1025,6 +1025,14 @@ bool InstallPackages(CacheFile &Cache,bo
2005-11-26 01:15:14 +03:00
// Just print out the uris an exit if the --print-uris flag was used
if (_config->FindB("APT::Get::Print-URIs") == true)
{
+ if (_config->FindB("APT::Get::PrintLocalFile"))
+ {
2006-02-21 03:47:29 +03:00
+ struct stat stb;
2005-11-26 01:15:14 +03:00
+ for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I < Fetcher.ItemsEnd(); ++I)
2006-02-21 03:47:29 +03:00
+ if (((*I)->Local) && !stat((*I)->DestFile.c_str(), &stb))
2005-11-26 01:15:14 +03:00
+ cout << (*I)->DestFile << endl;
+ return true;
+ }
pkgAcquire::UriIterator I = Fetcher.UriBegin();
for (; I != Fetcher.UriEnd(); I++)
cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
2006-02-21 03:47:29 +03:00
@@ -1719,6 +1726,14 @@ bool DoUpdate(CommandLine &CmdL)
2005-11-26 01:15:14 +03:00
// Just print out the uris an exit if the --print-uris flag was used
if (_config->FindB("APT::Get::Print-URIs") == true)
{
+ if (_config->FindB("APT::Get::PrintLocalFile"))
+ {
2006-02-21 03:47:29 +03:00
+ struct stat stb;
2005-11-26 01:15:14 +03:00
+ for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I < Fetcher.ItemsEnd(); ++I)
2006-02-21 03:47:29 +03:00
+ if (((*I)->Local) && !stat((*I)->DestFile.c_str(), &stb))
2005-11-26 01:15:14 +03:00
+ cout << (*I)->DestFile << endl;
+ return true;
+ }
pkgAcquire::UriIterator I = Fetcher.UriBegin();
for (; I != Fetcher.UriEnd(); I++)
cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
2006-02-21 03:47:29 +03:00
@@ -2533,6 +2547,14 @@ bool DoSource(CommandLine &CmdL)
2005-11-26 01:15:14 +03:00
// Just print out the uris an exit if the --print-uris flag was used
if (_config->FindB("APT::Get::Print-URIs") == true)
{
+ if (_config->FindB("APT::Get::PrintLocalFile"))
+ {
2006-02-21 03:47:29 +03:00
+ struct stat stb;
2005-11-26 01:15:14 +03:00
+ for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I < Fetcher.ItemsEnd(); ++I)
2006-02-21 03:47:29 +03:00
+ if (((*I)->Local) && !stat((*I)->DestFile.c_str(), &stb))
2005-11-26 01:15:14 +03:00
+ cout << (*I)->DestFile << endl;
+ return true;
+ }
pkgAcquire::UriIterator I = Fetcher.UriBegin();
for (; I != Fetcher.UriEnd(); I++)
cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<