Browse Source

Reorder progress report messages

We are seeing 'processing' messages from dpkg first, so it makes sense
to translate them to "Preparing" messages instead of using "Installing"
and co to override these shortly after with the "Preparing" messages.

The difference isn't all to visible as later messages tend to linger far
longer in the display than the ealier ones, but at least in a listing it
seems more logical.
tags/debian/1.7.0_rc1
David Kalnischkies 3 years ago
parent
commit
329c8d5e14
3 changed files with 31 additions and 31 deletions
  1. +9
    -9
      apt-pkg/deb/dpkgpm.cc
  2. +18
    -18
      test/integration/test-apt-progress-fd
  3. +4
    -4
      test/integration/test-apt-progress-fd-deb822

+ 9
- 9
apt-pkg/deb/dpkgpm.cc View File

@@ -142,12 +142,12 @@ namespace
// Maps the dpkg "processing" info to human readable names. Entry 0
// of each array is the key, entry 1 is the value.
const std::pair<const char *, const char *> PackageProcessingOps[] = {
std::make_pair("install", N_("Installing %s")),
std::make_pair("install", N_("Preparing %s")),
// we don't care for the difference
std::make_pair("upgrade", N_("Installing %s")),
std::make_pair("configure", N_("Configuring %s")),
std::make_pair("remove", N_("Removing %s")),
std::make_pair("purge", N_("Completely removing %s")),
std::make_pair("upgrade", N_("Preparing %s")),
std::make_pair("configure", N_("Preparing to configure %s")),
std::make_pair("remove", N_("Preparing for removal of %s")),
std::make_pair("purge", N_("Preparing to completely remove %s")),
std::make_pair("disappear", N_("Noting disappearance of %s")),
std::make_pair("trigproc", N_("Running post-installation trigger %s"))
};
@@ -1157,8 +1157,8 @@ void pkgDPkgPM::BuildPackagesProgressMap()
static const std::array<std::array<DpkgState, 2>, 4> DpkgStatesOpMap = {{
// Install operation
{{
{"half-installed", N_("Preparing %s")},
{"unpacked", N_("Unpacking %s") },
{"half-installed", N_("Unpacking %s")},
{"unpacked", N_("Installing %s") },
}},
// Configure operation
{{
@@ -1167,12 +1167,12 @@ void pkgDPkgPM::BuildPackagesProgressMap()
}},
// Remove operation
{{
{"half-configured", N_("Preparing for removal of %s")},
{"half-configured", N_("Removing %s")},
{"half-installed", N_("Removing %s")},
}},
// Purge operation
{{
{"config-files", N_("Preparing to completely remove %s")},
{"config-files", N_("Completely removing %s")},
{"not-installed", N_("Completely removed %s")},
}},
}};


+ 18
- 18
test/integration/test-apt-progress-fd View File

@@ -18,11 +18,11 @@ testsuccess aptget install testing=0.1 -y -o APT::Status-Fd=3
testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1
dlstatus:1:100.0000:Retrieving file 1 of 1
pmstatus:dpkg-exec:0.0000:Running dpkg
pmstatus:testing:0.0000:Installing testing (amd64)
pmstatus:testing:20.0000:Preparing testing (amd64)
pmstatus:testing:40.0000:Unpacking testing (amd64)
pmstatus:testing:0.0000:Preparing testing (amd64)
pmstatus:testing:20.0000:Unpacking testing (amd64)
pmstatus:testing:40.0000:Installing testing (amd64)
pmstatus:dpkg-exec:40.0000:Running dpkg
pmstatus:testing:40.0000:Configuring testing (amd64)
pmstatus:testing:40.0000:Preparing to configure testing (amd64)
pmstatus:testing:60.0000:Configuring testing (amd64)
pmstatus:testing:80.0000:Installed testing (amd64)'

