summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-cache.cc27
-rw-r--r--cmdline/apt-get.cc22
-rwxr-xr-xcmdline/apt-key6
3 files changed, 37 insertions, 18 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index e85492576..94cfab14f 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -1226,17 +1226,15 @@ bool DisplayRecord(pkgCache::VerIterator V)
}
// Get a pointer to start of Description field
- unsigned char *DescP = (unsigned char*)strstr((char*)Buffer, "Description:");
+ const unsigned char *DescP = (unsigned char*)strstr((char*)Buffer, "Description:");
// Write all but Description
- if (fwrite(Buffer,1,DescP - Buffer,stdout) < (size_t)(DescP - Buffer))
+ if (fwrite(Buffer,1,DescP - Buffer-1,stdout) < (size_t)(DescP - Buffer-1))
{
delete [] Buffer;
return false;
}
- delete [] Buffer;
-
// Show the right description
pkgRecords Recs(*GCache);
pkgCache::DescIterator DescDefault = V.DescriptionList();
@@ -1247,8 +1245,27 @@ bool DisplayRecord(pkgCache::VerIterator V)
if (Desc.end() == true) Desc = DescDefault;
pkgRecords::Parser &P = Recs.Lookup(Desc.FileList());
- cout << "Description" << ( (strcmp(Desc.LanguageCode(),"") != 0) ? "-" : "" ) << Desc.LanguageCode() << ": " << P.LongDesc() << endl;
+ cout << "Description" << ( (strcmp(Desc.LanguageCode(),"") != 0) ? "-" : "" ) << Desc.LanguageCode() << ": " << P.LongDesc();
+
+ // Find the first field after the description (if there is any)
+ for(DescP++;DescP != &Buffer[V.FileList()->Size];DescP++)
+ {
+ if(*DescP == '\n' && *(DescP+1) != ' ')
+ {
+ // write the rest of the buffer
+ const unsigned char *end=&Buffer[V.FileList()->Size];
+ if (fwrite(DescP,1,end-DescP,stdout) < (size_t)(end-DescP))
+ {
+ delete [] Buffer;
+ return false;
+ }
+ break;
+ }
+ }
+ // write a final newline (after the description)
+ cout<<endl;
+ delete [] Buffer;
return true;
}
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 316bb7af9..e673e0f5b 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -688,7 +688,7 @@ static bool CheckAuth(pkgAcquire& Fetcher)
if (_config->FindB("APT::Get::AllowUnauthenticated",false) == true)
{
- c2out << "Authentication warning overridden.\n";
+ c2out << _("Authentication warning overridden.\n");
return true;
}
@@ -750,7 +750,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
if (Cache->BrokenCount() != 0)
{
ShowBroken(c1out,Cache,false);
- return _error->Error("Internal error, InstallPackages was called with broken packages!");
+ return _error->Error(_("Internal error, InstallPackages was called with broken packages!"));
}
if (Cache->DelCount() == 0 && Cache->InstCount() == 0 &&
@@ -765,11 +765,12 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
if (_config->FindB("APT::Get::Simulate") == true)
{
pkgSimulate PM(Cache);
- pkgPackageManager::OrderResult Res = PM.DoInstall();
+ int status_fd = _config->FindI("APT::Status-Fd",-1);
+ pkgPackageManager::OrderResult Res = PM.DoInstall(status_fd);
if (Res == pkgPackageManager::Failed)
return false;
if (Res != pkgPackageManager::Completed)
- return _error->Error("Internal error, Ordering didn't finish");
+ return _error->Error(_("Internal error, Ordering didn't finish"));
return true;
}
@@ -810,7 +811,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
if (DebBytes != Cache->DebSize())
{
c0out << DebBytes << ',' << Cache->DebSize() << endl;
- c0out << "How odd.. The sizes didn't match, email apt@packages.debian.org" << endl;
+ c0out << _("How odd.. The sizes didn't match, email apt@packages.debian.org") << endl;
}
// Number of bytes
@@ -840,7 +841,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
struct statvfs Buf;
string OutputDir = _config->FindDir("Dir::Cache::Archives");
if (statvfs(OutputDir.c_str(),&Buf) != 0)
- return _error->Errno("statvfs","Couldn't determine free space in %s",
+ return _error->Errno("statvfs",_("Couldn't determine free space in %s"),
OutputDir.c_str());
if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize)
return _error->Error(_("You don't have enough free space in %s."),
@@ -994,7 +995,8 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
}
_system->UnLock();
- pkgPackageManager::OrderResult Res = PM->DoInstall();
+ int status_fd = _config->FindI("APT::Status-Fd",-1);
+ pkgPackageManager::OrderResult Res = PM->DoInstall(status_fd);
if (Res == pkgPackageManager::Failed || _error->PendingError() == true)
return false;
if (Res == pkgPackageManager::Completed)
@@ -1743,7 +1745,7 @@ bool DoDSelectUpgrade(CommandLine &CmdL)
if (Fix.Resolve() == false)
{
ShowBroken(c1out,Cache,false);
- return _error->Error("Internal error, problem resolver broke stuff");
+ return _error->Error(_("Internal error, problem resolver broke stuff"));
}
}
@@ -1751,7 +1753,7 @@ bool DoDSelectUpgrade(CommandLine &CmdL)
if (pkgAllUpgrade(Cache) == false)
{
ShowBroken(c1out,Cache,false);
- return _error->Error("Internal error, problem resolver broke stuff");
+ return _error->Error(_("Internal error, problem resolver broke stuff"));
}
return InstallPackages(Cache,false);
@@ -1922,7 +1924,7 @@ bool DoSource(CommandLine &CmdL)
struct statvfs Buf;
string OutputDir = ".";
if (statvfs(OutputDir.c_str(),&Buf) != 0)
- return _error->Errno("statvfs","Couldn't determine free space in %s",
+ return _error->Errno("statvfs",_("Couldn't determine free space in %s"),
OutputDir.c_str());
if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize)
return _error->Error(_("You don't have enough free space in %s"),
diff --git a/cmdline/apt-key b/cmdline/apt-key
index be2b19a1a..0685e36f7 100755
--- a/cmdline/apt-key
+++ b/cmdline/apt-key
@@ -9,14 +9,14 @@ GPG_CMD="gpg --no-options --no-default-keyring --secret-keyring /etc/apt/secring
GPG="$GPG_CMD --keyring /etc/apt/trusted.gpg"
-ARCHIVE_KEYRING=/usr/share/keyrings/ubuntu-archive-keyring.gpg
-REMOVED_KEYS=/usr/share/keyrings/ubuntu-archive-removed-keys.gpg
+ARCHIVE_KEYRING=/usr/share/keyrings/debian-archive-keyring.gpg
+REMOVED_KEYS=/usr/share/keyrings/debian-archive-removed-keys.gpg
update() {
if [ ! -f $ARCHIVE_KEYRING ]; then
echo >&2 "ERROR: Can't find the archive-keyring"
- echo >&2 "Is the ubuntu-keyring package installed?"
+ echo >&2 "Is the debian-keyring package installed?"
exit 1
fi