Apply apt-0.5.15cnc6-alt-PrintLocalFile.patch

Added in commit 8542fdc:
0.5.15cnc6-alt17

- apt-utils: Set locale to "C" (#2587).
- apt-utils: Added list of utilities to package description (#3564).
- apt-get: Implemented APT::Get::PrintLocalFile option.
This commit is contained in:
Gleb Fotengauer-Malinovskiy 2014-05-16 21:04:22 +04:00
parent eafde03fad
commit 89a98dd27f
2 changed files with 24 additions and 47 deletions

View File

@ -1,47 +0,0 @@
--- 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
@@ -1025,6 +1025,14 @@ bool InstallPackages(CacheFile &Cache,bo
// 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"))
+ {
+ struct stat stb;
+ for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I < Fetcher.ItemsEnd(); ++I)
+ if (((*I)->Local) && !stat((*I)->DestFile.c_str(), &stb))
+ cout << (*I)->DestFile << endl;
+ return true;
+ }
pkgAcquire::UriIterator I = Fetcher.UriBegin();
for (; I != Fetcher.UriEnd(); I++)
cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
@@ -1719,6 +1726,14 @@ bool DoUpdate(CommandLine &CmdL)
// 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"))
+ {
+ struct stat stb;
+ for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I < Fetcher.ItemsEnd(); ++I)
+ if (((*I)->Local) && !stat((*I)->DestFile.c_str(), &stb))
+ cout << (*I)->DestFile << endl;
+ return true;
+ }
pkgAcquire::UriIterator I = Fetcher.UriBegin();
for (; I != Fetcher.UriEnd(); I++)
cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
@@ -2533,6 +2547,14 @@ bool DoSource(CommandLine &CmdL)
// 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"))
+ {
+ struct stat stb;
+ for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I < Fetcher.ItemsEnd(); ++I)
+ if (((*I)->Local) && !stat((*I)->DestFile.c_str(), &stb))
+ cout << (*I)->DestFile << endl;
+ return true;
+ }
pkgAcquire::UriIterator I = Fetcher.UriBegin();
for (; I != Fetcher.UriEnd(); I++)
cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<

View File

@ -1025,6 +1025,14 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
// 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"))
{
struct stat stb;
for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I < Fetcher.ItemsEnd(); ++I)
if (((*I)->Local) && !stat((*I)->DestFile.c_str(), &stb))
cout << (*I)->DestFile << endl;
return true;
}
pkgAcquire::UriIterator I = Fetcher.UriBegin();
for (; I != Fetcher.UriEnd(); I++)
cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
@ -1734,6 +1742,14 @@ bool DoUpdate(CommandLine &CmdL)
// 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"))
{
struct stat stb;
for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I < Fetcher.ItemsEnd(); ++I)
if (((*I)->Local) && !stat((*I)->DestFile.c_str(), &stb))
cout << (*I)->DestFile << endl;
return true;
}
pkgAcquire::UriIterator I = Fetcher.UriBegin();
for (; I != Fetcher.UriEnd(); I++)
cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
@ -2591,6 +2607,14 @@ bool DoSource(CommandLine &CmdL)
// 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"))
{
struct stat stb;
for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I < Fetcher.ItemsEnd(); ++I)
if (((*I)->Local) && !stat((*I)->DestFile.c_str(), &stb))
cout << (*I)->DestFile << endl;
return true;
}
pkgAcquire::UriIterator I = Fetcher.UriBegin();
for (; I != Fetcher.UriEnd(); I++)
cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<