@@ -32,11 +32,11 @@ testsuccess aptget install testing=0.8.15 -y -o APT::Status-Fd=3
testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1
dlstatus:1:100.0000:Retrieving file 1 of 1
pmstatus:dpkg-exec:0.0000:Running dpkg
pmstatus:testing:0.0000:Installing testing (amd64)
pmstatus:testing:20.0000:Preparing testing (amd64)
pmstatus:testing:40.0000:Unpacking testing (amd64)
pmstatus:testing:0.0000:Preparing testing (amd64)
pmstatus:testing:20.0000:Unpacking testing (amd64)
pmstatus:testing:40.0000:Installing testing (amd64)
pmstatus:dpkg-exec:40.0000:Running dpkg
pmstatus:testing:40.0000:Configuring testing (amd64)
pmstatus:testing:40.0000:Preparing to configure testing (amd64)
pmstatus:testing:60.0000:Configuring testing (amd64)
pmstatus:testing:80.0000:Installed testing (amd64)'

@@ -46,11 +46,11 @@ testsuccess aptget install testing=0.8.15 --reinstall -y -o APT::Status-Fd=3
testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1
dlstatus:1:100.0000:Retrieving file 1 of 1
pmstatus:dpkg-exec:0.0000:Running dpkg
pmstatus:testing:0.0000:Installing testing (amd64)
pmstatus:testing:20.0000:Preparing testing (amd64)
pmstatus:testing:40.0000:Unpacking testing (amd64)
pmstatus:testing:0.0000:Preparing testing (amd64)
pmstatus:testing:20.0000:Unpacking testing (amd64)
pmstatus:testing:40.0000:Installing testing (amd64)
pmstatus:dpkg-exec:40.0000:Running dpkg
pmstatus:testing:40.0000:Configuring testing (amd64)
pmstatus:testing:40.0000:Preparing to configure testing (amd64)
pmstatus:testing:60.0000:Configuring testing (amd64)
pmstatus:testing:80.0000:Installed testing (amd64)'

@@ -58,8 +58,8 @@ pmstatus:testing:80.0000:Installed testing (amd64)'
exec 3> apt-progress.log
testsuccess aptget remove testing -y -o APT::Status-Fd=3
testfileequal './apt-progress.log' 'pmstatus:dpkg-exec:0.0000:Running dpkg
pmstatus:testing:0.0000:Removing testing (amd64)
pmstatus:testing:33.3333:Preparing for removal of testing (amd64)
pmstatus:testing:0.0000:Preparing for removal of testing (amd64)
pmstatus:testing:33.3333:Removing testing (amd64)
pmstatus:testing:66.6667:Removing testing (amd64)
pmstatus:dpkg-exec:66.6667:Running dpkg'

@@ -69,11 +69,11 @@ testsuccess aptget install testing2:i386 -y -o APT::Status-Fd=3
testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1
dlstatus:1:100.0000:Retrieving file 1 of 1
pmstatus:dpkg-exec:0.0000:Running dpkg
pmstatus:testing2:0.0000:Installing testing2 (i386)
pmstatus:testing2:20.0000:Preparing testing2 (i386)
pmstatus:testing2:40.0000:Unpacking testing2 (i386)
pmstatus:testing2:0.0000:Preparing testing2 (i386)
pmstatus:testing2:20.0000:Unpacking testing2 (i386)
pmstatus:testing2:40.0000:Installing testing2 (i386)
pmstatus:dpkg-exec:40.0000:Running dpkg
pmstatus:testing2:40.0000:Configuring testing2 (i386)
pmstatus:testing2:40.0000:Preparing to configure testing2 (i386)
pmstatus:testing2:60.0000:Configuring testing2 (i386)
pmstatus:testing2:80.0000:Installed testing2 (i386)'



+ 4
- 4
test/integration/test-apt-progress-fd-deb822 View File

@@ -23,17 +23,17 @@ Message: Running dpkg
Status: progress
Package: testing:amd64
Percent: 0.0000
Message: Installing testing (amd64)
Message: Preparing testing (amd64)

Status: progress
Package: testing:amd64
Percent: 20.0000
Message: Preparing testing (amd64)
Message: Unpacking testing (amd64)

Status: progress
Package: testing:amd64
Percent: 40.0000
Message: Unpacking testing (amd64)
Message: Installing testing (amd64)

Status: progress
Percent: 40.0000
@@ -42,7 +42,7 @@ Message: Running dpkg
Status: progress
Package: testing:amd64
Percent: 40.0000
Message: Configuring testing (amd64)
Message: Preparing to configure testing (amd64)

Status: progress
Package: testing:amd64


Loading…
Cancel
Save