From 5fd25d678f51cfa013643efe3429eb08b9504058 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Thu, 16 Jan 2014 23:00:27 +0100
Subject: use gpg --homedir instead of explicit file placement
Avoids that gpg gets the idea it could use files from the user which
weren't overridden specifically like secret keyring and trustdb as
before.
---
cmdline/apt-key.in | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
(limited to 'cmdline')
diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in
index 463e4b4b4..0ced500db 100644
--- a/cmdline/apt-key.in
+++ b/cmdline/apt-key.in
@@ -5,22 +5,23 @@ unset GREP_OPTIONS
GPG_CMD="gpg --ignore-time-conflict --no-options --no-default-keyring"
-# gpg needs a trustdb to function, but it can't be invalid (not even empty)
-# so we create a temporary directory to store our fresh readable trustdb in
-TRUSTDBDIR="$(mktemp -d)"
-CURRENTTRAP="${CURRENTTRAP} rm -rf '${TRUSTDBDIR}';"
+# gpg needs (in different versions more or less) files to function correctly,
+# so we give it its own homedir and generate some valid content for it
+GPGHOMEDIR="$(mktemp -d)"
+CURRENTTRAP="${CURRENTTRAP} rm -rf '${GPGHOMEDIR}';"
trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
-chmod 700 "$TRUSTDBDIR"
-# We also don't use a secret keyring, of course, but gpg panics and
+chmod 700 "$GPGHOMEDIR"
+# We don't use a secret keyring, of course, but gpg panics and
# implodes if there isn't one available - and writeable for imports
-SECRETKEYRING="${TRUSTDBDIR}/secring.gpg"
+SECRETKEYRING="${GPGHOMEDIR}/secring.gpg"
touch $SECRETKEYRING
-GPG_CMD="$GPG_CMD --secret-keyring $SECRETKEYRING"
-GPG_CMD="$GPG_CMD --trustdb-name ${TRUSTDBDIR}/trustdb.gpg"
-
-# now create the trustdb with an (empty) dummy keyring
-$GPG_CMD --quiet --check-trustdb --keyring $SECRETKEYRING
-# and make sure that gpg isn't trying to update the file
+GPG_CMD="$GPG_CMD --homedir $GPGHOMEDIR"
+# create the trustdb with an (empty) dummy keyring
+# older gpgs required it, newer gpgs even warn that it isn't needed,
+# but require it nontheless for some commands, so we just play safe
+# here for the foreseeable future and create a dummy one
+$GPG_CMD --quiet --check-trustdb --keyring $SECRETKEYRING >/dev/null 2>&1
+# tell gpg that it shouldn't try to maintain a trustdb file
GPG_CMD="$GPG_CMD --no-auto-check-trustdb --trust-model always"
GPG="$GPG_CMD"
--
cgit v1.2.3-70-g09d2
From 82e7f817a434e29df9ec6fbf19acfd8e7cd890e5 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Fri, 17 Jan 2014 07:48:43 +0100
Subject: add apt upgrade --dist
---
apt-private/private-cmndline.cc | 5 +++++
cmdline/apt.cc | 11 ++++++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
(limited to 'cmdline')
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc
index d6d7bca64..cbb40d42e 100644
--- a/apt-private/private-cmndline.cc
+++ b/apt-private/private-cmndline.cc
@@ -230,6 +230,11 @@ bool addArgumentsAPT(std::vector &Args, char const * const Cm
addArg('v', "verbose", "APT::Cmd::List-Include-Summary", 0);
addArg('a', "all-versions", "APT::Cmd::All-Versions", 0);
}
+ else if (CmdMatches("upgrade"))
+ {
+ // FIXME: find a better term
+ addArg(0,"dist","APT::Cmd::Dist-Upgrade", CommandLine::Boolean);
+ }
else if (addArgumentsAPTGet(Args, Cmd) || addArgumentsAPTCache(Args, Cmd))
{
// we have no (supported) command-name overlaps so far, so we call
diff --git a/cmdline/apt.cc b/cmdline/apt.cc
index 4bcae0aba..4dc826632 100644
--- a/cmdline/apt.cc
+++ b/cmdline/apt.cc
@@ -86,6 +86,15 @@ bool ShowHelp(CommandLine &CmdL)
return true;
}
+// figure out what kind of upgrade the user wants
+bool DoAptUpgrade(CommandLine &CmdL)
+{
+ if (_config->FindB("Apt::Cmd::Dist-Upgrade"))
+ return DoDistUpgrade(CmdL);
+ else
+ return DoUpgradeWithAllowNewPackages(CmdL);
+}
+
int main(int argc, const char *argv[]) /*{{{*/
{
CommandLine::Dispatch Cmds[] = {{"list",&List},
@@ -95,7 +104,7 @@ int main(int argc, const char *argv[]) /*{{{*/
{"install",&DoInstall},
{"remove", &DoInstall},
{"update",&DoUpdate},
- {"upgrade",&DoUpgradeWithAllowNewPackages},
+ {"upgrade",&DoAptUpgrade},
// misc
{"edit-sources",&EditSources},
// helper
--
cgit v1.2.3-70-g09d2
From b7159ec8835e61ea3069213d9188be91c109e32c Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Fri, 17 Jan 2014 07:52:22 +0100
Subject: reword !isatty() warning
---
cmdline/apt.cc | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
(limited to 'cmdline')
diff --git a/cmdline/apt.cc b/cmdline/apt.cc
index 4dc826632..2d3966e86 100644
--- a/cmdline/apt.cc
+++ b/cmdline/apt.cc
@@ -117,10 +117,9 @@ int main(int argc, const char *argv[]) /*{{{*/
if(!isatty(1))
{
std::cerr << std::endl
- << "WARNING WARNING "
- << argv[0]
- << " is *NOT* intended for scripts "
- << "use at your own peril^Wrisk"
+ << "WARNING: " << argv[0] << " "
+ << "does not have a stable CLI interface yet. "
+ << "Use with caution in scripts."
<< std::endl
<< std::endl;
}
--
cgit v1.2.3-70-g09d2
From 1410955589dc9f0eaa290907cac070b7ebf93b6a Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Fri, 17 Jan 2014 08:43:14 +0100
Subject: add missing integration test for "apt list"
---
apt-private/private-list.cc | 12 ++++++----
apt-private/private-output.cc | 8 ++++---
cmdline/apt.cc | 23 +++++++++++---------
test/integration/framework | 10 +++++----
test/integration/test-apt-binary | 47 ++++++++++++++++++++++++++++++++++++++++
5 files changed, 79 insertions(+), 21 deletions(-)
create mode 100755 test/integration/test-apt-binary
(limited to 'cmdline')
diff --git a/apt-private/private-list.cc b/apt-private/private-list.cc
index a02ebf02d..fbb66d204 100644
--- a/apt-private/private-list.cc
+++ b/apt-private/private-list.cc
@@ -101,11 +101,15 @@ private:
/*}}}*/
void ListAllVersions(pkgCacheFile &CacheFile, pkgRecords &records, /*{{{*/
pkgCache::PkgIterator P,
- std::ostream &outs)
+ std::ostream &outs,
+ bool include_summary=true)
{
for (pkgCache::VerIterator Ver = P.VersionList();
Ver.end() == false; Ver++)
- ListSingleVersion(CacheFile, records, Ver, outs);
+ {
+ ListSingleVersion(CacheFile, records, Ver, outs, include_summary);
+ outs << "\n";
+ }
}
/*}}}*/
// list - list package based on criteria /*{{{*/
@@ -136,7 +140,7 @@ bool List(CommandLine &Cmd)
PackageNameMatcher matcher(patterns);
LocalitySortedVersionSet bag;
- OpTextProgress progress;
+ OpTextProgress progress(*_config);
progress.OverallProgress(0,
Cache->Head().PackageCount,
Cache->Head().PackageCount,
@@ -147,7 +151,7 @@ bool List(CommandLine &Cmd)
std::stringstream outs;
if(_config->FindB("APT::Cmd::All-Versions", false) == true)
{
- ListAllVersions(CacheFile, records, V.ParentPkg(), outs);
+ ListAllVersions(CacheFile, records, V.ParentPkg(), outs, includeSummary);
output_map.insert(std::make_pair(
V.ParentPkg().Name(), outs.str()));
} else {
diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc
index 91d13f31b..a8bbad9e5 100644
--- a/apt-private/private-output.cc
+++ b/apt-private/private-output.cc
@@ -114,11 +114,13 @@ std::string GetVersion(pkgCacheFile &CacheFile, pkgCache::VerIterator V)/*{{{*/
pkgCache::PkgIterator P = V.ParentPkg();
if (V == P.CurrentVer())
{
+ std::string inst_str = DeNull(V.VerStr());
+#if 0 // FIXME: do we want this or something like this?
pkgDepCache *DepCache = CacheFile.GetDepCache();
pkgDepCache::StateCache &state = (*DepCache)[P];
- std::string inst_str = DeNull(V.VerStr());
if (state.Upgradable())
return "**"+inst_str;
+#endif
return inst_str;
}
@@ -224,11 +226,11 @@ void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records, /*{{{*/
else
out << GetVersion(CacheFile, V);
}
- out << " " << GetArchitecture(CacheFile, P) << " ";
+ out << " " << GetArchitecture(CacheFile, P);
if (include_summary)
{
out << std::endl
- << " " << GetShortDescription(CacheFile, records, P)
+ << " " << GetShortDescription(CacheFile, records, P)
<< std::endl;
}
}
diff --git a/cmdline/apt.cc b/cmdline/apt.cc
index 2d3966e86..8dc4c292a 100644
--- a/cmdline/apt.cc
+++ b/cmdline/apt.cc
@@ -114,16 +114,6 @@ int main(int argc, const char *argv[]) /*{{{*/
std::vector Args = getCommandArgs("apt", CommandLine::GetCommand(Cmds, argc, argv));
- if(!isatty(1))
- {
- std::cerr << std::endl
- << "WARNING: " << argv[0] << " "
- << "does not have a stable CLI interface yet. "
- << "Use with caution in scripts."
- << std::endl
- << std::endl;
- }
-
InitOutput();
// Set up gettext support
@@ -149,6 +139,19 @@ int main(int argc, const char *argv[]) /*{{{*/
return 100;
}
+ if(!isatty(STDOUT_FILENO) &&
+ _config->FindB("Apt::Cmd::Disable-Script-Warning", false) == false)
+ {
+ std::cerr << std::endl
+ << "WARNING: " << argv[0] << " "
+ << "does not have a stable CLI interface yet. "
+ << "Use with caution in scripts."
+ << std::endl
+ << std::endl;
+ }
+ if (!isatty(STDOUT_FILENO) && _config->FindI("quiet", -1) == -1)
+ _config->Set("quiet","1");
+
// See if the help should be shown
if (_config->FindB("help") == true ||
_config->FindB("version") == true ||
diff --git a/test/integration/framework b/test/integration/framework
index a28363768..6620c78dd 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -99,6 +99,7 @@ aptconfig() { runapt apt-config $*; }
aptcache() { runapt apt-cache $*; }
aptcdrom() { runapt apt-cdrom $*; }
aptget() { runapt apt-get $*; }
+apt() { runapt apt $*; }
aptftparchive() { runapt apt-ftparchive $*; }
aptkey() { runapt apt-key $*; }
aptmark() { runapt apt-mark $*; }
@@ -202,6 +203,7 @@ setupenvironment() {
echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf
echo 'quiet::NoUpdate "true";' >> aptconfig.conf
echo "Acquire::https::CaInfo \"${TESTDIR}/apt.pem\";" > rootdir/etc/apt/apt.conf.d/99https
+ echo "Apt::Cmd::Disable-Script-Warning \"1\";" > rootdir/etc/apt/apt.conf.d/apt-binary
export LC_ALL=C
export PATH="${PATH}:/usr/local/sbin:/usr/sbin:/sbin"
configcompression '.' 'gz' #'bz2' 'lzma' 'xz'
@@ -288,7 +290,7 @@ setupsimplenativepackage() {
local VERSION="$3"
local RELEASE="${4:-unstable}"
local DEPENDENCIES="$5"
- local DESCRIPTION="${6:-"Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
+ local DESCRIPTION="${6:-"an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
If you find such a package installed on your system,
something went horribly wrong! They are autogenerated
und used only by testcases and surf no other propose…"}"
@@ -338,7 +340,7 @@ buildsimplenativepackage() {
local VERSION="$3"
local RELEASE="${4:-unstable}"
local DEPENDENCIES="$5"
- local DESCRIPTION="${6:-"Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
+ local DESCRIPTION="${6:-"an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
If you find such a package installed on your system,
something went horribly wrong! They are autogenerated
und used only by testcases and surf no other propose…"}"
@@ -535,7 +537,7 @@ insertpackage() {
local VERSION="$4"
local DEPENDENCIES="$5"
local PRIORITY="${6:-optional}"
- local DESCRIPTION="${7:-"Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
+ local DESCRIPTION="${7:-"an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
If you find such a package installed on your system,
something went horribly wrong! They are autogenerated
und used only by testcases and surf no other propose…"}"
@@ -595,7 +597,7 @@ insertinstalledpackage() {
local DEPENDENCIES="$4"
local PRIORITY="${5:-optional}"
local STATUS="${6:-install ok installed}"
- local DESCRIPTION="${7:-"Description: an autogenerated dummy ${NAME}=${VERSION}/installed
+ local DESCRIPTION="${7:-"an autogenerated dummy ${NAME}=${VERSION}/installed
If you find such a package installed on your system,
something went horribly wrong! They are autogenerated
und used only by testcases and surf no other propose…"}"
diff --git a/test/integration/test-apt-binary b/test/integration/test-apt-binary
new file mode 100755
index 000000000..8d5df9051
--- /dev/null
+++ b/test/integration/test-apt-binary
@@ -0,0 +1,47 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+insertpackage 'unstable' 'foo' 'all' '1.0'
+insertinstalledpackage 'bar' 'i386' '1.0'
+
+insertinstalledpackage 'foobar' 'i386' '1.0'
+insertpackage 'unstable' 'foobar' 'i386' '2.0'
+
+setupaptarchive
+
+APTARCHIVE=$(readlink -f ./aptarchive)
+
+testequal "Listing...
+bar/now 1.0 [installed,local] i386
+foo/unstable 1.0 all
+foobar/unstable 2.0 [upgradable from: 1.0] i386" apt list
+
+testequal "Listing...
+foo/unstable 1.0 all
+foobar/unstable 2.0 [upgradable from: 1.0] i386" apt list "foo*"
+
+testequal "Listing...
+foobar/unstable 2.0 [upgradable from: 1.0] i386" apt list --upgradable
+
+# FIXME: hm, hm - does it make sense to have this different? shouldn't
+# we use "installed,upgradable" consitently?
+testequal "Listing...
+bar/now 1.0 [installed,local] i386
+foobar/now 1.0 [installed,upgradable to: 2.0] i386" apt list --installed
+
+testequal "Listing...
+foobar/unstable 2.0 [upgradable from: 1.0] i386
+foobar/now 1.0 [installed,upgradable to: 2.0] i386
+" apt list foobar --all-versions
+
+testequal "Listing...
+bar/now 1.0 [installed,local] i386
+ an autogenerated dummy bar=1.0/installed
+" apt list bar --verbose
+
--
cgit v1.2.3-70-g09d2
From 8a59cc322ac57c6662949e957611ed718a5f5119 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Fri, 17 Jan 2014 21:38:23 +0100
Subject: add purge to the apt cmdline
---
cmdline/apt.cc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
(limited to 'cmdline')
diff --git a/cmdline/apt.cc b/cmdline/apt.cc
index 8dc4c292a..61d5d938a 100644
--- a/cmdline/apt.cc
+++ b/cmdline/apt.cc
@@ -71,13 +71,16 @@ bool ShowHelp(CommandLine &CmdL)
_("Usage: apt [options] command\n"
"\n"
"CLI for apt.\n"
- "Commands: \n"
+ "Basic commands: \n"
" list - list packages based on package names\n"
" search - search in package descriptions\n"
" show - show package details\n"
"\n"
" update - update list of available packages\n"
+ "\n"
" install - install packages\n"
+ " remove - remove packages\n"
+ "\n"
" upgrade - upgrade the systems packages\n"
"\n"
" edit-sources - edit the source information file\n"
@@ -103,6 +106,7 @@ int main(int argc, const char *argv[]) /*{{{*/
// needs root
{"install",&DoInstall},
{"remove", &DoInstall},
+ {"purge", &DoInstall},
{"update",&DoUpdate},
{"upgrade",&DoAptUpgrade},
// misc
--
cgit v1.2.3-70-g09d2
From 6d73fe5be080e66a4f6ff2b250ed1957ae7ac063 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Wed, 22 Jan 2014 16:41:00 +0100
Subject: add test for apt show
---
cmdline/apt.cc | 3 ++-
test/integration/test-apt-cli-search | 3 ---
test/integration/test-apt-cli-show | 29 +++++++++++++++++++++++++++++
3 files changed, 31 insertions(+), 4 deletions(-)
create mode 100755 test/integration/test-apt-cli-show
(limited to 'cmdline')
diff --git a/cmdline/apt.cc b/cmdline/apt.cc
index 61d5d938a..07ade6b7c 100644
--- a/cmdline/apt.cc
+++ b/cmdline/apt.cc
@@ -103,10 +103,11 @@ int main(int argc, const char *argv[]) /*{{{*/
CommandLine::Dispatch Cmds[] = {{"list",&List},
{"search", &FullTextSearch},
{"show", &APT::Cmd::ShowPackage},
- // needs root
+ // package stuff
{"install",&DoInstall},
{"remove", &DoInstall},
{"purge", &DoInstall},
+ // system wide stuff
{"update",&DoUpdate},
{"upgrade",&DoAptUpgrade},
// misc
diff --git a/test/integration/test-apt-cli-search b/test/integration/test-apt-cli-search
index aa6018bca..979aff880 100755
--- a/test/integration/test-apt-cli-search
+++ b/test/integration/test-apt-cli-search
@@ -40,6 +40,3 @@ testequal "bar/testing 2.0 i386
foo/unstable 1.0 all
$DESCR
" apt search -qq aabbcc
-
-
-
diff --git a/test/integration/test-apt-cli-show b/test/integration/test-apt-cli-show
new file mode 100755
index 000000000..0ab3d2e56
--- /dev/null
+++ b/test/integration/test-apt-cli-show
@@ -0,0 +1,29 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+DESCR='Some description
+ That has multiple lines'
+insertpackage 'unstable' 'foo' 'all' '1.0' '' '' "$DESCR"
+
+setupaptarchive
+
+APTARCHIVE=$(readlink -f ./aptarchive)
+
+# note that we do not display Description-md5 with the "apt" cmd
+testequal "Package: foo
+Priority: optional
+Section: other
+Installed-Size: 42
+Maintainer: Joe Sixpack
+Architecture: all
+Version: 1.0
+Filename: pool/main/foo/foo_1.0_all.deb
+Description: Some description
+ That has multiple lines
+" apt show foo
--
cgit v1.2.3-70-g09d2
From 59e81cec3e2277e367f14f113168421909c42035 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Fri, 24 Jan 2014 20:33:02 +0100
Subject: add "apt full-upgrade" and tweak "apt upgrade"
There is a new "apt full-upgrade" that performs a apt-get dist-upgrade.
"apt dist-upgrade" is still supported as a alias. The "apt upgrade" code
is changed so that it mirrors the behavior of
"apt-get upgrade --with-new-pkgs" and also honors
"apt uprade --no-new-pkgs".
---
.gitignore | 1 +
apt-private/private-cmndline.cc | 5 -----
apt-private/private-upgrade.cc | 9 +++++++++
apt-private/private-upgrade.h | 1 +
cmdline/apt-get.cc | 8 --------
cmdline/apt.cc | 32 +++++++++++++++++---------------
test/integration/test-apt-cli-upgrade | 34 ++++++++++++++++++++++++++++++++++
7 files changed, 62 insertions(+), 28 deletions(-)
create mode 100755 test/integration/test-apt-cli-upgrade
(limited to 'cmdline')
diff --git a/.gitignore b/.gitignore
index 321b15471..69a229c3e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+*~
# build artifacts
/aclocal.m4
/autom4te.cache/
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc
index cbb40d42e..d6d7bca64 100644
--- a/apt-private/private-cmndline.cc
+++ b/apt-private/private-cmndline.cc
@@ -230,11 +230,6 @@ bool addArgumentsAPT(std::vector &Args, char const * const Cm
addArg('v', "verbose", "APT::Cmd::List-Include-Summary", 0);
addArg('a', "all-versions", "APT::Cmd::All-Versions", 0);
}
- else if (CmdMatches("upgrade"))
- {
- // FIXME: find a better term
- addArg(0,"dist","APT::Cmd::Dist-Upgrade", CommandLine::Boolean);
- }
else if (addArgumentsAPTGet(Args, Cmd) || addArgumentsAPTCache(Args, Cmd))
{
// we have no (supported) command-name overlaps so far, so we call
diff --git a/apt-private/private-upgrade.cc b/apt-private/private-upgrade.cc
index e76b5d7fc..a97e6d25b 100644
--- a/apt-private/private-upgrade.cc
+++ b/apt-private/private-upgrade.cc
@@ -1,3 +1,4 @@
+
// Includes /*{{{*/
#include
#include
@@ -39,6 +40,14 @@ bool DoDistUpgrade(CommandLine &CmdL)
return UpgradeHelper(CmdL, 0);
}
/*}}}*/
+bool DoUpgrade(CommandLine &CmdL) /*{{{*/
+{
+ if (_config->FindB("APT::Get::Upgrade-Allow-New", false) == true)
+ return DoUpgradeWithAllowNewPackages(CmdL);
+ else
+ return DoUpgradeNoNewPackages(CmdL);
+}
+ /*}}}*/
// DoUpgradeNoNewPackages - Upgrade all packages /*{{{*/
// ---------------------------------------------------------------------
/* Upgrade all packages without installing new packages or erasing old
diff --git a/apt-private/private-upgrade.h b/apt-private/private-upgrade.h
index 050d3a668..5efc66bf7 100644
--- a/apt-private/private-upgrade.h
+++ b/apt-private/private-upgrade.h
@@ -5,6 +5,7 @@
bool DoDistUpgrade(CommandLine &CmdL);
+bool DoUpgrade(CommandLine &CmdL);
bool DoUpgradeNoNewPackages(CommandLine &CmdL);
bool DoUpgradeWithAllowNewPackages(CommandLine &CmdL);
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 8a0772ce2..da7d28a1e 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1677,14 +1677,6 @@ void SigWinch(int)
if (ioctl(1, TIOCGWINSZ, &ws) != -1 && ws.ws_col >= 5)
ScreenWidth = ws.ws_col - 1;
#endif
-}
- /*}}}*/
-bool DoUpgrade(CommandLine &CmdL) /*{{{*/
-{
- if (_config->FindB("APT::Get::Upgrade-Allow-New", false) == true)
- return DoUpgradeWithAllowNewPackages(CmdL);
- else
- return DoUpgradeNoNewPackages(CmdL);
}
/*}}}*/
int main(int argc,const char *argv[]) /*{{{*/
diff --git a/cmdline/apt.cc b/cmdline/apt.cc
index 07ade6b7c..6fe25e3f3 100644
--- a/cmdline/apt.cc
+++ b/cmdline/apt.cc
@@ -81,7 +81,8 @@ bool ShowHelp(CommandLine &CmdL)
" install - install packages\n"
" remove - remove packages\n"
"\n"
- " upgrade - upgrade the systems packages\n"
+ " upgrade - upgrade the system by installing/upgrading packages\n"
+ "full-upgrade - upgrade the system by removing/installing/upgrading packages\n"
"\n"
" edit-sources - edit the source information file\n"
);
@@ -89,29 +90,29 @@ bool ShowHelp(CommandLine &CmdL)
return true;
}
-// figure out what kind of upgrade the user wants
-bool DoAptUpgrade(CommandLine &CmdL)
-{
- if (_config->FindB("Apt::Cmd::Dist-Upgrade"))
- return DoDistUpgrade(CmdL);
- else
- return DoUpgradeWithAllowNewPackages(CmdL);
-}
-
int main(int argc, const char *argv[]) /*{{{*/
{
- CommandLine::Dispatch Cmds[] = {{"list",&List},
+ CommandLine::Dispatch Cmds[] = {
+ // query
+ {"list",&List},
{"search", &FullTextSearch},
{"show", &APT::Cmd::ShowPackage},
+
// package stuff
{"install",&DoInstall},
{"remove", &DoInstall},
{"purge", &DoInstall},
+
// system wide stuff
{"update",&DoUpdate},
- {"upgrade",&DoAptUpgrade},
+ {"upgrade",&DoUpgrade},
+ {"full-upgrade",&DoDistUpgrade},
+ // for compat with muscle memory
+ {"dist-upgrade",&DoDistUpgrade},
+
// misc
{"edit-sources",&EditSources},
+
// helper
{"moo",&DoMoo},
{"help",&ShowHelp},
@@ -131,9 +132,10 @@ int main(int argc, const char *argv[]) /*{{{*/
return 100;
}
- // FIXME: move into a new libprivate/private-install.cc:Install()
- _config->Set("DPkgPM::Progress", "1");
- _config->Set("Apt::Color", "1");
+ // some different defaults
+ _config->CndSet("DPkgPM::Progress", "1");
+ _config->CndSet("Apt::Color", "1");
+ _config->CndSet("APT::Get::Upgrade-Allow-New", true);
// Parse the command line and initialize the package library
CommandLine CmdL(Args.data(), _config);
diff --git a/test/integration/test-apt-cli-upgrade b/test/integration/test-apt-cli-upgrade
new file mode 100755
index 000000000..163a55576
--- /dev/null
+++ b/test/integration/test-apt-cli-upgrade
@@ -0,0 +1,34 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+insertpackage 'unstable' 'foo' 'all' '2.0' 'Depends: foo-new-dependency'
+insertpackage 'unstable' 'foo-new-dependency' 'all' '2.0'
+insertinstalledpackage 'foo' 'all' '1.0'
+
+setupaptarchive
+
+APTARCHIVE=$(readlink -f ./aptarchive)
+
+# default is to allow new dependencies
+testequal "Calculating upgrade... Done
+The following NEW packages will be installed:
+ foo-new-dependency
+The following packages will be upgraded:
+ foo
+1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst foo-new-dependency (2.0 unstable [all])
+Inst foo [1.0] (2.0 unstable [all])
+Conf foo-new-dependency (2.0 unstable [all])
+Conf foo (2.0 unstable [all])" apt upgrade -qq -s
+
+# ensure
+testequal "Calculating upgrade... Done
+The following packages have been kept back:
+ foo
+0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded." apt upgrade -qq -s --no-new-pkgs
--
cgit v1.2.3-70-g09d2
From 1aef66d5e150c608276fabdf1c2d2aaca9c45b7f Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Fri, 24 Jan 2014 22:59:36 +0100
Subject: apt-mark help shows all commands now
---
cmdline/apt-mark.cc | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'cmdline')
diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc
index ebb1f9892..d3a3a780b 100644
--- a/cmdline/apt-mark.cc
+++ b/cmdline/apt-mark.cc
@@ -386,6 +386,11 @@ bool ShowHelp(CommandLine &CmdL)
"Commands:\n"
" auto - Mark the given packages as automatically installed\n"
" manual - Mark the given packages as manually installed\n"
+ " hold - Mark a package as held back\n"
+ " unhold - Unset a package set as held back\n"
+ " showauto - Print the list of automatically installed packages\n"
+ " showmanual - Print the list of manually installed packages\n"
+ " showhold - Print the list of package on hold\n"
"\n"
"Options:\n"
" -h This help text.\n"
--
cgit v1.2.3-70-g09d2
From 6ae22905f66064f46c0abf05d269e47869c664be Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Wed, 29 Jan 2014 10:37:17 +0100
Subject: fix apt-get download truncation (closes: #736962)
---
cmdline/apt-get.cc | 9 ++++++---
test/integration/test-apt-get-download | 7 +++++++
2 files changed, 13 insertions(+), 3 deletions(-)
(limited to 'cmdline')
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index da7d28a1e..6bff6e7de 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -678,14 +678,17 @@ bool DoDownload(CommandLine &CmdL)
// copy files in local sources to the current directory
for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); ++I)
- if ((*I)->Local == true && (*I)->Status == pkgAcquire::Item::StatDone)
+ {
+ std::string const filename = cwd + flNotDir((*I)->DestFile);
+ if ((*I)->Local == true &&
+ filename != (*I)->DestFile &&
+ (*I)->Status == pkgAcquire::Item::StatDone)
{
- std::string const filename = cwd + flNotDir((*I)->DestFile);
std::ifstream src((*I)->DestFile.c_str(), std::ios::binary);
std::ofstream dst(filename.c_str(), std::ios::binary);
dst << src.rdbuf();
}
-
+ }
return Failed == false;
}
/*}}}*/
diff --git a/test/integration/test-apt-get-download b/test/integration/test-apt-get-download
index fce0be018..c2a5c3d8e 100755
--- a/test/integration/test-apt-get-download
+++ b/test/integration/test-apt-get-download
@@ -24,6 +24,7 @@ testdownload() {
rm $1
}
+# normal case(es)
testdownload apt_1.0_all.deb apt stable
testdownload apt_2.0_all.deb apt
@@ -32,3 +33,9 @@ testequal "'file://${DEBFILE}' apt_2.0_all.deb $(stat -c%s $DEBFILE) SHA512:$(sh
# deb:677887
testequal "E: Can't find a source to download version '1.0' of 'vrms:i386'" aptget download vrms
+
+# deb:736962 - apt-get download foo &&
+aptget download apt
+aptget download apt
+testsuccess test -s apt_2.0_all.deb
+rm -f apt_1.0_all.deb
--
cgit v1.2.3-70-g09d2
From 33b813ce44c7bafeb2a36b66fd004f8d94a2cbe4 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Wed, 5 Feb 2014 17:35:33 +0100
Subject: move isatty() check into InitOutput()
---
apt-private/private-output.cc | 3 +++
cmdline/apt-get.cc | 4 ----
cmdline/apt.cc | 2 --
test/integration/test-apt-cli-upgrade | 6 ++----
4 files changed, 5 insertions(+), 10 deletions(-)
(limited to 'cmdline')
diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc
index 2ae112af4..420ca14d5 100644
--- a/apt-private/private-output.cc
+++ b/apt-private/private-output.cc
@@ -30,6 +30,9 @@ unsigned int ScreenWidth = 80 - 1; /* - 1 for the cursor */
bool InitOutput() /*{{{*/
{
+ if (!isatty(STDOUT_FILENO) && _config->FindI("quiet", -1) == -1)
+ _config->Set("quiet","1");
+
c0out.rdbuf(cout.rdbuf());
c1out.rdbuf(cout.rdbuf());
c2out.rdbuf(cout.rdbuf());
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 6bff6e7de..1019ff325 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1736,10 +1736,6 @@ int main(int argc,const char *argv[]) /*{{{*/
// see if we are in simulate mode
CheckSimulateMode(CmdL);
- // Deal with stdout not being a tty
- if (!isatty(STDOUT_FILENO) && _config->FindI("quiet", -1) == -1)
- _config->Set("quiet","1");
-
// Setup the output streams
InitOutput();
diff --git a/cmdline/apt.cc b/cmdline/apt.cc
index 6fe25e3f3..6ad470faa 100644
--- a/cmdline/apt.cc
+++ b/cmdline/apt.cc
@@ -156,8 +156,6 @@ int main(int argc, const char *argv[]) /*{{{*/
<< std::endl
<< std::endl;
}
- if (!isatty(STDOUT_FILENO) && _config->FindI("quiet", -1) == -1)
- _config->Set("quiet","1");
// See if the help should be shown
if (_config->FindB("help") == true ||
diff --git a/test/integration/test-apt-cli-upgrade b/test/integration/test-apt-cli-upgrade
index 163a55576..21ce69413 100755
--- a/test/integration/test-apt-cli-upgrade
+++ b/test/integration/test-apt-cli-upgrade
@@ -16,8 +16,7 @@ setupaptarchive
APTARCHIVE=$(readlink -f ./aptarchive)
# default is to allow new dependencies
-testequal "Calculating upgrade... Done
-The following NEW packages will be installed:
+testequal "The following NEW packages will be installed:
foo-new-dependency
The following packages will be upgraded:
foo
@@ -28,7 +27,6 @@ Conf foo-new-dependency (2.0 unstable [all])
Conf foo (2.0 unstable [all])" apt upgrade -qq -s
# ensure
-testequal "Calculating upgrade... Done
-The following packages have been kept back:
+testequal "The following packages have been kept back:
foo
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded." apt upgrade -qq -s --no-new-pkgs
--
cgit v1.2.3-70-g09d2
From e209542632e61b9bf07b809c333f1e4b9de7fde9 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Mon, 10 Feb 2014 18:06:28 +0100
Subject: use VersionSet in download to handle repeats
Closes: 738103
---
cmdline/apt-get.cc | 6 +++---
test/integration/test-apt-get-download | 13 +++++++++----
2 files changed, 12 insertions(+), 7 deletions(-)
(limited to 'cmdline')
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 6bff6e7de..2a9964722 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -630,8 +630,8 @@ bool DoDownload(CommandLine &CmdL)
return false;
APT::CacheSetHelper helper(c0out);
- APT::VersionList verset = APT::VersionList::FromCommandLine(Cache,
- CmdL.FileList + 1, APT::VersionList::CANDIDATE, helper);
+ APT::VersionSet verset = APT::VersionSet::FromCommandLine(Cache,
+ CmdL.FileList + 1, APT::VersionSet::CANDIDATE, helper);
if (verset.empty() == true)
return false;
@@ -650,7 +650,7 @@ bool DoDownload(CommandLine &CmdL)
std::string const cwd = SafeGetCWD();
_config->Set("Dir::Cache::Archives", cwd);
int i = 0;
- for (APT::VersionList::const_iterator Ver = verset.begin();
+ for (APT::VersionSet::const_iterator Ver = verset.begin();
Ver != verset.end(); ++Ver, ++i)
{
pkgAcquire::Item *I = new pkgAcqArchive(&Fetcher, SrcList, &Recs, *Ver, storefile[i]);
diff --git a/test/integration/test-apt-get-download b/test/integration/test-apt-get-download
index c2a5c3d8e..ec809e0ce 100755
--- a/test/integration/test-apt-get-download
+++ b/test/integration/test-apt-get-download
@@ -34,8 +34,13 @@ testequal "'file://${DEBFILE}' apt_2.0_all.deb $(stat -c%s $DEBFILE) SHA512:$(sh
# deb:677887
testequal "E: Can't find a source to download version '1.0' of 'vrms:i386'" aptget download vrms
-# deb:736962 - apt-get download foo &&
-aptget download apt
-aptget download apt
+# deb:736962
+testsuccess aptget download apt
+testsuccess aptget download apt
+testsuccess test -s apt_2.0_all.deb
+
+rm -f apt_1.0_all.deb apt_2.0_all.deb
+
+# deb:738103
+testsuccess aptget download apt apt apt/unstable apt=2.0
testsuccess test -s apt_2.0_all.deb
-rm -f apt_1.0_all.deb
--
cgit v1.2.3-70-g09d2
From 62dcbf84c4aee8cb01e40c594d4c7f3a23b64836 Mon Sep 17 00:00:00 2001
From: John Ogness
Date: Fri, 13 Dec 2013 20:59:31 +0100
Subject: apt-cdrom should succeed if any drive succeeds
If there are multiple CD-ROM drives, `apt-cdrom add` will abort with an
error if any of the drives do not contain a Debian CD which is against
the documentation we have saying "a CD-ROM" and also scripts do not
expect it this way.
This patch modifies apt-cdrom to return success if any of the drives
succeeded. If failures occur, apt-cdrom will still continue trying all
the drives and report the last failure (if none of them succeeded).
The 'ident' command was also changed to match the new 'add' behavior.
Closes: 728153
---
apt-pkg/cdrom.cc | 26 ++++++++++++++++--
cmdline/apt-cdrom.cc | 76 ++++++++++++++++++++++++++++++++++++++++------------
2 files changed, 83 insertions(+), 19 deletions(-)
(limited to 'cmdline')
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc
index a5668a50a..f577e3572 100644
--- a/apt-pkg/cdrom.cc
+++ b/apt-pkg/cdrom.cc
@@ -577,8 +577,30 @@ bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log) /*{{{*/
CDROM.c_str());
log->Update(msg.str());
}
- if (MountCdrom(CDROM) == false)
- return _error->Error("Failed to mount the cdrom.");
+
+ // Unmount the CD and get the user to put in the one they want
+ if (_config->FindB("APT::CDROM::NoMount",false) == false)
+ {
+ if(log != NULL)
+ log->Update(_("Unmounting CD-ROM\n"), STEP_UNMOUNT);
+ UnmountCdrom(CDROM);
+
+ if(log != NULL)
+ {
+ log->Update(_("Waiting for disc...\n"), STEP_WAIT);
+ if(!log->ChangeCdrom()) {
+ // user aborted
+ return false;
+ }
+ }
+
+ // Mount the new CDROM
+ if(log != NULL)
+ log->Update(_("Mounting CD-ROM...\n"), STEP_MOUNT);
+
+ if (MountCdrom(CDROM) == false)
+ return _error->Error("Failed to mount the cdrom.");
+ }
// Hash the CD to get an ID
if (log != NULL)
diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc
index 17a60ddcb..20c6e8892 100644
--- a/cmdline/apt-cdrom.cc
+++ b/cmdline/apt-cdrom.cc
@@ -111,10 +111,12 @@ OpProgress* pkgCdromTextStatus::GetOpProgress()
};
/*}}}*/
// SetupAutoDetect /*{{{*/
-bool AutoDetectCdrom(pkgUdevCdromDevices &UdevCdroms, unsigned int &i)
+bool AutoDetectCdrom(pkgUdevCdromDevices &UdevCdroms, unsigned int &i, bool &automounted)
{
bool Debug = _config->FindB("Debug::Acquire::cdrom", false);
+ automounted = false;
+
vector v = UdevCdroms.Scan();
if (i >= v.size())
return false;
@@ -137,6 +139,8 @@ bool AutoDetectCdrom(pkgUdevCdromDevices &UdevCdroms, unsigned int &i)
mkdir(AptMountPoint.c_str(), 0750);
if(MountCdrom(AptMountPoint, v[i].DeviceName) == false)
_error->Warning(_("Failed to mount '%s' to '%s'"), v[i].DeviceName.c_str(), AptMountPoint.c_str());
+ else
+ automounted = true;
_config->Set("Acquire::cdrom::mount", AptMountPoint);
_config->Set("APT::CDROM::NoMount", true);
}
@@ -160,17 +164,35 @@ bool DoAdd(CommandLine &)
bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect", true);
unsigned int count = 0;
+ string AptMountPoint = _config->FindDir("Dir::Media::MountPath");
+ bool automounted = false;
if (AutoDetect && UdevCdroms.Dlopen())
- while (AutoDetectCdrom(UdevCdroms, count))
- res &= cdrom.Add(&log);
- if (count == 0) {
- res = cdrom.Add(&log);
- if (res == false) {
- _error->Error("%s", _(W_NO_CDROM_FOUND));
+ while (AutoDetectCdrom(UdevCdroms, count, automounted)) {
+ if (count == 1) {
+ // begin loop with res false to detect any success using OR
+ res = false;
+ }
+
+ // dump any warnings/errors from autodetect
+ if (_error->empty() == false)
+ _error->DumpErrors();
+
+ res |= cdrom.Add(&log);
+
+ if (automounted)
+ UnmountCdrom(AptMountPoint);
+
+ // dump any warnings/errors from add/unmount
+ if (_error->empty() == false)
+ _error->DumpErrors();
}
- }
- if(res)
+ if (count == 0)
+ res = cdrom.Add(&log);
+
+ if (res == false)
+ _error->Error("%s", _(W_NO_CDROM_FOUND));
+ else
cout << _("Repeat this process for the rest of the CDs in your set.") << endl;
return res;
@@ -187,18 +209,38 @@ bool DoIdent(CommandLine &)
pkgCdrom cdrom;
bool res = true;
- bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect");
+ bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect", true);
unsigned int count = 0;
+ string AptMountPoint = _config->FindDir("Dir::Media::MountPath");
+ bool automounted = false;
if (AutoDetect && UdevCdroms.Dlopen())
- while (AutoDetectCdrom(UdevCdroms, count))
- res &= cdrom.Ident(ident, &log);
- if (count == 0) {
- res = cdrom.Ident(ident, &log);
- if (res == false) {
- _error->Error("%s", _(W_NO_CDROM_FOUND));
+ while (AutoDetectCdrom(UdevCdroms, count, automounted)) {
+ if (count == 1) {
+ // begin loop with res false to detect any success using OR
+ res = false;
+ }
+
+ // dump any warnings/errors from autodetect
+ if (_error->empty() == false)
+ _error->DumpErrors();
+
+ res |= cdrom.Ident(ident, &log);
+
+ if (automounted)
+ UnmountCdrom(AptMountPoint);
+
+ // dump any warnings/errors from add/unmount
+ if (_error->empty() == false)
+ _error->DumpErrors();
}
- }
+
+ if (count == 0)
+ res = cdrom.Ident(ident, &log);
+
+ if (res == false)
+ _error->Error("%s", _(W_NO_CDROM_FOUND));
+
return res;
}
/*}}}*/
--
cgit v1.2.3-70-g09d2
From 8f3594c3487800edc2a97af1f3290049776dc556 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Wed, 12 Feb 2014 07:59:07 +0100
Subject: Use a APT::VersionSet instead of a VersionList
Use a APT::VersionSet instead of a APT::VersionList in DoDownload()
to ensure that there is only one version in the set even if the
user passes multiple identical name/versions on the commandline
(Bug#738103)
---
cmdline/apt-get.cc | 6 +++---
test/integration/test-apt-get-download | 5 +++++
2 files changed, 8 insertions(+), 3 deletions(-)
(limited to 'cmdline')
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 1019ff325..4d609104c 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -630,8 +630,8 @@ bool DoDownload(CommandLine &CmdL)
return false;
APT::CacheSetHelper helper(c0out);
- APT::VersionList verset = APT::VersionList::FromCommandLine(Cache,
- CmdL.FileList + 1, APT::VersionList::CANDIDATE, helper);
+ APT::VersionSet verset = APT::VersionSet::FromCommandLine(Cache,
+ CmdL.FileList + 1, APT::VersionSet::CANDIDATE, helper);
if (verset.empty() == true)
return false;
@@ -650,7 +650,7 @@ bool DoDownload(CommandLine &CmdL)
std::string const cwd = SafeGetCWD();
_config->Set("Dir::Cache::Archives", cwd);
int i = 0;
- for (APT::VersionList::const_iterator Ver = verset.begin();
+ for (APT::VersionSet::const_iterator Ver = verset.begin();
Ver != verset.end(); ++Ver, ++i)
{
pkgAcquire::Item *I = new pkgAcqArchive(&Fetcher, SrcList, &Recs, *Ver, storefile[i]);
diff --git a/test/integration/test-apt-get-download b/test/integration/test-apt-get-download
index c2a5c3d8e..0d92283f1 100755
--- a/test/integration/test-apt-get-download
+++ b/test/integration/test-apt-get-download
@@ -39,3 +39,8 @@ aptget download apt
aptget download apt
testsuccess test -s apt_2.0_all.deb
rm -f apt_1.0_all.deb
+
+# deb:738103 - apt-get download foo foo fails
+rm -f apt_*.deb
+aptget download apt apt
+testsuccess test -s apt_2.0_all.deb
--
cgit v1.2.3-70-g09d2
From 52090faab4401ad6a2acb4d2c0c2cb53aa6b8f7f Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Thu, 13 Feb 2014 14:47:34 +0100
Subject: trivial indent fix
---
cmdline/apt.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'cmdline')
diff --git a/cmdline/apt.cc b/cmdline/apt.cc
index 6ad470faa..7ef9060aa 100644
--- a/cmdline/apt.cc
+++ b/cmdline/apt.cc
@@ -82,7 +82,7 @@ bool ShowHelp(CommandLine &CmdL)
" remove - remove packages\n"
"\n"
" upgrade - upgrade the system by installing/upgrading packages\n"
- "full-upgrade - upgrade the system by removing/installing/upgrading packages\n"
+ " full-upgrade - upgrade the system by removing/installing/upgrading packages\n"
"\n"
" edit-sources - edit the source information file\n"
);
--
cgit v1.2.3-70-g09d2
From 46a78c652d80818b4643c471432ae961b1ca5bd9 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Sat, 22 Feb 2014 18:07:43 +0100
Subject: remove auto-generated apt-key and sources.list on clean (closes:
739749)
---
cmdline/makefile | 33 +++++++++++++++++++--------------
debian/changelog | 6 ++++++
vendor/debian/makefile | 4 ++++
vendor/raspbian/makefile | 3 +++
vendor/steamos/makefile | 4 ++++
vendor/ubuntu/makefile | 3 +++
6 files changed, 39 insertions(+), 14 deletions(-)
(limited to 'cmdline')
diff --git a/cmdline/makefile b/cmdline/makefile
index 06f170b6a..f89192e10 100644
--- a/cmdline/makefile
+++ b/cmdline/makefile
@@ -40,20 +40,6 @@ LIB_MAKES = apt-pkg/makefile
SOURCE = apt-cdrom.cc
include $(PROGRAM_H)
-# The apt-key program
-apt-key: apt-key.in
- sed -e "s#&keyring-filename;#$(shell ../vendor/getinfo keyring-filename)#" \
- -e "s#&keyring-removed-filename;#$(shell ../vendor/getinfo keyring-removed-filename)#" \
- -e "s#&keyring-master-filename;#$(shell ../vendor/getinfo keyring-master-filename)#" \
- -e "s#&keyring-uri;#$(shell ../vendor/getinfo keyring-uri)#" \
- -e "s#&keyring-package;#$(shell ../vendor/getinfo keyring-package)#" $< > $@
- chmod 755 $@
-
-SOURCE=apt-key
-TO=$(BIN)
-TARGET=program
-include $(COPY_H)
-
# The apt-mark program
PROGRAM=apt-mark
SLIBS = -lapt-pkg -lapt-private $(INTLLIBS)
@@ -99,3 +85,22 @@ SLIBS = -lapt-pkg $(INTLLIBS)
LIB_MAKES = apt-pkg/makefile
SOURCE = apt-dump-solver.cc
include $(PROGRAM_H)
+
+# The apt-key program
+apt-key: apt-key.in
+ sed -e "s#&keyring-filename;#$(shell ../vendor/getinfo keyring-filename)#" \
+ -e "s#&keyring-removed-filename;#$(shell ../vendor/getinfo keyring-removed-filename)#" \
+ -e "s#&keyring-master-filename;#$(shell ../vendor/getinfo keyring-master-filename)#" \
+ -e "s#&keyring-uri;#$(shell ../vendor/getinfo keyring-uri)#" \
+ -e "s#&keyring-package;#$(shell ../vendor/getinfo keyring-package)#" $< > $@
+ chmod 755 $@
+
+SOURCE=apt-key
+TO=$(BIN)
+TARGET=program
+include $(COPY_H)
+
+clean: clean/apt-key
+
+clean/apt-key:
+ rm -f apt-key
diff --git a/debian/changelog b/debian/changelog
index 0780118ad..78c2d4573 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+apt (0.9.15.4) UNRELEASED; urgency=low
+
+ * remove auto-generated apt-key and sources.list on clean (closes: 739749)
+
+ -- Michael Vogt Sat, 22 Feb 2014 17:58:08 +0100
+
apt (0.9.15.3) unstable; urgency=medium
[ Michael Vogt ]
diff --git a/vendor/debian/makefile b/vendor/debian/makefile
index 1f82d7f47..a1bb74f9b 100644
--- a/vendor/debian/makefile
+++ b/vendor/debian/makefile
@@ -9,3 +9,7 @@ doc binary manpages: sources.list
sources.list: sources.list.in ../../doc/apt-verbatim.ent
sed -e 's#&stable-codename;#$(shell ../getinfo debian-stable-codename)#g' $< > $@
+
+clean:
+ rm -f sources.list
+
diff --git a/vendor/raspbian/makefile b/vendor/raspbian/makefile
index ced566c30..e5513ead4 100644
--- a/vendor/raspbian/makefile
+++ b/vendor/raspbian/makefile
@@ -9,3 +9,6 @@ doc binary manpages: sources.list
sources.list: sources.list.in ../../doc/apt-verbatim.ent
sed -e 's#&stable-codename;#$(shell ../getinfo debian-stable-codename)#g' $< > $@
+
+clean:
+ rm -f sources.list
diff --git a/vendor/steamos/makefile b/vendor/steamos/makefile
index c27494587..45ea18be2 100644
--- a/vendor/steamos/makefile
+++ b/vendor/steamos/makefile
@@ -9,3 +9,7 @@ doc binary manpages: sources.list
sources.list: sources.list.in ../../doc/apt-verbatim.ent
sed -e 's#&stable-codename;#$(shell ../getinfo debian-stable-codename)#g' $< | sed -e 's#&steamos-codename;#$(shell ../getinfo current-distro-codename)#g' > $@
+
+clean:
+ rm -f sources.list
+
diff --git a/vendor/ubuntu/makefile b/vendor/ubuntu/makefile
index c4b35935f..1fe138d2b 100644
--- a/vendor/ubuntu/makefile
+++ b/vendor/ubuntu/makefile
@@ -9,3 +9,6 @@ doc binary manpages: sources.list
sources.list: sources.list.in ../../doc/apt-verbatim.ent
sed -e 's#&ubuntu-codename;#$(shell ../getinfo ubuntu-codename)#g' $< > $@
+
+clean:
+ rm -f sources.list
--
cgit v1.2.3-70-g09d2
From 1e3f4083db29bba600b9725e9456b0e140975c99 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Sat, 22 Feb 2014 18:34:33 +0100
Subject: Fix typos in documentation (codespell)
---
COMPILING | 2 +-
README.ddtp | 4 ++--
README.make | 2 +-
README.progress-reporting | 2 +-
apt-inst/contrib/arfile.cc | 2 +-
apt-inst/contrib/extracttar.cc | 2 +-
apt-inst/extract.cc | 4 ++--
apt-inst/filelist.cc | 4 ++--
apt-pkg/acquire-item.cc | 20 ++++++++---------
apt-pkg/acquire-worker.cc | 2 +-
apt-pkg/acquire.cc | 6 ++---
apt-pkg/algorithms.cc | 12 +++++-----
apt-pkg/algorithms.h | 4 ++--
apt-pkg/aptconfiguration.cc | 8 +++----
apt-pkg/aptconfiguration.h | 10 ++++-----
apt-pkg/cacheiterators.h | 6 ++---
apt-pkg/cdrom.h | 2 +-
apt-pkg/clean.cc | 2 +-
apt-pkg/contrib/cdromutl.cc | 4 ++--
apt-pkg/contrib/cmndline.cc | 2 +-
apt-pkg/contrib/crc-16.cc | 2 +-
apt-pkg/contrib/error.h | 2 +-
apt-pkg/contrib/fileutl.cc | 6 ++---
apt-pkg/contrib/gpgv.h | 2 +-
apt-pkg/contrib/macros.h | 2 +-
apt-pkg/contrib/md5.h | 2 +-
apt-pkg/contrib/mmap.h | 4 ++--
apt-pkg/contrib/progress.h | 2 +-
apt-pkg/contrib/sha2_internal.cc | 2 +-
apt-pkg/contrib/strutl.cc | 10 ++++-----
apt-pkg/deb/deblistparser.cc | 2 +-
apt-pkg/deb/debsystem.cc | 2 +-
apt-pkg/deb/debversion.cc | 4 ++--
apt-pkg/depcache.cc | 6 ++---
apt-pkg/depcache.h | 2 +-
apt-pkg/edsp.h | 6 ++---
apt-pkg/indexfile.h | 4 ++--
apt-pkg/orderlist.cc | 8 +++----
apt-pkg/packagemanager.cc | 16 ++++++-------
apt-pkg/pkgcache.cc | 4 ++--
apt-pkg/pkgcache.h | 2 +-
apt-pkg/pkgsystem.h | 4 ++--
apt-pkg/upgrade.cc | 2 +-
buildlib/fail.mak | 2 +-
buildlib/program.mak | 2 +-
cmdline/apt-config.cc | 2 +-
cmdline/apt-get.cc | 4 ++--
cmdline/apt-internal-solver.cc | 6 ++---
cmdline/apt-key.in | 4 ++--
configure.ac | 2 +-
debian/apt.cron.daily | 4 ++--
debian/changelog | 4 ++++
doc/Bugs | 8 +++----
doc/design.sgml | 2 +-
doc/dpkg-tech.sgml | 6 ++---
doc/examples/configure-index | 2 +-
doc/files.sgml | 2 +-
doc/libapt-pkg2_to_3.txt | 4 ++--
doc/method.sgml | 6 ++---
doc/style.txt | 8 +++----
ftparchive/apt-ftparchive.cc | 2 +-
methods/file.cc | 2 +-
methods/ftp.cc | 4 ++--
methods/ftp.h | 2 +-
methods/http.cc | 4 ++--
methods/http.h | 2 +-
methods/https.cc | 4 ++--
methods/https.h | 2 +-
methods/mirror.cc | 6 ++---
methods/mirror.h | 2 +-
methods/rfc2553emu.h | 2 +-
methods/rsh.cc | 2 +-
methods/server.cc | 6 ++---
test/integration/framework | 2 +-
test/integration/test-apt-get-source | 2 +-
...17690-allow-unauthenticated-makes-all-untrusted | 2 +-
.../test-sourceslist-arch-plusminus-options | 2 +-
test/libapt/globalerror_test.cc | 26 +++++++++++-----------
78 files changed, 171 insertions(+), 167 deletions(-)
(limited to 'cmdline')
diff --git a/COMPILING b/COMPILING
index bc934c846..1076c6366 100644
--- a/COMPILING
+++ b/COMPILING
@@ -27,7 +27,7 @@ I am not interested in making 'ultra portable code'. I will accept patches
to make the code that already exists conform more to SUS or POSIX, but
I don't really care if your not-SUS OS doesn't work. It is simply too
much work to maintain patches for dysfunctional OSs. I highly suggest you
-contact your vendor and express intrest in a conforming C library.
+contact your vendor and express interest in a conforming C library.
That said, there are lots of finicky problems that must be dealt with even
between the supported OS's. Primarily the path I choose to take is to put
diff --git a/README.ddtp b/README.ddtp
index 98f6109aa..5865b4e02 100644
--- a/README.ddtp
+++ b/README.ddtp
@@ -52,7 +52,7 @@ is md5("XXX\n YYY\n .\n ZZZ\n") (perl-syntax).
A future APT version will download one or some 'Translate-$lang'
file(s) at 'update'-time. After this download it show a translated
description instead of the english form, if it found a translated
-description of the package with the right md5 chechsum. The enviroment
+description of the package with the right md5 chechsum. The environment
of the user will controlled this process (LANG, LANGUAGE, LC_MESSAGES,
etc). With this the package system will never show a outdated
translation.
@@ -60,7 +60,7 @@ translation.
The translations come all from the DDTP. A daily process on
ddtp.debian.org make new 'Translated-$lang' files and a script on
ftp-master request this files and move this to the debian archive.
-Now the first files are accessable at
+Now the first files are accessible at
http://ddtp.debian.org/pdesc/translatefiles/
If you found wrong translations, please read the guides on
diff --git a/README.make b/README.make
index 69d79d37a..db5f36e94 100644
--- a/README.make
+++ b/README.make
@@ -25,7 +25,7 @@ of these parameters will have an immediate effect. The use of makefile.in
and configure substitutions across build makefiles is not used at all.
Furthermore, the make system runs with a current directory equal to the
-source directory irregardless of the destination directory. This means
+source directory regardless of the destination directory. This means
#include "" and #include <> work as expected and more importantly
running 'make' in the source directory will work as expected. The
environment variable or make parameter 'BUILD' sets the build directory.
diff --git a/README.progress-reporting b/README.progress-reporting
index b575e7879..91c0a8ac0 100644
--- a/README.progress-reporting
+++ b/README.progress-reporting
@@ -2,7 +2,7 @@ Install-progress reporting
--------------------------
If the apt options: "APT::Status-Fd" is set, apt will send status
-reports to that fd. The status information is seperated with a ':',
+reports to that fd. The status information is separated with a ':',
there are the following status conditions:
status = {"pmstatus", "dlstatus", "conffile-prompt", "error", "media-change" }
diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc
index 9d84c1784..77dbc55d6 100644
--- a/apt-inst/contrib/arfile.cc
+++ b/apt-inst/contrib/arfile.cc
@@ -6,7 +6,7 @@
AR File - Handle an 'AR' archive
AR Archives have plain text headers at the start of each file
- section. The headers are aligned on a 2 byte boundry.
+ section. The headers are aligned on a 2 byte boundary.
Information about the structure of AR files can be found in ar(5)
on a BSD system, or in the binutils source.
diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc
index fb4db42f8..2437c9749 100644
--- a/apt-inst/contrib/extracttar.cc
+++ b/apt-inst/contrib/extracttar.cc
@@ -6,7 +6,7 @@
Extract a Tar - Tar Extractor
Some performance measurements showed that zlib performed quite poorly
- in comparision to a forked gzip process. This tar extractor makes use
+ in comparison to a forked gzip process. This tar extractor makes use
of the fact that dup'd file descriptors have the same seek pointer
and that gzip will not read past the end of a compressed stream,
even if there is more data. We use the dup property to track extraction
diff --git a/apt-inst/extract.cc b/apt-inst/extract.cc
index 2c95fba92..b3dfccfc6 100644
--- a/apt-inst/extract.cc
+++ b/apt-inst/extract.cc
@@ -10,7 +10,7 @@
object is unpacked to '.dpkg.new' then the original is hardlinked to
'.dpkg.tmp' and finally the new object is renamed to overwrite the old
one. From an external perspective the file never ceased to exist.
- After the archive has been sucessfully unpacked the .dpkg.tmp files
+ After the archive has been successfully unpacked the .dpkg.tmp files
are erased. A failure causes all the .dpkg.tmp files to be restored.
Decisions about unpacking go like this:
@@ -22,7 +22,7 @@
[Note, this is reduced to only check if a file was expected to be
there]
- If the existing link/file is not a directory then it is replaced
- irregardless
+ regardless
- If the existing link/directory is being replaced by a directory then
absolutely nothing happens.
- If the existing link/directory is being replaced by a link then
diff --git a/apt-inst/filelist.cc b/apt-inst/filelist.cc
index 879c07855..defc4f4df 100644
--- a/apt-inst/filelist.cc
+++ b/apt-inst/filelist.cc
@@ -5,14 +5,14 @@
File Listing - Manages a Cache of File -> Package names.
- Diversions add some signficant complexity to the system. To keep
+ Diversions add some significant complexity to the system. To keep
storage space down in the very special case of a diverted file no
extra bytes are allocated in the Node structure. Instead a diversion
is inserted directly into the hash table and its flag bit set. Every
lookup for that filename will always return the diversion.
The hash buckets are stored in sorted form, with diversions having
- the higest sort order. Identical files are assigned the same file
+ the highest sort order. Identical files are assigned the same file
pointer, thus after a search all of the nodes owning that file can be
found by iterating down the bucket.
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 60003c023..36bb48382 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -129,7 +129,7 @@ void pkgAcquire::Item::Done(string Message,unsigned long long Size,string Hash,
/*}}}*/
// Acquire::Item::Rename - Rename a file /*{{{*/
// ---------------------------------------------------------------------
-/* This helper function is used by alot of item methods as thier final
+/* This helper function is used by a lot of item methods as their final
step */
void pkgAcquire::Item::Rename(string From,string To)
{
@@ -299,7 +299,7 @@ void pkgAcqSubIndex::Done(string Message,unsigned long long Size,string Md5Hash,
return;
}
- // sucess in downloading the index
+ // success in downloading the index
// rename the index
if(Debug)
std::clog << "Renaming: " << DestFile << " -> " << FinalFile << std::endl;
@@ -327,7 +327,7 @@ bool pkgAcqSubIndex::ParseIndex(string const &IndexFile) /*{{{*/
/*}}}*/
// AcqDiffIndex::AcqDiffIndex - Constructor /*{{{*/
// ---------------------------------------------------------------------
-/* Get the DiffIndex file first and see if there are patches availabe
+/* Get the DiffIndex file first and see if there are patches available
* If so, create a pkgAcqIndexDiffs fetcher that will get and apply the
* patches. If anything goes wrong in that process, it will fall back to
* the original packages file
@@ -548,7 +548,7 @@ void pkgAcqDiffIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /*{{{
{
if(Debug)
std::clog << "pkgAcqDiffIndex failed: " << Desc.URI << std::endl
- << "Falling back to normal index file aquire" << std::endl;
+ << "Falling back to normal index file acquire" << std::endl;
new pkgAcqIndex(Owner, RealURI, Description, Desc.ShortDesc,
ExpectedHash);
@@ -569,7 +569,7 @@ void pkgAcqDiffIndex::Done(string Message,unsigned long long Size,string Md5Hash
string FinalFile;
FinalFile = _config->FindDir("Dir::State::lists")+URItoFileName(RealURI);
- // sucess in downloading the index
+ // success in downloading the index
// rename the index
FinalFile += string(".IndexDiff");
if(Debug)
@@ -628,7 +628,7 @@ void pkgAcqIndexDiffs::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /*{{
{
if(Debug)
std::clog << "pkgAcqIndexDiffs failed: " << Desc.URI << std::endl
- << "Falling back to normal index file aquire" << std::endl;
+ << "Falling back to normal index file acquire" << std::endl;
new pkgAcqIndex(Owner, RealURI, Description,Desc.ShortDesc,
ExpectedHash);
Finish();
@@ -733,7 +733,7 @@ void pkgAcqIndexDiffs::Done(string Message,unsigned long long Size,string Md5Has
string FinalFile;
FinalFile = _config->FindDir("Dir::State::lists")+URItoFileName(RealURI);
- // sucess in downloading a diff, enter ApplyDiff state
+ // success in downloading a diff, enter ApplyDiff state
if(State == StateFetchDiff)
{
@@ -825,7 +825,7 @@ void pkgAcqIndexMergeDiffs::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
// first failure means we should fallback
State = StateErrorDiff;
- std::clog << "Falling back to normal index file aquire" << std::endl;
+ std::clog << "Falling back to normal index file acquire" << std::endl;
new pkgAcqIndex(Owner, RealURI, Description,Desc.ShortDesc,
ExpectedHash);
}
@@ -1240,7 +1240,7 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner, /*{{{*/
if (RealFileExists(Final) == true)
{
// File was already in place. It needs to be re-downloaded/verified
- // because Release might have changed, we do give it a differnt
+ // because Release might have changed, we do give it a different
// name than DestFile because otherwise the http method will
// send If-Range requests and there are too many broken servers
// out there that do not understand them
@@ -2021,7 +2021,7 @@ bool pkgAcqArchive::QueueNext()
return true;
}
- /* Hmm, we have a file and its size does not match, this shouldnt
+ /* Hmm, we have a file and its size does not match, this shouldn't
happen.. */
unlink(FinalFile.c_str());
}
diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc
index 44c3e4e17..de62080da 100644
--- a/apt-pkg/acquire-worker.cc
+++ b/apt-pkg/acquire-worker.cc
@@ -568,7 +568,7 @@ bool pkgAcquire::Worker::InFdReady()
/*}}}*/
// Worker::MethodFailure - Called when the method fails /*{{{*/
// ---------------------------------------------------------------------
-/* This is called when the method is belived to have failed, probably because
+/* This is called when the method is believed to have failed, probably because
read returned -1. */
bool pkgAcquire::Worker::MethodFailure()
{
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index a8a5abd34..120e809e1 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -5,9 +5,9 @@
Acquire - File Acquiration
- The core element for the schedual system is the concept of a named
+ The core element for the schedule system is the concept of a named
queue. Each queue is unique and each queue has a name derived from the
- URI. The degree of paralization can be controled by how the queue
+ URI. The degree of paralization can be controlled by how the queue
name is derived from the URI.
##################################################################### */
@@ -175,7 +175,7 @@ void pkgAcquire::Add(Worker *Work)
// ---------------------------------------------------------------------
/* A worker has died. This can not be done while the select loop is running
as it would require that RunFds could handling a changing list state and
- it cant.. */
+ it can't.. */
void pkgAcquire::Remove(Worker *Work)
{
if (Running == true)
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index 8644a8138..0363ab3e2 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -424,7 +424,7 @@ void pkgProblemResolver::MakeScores()
/* This is arbitrary, it should be high enough to elevate an
essantial package above most other packages but low enough
to allow an obsolete essential packages to be removed by
- a conflicts on a powerfull normal package (ie libc6) */
+ a conflicts on a powerful normal package (ie libc6) */
if ((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential
|| (I->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important)
Score += PrioEssentials;
@@ -441,7 +441,7 @@ void pkgProblemResolver::MakeScores()
Score += PrioInstalledAndNotObsolete;
}
- // Now that we have the base scores we go and propogate dependencies
+ // Now that we have the base scores we go and propagate dependencies
for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
if (Cache[I].InstallVer == 0)
@@ -485,7 +485,7 @@ void pkgProblemResolver::MakeScores()
}
}
- /* Now we propogate along provides. This makes the packages that
+ /* Now we propagate along provides. This makes the packages that
provide important packages extremely important */
for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
@@ -640,7 +640,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
adjusting the package will inflict.
It goes from highest score to lowest and corrects all of the breaks by
- keeping or removing the dependant packages. If that fails then it removes
+ keeping or removing the dependent packages. If that fails then it removes
the package itself and goes on. The routine should be able to intelligently
go from any broken state to a fixed state.
@@ -830,7 +830,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
/* Look across the version list. If there are no possible
targets then we keep the package and bail. This is necessary
- if a package has a dep on another package that cant be found */
+ if a package has a dep on another package that can't be found */
SPtrArray VList = Start.AllTargets();
if (*VList == 0 && (Flags[I->ID] & Protected) != Protected &&
Start.IsNegative() == false &&
@@ -1183,7 +1183,7 @@ bool pkgProblemResolver::ResolveByKeepInternal()
continue;
/* Keep the package. If this works then great, otherwise we have
- to be significantly more agressive and manipulate its dependencies */
+ to be significantly more aggressive and manipulate its dependencies */
if ((Flags[I->ID] & Protected) == 0)
{
if (Debug == true)
diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h
index 5a9a77415..489d81159 100644
--- a/apt-pkg/algorithms.h
+++ b/apt-pkg/algorithms.h
@@ -10,7 +10,7 @@
see all of the effects of an upgrade run.
pkgDistUpgrade computes an upgrade that causes as many packages as
- possible to move to the newest verison.
+ possible to move to the newest version.
pkgApplyStatus sets the target state based on the content of the status
field in the status file. It is important to get proper crash recovery.
@@ -44,7 +44,7 @@ using std::ostream;
#endif
#ifndef APT_9_CLEANER_HEADERS
-// include pkg{DistUpgrade,AllUpgrade,MiniizeUpgrade} here for compatiblity
+// include pkg{DistUpgrade,AllUpgrade,MiniizeUpgrade} here for compatibility
#include
#include
#endif
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc
index 1ebcf97bc..0b0b546c5 100644
--- a/apt-pkg/aptconfiguration.cc
+++ b/apt-pkg/aptconfiguration.cc
@@ -27,9 +27,9 @@
#include
/*}}}*/
namespace APT {
-// getCompressionTypes - Return Vector of usbale compressiontypes /*{{{*/
+// getCompressionTypes - Return Vector of usable compressiontypes /*{{{*/
// ---------------------------------------------------------------------
-/* return a vector of compression types in the prefered order. */
+/* return a vector of compression types in the preferred order. */
std::vector
const Configuration::getCompressionTypes(bool const &Cached) {
static std::vector types;
@@ -109,7 +109,7 @@ const Configuration::getCompressionTypes(bool const &Cached) {
/*}}}*/
// GetLanguages - Return Vector of Language Codes /*{{{*/
// ---------------------------------------------------------------------
-/* return a vector of language codes in the prefered order.
+/* return a vector of language codes in the preferred order.
the special word "environment" will be replaced with the long and the short
code of the local settings and it will be insured that this will not add
duplicates. So in an german local the setting "environment, de_DE, en, de"
@@ -330,7 +330,7 @@ bool const Configuration::checkLanguage(std::string Lang, bool const All) {
return (std::find(langs.begin(), langs.end(), Lang) != langs.end());
}
/*}}}*/
-// getArchitectures - Return Vector of prefered Architectures /*{{{*/
+// getArchitectures - Return Vector of preferred Architectures /*{{{*/
std::vector const Configuration::getArchitectures(bool const &Cached) {
using std::string;
diff --git a/apt-pkg/aptconfiguration.h b/apt-pkg/aptconfiguration.h
index d22b675c0..bf7deae85 100644
--- a/apt-pkg/aptconfiguration.h
+++ b/apt-pkg/aptconfiguration.h
@@ -37,14 +37,14 @@ public: /*{{{*/
* \param Cached saves the result so we need to calculated it only once
* this parameter should ony be used for testing purposes.
*
- * \return a vector of the compression types in the prefered usage order
+ * \return a vector of the compression types in the preferred usage order
*/
std::vector static const getCompressionTypes(bool const &Cached = true);
/** \brief Returns a vector of Language Codes
*
* Languages can be defined with their two or five chars long code.
- * This methods handles the various ways to set the prefered codes,
+ * This methods handles the various ways to set the preferred codes,
* honors the environment and ensures that the codes are not listed twice.
*
* The special word "environment" will be replaced with the long and the short
@@ -52,7 +52,7 @@ public: /*{{{*/
* duplicates. So in an german local the setting "environment, de_DE, en, de"
* will result in "de_DE, de, en".
*
- * Another special word is "none" which separates the prefered from all codes
+ * Another special word is "none" which separates the preferred from all codes
* in this setting. So setting and method can be used to get codes the user want
* to see or to get all language codes APT (should) have Translations available.
*
@@ -62,7 +62,7 @@ public: /*{{{*/
* \param Locale don't get the locale from the system but use this one instead
* this parameter should ony be used for testing purposes.
*
- * \return a vector of (all) Language Codes in the prefered usage order
+ * \return a vector of (all) Language Codes in the preferred usage order
*/
std::vector static const getLanguages(bool const &All = false,
bool const &Cached = true, char const ** const Locale = 0);
@@ -80,7 +80,7 @@ public: /*{{{*/
* \param Cached saves the result so we need to calculated it only once
* this parameter should ony be used for testing purposes.
*
- * \return a vector of Architectures in prefered order
+ * \return a vector of Architectures in preferred order
*/
std::vector static const getArchitectures(bool const &Cached = true);
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index 886d84838..ea6a4afba 100644
--- a/apt-pkg/cacheiterators.h
+++ b/apt-pkg/cacheiterators.h
@@ -46,7 +46,7 @@ template class pkgCache::Iterator :
* The implementation of this method should be pretty short
* as it will only return the Pointer into the mmap stored
* in the owner but the name of this pointer is different for
- * each stucture and we want to abstract here at least for the
+ * each structure and we want to abstract here at least for the
* basic methods from the actual structure.
* \return Pointer to the first structure of this type
*/
@@ -198,7 +198,7 @@ class pkgCache::VerIterator : public Iterator {
/** \brief compares two version and returns if they are similar
This method should be used to identify if two pseudo versions are
- refering to the same "real" version */
+ referring to the same "real" version */
inline bool SimilarVer(const VerIterator &B) const {
return (B.end() == false && S->Hash == B->Hash && strcmp(VerStr(), B.VerStr()) == 0);
};
@@ -419,7 +419,7 @@ class pkgCache::DescFileIterator : public Iterator {
inline DescFileIterator(pkgCache &Owner,DescFile *Trg) : Iterator(Owner, Trg) {};
};
/*}}}*/
-// Inlined Begin functions cant be in the class because of order problems /*{{{*/
+// Inlined Begin functions can't be in the class because of order problems /*{{{*/
inline pkgCache::PkgIterator pkgCache::GrpIterator::PackageList() const
{return PkgIterator(*Owner,Owner->PkgP + S->FirstPackage);};
inline pkgCache::VerIterator pkgCache::PkgIterator::VersionList() const
diff --git a/apt-pkg/cdrom.h b/apt-pkg/cdrom.h
index db637b96d..c58593550 100644
--- a/apt-pkg/cdrom.h
+++ b/apt-pkg/cdrom.h
@@ -88,7 +88,7 @@ struct CdromDevice /*{{{*/
class pkgUdevCdromDevices /*{{{*/
{
protected:
- // libudev dlopen stucture
+ // libudev dlopen structure
void *libudev_handle;
struct udev* (*udev_new)(void);
int (*udev_enumerate_add_match_property)(struct udev_enumerate *udev_enumerate, const char *property, const char *value);
diff --git a/apt-pkg/clean.cc b/apt-pkg/clean.cc
index eae419e34..2dea8ffdd 100644
--- a/apt-pkg/clean.cc
+++ b/apt-pkg/clean.cc
@@ -105,7 +105,7 @@ bool pkgArchiveCleaner::Go(std::string Dir,pkgCache &Cache)
break;
}
- // See if this verison matches the file
+ // See if this version matches the file
if (IsFetchable == true && Ver == V.VerStr())
break;
}
diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc
index afa01a562..20210ec0a 100644
--- a/apt-pkg/contrib/cdromutl.cc
+++ b/apt-pkg/contrib/cdromutl.cc
@@ -47,8 +47,8 @@ bool IsMounted(string &Path)
if (Path[Path.length() - 1] != '/')
Path += '/';
- /* First we check if the path is actualy mounted, we do this by
- stating the path and the previous directory (carefull of links!)
+ /* First we check if the path is actually mounted, we do this by
+ stating the path and the previous directory (careful of links!)
and comparing their device fields. */
struct stat Buf,Buf2;
if (stat(Path.c_str(),&Buf) != 0 ||
diff --git a/apt-pkg/contrib/cmndline.cc b/apt-pkg/contrib/cmndline.cc
index 2086d91ca..ed5800007 100644
--- a/apt-pkg/contrib/cmndline.cc
+++ b/apt-pkg/contrib/cmndline.cc
@@ -293,7 +293,7 @@ bool CommandLine::HandleOpt(int &I,int argc,const char *argv[],
// Look for an argument.
while (1)
{
- // Look at preceeding text
+ // Look at preceding text
char Buffer[300];
if (Argument == 0)
{
diff --git a/apt-pkg/contrib/crc-16.cc b/apt-pkg/contrib/crc-16.cc
index 4058821f9..f5df2d8b1 100644
--- a/apt-pkg/contrib/crc-16.cc
+++ b/apt-pkg/contrib/crc-16.cc
@@ -10,7 +10,7 @@
Al Longyear
Modified by Jason Gunthorpe to fit the local coding
- style, this code is belived to be in the Public Domain.
+ style, this code is believed to be in the Public Domain.
##################################################################### */
/*}}}*/
diff --git a/apt-pkg/contrib/error.h b/apt-pkg/contrib/error.h
index 7d09b2d4a..bcee70b1a 100644
--- a/apt-pkg/contrib/error.h
+++ b/apt-pkg/contrib/error.h
@@ -229,7 +229,7 @@ public: /*{{{*/
/** \brief is the list empty?
*
* The default checks if the list is empty or contains only notices,
- * if you want to check if also no notices happend set the parameter
+ * if you want to check if also no notices happened set the parameter
* flag to \b false.
*
* \param WithoutNotice does notices count, default is \b true, so no
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 536284064..52411a762 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -222,7 +222,7 @@ int GetLock(string File,bool Errors)
int FD = open(File.c_str(),O_RDWR | O_CREAT | O_NOFOLLOW,0640);
if (FD < 0)
{
- // Read only .. cant have locking problems there.
+ // Read only .. can't have locking problems there.
if (errno == EROFS)
{
_error->Warning(_("Not using locking for read only lock file %s"),File.c_str());
@@ -238,7 +238,7 @@ int GetLock(string File,bool Errors)
}
SetCloseExec(FD,true);
- // Aquire a write lock
+ // Acquire a write lock
struct flock fl;
fl.l_type = F_WRLCK;
fl.l_whence = SEEK_SET;
@@ -1256,7 +1256,7 @@ FileFd::~FileFd()
/*}}}*/
// FileFd::Read - Read a bit of the file /*{{{*/
// ---------------------------------------------------------------------
-/* We are carefull to handle interruption by a signal while reading
+/* We are careful to handle interruption by a signal while reading
gracefully. */
bool FileFd::Read(void *To,unsigned long long Size,unsigned long long *Actual)
{
diff --git a/apt-pkg/contrib/gpgv.h b/apt-pkg/contrib/gpgv.h
index 45f069058..1d79a52ac 100644
--- a/apt-pkg/contrib/gpgv.h
+++ b/apt-pkg/contrib/gpgv.h
@@ -29,7 +29,7 @@
* for reading. Use #OpenMaybeClearSignedFile to access the message
* instead to ensure you are only reading signed data.
*
- * The method does not return, but has some noteable exit-codes:
+ * The method does not return, but has some notable exit-codes:
* 111 signals an internal error like the inability to execute gpgv,
* 112 indicates a clear-signed file which doesn't include a message,
* which can happen if APT is run while on a network requiring
diff --git a/apt-pkg/contrib/macros.h b/apt-pkg/contrib/macros.h
index 62e7b65db..e53d01b8f 100644
--- a/apt-pkg/contrib/macros.h
+++ b/apt-pkg/contrib/macros.h
@@ -44,7 +44,7 @@
#define _boundv(a,b,c) b = _bound(a,b,c)
#define ABS(a) (((a) < (0)) ?-(a) : (a))
-/* Usefull count macro, use on an array of things and it will return the
+/* Useful count macro, use on an array of things and it will return the
number of items in the array */
#define _count(a) (sizeof(a)/sizeof(a[0]))
diff --git a/apt-pkg/contrib/md5.h b/apt-pkg/contrib/md5.h
index 25631b166..195455645 100644
--- a/apt-pkg/contrib/md5.h
+++ b/apt-pkg/contrib/md5.h
@@ -10,7 +10,7 @@
store a MD5Sum in 16 bytes of memory.
A MD5Sum is used to generate a (hopefully) unique 16 byte number for a
- block of data. This can be used to gaurd against corruption of a file.
+ block of data. This can be used to guard against corruption of a file.
MD5 should not be used for tamper protection, use SHA or something more
secure.
diff --git a/apt-pkg/contrib/mmap.h b/apt-pkg/contrib/mmap.h
index 6bd4a2d86..c1dfedf6d 100644
--- a/apt-pkg/contrib/mmap.h
+++ b/apt-pkg/contrib/mmap.h
@@ -6,7 +6,7 @@
MMap Class - Provides 'real' mmap or a faked mmap using read().
The purpose of this code is to provide a generic way for clients to
- access the mmap function. In enviroments that do not support mmap
+ access the mmap function. In environments that do not support mmap
from file fd's this function will use read and normal allocated
memory.
@@ -15,7 +15,7 @@
The DynamicMMap class is used to help the on-disk data structure
generators. It provides a large allocated workspace and members
- to allocate space from the workspace in an effecient fashion.
+ to allocate space from the workspace in an efficient fashion.
This source is placed in the Public Domain, do with it what you will
It was originally written by Jason Gunthorpe.
diff --git a/apt-pkg/contrib/progress.h b/apt-pkg/contrib/progress.h
index 3a6943aee..f7fbc9ccf 100644
--- a/apt-pkg/contrib/progress.h
+++ b/apt-pkg/contrib/progress.h
@@ -7,7 +7,7 @@
This class allows lengthy operations to communicate their progress
to the GUI. The progress model is simple and is not designed to handle
- the complex case of the multi-activity aquire class.
+ the complex case of the multi-activity acquire class.
The model is based on the concept of an overall operation consisting
of a series of small sub operations. Each sub operation has it's own
diff --git a/apt-pkg/contrib/sha2_internal.cc b/apt-pkg/contrib/sha2_internal.cc
index f84fb761c..bb2560252 100644
--- a/apt-pkg/contrib/sha2_internal.cc
+++ b/apt-pkg/contrib/sha2_internal.cc
@@ -65,7 +65,7 @@
* Please make sure that your system defines BYTE_ORDER. If your
* architecture is little-endian, make sure it also defines
* LITTLE_ENDIAN and that the two (BYTE_ORDER and LITTLE_ENDIAN) are
- * equivilent.
+ * equivalent.
*
* If your system does not define the above, then you can do so by
* hand like this:
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index 962112854..d4f53ea3a 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -426,7 +426,7 @@ string TimeToStr(unsigned long Sec)
/*}}}*/
// SubstVar - Substitute a string for another string /*{{{*/
// ---------------------------------------------------------------------
-/* This replaces all occurances of Subst with Contents in Str. */
+/* This replaces all occurrences of Subst with Contents in Str. */
string SubstVar(const string &Str,const string &Subst,const string &Contents)
{
string::size_type Pos = 0;
@@ -926,7 +926,7 @@ bool FTPMDTMStrToTime(const char* const str,time_t &time)
/*}}}*/
// StrToTime - Converts a string into a time_t /*{{{*/
// ---------------------------------------------------------------------
-/* This handles all 3 populare time formats including RFC 1123, RFC 1036
+/* This handles all 3 popular time formats including RFC 1123, RFC 1036
and the C library asctime format. It requires the GNU library function
'timegm' to convert a struct tm in UTC to a time_t. For some bizzar
reason the C library does not provide any such function :< This also
@@ -1313,7 +1313,7 @@ string StripEpoch(const string &VerStr)
// tolower_ascii - tolower() function that ignores the locale /*{{{*/
// ---------------------------------------------------------------------
/* This little function is the most called method we have and tries
- therefore to do the absolut minimum - and is noteable faster than
+ therefore to do the absolut minimum - and is notable faster than
standard tolower/toupper and as a bonus avoids problems with different
locales - we only operate on ascii chars anyway. */
int tolower_ascii(int const c)
@@ -1324,9 +1324,9 @@ int tolower_ascii(int const c)
}
/*}}}*/
-// CheckDomainList - See if Host is in a , seperate list /*{{{*/
+// CheckDomainList - See if Host is in a , separate list /*{{{*/
// ---------------------------------------------------------------------
-/* The domain list is a comma seperate list of domains that are suffix
+/* The domain list is a comma separate list of domains that are suffix
matched against the argument */
bool CheckDomainList(const string &Host,const string &List)
{
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 68d544e1f..acdcc4554 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -758,7 +758,7 @@ bool debListParser::GrabWord(string Word,WordList *List,unsigned char &Out)
/*}}}*/
// ListParser::Step - Move to the next section in the file /*{{{*/
// ---------------------------------------------------------------------
-/* This has to be carefull to only process the correct architecture */
+/* This has to be careful to only process the correct architecture */
bool debListParser::Step()
{
iOffset = Tags.Offset();
diff --git a/apt-pkg/deb/debsystem.cc b/apt-pkg/deb/debsystem.cc
index 7ed6936c3..b95ff15df 100644
--- a/apt-pkg/deb/debsystem.cc
+++ b/apt-pkg/deb/debsystem.cc
@@ -193,7 +193,7 @@ bool debSystem::Initialize(Configuration &Cnf)
/*}}}*/
// System::ArchiveSupported - Is a file format supported /*{{{*/
// ---------------------------------------------------------------------
-/* The standard name for a deb is 'deb'.. There are no seperate versions
+/* The standard name for a deb is 'deb'.. There are no separate versions
of .deb to worry about.. */
bool debSystem::ArchiveSupported(const char *Type)
{
diff --git a/apt-pkg/deb/debversion.cc b/apt-pkg/deb/debversion.cc
index 140561262..74e2552ff 100644
--- a/apt-pkg/deb/debversion.cc
+++ b/apt-pkg/deb/debversion.cc
@@ -116,7 +116,7 @@ int debVersioningSystem::CmpFragment(const char *A,const char *AEnd,
return 1;
}
- // Shouldnt happen
+ // Shouldn't happen
return 1;
}
/*}}}*/
@@ -221,7 +221,7 @@ bool debVersioningSystem::CheckDep(const char *PkgVer,
if (PkgVer == DepVer)
return Op == pkgCache::Dep::Equals || Op == pkgCache::Dep::LessEq || Op == pkgCache::Dep::GreaterEq;
- // Perform the actual comparision.
+ // Perform the actual comparison.
int const Res = CmpVersion(PkgVer, DepVer);
switch (Op)
{
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index c39e8c628..a12e6963d 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -789,7 +789,7 @@ bool pkgDepCache::MarkKeep(PkgIterator const &Pkg, bool Soft, bool FromUser,
// - this makes sense as default when all Garbage dependencies
// are automatically marked for removal (as aptitude does).
// setting a package for keep then makes it no longer autoinstalled
- // for all other use-case this action is rather suprising
+ // for all other use-case this action is rather surprising
if(FromUser && !P.Marked)
P.Flags &= ~Flag::Auto;
#endif
@@ -1195,7 +1195,7 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
}
}
- /* This bit is for processing the possibilty of an install/upgrade
+ /* This bit is for processing the possibility of an install/upgrade
fixing the problem for "positive" dependencies */
if (Start.IsNegative() == false && (DepState[Start->ID] & DepCVer) == DepCVer)
{
@@ -1315,7 +1315,7 @@ bool pkgDepCache::IsInstallOkMultiArchSameVersionSynced(PkgIterator const &Pkg,
// (simple string-compare as stuff like '1' == '0:1-0' can't happen here)
if (P->CurrentVer == 0 || strcmp(Pkg.CandVersion(), P.CandVersion()) == 0)
continue;
- // packages loosing M-A:same can be out-of-sync
+ // packages losing M-A:same can be out-of-sync
VerIterator CV = PkgState[P->ID].CandidateVerIter(*this);
if (unlikely(CV.end() == true) ||
(CV->MultiArch & pkgCache::Version::Same) != pkgCache::Version::Same)
diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h
index 61c9aa559..f6848f383 100644
--- a/apt-pkg/depcache.h
+++ b/apt-pkg/depcache.h
@@ -15,7 +15,7 @@
This structure is important to support the readonly status of the cache
file. When the data is saved the cache will be refereshed from our
- internal rep and written to disk. Then the actual persistant data
+ internal rep and written to disk. Then the actual persistent data
files will be put on the disk.
Each dependency is compared against 3 target versions to produce to
diff --git a/apt-pkg/edsp.h b/apt-pkg/edsp.h
index 12b06d143..fd4436f60 100644
--- a/apt-pkg/edsp.h
+++ b/apt-pkg/edsp.h
@@ -2,7 +2,7 @@
/** Description \file edsp.h {{{
######################################################################
Set of methods to help writing and reading everything needed for EDSP
- with the noteable exception of reading a scenario for conversion into
+ with the notable exception of reading a scenario for conversion into
a Cache as this is handled by edsp interface for listparser and friends
##################################################################### */
/*}}}*/
@@ -182,13 +182,13 @@ public:
* they were unable to calculate a solution for a given task.
* Obviously they can't send a solution through, so this
* methods deals with formatting an error message correctly
- * so that the front-ends can recieve and display it.
+ * so that the front-ends can receive and display it.
*
* The first line of the message should be a short description
* of the error so it can be used for dialog titles or alike
*
* \param uuid of this error message
- * \param message is free form text to discribe the error
+ * \param message is free form text to describe the error
* \param output the front-end listens for error messages
*/
bool static WriteError(char const * const uuid, std::string const &message, FILE* output);
diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h
index 2d433b60a..a0096fa34 100644
--- a/apt-pkg/indexfile.h
+++ b/apt-pkg/indexfile.h
@@ -10,12 +10,12 @@
Binary index files
Binary translation files
- Bianry index files decribing the local system
+ Binary index files describing the local system
Source index files
They are all bundled together here, and the interfaces for
sources.list, acquire, cache gen and record parsing all use this class
- to acess the underlying representation.
+ to access the underlying representation.
##################################################################### */
/*}}}*/
diff --git a/apt-pkg/orderlist.cc b/apt-pkg/orderlist.cc
index 984ae1d10..21b5fc4e7 100644
--- a/apt-pkg/orderlist.cc
+++ b/apt-pkg/orderlist.cc
@@ -566,10 +566,10 @@ bool pkgOrderList::VisitProvides(DepIterator D,bool Critical)
// ---------------------------------------------------------------------
/* This is the core ordering routine. It calls the set dependency
consideration functions which then potentialy call this again. Finite
- depth is achived through the colouring mechinism. */
+ depth is achieved through the colouring mechinism. */
bool pkgOrderList::VisitNode(PkgIterator Pkg, char const* from)
{
- // Looping or irrelevent.
+ // Looping or irrelevant.
// This should probably trancend not installed packages
if (Pkg.end() == true || IsFlag(Pkg,Added) == true ||
IsFlag(Pkg,AddPending) == true || IsFlag(Pkg,InList) == false)
@@ -824,7 +824,7 @@ bool pkgOrderList::DepUnPackPre(DepIterator D)
The forwards depends loop is designed to bring the packages dependents
close to the package. This helps reduce deconfigure time.
- Loops are irrelevent to this. */
+ Loops are irrelevant to this. */
bool pkgOrderList::DepUnPackDep(DepIterator D)
{
@@ -840,7 +840,7 @@ bool pkgOrderList::DepUnPackDep(DepIterator D)
D.ParentPkg().CurrentVer() != D.ParentVer())
continue;
- // The dep will not break so it is irrelevent.
+ // The dep will not break so it is irrelevant.
if (CheckDep(D) == true)
continue;
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index 3fdd9b637..5f9a31264 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -215,7 +215,7 @@ bool pkgPackageManager::CreateOrderList()
return true;
}
/*}}}*/
-// PM::DepAlwaysTrue - Returns true if this dep is irrelevent /*{{{*/
+// PM::DepAlwaysTrue - Returns true if this dep is irrelevant /*{{{*/
// ---------------------------------------------------------------------
/* The restriction on provides is to eliminate the case when provides
are transitioning between valid states [ie exim to smail] */
@@ -243,11 +243,11 @@ bool pkgPackageManager::CheckRConflicts(PkgIterator Pkg,DepIterator D,
D->Type != pkgCache::Dep::Obsoletes)
continue;
- // The package hasnt been changed
+ // The package hasn't been changed
if (List->IsNow(Pkg) == false)
continue;
- // Ignore self conflicts, ignore conflicts from irrelevent versions
+ // Ignore self conflicts, ignore conflicts from irrelevant versions
if (D.IsIgnorable(Pkg) || D.ParentVer() != D.ParentPkg().CurrentVer())
continue;
@@ -314,7 +314,7 @@ bool pkgPackageManager::ConfigureAll()
Note on failure: This method can fail, without causing any problems.
This can happen when using Immediate-Configure-All, SmartUnPack may call
- SmartConfigure, it may fail because of a complex dependancy situation, but
+ SmartConfigure, it may fail because of a complex dependency situation, but
a error will only be reported if ConfigureAll fails. This is why some of the
messages this function reports on failure (return false;) as just warnings
only shown when debuging*/
@@ -596,7 +596,7 @@ bool pkgPackageManager::SmartRemove(PkgIterator Pkg)
/*}}}*/
// PM::SmartUnPack - Install helper /*{{{*/
// ---------------------------------------------------------------------
-/* This puts the system in a state where it can Unpack Pkg, if Pkg is allready
+/* This puts the system in a state where it can Unpack Pkg, if Pkg is already
unpacked, or when it has been unpacked, if Immediate==true it configures it. */
bool pkgPackageManager::SmartUnPack(PkgIterator Pkg)
{
@@ -623,7 +623,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c
/* PreUnpack Checks: This loop checks and attempts to rectify and problems that would prevent the package being unpacked.
It addresses: PreDepends, Conflicts, Obsoletes and Breaks (DpkgBreaks). Any resolutions that do not require it should
avoid configuration (calling SmartUnpack with Immediate=true), this is because when unpacking some packages with
- complex dependancy structures, trying to configure some packages while breaking the loops can complicate things .
+ complex dependency structures, trying to configure some packages while breaking the loops can complicate things .
This will be either dealt with if the package is configured as a dependency of Pkg (if and when Pkg is configured),
or by the ConfigureAll call at the end of the for loop in OrderInstall. */
bool Changed = false;
@@ -790,7 +790,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c
{
if (List->IsFlag(BrokenPkg,pkgOrderList::Loop) && PkgLoop)
{
- // This dependancy has already been dealt with by another SmartUnPack on Pkg
+ // This dependency has already been dealt with by another SmartUnPack on Pkg
break;
}
else
@@ -1003,7 +1003,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
DoneSomething = true;
if (ImmConfigureAll) {
- /* ConfigureAll here to pick up and packages left unconfigured becuase they were unpacked in the
+ /* ConfigureAll here to pick up and packages left unconfigured because they were unpacked in the
"PreUnpack Checks" section */
if (!ConfigureAll())
return Failed;
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index 52e814c0b..67a2a709d 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -8,7 +8,7 @@
Please see doc/apt-pkg/cache.sgml for a more detailed description of
this format. Also be sure to keep that file up-to-date!!
- This is the general utility functions for cache managment. They provide
+ This is the general utility functions for cache management. They provide
a complete set of accessor functions for the cache. The cacheiterators
header contains the STL-like iterators that can be used to easially
navigate the cache as well as seemlessly dereference the mmap'd
@@ -499,7 +499,7 @@ pkgCache::PkgIterator::CurVersion() const
// ostream operator to handle string representation of a package /*{{{*/
// ---------------------------------------------------------------------
/* Output name < cur.rent.version -> candid.ate.version | new.est.version > (section)
- Note that the characters <|>() are all literal above. Versions will be ommited
+ Note that the characters <|>() are all literal above. Versions will be omitted
if they provide no new information (e.g. there is no newer version than candidate)
If no version and/or section can be found "none" is used. */
std::ostream&
diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h
index 1a7013551..c31c5f30b 100644
--- a/apt-pkg/pkgcache.h
+++ b/apt-pkg/pkgcache.h
@@ -354,7 +354,7 @@ struct pkgCache::Group
the hash index of the name in the pkgCache::Header::PkgHashTable
A package can be created for every architecture so package names are
- not unique, but it is garanteed that packages with the same name
+ not unique, but it is guaranteed that packages with the same name
are sequencel ordered in the list. Packages with the same name can be
accessed with the Group.
*/
diff --git a/apt-pkg/pkgsystem.h b/apt-pkg/pkgsystem.h
index 75f7b9fcc..eb75df412 100644
--- a/apt-pkg/pkgsystem.h
+++ b/apt-pkg/pkgsystem.h
@@ -7,7 +7,7 @@
Instances of this class can be thought of as factories or meta-classes
for a variety of more specialized classes. Together this class and
- it's speciallized offspring completely define the environment and how
+ it's specialized offspring completely define the environment and how
to access resources for a specific system. There are several sub
areas that are all orthogonal - each system has a unique combination of
these sub areas:
@@ -23,7 +23,7 @@
- Selection of local 'status' indexes that make up the pkgCache.
It is important to note that the handling of index files is not a
- function of the system. Index files are handled through a seperate
+ function of the system. Index files are handled through a separate
abstraction - the only requirement is that the index files have the
same idea of versioning as the target system.
diff --git a/apt-pkg/upgrade.cc b/apt-pkg/upgrade.cc
index f06f6d40d..d6f6933dd 100644
--- a/apt-pkg/upgrade.cc
+++ b/apt-pkg/upgrade.cc
@@ -225,7 +225,7 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache)
Cache.MarkInstall(I, false, 0, false);
else
{
- // If keep didnt actually do anything then there was no change..
+ // If keep didn't actually do anything then there was no change..
if (Cache[I].Upgrade() == false)
Change = true;
}
diff --git a/buildlib/fail.mak b/buildlib/fail.mak
index dfc194e1e..fc187766d 100644
--- a/buildlib/fail.mak
+++ b/buildlib/fail.mak
@@ -4,7 +4,7 @@
# Input
# $(MESSAGE) - The message to show
-# $(PROGRAM) - The program/libary/whatever.
+# $(PROGRAM) - The program/library/whatever.
# See defaults.mak for information about LOCAL
diff --git a/buildlib/program.mak b/buildlib/program.mak
index e0e76316c..da538f5eb 100644
--- a/buildlib/program.mak
+++ b/buildlib/program.mak
@@ -6,7 +6,7 @@
# $(SOURCE) - The source code to use
# $(PROGRAM) - The name of the program
# $(SLIBS) - Shared libs to link against
-# $(LIB_MAKES) - Shared libary make files to depend on - to ensure we get
+# $(LIB_MAKES) - Shared library make files to depend on - to ensure we get
# remade when the shared library version increases.
# See defaults.mak for information about LOCAL
diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc
index 3481eaf5f..30c2a22d5 100644
--- a/cmdline/apt-config.cc
+++ b/cmdline/apt-config.cc
@@ -8,7 +8,7 @@
This program will parse a config file and then do something with it.
Commands:
- shell - Shell mode. After this a series of word pairs should occure.
+ shell - Shell mode. After this a series of word pairs should occur.
The first is the environment var to set and the second is
the key to set it from. Use like:
eval `apt-config shell QMode apt::QMode`
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 4d609104c..12e385b69 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -15,7 +15,7 @@
upgrade - Smart-Download the newest versions of all packages
dselect-upgrade - Follows dselect's changes to the Status: field
and installes new and removes old packages
- dist-upgrade - Powerfull upgrader designed to handle the issues with
+ dist-upgrade - Powerful upgrader designed to handle the issues with
a new distribution.
install - Download and install a given package (by name, not by .deb)
check - Update the package cache and check for broken packages
@@ -513,7 +513,7 @@ bool DoDSelectUpgrade(CommandLine &CmdL)
}
/* Resolve any problems that dselect created, allupgrade cannot handle
- such things. We do so quite agressively too.. */
+ such things. We do so quite aggressively too.. */
if (Cache->BrokenCount() != 0)
{
pkgProblemResolver Fix(Cache);
diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc
index 53b38ea43..bf5b8c1fe 100644
--- a/cmdline/apt-internal-solver.cc
+++ b/cmdline/apt-internal-solver.cc
@@ -160,16 +160,16 @@ int main(int argc,const char *argv[]) /*{{{*/
if (upgrade == true) {
if (pkgAllUpgrade(CacheFile) == false) {
- EDSP::WriteError("ERR_UNSOLVABLE_UPGRADE", "An upgrade error occured", output);
+ EDSP::WriteError("ERR_UNSOLVABLE_UPGRADE", "An upgrade error occurred", output);
return 0;
}
} else if (distUpgrade == true) {
if (pkgDistUpgrade(CacheFile) == false) {
- EDSP::WriteError("ERR_UNSOLVABLE_DIST_UPGRADE", "An dist-upgrade error occured", output);
+ EDSP::WriteError("ERR_UNSOLVABLE_DIST_UPGRADE", "An dist-upgrade error occurred", output);
return 0;
}
} else if (Fix.Resolve() == false) {
- EDSP::WriteError("ERR_UNSOLVABLE", "An error occured", output);
+ EDSP::WriteError("ERR_UNSOLVABLE", "An error occurred", output);
return 0;
}
diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in
index 0ced500db..0774cf4b7 100644
--- a/cmdline/apt-key.in
+++ b/cmdline/apt-key.in
@@ -18,7 +18,7 @@ touch $SECRETKEYRING
GPG_CMD="$GPG_CMD --homedir $GPGHOMEDIR"
# create the trustdb with an (empty) dummy keyring
# older gpgs required it, newer gpgs even warn that it isn't needed,
-# but require it nontheless for some commands, so we just play safe
+# but require it nonetheless for some commands, so we just play safe
# here for the foreseeable future and create a dummy one
$GPG_CMD --quiet --check-trustdb --keyring $SECRETKEYRING >/dev/null 2>&1
# tell gpg that it shouldn't try to maintain a trustdb file
@@ -187,7 +187,7 @@ remove_key_from_keyring() {
echo >&2 "Key ${2} is in keyring ${1}, but can't be removed as it is read only."
return
fi
- # check if it is the only key in the keyring and if so remove the keyring alltogether
+ # check if it is the only key in the keyring and if so remove the keyring altogether
if [ '1' = "$($GPG --with-colons --list-keys | grep "^pub:[^:]*:[^:]*:[^:]*:[0-9A-F]\+:" | wc -l)" ]; then
mv -f "$1" "${1}~" # behave like gpg
return
diff --git a/configure.ac b/configure.ac
index a5a9fe0b8..083e7c494 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@ dnl linux architectures and configurations, it is not used to make the
dnl code more portable
dnl You MUST have an environment that has all the POSIX functions and
-dnl some of the more populare bsd/sysv ones (like select). You'll also
+dnl some of the more popular bsd/sysv ones (like select). You'll also
dnl need a C++ compiler that is semi-standard conformant, exceptions are
dnl not used but STL is.
diff --git a/debian/apt.cron.daily b/debian/apt.cron.daily
index 2616af1dd..71ac76555 100644
--- a/debian/apt.cron.daily
+++ b/debian/apt.cron.daily
@@ -34,7 +34,7 @@
# APT::Archives::MinAge "2"; (old, deprecated)
# APT::Periodic::MinAge "2"; (new)
# - Set minimum age of a package file. If a file is younger it
-# will not be deleted (0=disable). Usefull to prevent races
+# will not be deleted (0=disable). Useful to prevent races
# and to keep backups of the packages for emergency.
#
# APT::Archives::MaxSize "0"; (old, deprecated)
@@ -384,7 +384,7 @@ fi
now=$(date +%s)
# Support old Archive for compatibility.
-# Document only Periodic for all controling parameters of this script.
+# Document only Periodic for all controlling parameters of this script.
UpdateInterval=0
eval $(apt-config shell UpdateInterval APT::Periodic::Update-Package-Lists)
diff --git a/debian/changelog b/debian/changelog
index 78c2d4573..eb5e079bc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,10 @@
apt (0.9.15.4) UNRELEASED; urgency=low
+ [ Michael Vogt ]
* remove auto-generated apt-key and sources.list on clean (closes: 739749)
+
+ [ Guillem Jover ]
+ * Fix typos in documentation (codespell)
-- Michael Vogt Sat, 22 Feb 2014 17:58:08 +0100
diff --git a/doc/Bugs b/doc/Bugs
index deb7334db..d584dce49 100644
--- a/doc/Bugs
+++ b/doc/Bugs
@@ -31,12 +31,12 @@
#27601: srange errors from dselect
Summary: Couldn't locate an archive source
Status: Require status file
- Believed to be fixed in 0.1.9, was not reproducable w/ given
+ Believed to be fixed in 0.1.9, was not reproducible w/ given
status file
#27841: apt: apt depends on a missing library
Status: New versions of APT in slink have been compiled with libstdc++2.9
#23984: apt: support for "no_proxy" would be nice
- Status: Planed to be integrated into the new methods via the configuration
+ Status: Planned to be integrated into the new methods via the configuration
file
Done - Use Acquire::http::proxy::host.com="DIRECT"
#25021: apt: Need some control over multiple connections
@@ -83,7 +83,7 @@
Status: Fix the man pages. This certainly will be done in 0.3.0
#24799: Some suggestions for the apt method in dselect
Summary: Wants to be able to specifiy -d from dselect
- Status: Likely a APT_OPTIONS enviornment variable will be created, -d can
+ Status: Likely a APT_OPTIONS environment variable will be created, -d can
be put there.
There is already an APT_CONFIG in 0.3, APT_OPTIONS may also
appear..
@@ -112,7 +112,7 @@
APT now sends a max age header. See the apt.conf(5)
#28172: HTTP Proxy cache refresh should be forced for corrupted packages
Summary: Some problem resulted in a corrupted package
- Status: I belive this reflects a deeper problem and the suggested solution
+ Status: I believe this reflects a deeper problem and the suggested solution
is only a band-aide patch. I intend to close this bug when #24685
is fixed with a configuration directive.
Use -o acquire::http::no-cache=true
diff --git a/doc/design.sgml b/doc/design.sgml
index 1ddf49fd8..67406aa01 100644
--- a/doc/design.sgml
+++ b/doc/design.sgml
@@ -48,7 +48,7 @@
that additional functionality in the underlying dpkg would
also be requested.
-
Diety/dselect are the first introduction that people have to
+
Deity/dselect are the first introduction that people have to
Debian, and unfortunately this first impression contributes
greatly to the public perception of the distribution. It is
imperative that this be a showcase for Debian, rather than
diff --git a/doc/dpkg-tech.sgml b/doc/dpkg-tech.sgml
index 1a15f6a4c..ce0c5fa83 100644
--- a/doc/dpkg-tech.sgml
+++ b/doc/dpkg-tech.sgml
@@ -322,7 +322,7 @@ The main principal of the new-format Debian archive (I won't describe the old
format - for that have a look at deb-old.5), is that the archive really is
an archive - as used by "ar" and friends. However, dpkg-deb uses this format
internally, rather than calling "ar". Inside this archive, there are usually
-the folowing members:-
+the following members:-
debian-binary
@@ -349,7 +349,7 @@ supports the following options:-
--build (-b) <dir> - builds a .deb archive, takes a directory which
contains all the files as an argument. Note that the directory
<dir>/DEBIAN will be packed separately into the control archive.
---contents (-c) <debfile> - Lists the contents of ther "data.tar.gz"
+--contents (-c) <debfile> - Lists the contents of the "data.tar.gz"
member.
--control (-e) <debfile> - Extracts the control archive into a
directory called DEBIAN. Alternatively, with another argument, it will extract
@@ -450,7 +450,7 @@ cleaned up when dpkg exits cleanly.
Juding by the use of the updates directory I would call it a Journal. Inorder
-to effeciently ensure the complete integrity of the status file dpkg will
+to efficiently ensure the complete integrity of the status file dpkg will
"checkpoint" or journal all of it's activities in the updates directory. By
merging the contents of the updates directory (in order!!) against the
original status file it can get the precise current state of the system,
diff --git a/doc/examples/configure-index b/doc/examples/configure-index
index f4d9d17f2..93e96cf16 100644
--- a/doc/examples/configure-index
+++ b/doc/examples/configure-index
@@ -142,7 +142,7 @@ APT
// APT::Archives::MinAge "2"; (old, deprecated)
MinAge "2"; // (new)
// - Set minimum age of a package file. If a file is younger it
- // will not be deleted (0=disable). Usefull to prevent races
+ // will not be deleted (0=disable). Useful to prevent races
// and to keep backups of the packages for emergency.
// APT::Archives::MaxSize "0"; (old, deprecated)
diff --git a/doc/files.sgml b/doc/files.sgml
index a52efc756..56c7f574d 100644
--- a/doc/files.sgml
+++ b/doc/files.sgml
@@ -201,7 +201,7 @@ from partial into archives/. Any files found in archives/ can be assumed
to be verified.
-No directory structure is transfered from the receiving site and all .deb
+No directory structure is transferred from the receiving site and all .deb
file names conform to debian conventions. No short (msdos) filename should
be placed in archives. If the need arises .debs should be unpacked, scanned
and renamed to their correct internal names. This is mostly to prevent
diff --git a/doc/libapt-pkg2_to_3.txt b/doc/libapt-pkg2_to_3.txt
index c1f71f9f2..b94dc666e 100644
--- a/doc/libapt-pkg2_to_3.txt
+++ b/doc/libapt-pkg2_to_3.txt
@@ -3,7 +3,7 @@ people need to be aware of.. Many of this changes are done so that most old
source will continue to function, but perhaps at reduced functionality.
* pkgDepCache is no longer self initilizing, you have to call the Init
- method seperately after constructing it. Users of pkgCacheFile do not
+ method separately after constructing it. Users of pkgCacheFile do not
need to worry about this
* GetCandidateVer/etc is gone from the pkgCache. It exists only in the
DepCache and is just an inline around the new Policy class
@@ -55,7 +55,7 @@ source will continue to function, but perhaps at reduced functionality.
(should be transparent largely)
* Locking is handled differently, there is no dpkg lock class, the _system
class provides Lock/UnLock methods
-* pkgDepCache is not a subclass of pkgCache, it agregates it now. Some
+* pkgDepCache is not a subclass of pkgCache, it aggregates it now. Some
compatibility functions are provided that make this transition fairly
easy.
* The following functions have had minor argument changes:
diff --git a/doc/method.sgml b/doc/method.sgml
index 27db50173..5aa7b52e8 100644
--- a/doc/method.sgml
+++ b/doc/method.sgml
@@ -246,14 +246,14 @@ pre-transfer status for Internet type methods.
Fields: Message
200 URI Start
-Indicates the URI is starting to be transfered. The URI is specified
+Indicates the URI is starting to be transferred. The URI is specified
along with stats about the file itself.
Fields: URI, Size, Last-Modified, Resume-Point
201 URI Done
-Indicates that a URI has completed being transfered. It is possible
+Indicates that a URI has completed being transferred. It is possible
to specify a 201 URI Done> without a URI Start> which would
-mean no data was transfered but the file is now available. A Filename
+mean no data was transferred but the file is now available. A Filename
field is specified when the URI is directly available in the local
pathname space. APT will either directly use that file or copy it into
another location. It is possible to return Alt-* fields to indicate that
diff --git a/doc/style.txt b/doc/style.txt
index 2072251d0..7658b0314 100644
--- a/doc/style.txt
+++ b/doc/style.txt
@@ -9,7 +9,7 @@ Ver - A version
Indenting, Comments, Etc
~~~~~~~~~~~~~~~~~~~~~~~~
Would make Linus cry :P However it is what I prefer. 3 space indent,
-8 space tab all braces on seperate lines, function return on the same line
+8 space tab all braces on separate lines, function return on the same line
as the function, cases aligned with their code. The 'indent' options for
this style are:
indent -bl -bli0 -di1 -i3 -nsc -ts8 -npcs -npsl
@@ -60,13 +60,13 @@ almost always designates a change in ownership rules).
* Pass by non-const reference may be used to indicate a OUT type variable
* Pass by pointer (except in the case where the pointer is really an array)
should be used when the object will be retained or ownership will be
- transfered. Ownership transference should be rare and noted by a comment.
+ transferred. Ownership transference should be rare and noted by a comment.
* Standard C things (FILE * etc) should be left as is.
* Return by references should indicate a borrowed object
* Return by pointer (except arrays) should indicate ownership is
- transfered. Return by pointer should not be used unless ownership is
- transfered.
+ transferred. Return by pointer should not be used unless ownership is
+ transferred.
* Return by pointer to variable indicates ownership transfer unless the
pointer is an 'input' parameter (designated generally by an =0,
indicating a default of 'none')
diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc
index 2639bc2f6..712f8469a 100644
--- a/ftparchive/apt-ftparchive.cc
+++ b/ftparchive/apt-ftparchive.cc
@@ -864,7 +864,7 @@ bool Generate(CommandLine &CmdL)
unsigned long MaxContentsChange = Setup.FindI("Default::MaxContentsChange",UINT_MAX)*1024;
for (vector::iterator I = PkgList.begin(); I != PkgList.end(); ++I)
{
- // This record is not relevent
+ // This record is not relevant
if (I->ContentsDone == true ||
I->Contents.empty() == true)
continue;
diff --git a/methods/file.cc b/methods/file.cc
index 7ed4e6f60..3d0687c5b 100644
--- a/methods/file.cc
+++ b/methods/file.cc
@@ -5,7 +5,7 @@
File URI method for APT
- This simply checks that the file specified exists, if so the relevent
+ This simply checks that the file specified exists, if so the relevant
information is returned. If a .gz filename is specified then the file
name with .gz removed will also be checked and information about it
will be returned in Alt-*
diff --git a/methods/ftp.cc b/methods/ftp.cc
index 70bf4f607..621f48476 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -3,7 +3,7 @@
// $Id: ftp.cc,v 1.31.2.1 2004/01/16 18:58:50 mdz Exp $
/* ######################################################################
- FTP Aquire Method - This is the FTP aquire method for APT.
+ FTP Acquire Method - This is the FTP acquire method for APT.
This is a very simple implementation that does not try to optimize
at all. Commands are sent syncronously with the FTP server (as the
@@ -946,7 +946,7 @@ FtpMethod::FtpMethod() : pkgAcqMethod("1.0",SendConfig)
/*}}}*/
// FtpMethod::SigTerm - Handle a fatal signal /*{{{*/
// ---------------------------------------------------------------------
-/* This closes and timestamps the open file. This is neccessary to get
+/* This closes and timestamps the open file. This is necessary to get
resume behavoir on user abort */
void FtpMethod::SigTerm(int)
{
diff --git a/methods/ftp.h b/methods/ftp.h
index 2634f0732..8055c389f 100644
--- a/methods/ftp.h
+++ b/methods/ftp.h
@@ -3,7 +3,7 @@
// $Id: ftp.h,v 1.4 2001/03/06 07:15:29 jgg Exp $
/* ######################################################################
- FTP Aquire Method - This is the FTP aquire method for APT.
+ FTP Acquire Method - This is the FTP acquire method for APT.
##################################################################### */
/*}}}*/
diff --git a/methods/http.cc b/methods/http.cc
index 96c4e3ca0..42b31beeb 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -3,7 +3,7 @@
// $Id: http.cc,v 1.59 2004/05/08 19:42:35 mdz Exp $
/* ######################################################################
- HTTP Acquire Method - This is the HTTP aquire method for APT.
+ HTTP Acquire Method - This is the HTTP acquire method for APT.
It uses HTTP/1.1 and many of the fancy options there-in, such as
pipelining, range, if-range and so on.
@@ -732,7 +732,7 @@ void HttpMethod::SendReq(FetchItem *Itm)
}
// If we ask for uncompressed files servers might respond with content-
- // negotation which lets us end up with compressed files we do not support,
+ // negotiation which lets us end up with compressed files we do not support,
// see 657029, 657560 and co, so if we have no extension on the request
// ask for text only. As a sidenote: If there is nothing to negotate servers
// seem to be nice and ignore it.
diff --git a/methods/http.h b/methods/http.h
index 02c04e8ae..450a42eed 100644
--- a/methods/http.h
+++ b/methods/http.h
@@ -3,7 +3,7 @@
// $Id: http.h,v 1.12 2002/04/18 05:09:38 jgg Exp $
/* ######################################################################
- HTTP Acquire Method - This is the HTTP aquire method for APT.
+ HTTP Acquire Method - This is the HTTP acquire method for APT.
##################################################################### */
/*}}}*/
diff --git a/methods/https.cc b/methods/https.cc
index e713be19f..febe6a0f0 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -3,7 +3,7 @@
// $Id: http.cc,v 1.59 2004/05/08 19:42:35 mdz Exp $
/* ######################################################################
- HTTPS Acquire Method - This is the HTTPS aquire method for APT.
+ HTTPS Acquire Method - This is the HTTPS acquire method for APT.
It uses libcurl
@@ -309,7 +309,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_errorstr);
// If we ask for uncompressed files servers might respond with content-
- // negotation which lets us end up with compressed files we do not support,
+ // negotiation which lets us end up with compressed files we do not support,
// see 657029, 657560 and co, so if we have no extension on the request
// ask for text only. As a sidenote: If there is nothing to negotate servers
// seem to be nice and ignore it.
diff --git a/methods/https.h b/methods/https.h
index 89a89d19c..ab0dd3407 100644
--- a/methods/https.h
+++ b/methods/https.h
@@ -3,7 +3,7 @@
// $Id: http.h,v 1.12 2002/04/18 05:09:38 jgg Exp $
/* ######################################################################
- HTTP Acquire Method - This is the HTTP aquire method for APT.
+ HTTP Acquire Method - This is the HTTP acquire method for APT.
##################################################################### */
/*}}}*/
diff --git a/methods/mirror.cc b/methods/mirror.cc
index 83ef0d133..085f3717b 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -3,7 +3,7 @@
// $Id: mirror.cc,v 1.59 2004/05/08 19:42:35 mdz Exp $
/* ######################################################################
- Mirror Aquire Method - This is the Mirror aquire method for APT.
+ Mirror Acquire Method - This is the Mirror acquire method for APT.
##################################################################### */
/*}}}*/
@@ -49,7 +49,7 @@ using namespace std;
* of the failure that is also send to LP
*
* TODO:
- * - deal with runing as non-root because we can't write to the lists
+ * - deal with running as non-root because we can't write to the lists
dir then -> use the cached mirror file
* - better method to download than having a pkgAcquire interface here
* and better error handling there!
@@ -290,7 +290,7 @@ bool MirrorMethod::InitMirrors()
// FIXME: make the mirror selection more clever, do not
// just use the first one!
// BUT: we can not make this random, the mirror has to be
- // stable accross session, because otherwise we can
+ // stable across session, because otherwise we can
// get into sync issues (got indexfiles from mirror A,
// but packages from mirror B - one might be out of date etc)
ifstream in(MirrorFile.c_str());
diff --git a/methods/mirror.h b/methods/mirror.h
index 81e531e21..1dd9f2ec6 100644
--- a/methods/mirror.h
+++ b/methods/mirror.h
@@ -3,7 +3,7 @@
// $Id: http.h,v 1.12 2002/04/18 05:09:38 jgg Exp $
/* ######################################################################
- MIRROR Aquire Method - This is the MIRROR aquire method for APT.
+ MIRROR Acquire Method - This is the MIRROR acquire method for APT.
##################################################################### */
/*}}}*/
diff --git a/methods/rfc2553emu.h b/methods/rfc2553emu.h
index b15facb31..ad7ddf48a 100644
--- a/methods/rfc2553emu.h
+++ b/methods/rfc2553emu.h
@@ -75,7 +75,7 @@
#endif
/* If we don't have getaddrinfo then we probably don't have
- sockaddr_storage either (same RFC) so we definately will not be
+ sockaddr_storage either (same RFC) so we definitely will not be
doing any IPv6 stuff. Do not use the members of this structure to
retain portability, cast to a sockaddr. */
#define sockaddr_storage sockaddr_in
diff --git a/methods/rsh.cc b/methods/rsh.cc
index 4e1aaea26..550f77eca 100644
--- a/methods/rsh.cc
+++ b/methods/rsh.cc
@@ -255,7 +255,7 @@ bool RSHConn::WriteMsg(std::string &Text,bool Sync,const char *Fmt,...)
/*}}}*/
// RSHConn::Size - Return the size of the file /*{{{*/
// ---------------------------------------------------------------------
-/* Right now for successfull transfer the file size must be known in
+/* Right now for successful transfer the file size must be known in
advance. */
bool RSHConn::Size(const char *Path,unsigned long long &Size)
{
diff --git a/methods/server.cc b/methods/server.cc
index 6dd3970a6..ef90c809c 100644
--- a/methods/server.cc
+++ b/methods/server.cc
@@ -86,7 +86,7 @@ ServerState::RunHeadersResult ServerState::RunHeaders(FileFd * const File)
if (Result == 100)
continue;
- // Tidy up the connection persistance state.
+ // Tidy up the connection persistence state.
if (Encoding == Closes && HaveContent == true)
Persistent = false;
@@ -146,7 +146,7 @@ bool ServerState::HeaderLine(string Line)
return _error->Error(_("The HTTP server sent an invalid reply header"));
}
- /* Check the HTTP response header to get the default persistance
+ /* Check the HTTP response header to get the default persistence
state. */
if (Major < 1)
Persistent = false;
@@ -366,7 +366,7 @@ ServerMethod::DealWithHeaders(FetchResult &Res)
/*}}}*/
// ServerMethod::SigTerm - Handle a fatal signal /*{{{*/
// ---------------------------------------------------------------------
-/* This closes and timestamps the open file. This is neccessary to get
+/* This closes and timestamps the open file. This is necessary to get
resume behavoir on user abort */
void ServerMethod::SigTerm(int)
{
diff --git a/test/integration/framework b/test/integration/framework
index 08d796a10..63df86df7 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -947,7 +947,7 @@ URI: $1
Filename: ${2}
"
# simple worker keeping stdin open until we are done (201) or error (400)
- # and requesting new URIs on try-agains/redirects inbetween
+ # and requesting new URIs on try-agains/redirects in-between
{ tail -n 999 -f "$DOWNLOG" & echo "TAILPID: $!"; } | while read f1 f2; do
if [ "$f1" = 'TAILPID:' ]; then
TAILPID="$f2"
diff --git a/test/integration/test-apt-get-source b/test/integration/test-apt-get-source
index 083e26db1..33bd980d0 100755
--- a/test/integration/test-apt-get-source
+++ b/test/integration/test-apt-get-source
@@ -65,7 +65,7 @@ Need to get 0 B of source archives.
'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo=1.0
# select by release with no binary package (Bug#731102) but ensure to get
-# higest version
+# highest version
testequal "$HEADER
Selected version '0.1' (wheezy) for foo
Need to get 0 B of source archives.
diff --git a/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted b/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted
index 633c197c0..f93510fd7 100755
--- a/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted
+++ b/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted
@@ -11,7 +11,7 @@ buildsimplenativepackage 'cool' 'i386' '1.0' 'unstable'
setupaptarchive --no-update
testfileexists() {
- msgtest 'Test for existance of file' "$1"
+ msgtest 'Test for existence of file' "$1"
test -e "$1" && msgpass || msgfail
rm -f "$1"
}
diff --git a/test/integration/test-sourceslist-arch-plusminus-options b/test/integration/test-sourceslist-arch-plusminus-options
index 0d4d7448f..0091964e6 100755
--- a/test/integration/test-sourceslist-arch-plusminus-options
+++ b/test/integration/test-sourceslist-arch-plusminus-options
@@ -76,7 +76,7 @@ echo 'deb [arch=mips,i386 arch-=mips] http://example.org/debian stable rocks' >
testbinaries 'substract from a arch-set' 'i386'
echo 'deb [arch=mips,i386 arch-=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
-testbinaries 'useless substract from a arch-set' 'i386'
+testbinaries 'useless subtract from a arch-set' 'i386'
echo 'deb [arch=mips,i386 arch+=armhf] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'addition to a arch-set' 'i386' 'mips' 'armhf'
diff --git a/test/libapt/globalerror_test.cc b/test/libapt/globalerror_test.cc
index 72044d493..b6939231d 100644
--- a/test/libapt/globalerror_test.cc
+++ b/test/libapt/globalerror_test.cc
@@ -15,17 +15,17 @@ int main(int argc,char *argv[])
equals(_error->empty(), true);
equals(_error->empty(GlobalError::DEBUG), false);
equals(_error->PendingError(), false);
- equals(_error->Error("%s horrible %s %d times", "Something", "happend", 2), false);
+ equals(_error->Error("%s horrible %s %d times", "Something", "happened", 2), false);
equals(_error->PendingError(), true);
std::string text;
equals(_error->PopMessage(text), false);
equals(_error->PendingError(), true);
equals(text, "A Notice");
equals(_error->PopMessage(text), true);
- equals(text, "Something horrible happend 2 times");
+ equals(text, "Something horrible happened 2 times");
equals(_error->empty(GlobalError::DEBUG), true);
equals(_error->PendingError(), false);
- equals(_error->Error("%s horrible %s %d times", "Something", "happend", 2), false);
+ equals(_error->Error("%s horrible %s %d times", "Something", "happened", 2), false);
equals(_error->PendingError(), true);
equals(_error->empty(GlobalError::FATAL), false);
_error->Discard();
@@ -33,7 +33,7 @@ int main(int argc,char *argv[])
equals(_error->empty(), true);
equals(_error->PendingError(), false);
equals(_error->Notice("%s Notice", "A"), false);
- equals(_error->Error("%s horrible %s %d times", "Something", "happend", 2), false);
+ equals(_error->Error("%s horrible %s %d times", "Something", "happened", 2), false);
equals(_error->PendingError(), true);
equals(_error->empty(GlobalError::NOTICE), false);
_error->PushToStack();
@@ -49,12 +49,12 @@ int main(int argc,char *argv[])
equals(_error->PendingError(), true);
equals(text, "A Notice");
equals(_error->PopMessage(text), true);
- equals(text, "Something horrible happend 2 times");
+ equals(text, "Something horrible happened 2 times");
equals(_error->PendingError(), false);
equals(_error->empty(), true);
equals(_error->Notice("%s Notice", "A"), false);
- equals(_error->Error("%s horrible %s %d times", "Something", "happend", 2), false);
+ equals(_error->Error("%s horrible %s %d times", "Something", "happened", 2), false);
equals(_error->PendingError(), true);
equals(_error->empty(GlobalError::NOTICE), false);
_error->PushToStack();
@@ -70,7 +70,7 @@ int main(int argc,char *argv[])
equals(_error->PendingError(), true);
equals(text, "A Notice");
equals(_error->PopMessage(text), true);
- equals(text, "Something horrible happend 2 times");
+ equals(text, "Something horrible happened 2 times");
equals(_error->PendingError(), false);
equals(_error->empty(), false);
equals(_error->PopMessage(text), false);
@@ -78,24 +78,24 @@ int main(int argc,char *argv[])
equals(_error->empty(), true);
errno = 0;
- equals(_error->Errno("errno", "%s horrible %s %d times", "Something", "happend", 2), false);
+ equals(_error->Errno("errno", "%s horrible %s %d times", "Something", "happened", 2), false);
equals(_error->empty(), false);
equals(_error->PendingError(), true);
equals(_error->PopMessage(text), true);
equals(_error->PendingError(), false);
- equals(text, std::string("Something horrible happend 2 times - errno (0: ").append(textOfErrnoZero).append(")"));
+ equals(text, std::string("Something horrible happened 2 times - errno (0: ").append(textOfErrnoZero).append(")"));
equals(_error->empty(), true);
std::string longText;
for (size_t i = 0; i < 500; ++i)
longText.append("a");
- equals(_error->Error("%s horrible %s %d times", longText.c_str(), "happend", 2), false);
+ equals(_error->Error("%s horrible %s %d times", longText.c_str(), "happened", 2), false);
equals(_error->PopMessage(text), true);
- equals(text, std::string(longText).append(" horrible happend 2 times"));
+ equals(text, std::string(longText).append(" horrible happened 2 times"));
- equals(_error->Errno("errno", "%s horrible %s %d times", longText.c_str(), "happend", 2), false);
+ equals(_error->Errno("errno", "%s horrible %s %d times", longText.c_str(), "happened", 2), false);
equals(_error->PopMessage(text), true);
- equals(text, std::string(longText).append(" horrible happend 2 times - errno (0: ").append(textOfErrnoZero).append(")"));
+ equals(text, std::string(longText).append(" horrible happened 2 times - errno (0: ").append(textOfErrnoZero).append(")"));
equals(_error->Warning("Репозиторий не обновлён и будут %d %s", 4, "test"), false);
equals(_error->PopMessage(text), false);
--
cgit v1.2.3-70-g09d2
From e7f56293f029505f59670be2bad244f6d9912369 Mon Sep 17 00:00:00 2001
From: Guillem Jover
Date: Sun, 16 Feb 2014 23:30:48 +0100
Subject: Add support for data.tar, control.tar and control.tar.xz
Sync the deb(5) format support with latest dpkg, by allowing
uncompressed tar members and xz compressed control.tar. This
also refactors the control.tar member extraction by using
ExtractTarMember(), which also means future changes only need
to be implemented in a single place.
---
apt-inst/deb/debfile.cc | 21 ++++++++++-----------
cmdline/apt-extracttemplates.cc | 18 ++++--------------
2 files changed, 14 insertions(+), 25 deletions(-)
(limited to 'cmdline')
diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc
index 15db1a7fc..a811bbe88 100644
--- a/apt-inst/deb/debfile.cc
+++ b/apt-inst/deb/debfile.cc
@@ -42,12 +42,15 @@ debDebFile::debDebFile(FileFd &File) : File(File), AR(File)
return;
}
- if (!CheckMember("control.tar.gz")) {
- _error->Error(_("This is not a valid DEB archive, missing '%s' member"), "control.tar.gz");
+ if (!CheckMember("control.tar") &&
+ !CheckMember("control.tar.gz") &&
+ !CheckMember("control.tar.xz")) {
+ _error->Error(_("This is not a valid DEB archive, missing '%s' member"), "control.tar");
return;
}
- if (!CheckMember("data.tar.gz") &&
+ if (!CheckMember("data.tar") &&
+ !CheckMember("data.tar.gz") &&
!CheckMember("data.tar.bz2") &&
!CheckMember("data.tar.lzma") &&
!CheckMember("data.tar.xz")) {
@@ -108,6 +111,9 @@ bool debDebFile::ExtractTarMember(pkgDirStream &Stream,const char *Name)
break;
}
+ if (Member == NULL)
+ Member = AR.FindMember(std::string(Name).c_str());
+
if (Member == NULL)
{
std::string ext = std::string(Name) + ".{";
@@ -201,14 +207,7 @@ bool debDebFile::MemControlExtract::Process(Item &Itm,const unsigned char *Data,
it parses it into a tag section parser. */
bool debDebFile::MemControlExtract::Read(debDebFile &Deb)
{
- // Get the archive member and positition the file
- const ARArchive::Member *Member = Deb.GotoMember("control.tar.gz");
- if (Member == 0)
- return false;
-
- // Extract it.
- ExtractTar Tar(Deb.GetFile(),Member->Size,"gzip");
- if (Tar.Go(*this) == false)
+ if (Deb.ExtractTarMember(*this, "control.tar") == false)
return false;
if (Control == 0)
diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc
index 8e1937113..2408a7d9d 100644
--- a/cmdline/apt-extracttemplates.cc
+++ b/cmdline/apt-extracttemplates.cc
@@ -24,8 +24,7 @@
#include
#include
#include
-#include
-#include
+#include
#include
#include
#include
@@ -91,18 +90,9 @@ string DebFile::GetInstalledVer(const string &package)
/* */
bool DebFile::Go()
{
- ARArchive AR(File);
- if (_error->PendingError() == true)
- return false;
-
- const ARArchive::Member *Member = AR.FindMember("control.tar.gz");
- if (Member == 0)
- return _error->Error(_("%s not a valid DEB package."),File.Name().c_str());
-
- if (File.Seek(Member->Start) == false)
- return false;
- ExtractTar Tar(File, Member->Size,"gzip");
- return Tar.Go(*this);
+ debDebFile Deb(File);
+
+ return Deb.ExtractTarMember(*this, "control.tar");
}
/*}}}*/
// DebFile::DoItem examine element in package and mark /*{{{*/
--
cgit v1.2.3-70-g09d2
From ed9665aedf77b3b8345bd4ed33de7885738e29f0 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Thu, 27 Feb 2014 16:46:05 +0100
Subject: initial version of apt-helper
---
apt-pkg/acquire-item.cc | 2 +-
cmdline/apt-helper.cc | 127 ++++++++++++++++++++++++++++
cmdline/makefile | 7 ++
debian/rules | 3 +
debian/tests/run-tests | 1 +
test/integration/framework | 43 ++--------
test/integration/test-apt-https-no-redirect | 2 +-
7 files changed, 148 insertions(+), 37 deletions(-)
create mode 100644 cmdline/apt-helper.cc
(limited to 'cmdline')
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 36bb48382..de03011bf 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -2201,7 +2201,7 @@ pkgAcqFile::pkgAcqFile(pkgAcquire *Owner,string URI,string Hash,
if (stat(DestFile.c_str(),&Buf) == 0)
{
// Hmm, the partial file is too big, erase it
- if ((unsigned long long)Buf.st_size > Size)
+ if ((Size > 0) && (unsigned long long)Buf.st_size > Size)
unlink(DestFile.c_str());
else
PartialSize = Buf.st_size;
diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc
new file mode 100644
index 000000000..c1c8b2178
--- /dev/null
+++ b/cmdline/apt-helper.cc
@@ -0,0 +1,127 @@
+// -*- mode: cpp; mode: fold -*-
+// Description /*{{{*/
+/* #####################################################################
+ apt-helper - cmdline helpers
+ ##################################################################### */
+ /*}}}*/
+// Include Files /*{{{*/
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+
+#include
+ /*}}}*/
+using namespace std;
+
+bool DoDownloadFile(CommandLine &CmdL)
+{
+ if (CmdL.FileSize() <= 2)
+ return _error->Error(_("Must specify at least one pair url/filename"));
+
+
+ pkgAcquire Fetcher;
+ AcqTextStatus Stat(ScreenWidth, _config->FindI("quiet",0));
+ Fetcher.Setup(&Stat);
+ std::string download_uri = CmdL.FileList[1];
+ std::string targetfile = CmdL.FileList[2];
+ new pkgAcqFile(&Fetcher, download_uri, "", 0, "desc", "short-desc",
+ "dest-dir-ignored", targetfile);
+ Fetcher.Run();
+ if (!FileExists(targetfile))
+ {
+ _error->Error(_("Download Failed"));
+ return false;
+ }
+ return true;
+}
+
+bool ShowHelp(CommandLine &CmdL)
+{
+ ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
+ COMMON_ARCH,__DATE__,__TIME__);
+
+ if (_config->FindB("version") == true)
+ return true;
+
+ cout <<
+ _("Usage: apt-helper [options] command\n"
+ " apt-helper [options] download-file uri target-path\n"
+ "\n"
+ "apt-helper is a internal helper for apt\n"
+ "\n"
+ "Commands:\n"
+ " download-file - download the given uri to the target-path\n"
+ "\n"
+ " This APT helper has Super Meep Powers.\n");
+ return true;
+}
+
+
+int main(int argc,const char *argv[]) /*{{{*/
+{
+ CommandLine::Dispatch Cmds[] = {{"help",&ShowHelp},
+ {"download-file", &DoDownloadFile},
+ {0,0}};
+
+ std::vector Args = getCommandArgs(
+ "apt-download", CommandLine::GetCommand(Cmds, argc, argv));
+
+ // Set up gettext support
+ setlocale(LC_ALL,"");
+ textdomain(PACKAGE);
+
+ // Parse the command line and initialize the package library
+ CommandLine CmdL(Args.data(),_config);
+ if (pkgInitConfig(*_config) == false ||
+ CmdL.Parse(argc,argv) == false ||
+ pkgInitSystem(*_config,_system) == false)
+ {
+ if (_config->FindB("version") == true)
+ ShowHelp(CmdL);
+ _error->DumpErrors();
+ return 100;
+ }
+
+ // See if the help should be shown
+ if (_config->FindB("help") == true ||
+ _config->FindB("version") == true ||
+ CmdL.FileSize() == 0)
+ {
+ ShowHelp(CmdL);
+ return 0;
+ }
+
+ InitOutput();
+
+ // Match the operation
+ CmdL.DispatchArg(Cmds);
+
+ // Print any errors or warnings found during parsing
+ bool const Errors = _error->PendingError();
+ if (_config->FindI("quiet",0) > 0)
+ _error->DumpErrors();
+ else
+ _error->DumpErrors(GlobalError::DEBUG);
+ return Errors == true ? 100 : 0;
+}
+ /*}}}*/
diff --git a/cmdline/makefile b/cmdline/makefile
index f89192e10..c4a249cd6 100644
--- a/cmdline/makefile
+++ b/cmdline/makefile
@@ -47,6 +47,13 @@ LIB_MAKES = apt-pkg/makefile
SOURCE = apt-mark.cc
include $(PROGRAM_H)
+# The apt-helper
+PROGRAM=apt-helper
+SLIBS = -lapt-pkg -lapt-private $(INTLLIBS)
+LIB_MAKES = apt-pkg/makefile
+SOURCE = apt-helper.cc
+include $(PROGRAM_H)
+
# The apt-report-mirror-failure program
#SOURCE=apt-report-mirror-failure
#TO=$(BIN)
diff --git a/debian/rules b/debian/rules
index 1b3782ab6..eec016607 100755
--- a/debian/rules
+++ b/debian/rules
@@ -207,6 +207,9 @@ apt: build-binary build-manpages debian/apt.install
#mv debian/$@/usr/bin/apt-report-mirror-failure \
# debian/$@/usr/lib/apt/apt-report-mirror-failure \
+ # move the apt-helper in place
+ mv debian/$@/usr/bin/apt-helper debian/$@/usr/lib/apt/apt-helper
+
dh_bugfiles -p$@
dh_lintian -p$@
dh_installexamples -p$@ $(BLD)/docs/examples/*
diff --git a/debian/tests/run-tests b/debian/tests/run-tests
index 6dc4eaa93..e03db9b0c 100644
--- a/debian/tests/run-tests
+++ b/debian/tests/run-tests
@@ -14,5 +14,6 @@ make -C test/interactive-helper/
# run against the installed apt
APT_INTEGRATION_TESTS_WEBSERVER_BIN_DIR=$(pwd)/build/bin \
APT_INTEGRATION_TESTS_METHODS_DIR=/usr/lib/apt/methods \
+APT_INTEGRATION_TESTS_LIBEXEC_DIR=/usr/lib/apt/ \
APT_INTEGRATION_TESTS_BUILD_DIR=/usr/bin \
./test/integration/run-tests
diff --git a/test/integration/framework b/test/integration/framework
index 99214ef73..911a4d742 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -111,6 +111,9 @@ aptftparchive() { runapt apt-ftparchive "$@"; }
aptkey() { runapt apt-key "$@"; }
aptmark() { runapt apt-mark "$@"; }
apt() { runapt apt "$@"; }
+apthelper() {
+ LD_LIBRARY_PATH=${APTHELPERBINDIR} ${APTHELPERBINDIR}/apt-helper "$@";
+}
aptwebserver() {
LD_LIBRARY_PATH=${APTWEBSERVERBINDIR} ${APTWEBSERVERBINDIR}/aptwebserver "$@";
}
@@ -177,6 +180,7 @@ setupenvironment() {
# allow overriding the default BUILDDIR location
BUILDDIRECTORY=${APT_INTEGRATION_TESTS_BUILD_DIR:-"${TESTDIRECTORY}/../../build/bin"}
METHODSDIR=${APT_INTEGRATION_TESTS_METHODS_DIR:-"${BUILDDIRECTORY}/methods"}
+ APTHELPERBINDIR=${APT_INTEGRATION_TESTS_LIBEXEC_DIR:-"${BUILDDIRECTORY}"}
APTWEBSERVERBINDIR=${APT_INTEGRATION_TESTS_WEBSERVER_BIN_DIR:-"${BUILDDIRECTORY}"}
test -x "${BUILDDIRECTORY}/apt-get" || msgdie "You need to build tree first"
# -----
@@ -934,41 +938,10 @@ changetocdrom() {
}
downloadfile() {
- PROTO="$(echo "$1" | cut -d':' -f 1)"
- if [ ! -x "${METHODSDIR}/${PROTO}" ]; then
- msgwarn "can not find ${METHODSDIR}/${PROTO}"
- return 1
- fi
- local DOWNLOG="${TMPWORKINGDIRECTORY}/download.log"
- rm -f "$DOWNLOG"
- touch "$DOWNLOG"
- {
- echo "601 Configuration
-Config-Item: Acquire::https::CaInfo=${TESTDIR}/apt.pem
-Config-Item: Debug::Acquire::${PROTO}=1
-
-600 Acquire URI
-URI: $1
-Filename: ${2}
-"
- # simple worker keeping stdin open until we are done (201) or error (400)
- # and requesting new URIs on try-agains/redirects in-between
- { tail -n 999 -f "$DOWNLOG" & echo "TAILPID: $!"; } | while read f1 f2; do
- if [ "$f1" = 'TAILPID:' ]; then
- TAILPID="$f2"
- elif [ "$f1" = 'New-URI:' ]; then
- echo "600 Acquire URI
-URI: $f2
-Filename: ${2}
-"
- elif [ "$f1" = '201' ] || [ "$f1" = '400' ]; then
- # tail would only die on next read – which never happens
- test -z "$TAILPID" || kill -s HUP "$TAILPID"
- break
- fi
- done
- } | LD_LIBRARY_PATH=${BUILDDIRECTORY} ${METHODSDIR}/${PROTO} 2>&1 | tee "$DOWNLOG"
- rm "$DOWNLOG"
+ PROTO="$(echo "$1" | cut -d':' -f 1)"
+ apthelper -o Acquire::https::CaInfo=${TESTDIR}/apt.pem \
+ -o Debug::Acquire::${PROTO}=1 \
+ download-file "$1" "$2" 2>&1
# only if the file exists the download was successful
if [ -e "$2" ]; then
return 0
diff --git a/test/integration/test-apt-https-no-redirect b/test/integration/test-apt-https-no-redirect
index c405d1167..0408c6832 100755
--- a/test/integration/test-apt-https-no-redirect
+++ b/test/integration/test-apt-https-no-redirect
@@ -19,6 +19,6 @@ msgtest 'normal https download works'
downloadfile 'https://localhost:4433/pool/apt_1.0/changelog' changelog >/dev/null 2>/dev/null && msgpass || msgfail
msgtest 'redirecting https to http does not work'
-downloadfile 'https://localhost:4433/redirectme/pool/apt_1.0/changelog' changelog3 2>&1 | grep "Protocol http not supported or disabled in libcurl" > /dev/null && msgpass
+downloadfile 'https://localhost:4433/redirectme/pool/apt_1.0/changelog' changelog3 2>&1 | grep "Protocol http not supported or disabled in libcurl" > /dev/null && msgpass || msgfail
--
cgit v1.2.3-70-g09d2
From e43a426e5d402d36eb180935fbbf1430a4a86e3f Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Thu, 27 Feb 2014 16:46:05 +0100
Subject: initial version of apt-helper
---
apt-pkg/acquire-item.cc | 2 +-
cmdline/apt-helper.cc | 127 ++++++++++++++++++++++++++++
cmdline/makefile | 7 ++
debian/rules | 3 +
debian/tests/run-tests | 1 +
test/integration/framework | 69 ++++-----------
test/integration/test-apt-https-no-redirect | 20 ++++-
7 files changed, 174 insertions(+), 55 deletions(-)
create mode 100644 cmdline/apt-helper.cc
(limited to 'cmdline')
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 36bb48382..de03011bf 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -2201,7 +2201,7 @@ pkgAcqFile::pkgAcqFile(pkgAcquire *Owner,string URI,string Hash,
if (stat(DestFile.c_str(),&Buf) == 0)
{
// Hmm, the partial file is too big, erase it
- if ((unsigned long long)Buf.st_size > Size)
+ if ((Size > 0) && (unsigned long long)Buf.st_size > Size)
unlink(DestFile.c_str());
else
PartialSize = Buf.st_size;
diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc
new file mode 100644
index 000000000..c1c8b2178
--- /dev/null
+++ b/cmdline/apt-helper.cc
@@ -0,0 +1,127 @@
+// -*- mode: cpp; mode: fold -*-
+// Description /*{{{*/
+/* #####################################################################
+ apt-helper - cmdline helpers
+ ##################################################################### */
+ /*}}}*/
+// Include Files /*{{{*/
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+
+#include
+ /*}}}*/
+using namespace std;
+
+bool DoDownloadFile(CommandLine &CmdL)
+{
+ if (CmdL.FileSize() <= 2)
+ return _error->Error(_("Must specify at least one pair url/filename"));
+
+
+ pkgAcquire Fetcher;
+ AcqTextStatus Stat(ScreenWidth, _config->FindI("quiet",0));
+ Fetcher.Setup(&Stat);
+ std::string download_uri = CmdL.FileList[1];
+ std::string targetfile = CmdL.FileList[2];
+ new pkgAcqFile(&Fetcher, download_uri, "", 0, "desc", "short-desc",
+ "dest-dir-ignored", targetfile);
+ Fetcher.Run();
+ if (!FileExists(targetfile))
+ {
+ _error->Error(_("Download Failed"));
+ return false;
+ }
+ return true;
+}
+
+bool ShowHelp(CommandLine &CmdL)
+{
+ ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
+ COMMON_ARCH,__DATE__,__TIME__);
+
+ if (_config->FindB("version") == true)
+ return true;
+
+ cout <<
+ _("Usage: apt-helper [options] command\n"
+ " apt-helper [options] download-file uri target-path\n"
+ "\n"
+ "apt-helper is a internal helper for apt\n"
+ "\n"
+ "Commands:\n"
+ " download-file - download the given uri to the target-path\n"
+ "\n"
+ " This APT helper has Super Meep Powers.\n");
+ return true;
+}
+
+
+int main(int argc,const char *argv[]) /*{{{*/
+{
+ CommandLine::Dispatch Cmds[] = {{"help",&ShowHelp},
+ {"download-file", &DoDownloadFile},
+ {0,0}};
+
+ std::vector Args = getCommandArgs(
+ "apt-download", CommandLine::GetCommand(Cmds, argc, argv));
+
+ // Set up gettext support
+ setlocale(LC_ALL,"");
+ textdomain(PACKAGE);
+
+ // Parse the command line and initialize the package library
+ CommandLine CmdL(Args.data(),_config);
+ if (pkgInitConfig(*_config) == false ||
+ CmdL.Parse(argc,argv) == false ||
+ pkgInitSystem(*_config,_system) == false)
+ {
+ if (_config->FindB("version") == true)
+ ShowHelp(CmdL);
+ _error->DumpErrors();
+ return 100;
+ }
+
+ // See if the help should be shown
+ if (_config->FindB("help") == true ||
+ _config->FindB("version") == true ||
+ CmdL.FileSize() == 0)
+ {
+ ShowHelp(CmdL);
+ return 0;
+ }
+
+ InitOutput();
+
+ // Match the operation
+ CmdL.DispatchArg(Cmds);
+
+ // Print any errors or warnings found during parsing
+ bool const Errors = _error->PendingError();
+ if (_config->FindI("quiet",0) > 0)
+ _error->DumpErrors();
+ else
+ _error->DumpErrors(GlobalError::DEBUG);
+ return Errors == true ? 100 : 0;
+}
+ /*}}}*/
diff --git a/cmdline/makefile b/cmdline/makefile
index f89192e10..c4a249cd6 100644
--- a/cmdline/makefile
+++ b/cmdline/makefile
@@ -47,6 +47,13 @@ LIB_MAKES = apt-pkg/makefile
SOURCE = apt-mark.cc
include $(PROGRAM_H)
+# The apt-helper
+PROGRAM=apt-helper
+SLIBS = -lapt-pkg -lapt-private $(INTLLIBS)
+LIB_MAKES = apt-pkg/makefile
+SOURCE = apt-helper.cc
+include $(PROGRAM_H)
+
# The apt-report-mirror-failure program
#SOURCE=apt-report-mirror-failure
#TO=$(BIN)
diff --git a/debian/rules b/debian/rules
index 1b3782ab6..eec016607 100755
--- a/debian/rules
+++ b/debian/rules
@@ -207,6 +207,9 @@ apt: build-binary build-manpages debian/apt.install
#mv debian/$@/usr/bin/apt-report-mirror-failure \
# debian/$@/usr/lib/apt/apt-report-mirror-failure \
+ # move the apt-helper in place
+ mv debian/$@/usr/bin/apt-helper debian/$@/usr/lib/apt/apt-helper
+
dh_bugfiles -p$@
dh_lintian -p$@
dh_installexamples -p$@ $(BLD)/docs/examples/*
diff --git a/debian/tests/run-tests b/debian/tests/run-tests
index 6dc4eaa93..e03db9b0c 100644
--- a/debian/tests/run-tests
+++ b/debian/tests/run-tests
@@ -14,5 +14,6 @@ make -C test/interactive-helper/
# run against the installed apt
APT_INTEGRATION_TESTS_WEBSERVER_BIN_DIR=$(pwd)/build/bin \
APT_INTEGRATION_TESTS_METHODS_DIR=/usr/lib/apt/methods \
+APT_INTEGRATION_TESTS_LIBEXEC_DIR=/usr/lib/apt/ \
APT_INTEGRATION_TESTS_BUILD_DIR=/usr/bin \
./test/integration/run-tests
diff --git a/test/integration/framework b/test/integration/framework
index 99214ef73..d9bacef83 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -90,18 +90,18 @@ msgdone() {
echo "${CDONE}DONE${CNORMAL}";
fi
}
-
+getaptconfig() {
+ if [ -f ./aptconfig.conf ]; then
+ echo "./aptconfig.conf"
+ elif [ -f ../aptconfig.conf ]; then
+ echo "../aptconfig.conf"
+ fi
+}
runapt() {
msgdebug "Executing: ${CCMD}$*${CDEBUG} "
local CMD="$1"
shift
- if [ -f ./aptconfig.conf ]; then
- MALLOC_PERTURB_=21 MALLOC_CHECK_=2 APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$CMD "$@"
- elif [ -f ../aptconfig.conf ]; then
- MALLOC_PERTURB_=21 MALLOC_CHECK_=2 APT_CONFIG=../aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$CMD "$@"
- else
- MALLOC_PERTURB_=21 MALLOC_CHECK_=2 LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$CMD "$@"
- fi
+ MALLOC_PERTURB_=21 MALLOC_CHECK_=2 APT_CONFIG="$(getaptconfig)" LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$CMD "$@"
}
aptconfig() { runapt apt-config "$@"; }
aptcache() { runapt apt-cache "$@"; }
@@ -111,6 +111,9 @@ aptftparchive() { runapt apt-ftparchive "$@"; }
aptkey() { runapt apt-key "$@"; }
aptmark() { runapt apt-mark "$@"; }
apt() { runapt apt "$@"; }
+apthelper() {
+ APT_CONFIG="$(getaptconfig)" LD_LIBRARY_PATH=${APTHELPERBINDIR} ${APTHELPERBINDIR}/apt-helper "$@";
+}
aptwebserver() {
LD_LIBRARY_PATH=${APTWEBSERVERBINDIR} ${APTWEBSERVERBINDIR}/aptwebserver "$@";
}
@@ -118,17 +121,11 @@ dpkg() {
command dpkg --root=${TMPWORKINGDIRECTORY}/rootdir --force-not-root --force-bad-path --log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log "$@"
}
aptitude() {
- if [ -f ./aptconfig.conf ]; then
- APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} command aptitude "$@"
- elif [ -f ../aptconfig.conf ]; then
- APT_CONFIG=../aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} command aptitude "$@"
- else
- LD_LIBRARY_PATH=${BUILDDIRECTORY} command aptitude "$@"
- fi
+ APT_CONFIG="$(getaptconfig)" LD_LIBRARY_PATH=${BUILDDIRECTORY} command aptitude "$@"
}
gdb() {
echo "gdb: run »$*«"
- APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} command gdb ${BUILDDIRECTORY}/$1 --args "$@"
+ APT_CONFIG="$(getaptconfig)" LD_LIBRARY_PATH=${BUILDDIRECTORY} command gdb ${BUILDDIRECTORY}/$1 --args "$@"
}
http() {
LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/methods/http
@@ -177,6 +174,7 @@ setupenvironment() {
# allow overriding the default BUILDDIR location
BUILDDIRECTORY=${APT_INTEGRATION_TESTS_BUILD_DIR:-"${TESTDIRECTORY}/../../build/bin"}
METHODSDIR=${APT_INTEGRATION_TESTS_METHODS_DIR:-"${BUILDDIRECTORY}/methods"}
+ APTHELPERBINDIR=${APT_INTEGRATION_TESTS_LIBEXEC_DIR:-"${BUILDDIRECTORY}"}
APTWEBSERVERBINDIR=${APT_INTEGRATION_TESTS_WEBSERVER_BIN_DIR:-"${BUILDDIRECTORY}"}
test -x "${BUILDDIRECTORY}/apt-get" || msgdie "You need to build tree first"
# -----
@@ -934,41 +932,10 @@ changetocdrom() {
}
downloadfile() {
- PROTO="$(echo "$1" | cut -d':' -f 1)"
- if [ ! -x "${METHODSDIR}/${PROTO}" ]; then
- msgwarn "can not find ${METHODSDIR}/${PROTO}"
- return 1
- fi
- local DOWNLOG="${TMPWORKINGDIRECTORY}/download.log"
- rm -f "$DOWNLOG"
- touch "$DOWNLOG"
- {
- echo "601 Configuration
-Config-Item: Acquire::https::CaInfo=${TESTDIR}/apt.pem
-Config-Item: Debug::Acquire::${PROTO}=1
-
-600 Acquire URI
-URI: $1
-Filename: ${2}
-"
- # simple worker keeping stdin open until we are done (201) or error (400)
- # and requesting new URIs on try-agains/redirects in-between
- { tail -n 999 -f "$DOWNLOG" & echo "TAILPID: $!"; } | while read f1 f2; do
- if [ "$f1" = 'TAILPID:' ]; then
- TAILPID="$f2"
- elif [ "$f1" = 'New-URI:' ]; then
- echo "600 Acquire URI
-URI: $f2
-Filename: ${2}
-"
- elif [ "$f1" = '201' ] || [ "$f1" = '400' ]; then
- # tail would only die on next read – which never happens
- test -z "$TAILPID" || kill -s HUP "$TAILPID"
- break
- fi
- done
- } | LD_LIBRARY_PATH=${BUILDDIRECTORY} ${METHODSDIR}/${PROTO} 2>&1 | tee "$DOWNLOG"
- rm "$DOWNLOG"
+ PROTO="$(echo "$1" | cut -d':' -f 1)"
+ apthelper -o Acquire::https::CaInfo=${TESTDIR}/apt.pem \
+ -o Debug::Acquire::${PROTO}=1 \
+ download-file "$1" "$2" 2>&1
# only if the file exists the download was successful
if [ -e "$2" ]; then
return 0
diff --git a/test/integration/test-apt-https-no-redirect b/test/integration/test-apt-https-no-redirect
index c405d1167..106d4bced 100755
--- a/test/integration/test-apt-https-no-redirect
+++ b/test/integration/test-apt-https-no-redirect
@@ -12,13 +12,27 @@ setupaptarchive --no-update
changetohttpswebserver -o 'aptwebserver::redirect::replace::/redirectme/=http://localhost:8080/'
+DOWNLOG='download-testfile.log'
msgtest 'normal http download works'
-downloadfile 'http://localhost:8080/pool/apt_1.0/changelog' changelog2 >/dev/null 2>/dev/null && msgpass || msgfail
+downloadfile 'http://localhost:8080/pool/apt_1.0/changelog' changelog2 > "$DOWNLOG" && msgpass || msgfail
msgtest 'normal https download works'
-downloadfile 'https://localhost:4433/pool/apt_1.0/changelog' changelog >/dev/null 2>/dev/null && msgpass || msgfail
+downloadfile 'https://localhost:4433/pool/apt_1.0/changelog' changelog > "$DOWNLOG" && msgpass || msgfail
msgtest 'redirecting https to http does not work'
-downloadfile 'https://localhost:4433/redirectme/pool/apt_1.0/changelog' changelog3 2>&1 | grep "Protocol http not supported or disabled in libcurl" > /dev/null && msgpass
+if ! downloadfile 'https://localhost:4433/redirectme/pool/apt_1.0/changelog' changelog3 > "$DOWNLOG"; then
+ msgpass
+else
+ cat >&2 "$DOWNLOG"
+ msgfail
+fi
+
+msgtest 'https methods given proper error on redirect attempt'
+if grep -q 'Protocol http not supported or disabled in libcurl' "$DOWNLOG"; then
+ msgpass
+else
+ cat >&2 "$DOWNLOG"
+ msgfail
+fi
--
cgit v1.2.3-70-g09d2
From c1409d1be88557529c62883be3174793481233de Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Wed, 12 Mar 2014 20:33:05 +0100
Subject: add hashsum support in apt-file download and add more tests
---
apt-pkg/contrib/fileutl.cc | 11 +++++++++++
apt-pkg/contrib/fileutl.h | 1 +
cmdline/apt-helper.cc | 11 +++++++++++
test/integration/test-apt-helper | 37 +++++++++++++++++++++++++++++++++++++
4 files changed, 60 insertions(+)
create mode 100755 test/integration/test-apt-helper
(limited to 'cmdline')
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 52411a762..79bcf112c 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -1841,3 +1841,14 @@ std::string GetTempDir()
return string(tmpdir);
}
+
+bool Rename(std::string From, std::string To)
+{
+ if (rename(From.c_str(),To.c_str()) != 0)
+ {
+ _error->Error(_("rename failed, %s (%s -> %s)."),strerror(errno),
+ From.c_str(),To.c_str());
+ return false;
+ }
+ return true;
+}
diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h
index e752e9621..f0569b6fd 100644
--- a/apt-pkg/contrib/fileutl.h
+++ b/apt-pkg/contrib/fileutl.h
@@ -164,6 +164,7 @@ bool RealFileExists(std::string File);
bool DirectoryExists(std::string const &Path) __attrib_const;
bool CreateDirectory(std::string const &Parent, std::string const &Path);
time_t GetModificationTime(std::string const &Path);
+bool Rename(std::string From, std::string To);
std::string GetTempDir();
diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc
index c1c8b2178..4a24b01d9 100644
--- a/cmdline/apt-helper.cc
+++ b/cmdline/apt-helper.cc
@@ -44,6 +44,9 @@ bool DoDownloadFile(CommandLine &CmdL)
Fetcher.Setup(&Stat);
std::string download_uri = CmdL.FileList[1];
std::string targetfile = CmdL.FileList[2];
+ HashString hash;
+ if (CmdL.FileSize() > 3)
+ hash = HashString(CmdL.FileList[3]);
new pkgAcqFile(&Fetcher, download_uri, "", 0, "desc", "short-desc",
"dest-dir-ignored", targetfile);
Fetcher.Run();
@@ -52,6 +55,14 @@ bool DoDownloadFile(CommandLine &CmdL)
_error->Error(_("Download Failed"));
return false;
}
+ if(hash.empty() == false)
+ if(hash.VerifyFile(targetfile) == false)
+ {
+ _error->Error(_("HashSum Failed"));
+ Rename(targetfile, targetfile+".failed");
+ return false;
+ }
+
return true;
}
diff --git a/test/integration/test-apt-helper b/test/integration/test-apt-helper
new file mode 100755
index 000000000..37ed95181
--- /dev/null
+++ b/test/integration/test-apt-helper
@@ -0,0 +1,37 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+changetohttpswebserver
+
+echo "foo" > aptarchive/foo
+
+msgtest 'apt-file download-file md5sum'
+apthelper -qq download-file http://localhost:8080/foo foo2 MD5Sum:d3b07384d113edec49eaa6238ad5ff00 && msgpass || msgfail
+testfileequal foo2 'foo'
+
+msgtest 'apt-file download-file sha1'
+apthelper -qq download-file http://localhost:8080/foo foo1 SHA1:f1d2d2f924e986ac86fdf7b36c94bcdf32beec15 && msgpass || msgfail
+testfileequal foo1 'foo'
+
+msgtest 'apt-file download-file sha256'
+apthelper -qq download-file http://localhost:8080/foo foo3 SHA256:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c && msgpass || msgfail
+testfileequal foo3 'foo'
+
+msgtest 'apt-file download-file no-hash'
+apthelper -qq download-file http://localhost:8080/foo foo4 && msgpass || msgfail
+testfileequal foo4 'foo'
+
+msgtest 'apt-file download-file wrong hash'
+if ! apthelper -qq download-file http://localhost:8080/foo foo5 MD5Sum:aabbcc 2>&1 2> download.stderr; then
+ msgpass
+else
+ msgfail
+fi
+testfileequal download.stderr 'E: HashSum Failed'
+testfileequal foo5.failed 'foo'
--
cgit v1.2.3-70-g09d2
From ce7f128c020e1347f91c6074238fc5da58c5df71 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Tue, 25 Feb 2014 14:26:18 +0100
Subject: support DEB_BUILD_PROFILES and -P for build profiles
Inspired by the rest of the patch in 661537, but abstract the
parsing of various ways of setting the build profiles more so it can
potentially be reused and all apt parts have the same behaviour.
Especially config options, cmdline options and environment will not be
combined as proposed as this isn't APTs usual behaviour and dpkg doesn't
do it either, so one overrides the other as it normally does.
---
apt-pkg/aptconfiguration.cc | 26 +++-
apt-pkg/aptconfiguration.h | 5 +
apt-pkg/deb/deblistparser.cc | 2 +-
apt-private/private-cmndline.cc | 2 +
cmdline/apt-config.cc | 5 +
cmdline/apt-get.cc | 6 +
debian/control | 2 +-
doc/apt-get.8.xml | 13 +-
doc/apt.conf.5.xml | 9 ++
test/integration/framework | 6 +
.../test-bug-661537-build-profiles-support | 147 +++++++++++++++++++++
11 files changed, 219 insertions(+), 4 deletions(-)
create mode 100755 test/integration/test-bug-661537-build-profiles-support
(limited to 'cmdline')
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc
index f5c758e14..3948854c6 100644
--- a/apt-pkg/aptconfiguration.cc
+++ b/apt-pkg/aptconfiguration.cc
@@ -426,7 +426,7 @@ void Configuration::setDefaultConfigurationForCompressors() {
}
}
/*}}}*/
-// getCompressors - Return Vector of usbale compressors /*{{{*/
+// getCompressors - Return Vector of usealbe compressors /*{{{*/
// ---------------------------------------------------------------------
/* return a vector of compressors used by apt-ftparchive in the
multicompress functionality or to detect data.tar files */
@@ -508,4 +508,28 @@ Configuration::Compressor::Compressor(char const *name, char const *extension,
UncompressArgs.push_back(uncompressArg);
}
/*}}}*/
+// getBuildProfiles - return a vector of enabled build profiles /*{{{*/
+std::vector const Configuration::getBuildProfiles() {
+ // order is: override value (~= commandline), environment variable, list (~= config file)
+ std::string profiles_env = getenv("DEB_BUILD_PROFILES") == 0 ? "" : getenv("DEB_BUILD_PROFILES");
+ if (profiles_env.empty() == false) {
+ profiles_env = SubstVar(profiles_env, " ", ",");
+ std::string const bp = _config->Find("APT::Build-Profiles");
+ _config->Clear("APT::Build-Profiles");
+ if (bp.empty() == false)
+ _config->Set("APT::Build-Profiles", bp);
+ }
+ return _config->FindVector("APT::Build-Profiles", profiles_env);
+}
+std::string const Configuration::getBuildProfilesString() {
+ std::vector profiles = getBuildProfiles();
+ if (profiles.empty() == true)
+ return "";
+ std::vector::const_iterator p = profiles.begin();
+ std::string list = *p;
+ for (; p != profiles.end(); ++p)
+ list.append(",").append(*p);
+ return list;
+}
+ /*}}}*/
}
diff --git a/apt-pkg/aptconfiguration.h b/apt-pkg/aptconfiguration.h
index bf7deae85..026493c6d 100644
--- a/apt-pkg/aptconfiguration.h
+++ b/apt-pkg/aptconfiguration.h
@@ -117,6 +117,11 @@ public: /*{{{*/
/** \brief Return a vector of extensions supported for data.tar's */
std::vector static const getCompressorExtensions();
+
+ /** \return Return a vector of enabled build profile specifications */
+ std::vector static const getBuildProfiles();
+ /** \return Return a comma-separated list of enabled build profile specifications */
+ std::string static const getBuildProfilesString();
/*}}}*/
private: /*{{{*/
void static setDefaultConfigurationForCompressors();
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index a4795f15d..89f3514c9 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -625,7 +625,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
if (unlikely(I == Stop))
return 0;
- std::vector const profiles = _config->FindVector("APT::Build-Profiles");
+ std::vector const profiles = APT::Configuration::getBuildProfiles();
const char *End = I;
bool Found = false;
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc
index ef7d65f3c..b99443210 100644
--- a/apt-private/private-cmndline.cc
+++ b/apt-private/private-cmndline.cc
@@ -141,6 +141,7 @@ bool addArgumentsAPTGet(std::vector &Args, char const * const
{
addArg('b', "compile", "APT::Get::Compile", 0);
addArg('b', "build", "APT::Get::Compile", 0);
+ addArg('P', "build-profiles", "APT::Build-Profiles", CommandLine::HasArg);
addArg(0, "diff-only", "APT::Get::Diff-Only", 0);
addArg(0, "debian-only", "APT::Get::Diff-Only", 0);
addArg(0, "tar-only", "APT::Get::Tar-Only", 0);
@@ -149,6 +150,7 @@ bool addArgumentsAPTGet(std::vector &Args, char const * const
else if (CmdMatches("build-dep"))
{
addArg('a', "host-architecture", "APT::Get::Host-Architecture", CommandLine::HasArg);
+ addArg('P', "build-profiles", "APT::Build-Profiles", CommandLine::HasArg);
addArg(0, "purge", "APT::Get::Purge", 0);
addArg(0, "solver", "APT::Solver", CommandLine::HasArg);
// this has no effect *but* sbuild is using it (see LP: #1255806)
diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc
index 30c2a22d5..9f20b3c1b 100644
--- a/cmdline/apt-config.cc
+++ b/cmdline/apt-config.cc
@@ -155,6 +155,11 @@ int main(int argc,const char *argv[]) /*{{{*/
_config->Set(comp + "UncompressArg::", *a);
}
+ std::vector const profiles = APT::Configuration::getBuildProfiles();
+ _config->Clear("APT::Build-Profiles");
+ for (std::vector::const_iterator p = profiles.begin(); p != profiles.end(); ++p)
+ _config->Set("APT::Build-Profiles::", *p);
+
// Match the operation
CmdL.DispatchArg(Cmds);
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 12e385b69..f8de80a91 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -970,6 +970,12 @@ bool DoSource(CommandLine &CmdL)
string buildopts = _config->Find("APT::Get::Host-Architecture");
if (buildopts.empty() == false)
buildopts = "-a" + buildopts + " ";
+
+ // get all active build profiles
+ std::string const profiles = APT::Configuration::getBuildProfilesString();
+ if (profiles.empty() == false)
+ buildopts.append(" -P").append(profiles).append(" ");
+
buildopts.append(_config->Find("DPkg::Build-Options","-b -uc"));
// Call dpkg-buildpackage
diff --git a/debian/control b/debian/control
index 2d58d0711..5ce68414e 100644
--- a/debian/control
+++ b/debian/control
@@ -21,7 +21,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${apt:keyring}, gnupg
Replaces: manpages-pl (<< 20060617-3~), manpages-it (<< 2.80-4~)
Breaks: manpages-pl (<< 20060617-3~), manpages-it (<< 2.80-4~)
Conflicts: python-apt (<< 0.7.93.2~)
-Suggests: aptitude | synaptic | wajig, dpkg-dev, apt-doc, python-apt
+Suggests: aptitude | synaptic | wajig, dpkg-dev (>= 1.17.2), apt-doc, python-apt
Description: commandline package manager
This package provides commandline tools for searching and
managing as well as querying information about packages
diff --git a/doc/apt-get.8.xml b/doc/apt-get.8.xml
index 595ea875d..1ed08904e 100644
--- a/doc/apt-get.8.xml
+++ b/doc/apt-get.8.xml
@@ -371,7 +371,18 @@
by apt-get source --compile and how cross-builddependencies
are satisfied. By default is it not set which means that the host architecture
is the same as the build architecture (which is defined by APT::Architecture).
- Configuration Item: APT::Get::Host-Architecture
+ Configuration Item: APT::Get::Host-Architecture.
+
+
+
+
+
+ This option controls the activated build profiles for which
+ a source package is built by apt-get source --compile and
+ how build dependencies are satisfied. By default no build profile is active.
+ More than one build profile can be activated at a time by concatenating them
+ with a comma.
+ Configuration Item: APT::Build-Profiles.
diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml
index bfc43ba29..78f6a27a2 100644
--- a/doc/apt.conf.5.xml
+++ b/doc/apt.conf.5.xml
@@ -177,6 +177,15 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
+
+
+ List of all build profiles enabled for build-dependency resolution,
+ without the "profile." namespace prefix.
+ By default this list is empty. The DEB_BUILD_PROFILES
+ as used by &dpkg-buildpackage; overrides the list notation.
+
+
+
Default release to install packages from if more than one
version is available. Contains release name, codename or release version. Examples: 'stable', 'testing',
diff --git a/test/integration/framework b/test/integration/framework
index 911a4d742..9c4ac87d3 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -120,6 +120,9 @@ aptwebserver() {
dpkg() {
command dpkg --root=${TMPWORKINGDIRECTORY}/rootdir --force-not-root --force-bad-path --log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log "$@"
}
+dpkgcheckbuilddeps() {
+ command dpkg-checkbuilddeps --admindir=${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg "$@"
+}
aptitude() {
if [ -f ./aptconfig.conf ]; then
APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} command aptitude "$@"
@@ -240,6 +243,9 @@ setupenvironment() {
# newer gpg versions are fine without it, but play it safe for now
gpg --quiet --check-trustdb --secret-keyring $SECRETKEYRING --keyring $SECRETKEYRING >/dev/null 2>&1
+ # cleanup the environment a bit
+ unset GREP_OPTIONS DEB_BUILD_PROFILES
+
msgdone "info"
}
diff --git a/test/integration/test-bug-661537-build-profiles-support b/test/integration/test-bug-661537-build-profiles-support
new file mode 100755
index 000000000..ae1403f71
--- /dev/null
+++ b/test/integration/test-bug-661537-build-profiles-support
@@ -0,0 +1,147 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386' 'armel'
+
+insertinstalledpackage 'build-essential' 'all' '0' 'Multi-Arch: foreign'
+
+insertpackage 'unstable' 'foo' 'all' '1.0'
+insertpackage 'unstable' 'bar' 'all' '1.0'
+
+insertsource 'unstable' 'buildprofiles' 'any' '1' 'Build-Depends: foo (>= 1.0) [i386 arm] , bar'
+
+# table from https://wiki.debian.org/BuildProfileSpec
+insertsource 'unstable' 'spec-1' 'any' '1' 'Build-Depends: foo '
+insertsource 'unstable' 'spec-2' 'any' '1' 'Build-Depends: foo '
+insertsource 'unstable' 'spec-3' 'any' '1' 'Build-Depends: foo '
+insertsource 'unstable' 'spec-4' 'any' '1' 'Build-Depends: foo '
+insertsource 'unstable' 'spec-5' 'any' '1' 'Build-Depends: foo '
+insertsource 'unstable' 'spec-6' 'any' '1' 'Build-Depends: foo '
+# multiple stanzas not supported: error out
+insertsource 'unstable' 'spec-7' 'any' '1' 'Build-Depends: foo '
+insertsource 'unstable' 'spec-8' 'any' '1' 'Build-Depends: foo '
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ bar
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst bar (1.0 unstable [all])
+Conf bar (1.0 unstable [all])' aptget build-dep buildprofiles -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ bar foo
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst bar (1.0 unstable [all])
+Inst foo (1.0 unstable [all])
+Conf bar (1.0 unstable [all])
+Conf foo (1.0 unstable [all])' aptget build-dep buildprofiles -s -o APT::Architecture=i386
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ bar
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst bar (1.0 unstable [all])
+Conf bar (1.0 unstable [all])' aptget build-dep buildprofiles -s -o APT::Architecture=armel
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ bar
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst bar (1.0 unstable [all])
+Conf bar (1.0 unstable [all])' aptget build-dep buildprofiles -s -o APT::Architecture=i386 -P stage1
+
+KEEP='Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ foo
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst foo (1.0 unstable [all])
+Conf foo (1.0 unstable [all])'
+DROP='Reading package lists...
+Building dependency tree...
+0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.'
+
+msgtest 'Check if version of installed dpkg is high enough for' 'build profiles support'
+if dpkg --compare-versions "$(command dpkg-query --showformat='${Version}' --show dpkg)" 'ge' '1.17.2'; then
+ msgpass
+ testwithdpkg() {
+ msgtest "Test with" "dpkg-checkbuilddeps -d '$1' -P '$2'"
+ local OUTPUT="${TMPWORKINGDIRECTORY}/rootdir/tmp/testwithdpkg.output"
+ if dpkgcheckbuilddeps -d "$1" -P "$2" /dev/null >$OUTPUT 2>&1; then
+ if [ "$3" = "$DROP" ]; then
+ msgpass
+ else
+ cat $OUTPUT
+ msgfail
+ fi
+ else
+ if [ "$3" = "$KEEP" ]; then
+ msgpass
+ else
+ cat $OUTPUT
+ msgfail
+ fi
+ fi
+ }
+else
+ msgskip
+ testwithdpkg() {
+ msgtest "Test with" "dpkg-checkbuilddeps -d '$1' -P '$2'"
+ msgskip
+ }
+fi
+
+testprofile() {
+ if [ -n "$3" ]; then
+ testequal "$4" aptget build-dep "$1" -s -P "$3"
+ export DEB_BUILD_PROFILES="$(echo "$3" | tr ',' ' ')"
+ testequal "$4" aptget build-dep "$1" -s -o with::environment=1
+ unset DEB_BUILD_PROFILES
+ else
+ testequal "$4" aptget build-dep "$1" -s
+ fi
+ testwithdpkg "$2" "$3" "$4"
+}
+
+testprofile 'spec-1' 'foo ' '' "$KEEP"
+testprofile 'spec-1' 'foo ' 'stage1' "$DROP"
+testprofile 'spec-1' 'foo ' 'notest' "$KEEP"
+testprofile 'spec-1' 'foo ' 'stage1,notest' "$DROP"
+
+testprofile 'spec-2' 'foo ' '' "$DROP"
+testprofile 'spec-2' 'foo ' 'stage1' "$KEEP"
+testprofile 'spec-2' 'foo ' 'notest' "$DROP"
+testprofile 'spec-2' 'foo ' 'stage1,notest' "$KEEP"
+
+testprofile 'spec-3' 'foo ' '' "$KEEP"
+testprofile 'spec-3' 'foo ' 'stage1' "$DROP"
+testprofile 'spec-3' 'foo ' 'notest' "$DROP"
+testprofile 'spec-3' 'foo ' 'stage1,notest' "$DROP"
+
+testprofile 'spec-4' 'foo ' '' "$DROP"
+testprofile 'spec-4' 'foo ' 'stage1' "$KEEP"
+testprofile 'spec-4' 'foo ' 'notest' "$KEEP"
+testprofile 'spec-4' 'foo ' 'stage1,notest' "$KEEP"
+
+testprofile 'spec-5' 'foo ' '' "$KEEP"
+testprofile 'spec-5' 'foo ' 'stage1' "$DROP"
+testprofile 'spec-5' 'foo ' 'notest' "$KEEP"
+testprofile 'spec-5' 'foo ' 'stage1,notest' "$DROP"
+
+testprofile 'spec-6' 'foo ' '' "$KEEP"
+testprofile 'spec-6' 'foo ' 'stage1' "$KEEP"
+testprofile 'spec-6' 'foo ' 'notest' "$DROP"
+testprofile 'spec-6' 'foo ' 'stage1,notest' "$KEEP"
+
+testfailure aptget build-dep spec-7 -s
+testfailure aptget build-dep spec-8 -s
--
cgit v1.2.3-70-g09d2
From 67c3067f1a615fd6ff0b332c2a526d052442913d Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Tue, 25 Feb 2014 22:22:41 +0100
Subject: fix -Wmissing-field-initializers warnings
Reported-By: gcc
Git-Dch: Ignore
---
apt-pkg/deb/deblistparser.cc | 8 ++++----
apt-pkg/indexcopy.cc | 8 ++++----
apt-private/private-show.cc | 26 +++++++++++++-------------
cmdline/apt-cache.cc | 2 +-
ftparchive/apt-ftparchive.cc | 2 +-
methods/ftp.cc | 4 ++--
6 files changed, 25 insertions(+), 25 deletions(-)
(limited to 'cmdline')
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 89f3514c9..3374865ac 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -34,7 +34,7 @@ static debListParser::WordList PrioList[] = {
{"standard",pkgCache::State::Standard},
{"optional",pkgCache::State::Optional},
{"extra",pkgCache::State::Extra},
- {}};
+ {NULL, 0}};
// ListParser::debListParser - Constructor /*{{{*/
// ---------------------------------------------------------------------
@@ -354,7 +354,7 @@ bool debListParser::ParseStatus(pkgCache::PkgIterator &Pkg,
{"hold",pkgCache::State::Hold},
{"deinstall",pkgCache::State::DeInstall},
{"purge",pkgCache::State::Purge},
- {}};
+ {NULL, 0}};
if (GrabWord(string(Start,I-Start),WantList,Pkg->SelectedState) == false)
return _error->Error("Malformed 1st word in the Status line");
@@ -370,7 +370,7 @@ bool debListParser::ParseStatus(pkgCache::PkgIterator &Pkg,
{"reinstreq",pkgCache::State::ReInstReq},
{"hold",pkgCache::State::HoldInst},
{"hold-reinstreq",pkgCache::State::HoldReInstReq},
- {}};
+ {NULL, 0}};
if (GrabWord(string(Start,I-Start),FlagList,Pkg->InstState) == false)
return _error->Error("Malformed 2nd word in the Status line");
@@ -392,7 +392,7 @@ bool debListParser::ParseStatus(pkgCache::PkgIterator &Pkg,
{"triggers-pending",pkgCache::State::TriggersPending},
{"post-inst-failed",pkgCache::State::HalfConfigured},
{"removal-failed",pkgCache::State::HalfInstalled},
- {}};
+ {NULL, 0}};
if (GrabWord(string(Start,I-Start),StatusList,Pkg->CurrentState) == false)
return _error->Error("Malformed 3rd word in the Status line");
diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc
index 7694cb1dd..9ea244139 100644
--- a/apt-pkg/indexcopy.cc
+++ b/apt-pkg/indexcopy.cc
@@ -436,8 +436,8 @@ bool PackageCopy::GetFile(string &File,unsigned long long &Size)
/* */
bool PackageCopy::RewriteEntry(FILE *Target,string File)
{
- TFRewriteData Changes[] = {{"Filename",File.c_str()},
- {}};
+ TFRewriteData Changes[] = {{ "Filename", File.c_str(), NULL },
+ { NULL, NULL, NULL }};
if (TFRewrite(Target,*Section,TFRewritePackageOrder,Changes) == false)
return false;
@@ -482,8 +482,8 @@ bool SourceCopy::GetFile(string &File,unsigned long long &Size)
bool SourceCopy::RewriteEntry(FILE *Target,string File)
{
string Dir(File,0,File.rfind('/'));
- TFRewriteData Changes[] = {{"Directory",Dir.c_str()},
- {}};
+ TFRewriteData Changes[] = {{ "Directory", Dir.c_str(), NULL },
+ { NULL, NULL, NULL }};
if (TFRewrite(Target,*Section,TFRewriteSourceOrder,Changes) == false)
return false;
diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc
index 60d951316..9e4bbd35e 100644
--- a/apt-private/private-show.cc
+++ b/apt-private/private-show.cc
@@ -96,23 +96,23 @@ bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V,
// FIXME: add verbose that does not do the removal of the tags?
TFRewriteData RW[] = {
// delete, apt-cache show has this info and most users do not care
- {"MD5sum", 0},
- {"SHA1", 0},
- {"SHA256", 0},
- {"Filename", 0},
- {"Multi-Arch", 0},
- {"Architecture", 0},
- {"Conffiles",0},
+ {"MD5sum", NULL, NULL},
+ {"SHA1", NULL, NULL},
+ {"SHA256", NULL, NULL},
+ {"Filename", NULL, NULL},
+ {"Multi-Arch", NULL, NULL},
+ {"Architecture", NULL, NULL},
+ {"Conffiles", NULL, NULL},
// we use the translated description
- {"Description",0},
- {"Description-md5",0},
+ {"Description", NULL, NULL},
+ {"Description-md5", NULL, NULL},
// improve
- {"Installed-Size", installed_size.c_str(), 0},
+ {"Installed-Size", installed_size.c_str(), NULL},
{"Size", package_size.c_str(), "Download-Size"},
// add
- {"APT-Manual-Installed", manual_installed, 0},
- {"APT-Sources", source_index_file.c_str(), 0},
- {}
+ {"APT-Manual-Installed", manual_installed, NULL},
+ {"APT-Sources", source_index_file.c_str(), NULL},
+ {NULL, NULL, NULL}
};
if(TFRewrite(stdout, Tags, NULL, RW) == false)
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index b8892d23d..22778eb24 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -532,7 +532,7 @@ bool DumpAvail(CommandLine &Cmd)
if ((File->Flags & pkgCache::Flag::NotSource) == pkgCache::Flag::NotSource)
{
pkgTagSection Tags;
- TFRewriteData RW[] = {{"Status",0},{"Config-Version",0},{}};
+ TFRewriteData RW[] = {{"Status", NULL, NULL},{"Config-Version", NULL, NULL},{NULL, NULL, NULL}};
const char *Zero = 0;
if (Tags.Scan(Buffer+Jitter,VF.Size+1) == false ||
TFRewrite(stdout,Tags,&Zero,RW) == false)
diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc
index 712f8469a..d14b68044 100644
--- a/ftparchive/apt-ftparchive.cc
+++ b/ftparchive/apt-ftparchive.cc
@@ -484,7 +484,7 @@ void LoadTree(vector &PkgList,Configuration &Setup)
struct SubstVar const Vars[] = {{"$(DIST)",&Dist},
{"$(SECTION)",&Section},
{"$(ARCH)",&Arch},
- {}};
+ {NULL, NULL}};
mode_t const Perms = Block.FindI("FileMode", Permissions);
bool const LongDesc = Block.FindB("LongDescription", LongDescription);
TranslationWriter *TransWriter;
diff --git a/methods/ftp.cc b/methods/ftp.cc
index 621f48476..5a87ded1c 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -56,9 +56,9 @@ struct AFMap
};
#ifndef AF_INET6
-struct AFMap AFMap[] = {{AF_INET,1},{}};
+struct AFMap AFMap[] = {{AF_INET,1},{0, 0}};
#else
-struct AFMap AFMap[] = {{AF_INET,1},{AF_INET6,2},{}};
+struct AFMap AFMap[] = {{AF_INET,1},{AF_INET6,2},{0, 0}};
#endif
unsigned long TimeOut = 120;
--
cgit v1.2.3-70-g09d2
From d3e8fbb395f57954acd7a2095f02ce530a05ec6a Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Thu, 27 Feb 2014 01:20:53 +0100
Subject: warning: extra ‘;’ [-Wpedantic]
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-Dch: Ignore
Reported-By: gcc -Wpedantic
---
apt-inst/filelist.h | 152 +++++++++++++-------------
apt-pkg/acquire.cc | 2 +-
apt-pkg/cacheiterators.h | 226 +++++++++++++++++++--------------------
apt-pkg/cacheset.h | 176 +++++++++++++++---------------
apt-pkg/cdrom.cc | 6 +-
apt-pkg/contrib/configuration.cc | 3 +-
apt-pkg/contrib/error.cc | 2 +-
apt-pkg/contrib/gpgv.h | 2 +-
apt-pkg/contrib/progress.cc | 12 +--
apt-pkg/contrib/strutl.cc | 2 +-
apt-pkg/contrib/strutl.h | 38 +++----
apt-pkg/depcache.cc | 4 +-
apt-pkg/indexcopy.cc | 4 +-
apt-pkg/install-progress.cc | 4 +-
apt-pkg/install-progress.h | 32 +++---
apt-pkg/pkgcache.cc | 20 ++--
apt-pkg/pkgcache.h | 42 ++++----
apt-pkg/upgrade.h | 2 +-
apt-private/acqprogress.cc | 62 +++++------
cmdline/apt-cdrom.cc | 26 ++---
ftparchive/override.cc | 8 +-
methods/cdrom.cc | 2 +-
methods/http.cc | 6 +-
methods/https.cc | 2 +-
methods/mirror.cc | 28 ++---
methods/rsh.cc | 2 +-
methods/server.cc | 20 ++--
methods/server.h | 2 +-
28 files changed, 443 insertions(+), 444 deletions(-)
(limited to 'cmdline')
diff --git a/apt-inst/filelist.h b/apt-inst/filelist.h
index 0405d61df..8c4891bcf 100644
--- a/apt-inst/filelist.h
+++ b/apt-inst/filelist.h
@@ -42,25 +42,25 @@ class pkgFLCache
struct Package;
struct Diversion;
struct ConfFile;
-
+
class NodeIterator;
class DirIterator;
class PkgIterator;
class DiverIterator;
-
+
protected:
std::string CacheFile;
DynamicMMap ⤅
map_ptrloc LastTreeLookup;
unsigned long LastLookupSize;
-
+
// Helpers for the addition algorithms
map_ptrloc TreeLookup(map_ptrloc *Base,const char *Text,const char *TextEnd,
unsigned long Size,unsigned int *Count = 0,
bool Insert = false);
-
+
public:
-
+
// Pointers to the arrays of items
Header *HeaderP;
Node *NodeP;
@@ -70,10 +70,10 @@ class pkgFLCache
ConfFile *ConfP;
char *StrP;
unsigned char *AnyP;
-
+
// Quick accessors
Node *FileHash;
-
+
// Accessors
Header &Head() {return *HeaderP;};
void PrintTree(map_ptrloc Base,unsigned long Size);
@@ -89,7 +89,7 @@ class pkgFLCache
void DropNode(map_ptrloc Node);
inline DiverIterator DiverBegin();
-
+
// Diversion control
void BeginDiverLoad();
void FinishDiverLoad();
@@ -97,7 +97,7 @@ class pkgFLCache
const char *To);
bool AddConfFile(const char *Name,const char *NameEnd,
PkgIterator const &Owner,const unsigned char *Sum);
-
+
pkgFLCache(DynamicMMap &Map);
// ~pkgFLCache();
};
@@ -109,7 +109,7 @@ struct pkgFLCache::Header
short MajorVersion;
short MinorVersion;
bool Dirty;
-
+
// Size of structure values
unsigned HeaderSz;
unsigned NodeSz;
@@ -117,7 +117,7 @@ struct pkgFLCache::Header
unsigned PackageSz;
unsigned DiversionSz;
unsigned ConfFileSz;
-
+
// Structure Counts;
unsigned int NodeCount;
unsigned int DirCount;
@@ -126,13 +126,13 @@ struct pkgFLCache::Header
unsigned int ConfFileCount;
unsigned int HashSize;
unsigned long UniqNodes;
-
+
// Offsets
map_ptrloc FileHash;
map_ptrloc DirTree;
map_ptrloc Packages;
map_ptrloc Diversions;
-
+
/* Allocation pools, there should be one of these for each structure
excluding the header */
DynamicMMap::Pool Pools[5];
@@ -177,7 +177,7 @@ struct pkgFLCache::Diversion
map_ptrloc OwnerPkg; // Package
map_ptrloc DivertFrom; // Node
map_ptrloc DivertTo; // String
-
+
map_ptrloc Next; // Diversion
unsigned long Flags;
@@ -194,120 +194,120 @@ class pkgFLCache::PkgIterator
{
Package *Pkg;
pkgFLCache *Owner;
-
+
public:
-
+
inline bool end() const {return Owner == 0 || Pkg == Owner->PkgP?true:false;}
-
+
// Accessors
- inline Package *operator ->() {return Pkg;};
- inline Package const *operator ->() const {return Pkg;};
- inline Package const &operator *() const {return *Pkg;};
- inline operator Package *() {return Pkg == Owner->PkgP?0:Pkg;};
- inline operator Package const *() const {return Pkg == Owner->PkgP?0:Pkg;};
-
- inline unsigned long Offset() const {return Pkg - Owner->PkgP;};
- inline const char *Name() const {return Pkg->Name == 0?0:Owner->StrP + Pkg->Name;};
+ inline Package *operator ->() {return Pkg;}
+ inline Package const *operator ->() const {return Pkg;}
+ inline Package const &operator *() const {return *Pkg;}
+ inline operator Package *() {return Pkg == Owner->PkgP?0:Pkg;}
+ inline operator Package const *() const {return Pkg == Owner->PkgP?0:Pkg;}
+
+ inline unsigned long Offset() const {return Pkg - Owner->PkgP;}
+ inline const char *Name() const {return Pkg->Name == 0?0:Owner->StrP + Pkg->Name;}
inline pkgFLCache::NodeIterator Files() const;
- PkgIterator() : Pkg(0), Owner(0) {};
- PkgIterator(pkgFLCache &Owner,Package *Trg) : Pkg(Trg), Owner(&Owner) {};
+ PkgIterator() : Pkg(0), Owner(0) {}
+ PkgIterator(pkgFLCache &Owner,Package *Trg) : Pkg(Trg), Owner(&Owner) {}
};
class pkgFLCache::DirIterator
{
Directory *Dir;
pkgFLCache *Owner;
-
+
public:
-
+
// Accessors
- inline Directory *operator ->() {return Dir;};
- inline Directory const *operator ->() const {return Dir;};
- inline Directory const &operator *() const {return *Dir;};
- inline operator Directory *() {return Dir == Owner->DirP?0:Dir;};
- inline operator Directory const *() const {return Dir == Owner->DirP?0:Dir;};
+ inline Directory *operator ->() {return Dir;}
+ inline Directory const *operator ->() const {return Dir;}
+ inline Directory const &operator *() const {return *Dir;}
+ inline operator Directory *() {return Dir == Owner->DirP?0:Dir;}
+ inline operator Directory const *() const {return Dir == Owner->DirP?0:Dir;}
- inline const char *Name() const {return Dir->Name == 0?0:Owner->StrP + Dir->Name;};
+ inline const char *Name() const {return Dir->Name == 0?0:Owner->StrP + Dir->Name;}
- DirIterator() : Dir(0), Owner(0) {};
- DirIterator(pkgFLCache &Owner,Directory *Trg) : Dir(Trg), Owner(&Owner) {};
+ DirIterator() : Dir(0), Owner(0) {}
+ DirIterator(pkgFLCache &Owner,Directory *Trg) : Dir(Trg), Owner(&Owner) {}
};
class pkgFLCache::DiverIterator
{
Diversion *Diver;
pkgFLCache *Owner;
-
+
public:
// Iteration
- void operator ++(int) {if (Diver != Owner->DiverP) Diver = Owner->DiverP + Diver->Next;};
- inline void operator ++() {operator ++(0);};
- inline bool end() const {return Owner == 0 || Diver == Owner->DiverP;};
+ void operator ++(int) {if (Diver != Owner->DiverP) Diver = Owner->DiverP + Diver->Next;}
+ inline void operator ++() {operator ++(0);}
+ inline bool end() const {return Owner == 0 || Diver == Owner->DiverP;}
// Accessors
- inline Diversion *operator ->() {return Diver;};
- inline Diversion const *operator ->() const {return Diver;};
- inline Diversion const &operator *() const {return *Diver;};
- inline operator Diversion *() {return Diver == Owner->DiverP?0:Diver;};
- inline operator Diversion const *() const {return Diver == Owner->DiverP?0:Diver;};
+ inline Diversion *operator ->() {return Diver;}
+ inline Diversion const *operator ->() const {return Diver;}
+ inline Diversion const &operator *() const {return *Diver;}
+ inline operator Diversion *() {return Diver == Owner->DiverP?0:Diver;}
+ inline operator Diversion const *() const {return Diver == Owner->DiverP?0:Diver;}
- inline PkgIterator OwnerPkg() const {return PkgIterator(*Owner,Owner->PkgP + Diver->OwnerPkg);};
+ inline PkgIterator OwnerPkg() const {return PkgIterator(*Owner,Owner->PkgP + Diver->OwnerPkg);}
inline NodeIterator DivertFrom() const;
inline NodeIterator DivertTo() const;
DiverIterator() : Diver(0), Owner(0) {};
- DiverIterator(pkgFLCache &Owner,Diversion *Trg) : Diver(Trg), Owner(&Owner) {};
+ DiverIterator(pkgFLCache &Owner,Diversion *Trg) : Diver(Trg), Owner(&Owner) {}
};
class pkgFLCache::NodeIterator
{
Node *Nde;
- enum {NdePkg, NdeHash} Type;
+ enum {NdePkg, NdeHash} Type;
pkgFLCache *Owner;
-
+
public:
-
+
// Iteration
- void operator ++(int) {if (Nde != Owner->NodeP) Nde = Owner->NodeP +
- (Type == NdePkg?Nde->NextPkg:Nde->Next);};
- inline void operator ++() {operator ++(0);};
- inline bool end() const {return Owner == 0 || Nde == Owner->NodeP;};
+ void operator ++(int) {if (Nde != Owner->NodeP) Nde = Owner->NodeP +
+ (Type == NdePkg?Nde->NextPkg:Nde->Next);}
+ inline void operator ++() {operator ++(0);}
+ inline bool end() const {return Owner == 0 || Nde == Owner->NodeP;}
// Accessors
- inline Node *operator ->() {return Nde;};
- inline Node const *operator ->() const {return Nde;};
- inline Node const &operator *() const {return *Nde;};
- inline operator Node *() {return Nde == Owner->NodeP?0:Nde;};
- inline operator Node const *() const {return Nde == Owner->NodeP?0:Nde;};
- inline unsigned long Offset() const {return Nde - Owner->NodeP;};
- inline DirIterator Dir() const {return DirIterator(*Owner,Owner->DirP + Nde->Dir);};
- inline DiverIterator Diversion() const {return DiverIterator(*Owner,Owner->DiverP + Nde->Pointer);};
- inline const char *File() const {return Nde->File == 0?0:Owner->StrP + Nde->File;};
- inline const char *DirN() const {return Owner->StrP + Owner->DirP[Nde->Dir].Name;};
+ inline Node *operator ->() {return Nde;}
+ inline Node const *operator ->() const {return Nde;}
+ inline Node const &operator *() const {return *Nde;}
+ inline operator Node *() {return Nde == Owner->NodeP?0:Nde;}
+ inline operator Node const *() const {return Nde == Owner->NodeP?0:Nde;}
+ inline unsigned long Offset() const {return Nde - Owner->NodeP;}
+ inline DirIterator Dir() const {return DirIterator(*Owner,Owner->DirP + Nde->Dir);}
+ inline DiverIterator Diversion() const {return DiverIterator(*Owner,Owner->DiverP + Nde->Pointer);}
+ inline const char *File() const {return Nde->File == 0?0:Owner->StrP + Nde->File;}
+ inline const char *DirN() const {return Owner->StrP + Owner->DirP[Nde->Dir].Name;}
Package *RealPackage() const;
-
+
NodeIterator() : Nde(0), Type(NdeHash), Owner(0) {};
- NodeIterator(pkgFLCache &Owner) : Nde(Owner.NodeP), Type(NdeHash), Owner(&Owner) {};
- NodeIterator(pkgFLCache &Owner,Node *Trg) : Nde(Trg), Type(NdeHash), Owner(&Owner) {};
- NodeIterator(pkgFLCache &Owner,Node *Trg,Package *) : Nde(Trg), Type(NdePkg), Owner(&Owner) {};
+ NodeIterator(pkgFLCache &Owner) : Nde(Owner.NodeP), Type(NdeHash), Owner(&Owner) {}
+ NodeIterator(pkgFLCache &Owner,Node *Trg) : Nde(Trg), Type(NdeHash), Owner(&Owner) {}
+ NodeIterator(pkgFLCache &Owner,Node *Trg,Package *) : Nde(Trg), Type(NdePkg), Owner(&Owner) {}
};
/* Inlines with forward references that cannot be included directly in their
respsective classes */
-inline pkgFLCache::NodeIterator pkgFLCache::DiverIterator::DivertFrom() const
- {return NodeIterator(*Owner,Owner->NodeP + Diver->DivertFrom);};
+inline pkgFLCache::NodeIterator pkgFLCache::DiverIterator::DivertFrom() const
+ {return NodeIterator(*Owner,Owner->NodeP + Diver->DivertFrom);}
inline pkgFLCache::NodeIterator pkgFLCache::DiverIterator::DivertTo() const
- {return NodeIterator(*Owner,Owner->NodeP + Diver->DivertTo);};
+ {return NodeIterator(*Owner,Owner->NodeP + Diver->DivertTo);}
inline pkgFLCache::NodeIterator pkgFLCache::PkgIterator::Files() const
- {return NodeIterator(*Owner,Owner->NodeP + Pkg->Files,Pkg);};
+ {return NodeIterator(*Owner,Owner->NodeP + Pkg->Files,Pkg);}
inline pkgFLCache::DiverIterator pkgFLCache::DiverBegin()
- {return DiverIterator(*this,DiverP + HeaderP->Diversions);};
+ {return DiverIterator(*this,DiverP + HeaderP->Diversions);}
-inline pkgFLCache::PkgIterator pkgFLCache::GetPkg(const char *Name,bool Insert)
- {return GetPkg(Name,Name+strlen(Name),Insert);};
+inline pkgFLCache::PkgIterator pkgFLCache::GetPkg(const char *Name,bool Insert)
+ {return GetPkg(Name,Name+strlen(Name),Insert);}
#endif
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 120e809e1..e8fa68338 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -468,7 +468,7 @@ void pkgAcquire::Bump()
pkgAcquire::Worker *pkgAcquire::WorkerStep(Worker *I)
{
return I->NextAcquire;
-};
+}
/*}}}*/
// Acquire::Clean - Cleans a directory /*{{{*/
// ---------------------------------------------------------------------
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index ea6a4afba..ca8bc5ca0 100644
--- a/apt-pkg/cacheiterators.h
+++ b/apt-pkg/cacheiterators.h
@@ -55,26 +55,26 @@ template class pkgCache::Iterator :
public:
// Iteration
virtual void operator ++(int) = 0;
- virtual void operator ++() = 0; // Should be {operator ++(0);};
- inline bool end() const {return Owner == 0 || S == OwnerPointer();};
+ virtual void operator ++() = 0; // Should be {operator ++(0);}
+ inline bool end() const {return Owner == 0 || S == OwnerPointer();}
// Comparison
- inline bool operator ==(const Itr &B) const {return S == B.S;};
- inline bool operator !=(const Itr &B) const {return S != B.S;};
+ inline bool operator ==(const Itr &B) const {return S == B.S;}
+ inline bool operator !=(const Itr &B) const {return S != B.S;}
// Accessors
- inline Str *operator ->() {return S;};
- inline Str const *operator ->() const {return S;};
- inline operator Str *() {return S == OwnerPointer() ? 0 : S;};
- inline operator Str const *() const {return S == OwnerPointer() ? 0 : S;};
- inline Str &operator *() {return *S;};
- inline Str const &operator *() const {return *S;};
- inline pkgCache *Cache() const {return Owner;};
+ inline Str *operator ->() {return S;}
+ inline Str const *operator ->() const {return S;}
+ inline operator Str *() {return S == OwnerPointer() ? 0 : S;}
+ inline operator Str const *() const {return S == OwnerPointer() ? 0 : S;}
+ inline Str &operator *() {return *S;}
+ inline Str const &operator *() const {return *S;}
+ inline pkgCache *Cache() const {return Owner;}
// Mixed stuff
- inline void operator =(const Itr &B) {S = B.S; Owner = B.Owner;};
- inline bool IsGood() const { return S && Owner && ! end();};
- inline unsigned long Index() const {return S - OwnerPointer();};
+ inline void operator =(const Itr &B) {S = B.S; Owner = B.Owner;}
+ inline bool IsGood() const { return S && Owner && ! end();}
+ inline unsigned long Index() const {return S - OwnerPointer();}
void ReMap(void const * const oldMap, void const * const newMap) {
if (Owner == 0 || S == 0)
@@ -83,8 +83,8 @@ template class pkgCache::Iterator :
}
// Constructors - look out for the variable assigning
- inline Iterator() : S(0), Owner(0) {};
- inline Iterator(pkgCache &Owner,Str *T = 0) : S(T), Owner(&Owner) {};
+ inline Iterator() : S(0), Owner(0) {}
+ inline Iterator(pkgCache &Owner,Str *T = 0) : S(T), Owner(&Owner) {}
};
/*}}}*/
// Group Iterator /*{{{*/
@@ -98,19 +98,19 @@ class pkgCache::GrpIterator: public Iterator {
protected:
inline Group* OwnerPointer() const {
return (Owner != 0) ? Owner->GrpP : 0;
- };
+ }
public:
// This constructor is the 'begin' constructor, never use it.
inline GrpIterator(pkgCache &Owner) : Iterator(Owner), HashIndex(-1) {
S = OwnerPointer();
operator ++(0);
- };
+ }
virtual void operator ++(int);
- virtual void operator ++() {operator ++(0);};
+ virtual void operator ++() {operator ++(0);}
- inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;};
+ inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;}
inline PkgIterator PackageList() const;
PkgIterator FindPkg(std::string Arch = "any") const;
/** \brief find the package with the "best" architecture
@@ -127,8 +127,8 @@ class pkgCache::GrpIterator: public Iterator {
inline GrpIterator(pkgCache &Owner, Group *Trg) : Iterator(Owner, Trg), HashIndex(0) {
if (S == 0)
S = OwnerPointer();
- };
- inline GrpIterator() : Iterator(), HashIndex(0) {};
+ }
+ inline GrpIterator() : Iterator(), HashIndex(0) {}
};
/*}}}*/
@@ -139,27 +139,27 @@ class pkgCache::PkgIterator: public Iterator {
protected:
inline Package* OwnerPointer() const {
return (Owner != 0) ? Owner->PkgP : 0;
- };
+ }
public:
// This constructor is the 'begin' constructor, never use it.
inline PkgIterator(pkgCache &Owner) : Iterator(Owner), HashIndex(-1) {
S = OwnerPointer();
operator ++(0);
- };
+ }
virtual void operator ++(int);
- virtual void operator ++() {operator ++(0);};
+ virtual void operator ++() {operator ++(0);}
enum OkState {NeedsNothing,NeedsUnpack,NeedsConfigure};
// Accessors
- inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;};
- inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;};
+ inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;}
+ inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;}
inline bool Purge() const {return S->CurrentState == pkgCache::State::Purge ||
- (S->CurrentVer == 0 && S->CurrentState == pkgCache::State::NotInstalled);};
- inline const char *Arch() const {return S->Arch == 0?0:Owner->StrP + S->Arch;};
- inline GrpIterator Group() const { return GrpIterator(*Owner, Owner->GrpP + S->Group);};
+ (S->CurrentVer == 0 && S->CurrentState == pkgCache::State::NotInstalled);}
+ inline const char *Arch() const {return S->Arch == 0?0:Owner->StrP + S->Arch;}
+ inline GrpIterator Group() const { return GrpIterator(*Owner, Owner->GrpP + S->Group);}
inline VerIterator VersionList() const;
inline VerIterator CurrentVer() const;
@@ -177,8 +177,8 @@ class pkgCache::PkgIterator: public Iterator {
inline PkgIterator(pkgCache &Owner,Package *Trg) : Iterator(Owner, Trg), HashIndex(0) {
if (S == 0)
S = OwnerPointer();
- };
- inline PkgIterator() : Iterator(), HashIndex(0) {};
+ }
+ inline PkgIterator() : Iterator(), HashIndex(0) {}
};
/*}}}*/
// Version Iterator /*{{{*/
@@ -186,12 +186,12 @@ class pkgCache::VerIterator : public Iterator {
protected:
inline Version* OwnerPointer() const {
return (Owner != 0) ? Owner->VerP : 0;
- };
+ }
public:
// Iteration
- void operator ++(int) {if (S != Owner->VerP) S = Owner->VerP + S->NextVer;};
- inline void operator ++() {operator ++(0);};
+ void operator ++(int) {if (S != Owner->VerP) S = Owner->VerP + S->NextVer;}
+ inline void operator ++() {operator ++(0);}
// Comparison
int CompareVer(const VerIterator &B) const;
@@ -201,17 +201,17 @@ class pkgCache::VerIterator : public Iterator {
referring to the same "real" version */
inline bool SimilarVer(const VerIterator &B) const {
return (B.end() == false && S->Hash == B->Hash && strcmp(VerStr(), B.VerStr()) == 0);
- };
+ }
// Accessors
- inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;};
- inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;};
+ inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;}
+ inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;}
inline const char *Arch() const {
if ((S->MultiArch & pkgCache::Version::All) == pkgCache::Version::All)
return "all";
return S->ParentPkg == 0?0:Owner->StrP + ParentPkg()->Arch;
- };
- inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);};
+ }
+ inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);}
inline DescIterator DescriptionList() const;
DescIterator TranslatedDescription() const;
@@ -219,7 +219,7 @@ class pkgCache::VerIterator : public Iterator {
inline PrvIterator ProvidesList() const;
inline VerFileIterator FileList() const;
bool Downloadable() const;
- inline const char *PriorityType() const {return Owner->Priority(S->Priority);};
+ inline const char *PriorityType() const {return Owner->Priority(S->Priority);}
const char *MultiArchType() const;
std::string RelStr() const;
@@ -229,8 +229,8 @@ class pkgCache::VerIterator : public Iterator {
inline VerIterator(pkgCache &Owner,Version *Trg = 0) : Iterator(Owner, Trg) {
if (S == 0)
S = OwnerPointer();
- };
- inline VerIterator() : Iterator() {};
+ }
+ inline VerIterator() : Iterator() {}
};
/*}}}*/
// Description Iterator /*{{{*/
@@ -238,26 +238,26 @@ class pkgCache::DescIterator : public Iterator {
protected:
inline Description* OwnerPointer() const {
return (Owner != 0) ? Owner->DescP : 0;
- };
+ }
public:
// Iteration
- void operator ++(int) {if (S != Owner->DescP) S = Owner->DescP + S->NextDesc;};
- inline void operator ++() {operator ++(0);};
+ void operator ++(int) {if (S != Owner->DescP) S = Owner->DescP + S->NextDesc;}
+ inline void operator ++() {operator ++(0);}
// Comparison
int CompareDesc(const DescIterator &B) const;
// Accessors
- inline const char *LanguageCode() const {return Owner->StrP + S->language_code;};
- inline const char *md5() const {return Owner->StrP + S->md5sum;};
+ inline const char *LanguageCode() const {return Owner->StrP + S->language_code;}
+ inline const char *md5() const {return Owner->StrP + S->md5sum;}
inline DescFileIterator FileList() const;
- inline DescIterator() : Iterator() {};
+ inline DescIterator() : Iterator() {}
inline DescIterator(pkgCache &Owner,Description *Trg = 0) : Iterator(Owner, Trg) {
if (S == 0)
S = Owner.DescP;
- };
+ }
};
/*}}}*/
// Dependency iterator /*{{{*/
@@ -267,21 +267,21 @@ class pkgCache::DepIterator : public Iterator {
protected:
inline Dependency* OwnerPointer() const {
return (Owner != 0) ? Owner->DepP : 0;
- };
+ }
public:
// Iteration
void operator ++(int) {if (S != Owner->DepP) S = Owner->DepP +
- (Type == DepVer ? S->NextDepends : S->NextRevDepends);};
- inline void operator ++() {operator ++(0);};
+ (Type == DepVer ? S->NextDepends : S->NextRevDepends);}
+ inline void operator ++() {operator ++(0);}
// Accessors
- inline const char *TargetVer() const {return S->Version == 0?0:Owner->StrP + S->Version;};
- inline PkgIterator TargetPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->Package);};
- inline PkgIterator SmartTargetPkg() const {PkgIterator R(*Owner,0);SmartTargetPkg(R);return R;};
- inline VerIterator ParentVer() const {return VerIterator(*Owner,Owner->VerP + S->ParentVer);};
- inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->ParentVer].ParentPkg);};
- inline bool Reverse() const {return Type == DepRev;};
+ inline const char *TargetVer() const {return S->Version == 0?0:Owner->StrP + S->Version;}
+ inline PkgIterator TargetPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->Package);}
+ inline PkgIterator SmartTargetPkg() const {PkgIterator R(*Owner,0);SmartTargetPkg(R);return R;}
+ inline VerIterator ParentVer() const {return VerIterator(*Owner,Owner->VerP + S->ParentVer);}
+ inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->ParentVer].ParentPkg);}
+ inline bool Reverse() const {return Type == DepRev;}
bool IsCritical() const;
bool IsNegative() const;
bool IsIgnorable(PrvIterator const &Prv) const;
@@ -292,8 +292,8 @@ class pkgCache::DepIterator : public Iterator {
void GlobOr(DepIterator &Start,DepIterator &End);
Version **AllTargets() const;
bool SmartTargetPkg(PkgIterator &Result) const;
- inline const char *CompType() const {return Owner->CompType(S->CompareOp);};
- inline const char *DepType() const {return Owner->DepType(S->Type);};
+ inline const char *CompType() const {return Owner->CompType(S->CompareOp);}
+ inline const char *DepType() const {return Owner->DepType(S->Type);}
//Nice printable representation
friend std::ostream& operator <<(std::ostream& out, DepIterator D);
@@ -302,13 +302,13 @@ class pkgCache::DepIterator : public Iterator {
Iterator(Owner, Trg), Type(DepVer) {
if (S == 0)
S = Owner.DepP;
- };
+ }
inline DepIterator(pkgCache &Owner, Dependency *Trg, Package*) :
Iterator(Owner, Trg), Type(DepRev) {
if (S == 0)
S = Owner.DepP;
- };
- inline DepIterator() : Iterator(), Type(DepVer) {};
+ }
+ inline DepIterator() : Iterator(), Type(DepVer) {}
};
/*}}}*/
// Provides iterator /*{{{*/
@@ -318,34 +318,34 @@ class pkgCache::PrvIterator : public Iterator {
protected:
inline Provides* OwnerPointer() const {
return (Owner != 0) ? Owner->ProvideP : 0;
- };
+ }
public:
// Iteration
void operator ++(int) {if (S != Owner->ProvideP) S = Owner->ProvideP +
- (Type == PrvVer?S->NextPkgProv:S->NextProvides);};
- inline void operator ++() {operator ++(0);};
+ (Type == PrvVer?S->NextPkgProv:S->NextProvides);}
+ inline void operator ++() {operator ++(0);}
// Accessors
- inline const char *Name() const {return Owner->StrP + Owner->PkgP[S->ParentPkg].Name;};
- inline const char *ProvideVersion() const {return S->ProvideVersion == 0?0:Owner->StrP + S->ProvideVersion;};
- inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);};
- inline VerIterator OwnerVer() const {return VerIterator(*Owner,Owner->VerP + S->Version);};
- inline PkgIterator OwnerPkg() const {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->Version].ParentPkg);};
+ inline const char *Name() const {return Owner->StrP + Owner->PkgP[S->ParentPkg].Name;}
+ inline const char *ProvideVersion() const {return S->ProvideVersion == 0?0:Owner->StrP + S->ProvideVersion;}
+ inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);}
+ inline VerIterator OwnerVer() const {return VerIterator(*Owner,Owner->VerP + S->Version);}
+ inline PkgIterator OwnerPkg() const {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->Version].ParentPkg);}
bool IsMultiArchImplicit() const;
- inline PrvIterator() : Iterator(), Type(PrvVer) {};
+ inline PrvIterator() : Iterator(), Type(PrvVer) {}
inline PrvIterator(pkgCache &Owner, Provides *Trg, Version*) :
Iterator(Owner, Trg), Type(PrvVer) {
if (S == 0)
S = Owner.ProvideP;
- };
+ }
inline PrvIterator(pkgCache &Owner, Provides *Trg, Package*) :
Iterator(Owner, Trg), Type(PrvPkg) {
if (S == 0)
S = Owner.ProvideP;
- };
+ }
};
/*}}}*/
// Package file /*{{{*/
@@ -353,32 +353,32 @@ class pkgCache::PkgFileIterator : public Iterator
protected:
inline PackageFile* OwnerPointer() const {
return (Owner != 0) ? Owner->PkgFileP : 0;
- };
+ }
public:
// Iteration
- void operator ++(int) {if (S != Owner->PkgFileP) S = Owner->PkgFileP + S->NextFile;};
- inline void operator ++() {operator ++(0);};
+ void operator ++(int) {if (S != Owner->PkgFileP) S = Owner->PkgFileP + S->NextFile;}
+ inline void operator ++() {operator ++(0);}
// Accessors
- inline const char *FileName() const {return S->FileName == 0?0:Owner->StrP + S->FileName;};
- inline const char *Archive() const {return S->Archive == 0?0:Owner->StrP + S->Archive;};
- inline const char *Component() const {return S->Component == 0?0:Owner->StrP + S->Component;};
- inline const char *Version() const {return S->Version == 0?0:Owner->StrP + S->Version;};
- inline const char *Origin() const {return S->Origin == 0?0:Owner->StrP + S->Origin;};
- inline const char *Codename() const {return S->Codename ==0?0:Owner->StrP + S->Codename;};
- inline const char *Label() const {return S->Label == 0?0:Owner->StrP + S->Label;};
- inline const char *Site() const {return S->Site == 0?0:Owner->StrP + S->Site;};
- inline const char *Architecture() const {return S->Architecture == 0?0:Owner->StrP + S->Architecture;};
- inline const char *IndexType() const {return S->IndexType == 0?0:Owner->StrP + S->IndexType;};
+ inline const char *FileName() const {return S->FileName == 0?0:Owner->StrP + S->FileName;}
+ inline const char *Archive() const {return S->Archive == 0?0:Owner->StrP + S->Archive;}
+ inline const char *Component() const {return S->Component == 0?0:Owner->StrP + S->Component;}
+ inline const char *Version() const {return S->Version == 0?0:Owner->StrP + S->Version;}
+ inline const char *Origin() const {return S->Origin == 0?0:Owner->StrP + S->Origin;}
+ inline const char *Codename() const {return S->Codename ==0?0:Owner->StrP + S->Codename;}
+ inline const char *Label() const {return S->Label == 0?0:Owner->StrP + S->Label;}
+ inline const char *Site() const {return S->Site == 0?0:Owner->StrP + S->Site;}
+ inline const char *Architecture() const {return S->Architecture == 0?0:Owner->StrP + S->Architecture;}
+ inline const char *IndexType() const {return S->IndexType == 0?0:Owner->StrP + S->IndexType;}
bool IsOk();
std::string RelStr();
// Constructors
- inline PkgFileIterator() : Iterator() {};
- inline PkgFileIterator(pkgCache &Owner) : Iterator(Owner, Owner.PkgFileP) {};
- inline PkgFileIterator(pkgCache &Owner,PackageFile *Trg) : Iterator(Owner, Trg) {};
+ inline PkgFileIterator() : Iterator() {}
+ inline PkgFileIterator(pkgCache &Owner) : Iterator(Owner, Owner.PkgFileP) {}
+ inline PkgFileIterator(pkgCache &Owner,PackageFile *Trg) : Iterator(Owner, Trg) {}
};
/*}}}*/
// Version File /*{{{*/
@@ -386,18 +386,18 @@ class pkgCache::VerFileIterator : public pkgCache::IteratorVerFileP : 0;
- };
+ }
public:
// Iteration
- void operator ++(int) {if (S != Owner->VerFileP) S = Owner->VerFileP + S->NextFile;};
- inline void operator ++() {operator ++(0);};
+ void operator ++(int) {if (S != Owner->VerFileP) S = Owner->VerFileP + S->NextFile;}
+ inline void operator ++() {operator ++(0);}
// Accessors
- inline PkgFileIterator File() const {return PkgFileIterator(*Owner,S->File + Owner->PkgFileP);};
+ inline PkgFileIterator File() const {return PkgFileIterator(*Owner,S->File + Owner->PkgFileP);}
- inline VerFileIterator() : Iterator() {};
- inline VerFileIterator(pkgCache &Owner,VerFile *Trg) : Iterator(Owner, Trg) {};
+ inline VerFileIterator() : Iterator() {}
+ inline VerFileIterator(pkgCache &Owner,VerFile *Trg) : Iterator(Owner, Trg) {}
};
/*}}}*/
// Description File /*{{{*/
@@ -405,40 +405,40 @@ class pkgCache::DescFileIterator : public Iterator {
protected:
inline DescFile* OwnerPointer() const {
return (Owner != 0) ? Owner->DescFileP : 0;
- };
+ }
public:
// Iteration
- void operator ++(int) {if (S != Owner->DescFileP) S = Owner->DescFileP + S->NextFile;};
- inline void operator ++() {operator ++(0);};
+ void operator ++(int) {if (S != Owner->DescFileP) S = Owner->DescFileP + S->NextFile;}
+ inline void operator ++() {operator ++(0);}
// Accessors
- inline PkgFileIterator File() const {return PkgFileIterator(*Owner,S->File + Owner->PkgFileP);};
+ inline PkgFileIterator File() const {return PkgFileIterator(*Owner,S->File + Owner->PkgFileP);}
- inline DescFileIterator() : Iterator() {};
- inline DescFileIterator(pkgCache &Owner,DescFile *Trg) : Iterator(Owner, Trg) {};
+ inline DescFileIterator() : Iterator() {}
+ inline DescFileIterator(pkgCache &Owner,DescFile *Trg) : Iterator(Owner, Trg) {}
};
/*}}}*/
// Inlined Begin functions can't be in the class because of order problems /*{{{*/
inline pkgCache::PkgIterator pkgCache::GrpIterator::PackageList() const
- {return PkgIterator(*Owner,Owner->PkgP + S->FirstPackage);};
+ {return PkgIterator(*Owner,Owner->PkgP + S->FirstPackage);}
inline pkgCache::VerIterator pkgCache::PkgIterator::VersionList() const
- {return VerIterator(*Owner,Owner->VerP + S->VersionList);};
+ {return VerIterator(*Owner,Owner->VerP + S->VersionList);}
inline pkgCache::VerIterator pkgCache::PkgIterator::CurrentVer() const
- {return VerIterator(*Owner,Owner->VerP + S->CurrentVer);};
+ {return VerIterator(*Owner,Owner->VerP + S->CurrentVer);}
inline pkgCache::DepIterator pkgCache::PkgIterator::RevDependsList() const
- {return DepIterator(*Owner,Owner->DepP + S->RevDepends,S);};
+ {return DepIterator(*Owner,Owner->DepP + S->RevDepends,S);}
inline pkgCache::PrvIterator pkgCache::PkgIterator::ProvidesList() const
- {return PrvIterator(*Owner,Owner->ProvideP + S->ProvidesList,S);};
+ {return PrvIterator(*Owner,Owner->ProvideP + S->ProvidesList,S);}
inline pkgCache::DescIterator pkgCache::VerIterator::DescriptionList() const
- {return DescIterator(*Owner,Owner->DescP + S->DescriptionList);};
+ {return DescIterator(*Owner,Owner->DescP + S->DescriptionList);}
inline pkgCache::PrvIterator pkgCache::VerIterator::ProvidesList() const
- {return PrvIterator(*Owner,Owner->ProvideP + S->ProvidesList,S);};
+ {return PrvIterator(*Owner,Owner->ProvideP + S->ProvidesList,S);}
inline pkgCache::DepIterator pkgCache::VerIterator::DependsList() const
- {return DepIterator(*Owner,Owner->DepP + S->DependsList,S);};
+ {return DepIterator(*Owner,Owner->DepP + S->DependsList,S);}
inline pkgCache::VerFileIterator pkgCache::VerIterator::FileList() const
- {return VerFileIterator(*Owner,Owner->VerFileP + S->FileList);};
+ {return VerFileIterator(*Owner,Owner->VerFileP + S->FileList);}
inline pkgCache::DescFileIterator pkgCache::DescIterator::FileList() const
- {return DescFileIterator(*Owner,Owner->DescFileP + S->FileList);};
+ {return DescFileIterator(*Owner,Owner->DescFileP + S->FileList);}
/*}}}*/
#endif
diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h
index ce502d8ca..ef28bbc34 100644
--- a/apt-pkg/cacheset.h
+++ b/apt-pkg/cacheset.h
@@ -43,8 +43,8 @@ class CacheSetHelper { /*{{{*/
public: /*{{{*/
CacheSetHelper(bool const ShowError = true,
GlobalError::MsgType ErrorType = GlobalError::ERROR) :
- ShowError(ShowError), ErrorType(ErrorType) {};
- virtual ~CacheSetHelper() {};
+ ShowError(ShowError), ErrorType(ErrorType) {}
+ virtual ~CacheSetHelper() {}
virtual void showTaskSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern);
virtual void showRegExSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern);
@@ -76,9 +76,9 @@ public: /*{{{*/
virtual pkgCache::VerIterator canNotFindInstalledVer(pkgCacheFile &Cache,
pkgCache::PkgIterator const &Pkg);
- bool showErrors() const { return ShowError; };
- bool showErrors(bool const newValue) { if (ShowError == newValue) return ShowError; else return ((ShowError = newValue) == false); };
- GlobalError::MsgType errorType() const { return ErrorType; };
+ bool showErrors() const { return ShowError; }
+ bool showErrors(bool const newValue) { if (ShowError == newValue) return ShowError; else return ((ShowError = newValue) == false); }
+ GlobalError::MsgType errorType() const { return ErrorType; }
GlobalError::MsgType errorType(GlobalError::MsgType const &newValue)
{
if (ErrorType == newValue) return ErrorType;
@@ -87,7 +87,7 @@ public: /*{{{*/
ErrorType = newValue;
return oldValue;
}
- };
+ }
/*}}}*/
protected:
@@ -124,12 +124,12 @@ public:
inline pkgCache::PkgIterator::OkState State() const { return getPkg().State(); }
inline const char *CandVersion() const { return getPkg().CandVersion(); }
inline const char *CurVersion() const { return getPkg().CurVersion(); }
- inline pkgCache *Cache() const { return getPkg().Cache(); };
- inline unsigned long Index() const {return getPkg().Index();};
+ inline pkgCache *Cache() const { return getPkg().Cache(); }
+ inline unsigned long Index() const {return getPkg().Index();}
// we have only valid iterators here
- inline bool end() const { return false; };
+ inline bool end() const { return false; }
- inline pkgCache::Package const * operator->() const {return &*getPkg();};
+ inline pkgCache::Package const * operator->() const {return &*getPkg();}
};
/*}}}*/
@@ -154,7 +154,7 @@ public:
unsigned short ID;
const char * const Alias;
Position Pos;
- Modifier (unsigned short const &id, const char * const alias, Position const &pos) : ID(id), Alias(alias), Pos(pos) {};
+ Modifier (unsigned short const &id, const char * const alias, Position const &pos) : ID(id), Alias(alias), Pos(pos) {}
};
static bool FromModifierCommandLine(unsigned short &modID, PackageContainerInterface * const pci,
@@ -177,12 +177,12 @@ public: /*{{{*/
public:
const_iterator(typename Container::const_iterator i) : _iter(i) {}
pkgCache::PkgIterator getPkg(void) const { return *_iter; }
- inline pkgCache::PkgIterator operator*(void) const { return *_iter; };
+ inline pkgCache::PkgIterator operator*(void) const { return *_iter; }
operator typename Container::const_iterator(void) const { return _iter; }
inline const_iterator& operator++() { ++_iter; return *this; }
inline const_iterator operator++(int) { const_iterator tmp(*this); operator++(); return tmp; }
- inline bool operator!=(const_iterator const &i) const { return _iter != i._iter; };
- inline bool operator==(const_iterator const &i) const { return _iter == i._iter; };
+ inline bool operator!=(const_iterator const &i) const { return _iter != i._iter; }
+ inline bool operator==(const_iterator const &i) const { return _iter == i._iter; }
friend std::ostream& operator<<(std::ostream& out, const_iterator i) { return operator<<(out, *i); }
};
class iterator : public PackageContainerInterface::const_iterator,
@@ -191,43 +191,43 @@ public: /*{{{*/
public:
iterator(typename Container::iterator i) : _iter(i) {}
pkgCache::PkgIterator getPkg(void) const { return *_iter; }
- inline pkgCache::PkgIterator operator*(void) const { return *_iter; };
+ inline pkgCache::PkgIterator operator*(void) const { return *_iter; }
operator typename Container::iterator(void) const { return _iter; }
operator typename PackageContainer::const_iterator() { return typename PackageContainer::const_iterator(_iter); }
inline iterator& operator++() { ++_iter; return *this; }
inline iterator operator++(int) { iterator tmp(*this); operator++(); return tmp; }
- inline bool operator!=(iterator const &i) const { return _iter != i._iter; };
- inline bool operator==(iterator const &i) const { return _iter == i._iter; };
- inline iterator& operator=(iterator const &i) { _iter = i._iter; return *this; };
- inline iterator& operator=(typename Container::iterator const &i) { _iter = i; return *this; };
+ inline bool operator!=(iterator const &i) const { return _iter != i._iter; }
+ inline bool operator==(iterator const &i) const { return _iter == i._iter; }
+ inline iterator& operator=(iterator const &i) { _iter = i._iter; return *this; }
+ inline iterator& operator=(typename Container::iterator const &i) { _iter = i; return *this; }
friend std::ostream& operator<<(std::ostream& out, iterator i) { return operator<<(out, *i); }
};
/*}}}*/
- bool insert(pkgCache::PkgIterator const &P) { if (P.end() == true) return false; _cont.insert(P); return true; };
- template void insert(PackageContainer const &pkgcont) { _cont.insert((typename Cont::const_iterator)pkgcont.begin(), (typename Cont::const_iterator)pkgcont.end()); };
- void insert(const_iterator begin, const_iterator end) { _cont.insert(begin, end); };
+ bool insert(pkgCache::PkgIterator const &P) { if (P.end() == true) return false; _cont.insert(P); return true; }
+ template void insert(PackageContainer const &pkgcont) { _cont.insert((typename Cont::const_iterator)pkgcont.begin(), (typename Cont::const_iterator)pkgcont.end()); }
+ void insert(const_iterator begin, const_iterator end) { _cont.insert(begin, end); }
- bool empty() const { return _cont.empty(); };
- void clear() { return _cont.clear(); };
+ bool empty() const { return _cont.empty(); }
+ void clear() { return _cont.clear(); }
//FIXME: on ABI break, replace the first with the second without bool
- void erase(iterator position) { _cont.erase((typename Container::iterator)position); };
- iterator& erase(iterator &position, bool) { return position = _cont.erase((typename Container::iterator)position); };
- size_t erase(const pkgCache::PkgIterator x) { return _cont.erase(x); };
- void erase(iterator first, iterator last) { _cont.erase(first, last); };
- size_t size() const { return _cont.size(); };
+ void erase(iterator position) { _cont.erase((typename Container::iterator)position); }
+ iterator& erase(iterator &position, bool) { return position = _cont.erase((typename Container::iterator)position); }
+ size_t erase(const pkgCache::PkgIterator x) { return _cont.erase(x); }
+ void erase(iterator first, iterator last) { _cont.erase(first, last); }
+ size_t size() const { return _cont.size(); }
- const_iterator begin() const { return const_iterator(_cont.begin()); };
- const_iterator end() const { return const_iterator(_cont.end()); };
- iterator begin() { return iterator(_cont.begin()); };
- iterator end() { return iterator(_cont.end()); };
- const_iterator find(pkgCache::PkgIterator const &P) const { return const_iterator(_cont.find(P)); };
+ const_iterator begin() const { return const_iterator(_cont.begin()); }
+ const_iterator end() const { return const_iterator(_cont.end()); }
+ iterator begin() { return iterator(_cont.begin()); }
+ iterator end() { return iterator(_cont.end()); }
+ const_iterator find(pkgCache::PkgIterator const &P) const { return const_iterator(_cont.find(P)); }
- void setConstructor(Constructor const &by) { ConstructedBy = by; };
- Constructor getConstructor() const { return ConstructedBy; };
+ void setConstructor(Constructor const &by) { ConstructedBy = by; }
+ Constructor getConstructor() const { return ConstructedBy; }
- PackageContainer() : ConstructedBy(UNKNOWN) {};
- PackageContainer(Constructor const &by) : ConstructedBy(by) {};
+ PackageContainer() : ConstructedBy(UNKNOWN) {}
+ PackageContainer(Constructor const &by) : ConstructedBy(by) {}
/** \brief returns all packages in the cache who belong to the given task
@@ -365,7 +365,7 @@ private: /*{{{*/
template<> template void PackageContainer >::insert(PackageContainer const &pkgcont) {
for (typename PackageContainer::const_iterator p = pkgcont.begin(); p != pkgcont.end(); ++p)
_cont.push_back(*p);
-};
+}
// these two are 'inline' as otherwise the linker has problems with seeing these untemplated
// specializations again and again - but we need to see them, so that library users can use them
template<> inline bool PackageContainer >::insert(pkgCache::PkgIterator const &P) {
@@ -373,11 +373,11 @@ template<> inline bool PackageContainer >::inse
return false;
_cont.push_back(P);
return true;
-};
+}
template<> inline void PackageContainer >::insert(const_iterator begin, const_iterator end) {
for (const_iterator p = begin; p != end; ++p)
_cont.push_back(*p);
-};
+}
typedef PackageContainer > PackageSet;
typedef PackageContainer > PackageList;
@@ -392,27 +392,27 @@ public:
virtual pkgCache::VerIterator getVer() const = 0;
operator pkgCache::VerIterator(void) { return getVer(); }
- inline pkgCache *Cache() const { return getVer().Cache(); };
- inline unsigned long Index() const {return getVer().Index();};
- inline int CompareVer(const pkgCache::VerIterator &B) const { return getVer().CompareVer(B); };
- inline const char *VerStr() const { return getVer().VerStr(); };
- inline const char *Section() const { return getVer().Section(); };
- inline const char *Arch() const { return getVer().Arch(); };
- inline pkgCache::PkgIterator ParentPkg() const { return getVer().ParentPkg(); };
- inline pkgCache::DescIterator DescriptionList() const { return getVer().DescriptionList(); };
- inline pkgCache::DescIterator TranslatedDescription() const { return getVer().TranslatedDescription(); };
- inline pkgCache::DepIterator DependsList() const { return getVer().DependsList(); };
- inline pkgCache::PrvIterator ProvidesList() const { return getVer().ProvidesList(); };
- inline pkgCache::VerFileIterator FileList() const { return getVer().FileList(); };
- inline bool Downloadable() const { return getVer().Downloadable(); };
- inline const char *PriorityType() const { return getVer().PriorityType(); };
- inline std::string RelStr() const { return getVer().RelStr(); };
- inline bool Automatic() const { return getVer().Automatic(); };
- inline pkgCache::VerFileIterator NewestFile() const { return getVer().NewestFile(); };
+ inline pkgCache *Cache() const { return getVer().Cache(); }
+ inline unsigned long Index() const {return getVer().Index();}
+ inline int CompareVer(const pkgCache::VerIterator &B) const { return getVer().CompareVer(B); }
+ inline const char *VerStr() const { return getVer().VerStr(); }
+ inline const char *Section() const { return getVer().Section(); }
+ inline const char *Arch() const { return getVer().Arch(); }
+ inline pkgCache::PkgIterator ParentPkg() const { return getVer().ParentPkg(); }
+ inline pkgCache::DescIterator DescriptionList() const { return getVer().DescriptionList(); }
+ inline pkgCache::DescIterator TranslatedDescription() const { return getVer().TranslatedDescription(); }
+ inline pkgCache::DepIterator DependsList() const { return getVer().DependsList(); }
+ inline pkgCache::PrvIterator ProvidesList() const { return getVer().ProvidesList(); }
+ inline pkgCache::VerFileIterator FileList() const { return getVer().FileList(); }
+ inline bool Downloadable() const { return getVer().Downloadable(); }
+ inline const char *PriorityType() const { return getVer().PriorityType(); }
+ inline std::string RelStr() const { return getVer().RelStr(); }
+ inline bool Automatic() const { return getVer().Automatic(); }
+ inline pkgCache::VerFileIterator NewestFile() const { return getVer().NewestFile(); }
// we have only valid iterators here
- inline bool end() const { return false; };
+ inline bool end() const { return false; }
- inline pkgCache::Version const * operator->() const { return &*getVer(); };
+ inline pkgCache::Version const * operator->() const { return &*getVer(); }
};
/*}}}*/
@@ -446,7 +446,7 @@ public:
Version SelectVersion;
Modifier (unsigned short const &id, const char * const alias, Position const &pos,
Version const &select) : ID(id), Alias(alias), Pos(pos),
- SelectVersion(select) {};
+ SelectVersion(select) {}
};
static bool FromCommandLine(VersionContainerInterface * const vci, pkgCacheFile &Cache,
@@ -509,12 +509,12 @@ public: /*{{{*/
public:
const_iterator(typename Container::const_iterator i) : _iter(i) {}
pkgCache::VerIterator getVer(void) const { return *_iter; }
- inline pkgCache::VerIterator operator*(void) const { return *_iter; };
+ inline pkgCache::VerIterator operator*(void) const { return *_iter; }
operator typename Container::const_iterator(void) const { return _iter; }
inline const_iterator& operator++() { ++_iter; return *this; }
inline const_iterator operator++(int) { const_iterator tmp(*this); operator++(); return tmp; }
- inline bool operator!=(const_iterator const &i) const { return _iter != i._iter; };
- inline bool operator==(const_iterator const &i) const { return _iter == i._iter; };
+ inline bool operator!=(const_iterator const &i) const { return _iter != i._iter; }
+ inline bool operator==(const_iterator const &i) const { return _iter == i._iter; }
friend std::ostream& operator<<(std::ostream& out, const_iterator i) { return operator<<(out, *i); }
};
class iterator : public VersionContainerInterface::const_iterator,
@@ -523,36 +523,36 @@ public: /*{{{*/
public:
iterator(typename Container::iterator i) : _iter(i) {}
pkgCache::VerIterator getVer(void) const { return *_iter; }
- inline pkgCache::VerIterator operator*(void) const { return *_iter; };
+ inline pkgCache::VerIterator operator*(void) const { return *_iter; }
operator typename Container::iterator(void) const { return _iter; }
operator typename VersionContainer::const_iterator() { return typename VersionContainer::const_iterator(_iter); }
inline iterator& operator++() { ++_iter; return *this; }
inline iterator operator++(int) { iterator tmp(*this); operator++(); return tmp; }
- inline bool operator!=(iterator const &i) const { return _iter != i._iter; };
- inline bool operator==(iterator const &i) const { return _iter == i._iter; };
- inline iterator& operator=(iterator const &i) { _iter = i._iter; return *this; };
- inline iterator& operator=(typename Container::iterator const &i) { _iter = i; return *this; };
+ inline bool operator!=(iterator const &i) const { return _iter != i._iter; }
+ inline bool operator==(iterator const &i) const { return _iter == i._iter; }
+ inline iterator& operator=(iterator const &i) { _iter = i._iter; return *this; }
+ inline iterator& operator=(typename Container::iterator const &i) { _iter = i; return *this; }
friend std::ostream& operator<<(std::ostream& out, iterator i) { return operator<<(out, *i); }
};
/*}}}*/
- bool insert(pkgCache::VerIterator const &V) { if (V.end() == true) return false; _cont.insert(V); return true; };
- template void insert(VersionContainer const &vercont) { _cont.insert((typename Cont::const_iterator)vercont.begin(), (typename Cont::const_iterator)vercont.end()); };
- void insert(const_iterator begin, const_iterator end) { _cont.insert(begin, end); };
- bool empty() const { return _cont.empty(); };
- void clear() { return _cont.clear(); };
+ bool insert(pkgCache::VerIterator const &V) { if (V.end() == true) return false; _cont.insert(V); return true; }
+ template void insert(VersionContainer const &vercont) { _cont.insert((typename Cont::const_iterator)vercont.begin(), (typename Cont::const_iterator)vercont.end()); }
+ void insert(const_iterator begin, const_iterator end) { _cont.insert(begin, end); }
+ bool empty() const { return _cont.empty(); }
+ void clear() { return _cont.clear(); }
//FIXME: on ABI break, replace the first with the second without bool
- void erase(iterator position) { _cont.erase((typename Container::iterator)position); };
- iterator& erase(iterator &position, bool) { return position = _cont.erase((typename Container::iterator)position); };
- size_t erase(const pkgCache::VerIterator x) { return _cont.erase(x); };
- void erase(iterator first, iterator last) { _cont.erase(first, last); };
- size_t size() const { return _cont.size(); };
-
- const_iterator begin() const { return const_iterator(_cont.begin()); };
- const_iterator end() const { return const_iterator(_cont.end()); };
- iterator begin() { return iterator(_cont.begin()); };
- iterator end() { return iterator(_cont.end()); };
- const_iterator find(pkgCache::VerIterator const &V) const { return const_iterator(_cont.find(V)); };
+ void erase(iterator position) { _cont.erase((typename Container::iterator)position); }
+ iterator& erase(iterator &position, bool) { return position = _cont.erase((typename Container::iterator)position); }
+ size_t erase(const pkgCache::VerIterator x) { return _cont.erase(x); }
+ void erase(iterator first, iterator last) { _cont.erase(first, last); }
+ size_t size() const { return _cont.size(); }
+
+ const_iterator begin() const { return const_iterator(_cont.begin()); }
+ const_iterator end() const { return const_iterator(_cont.end()); }
+ iterator begin() { return iterator(_cont.begin()); }
+ iterator end() { return iterator(_cont.end()); }
+ const_iterator find(pkgCache::VerIterator const &V) const { return const_iterator(_cont.find(V)); }
/** \brief returns all versions specified on the commandline
@@ -659,7 +659,7 @@ public: /*{{{*/
template<> template void VersionContainer >::insert(VersionContainer const &vercont) {
for (typename VersionContainer::const_iterator v = vercont.begin(); v != vercont.end(); ++v)
_cont.push_back(*v);
-};
+}
// these two are 'inline' as otherwise the linker has problems with seeing these untemplated
// specializations again and again - but we need to see them, so that library users can use them
template<> inline bool VersionContainer >::insert(pkgCache::VerIterator const &V) {
@@ -667,11 +667,11 @@ template<> inline bool VersionContainer >::inse
return false;
_cont.push_back(V);
return true;
-};
+}
template<> inline void VersionContainer >::insert(const_iterator begin, const_iterator end) {
for (const_iterator v = begin; v != end; ++v)
_cont.push_back(*v);
-};
+}
typedef VersionContainer > VersionSet;
typedef VersionContainer > VersionList;
}
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc
index 3ae1e8b1d..838c8887a 100644
--- a/apt-pkg/cdrom.cc
+++ b/apt-pkg/cdrom.cc
@@ -933,10 +933,10 @@ pkgUdevCdromDevices::Dlopen() /*{{{*/
// convenience interface, this will just call ScanForRemovable
vector
pkgUdevCdromDevices::Scan()
-{
+{
bool CdromOnly = _config->FindB("APT::cdrom::CdromOnly", true);
- return ScanForRemovable(CdromOnly);
-};
+ return ScanForRemovable(CdromOnly);
+}
/*}}}*/
/*{{{*/
vector
diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc
index 8eddd56d4..003fd01d8 100644
--- a/apt-pkg/contrib/configuration.cc
+++ b/apt-pkg/contrib/configuration.cc
@@ -43,8 +43,7 @@ Configuration::Configuration() : ToFree(true)
}
Configuration::Configuration(const Item *Root) : Root((Item *)Root), ToFree(false)
{
-};
-
+}
/*}}}*/
// Configuration::~Configuration - Destructor /*{{{*/
// ---------------------------------------------------------------------
diff --git a/apt-pkg/contrib/error.cc b/apt-pkg/contrib/error.cc
index d457781c3..2d25f5ed9 100644
--- a/apt-pkg/contrib/error.cc
+++ b/apt-pkg/contrib/error.cc
@@ -223,7 +223,7 @@ void GlobalError::DumpErrors(std::ostream &out, MsgType const &threshold,
void GlobalError::Discard() {
Messages.clear();
PendingFlag = false;
-};
+}
/*}}}*/
// GlobalError::empty - does our error list include anything? /*{{{*/
bool GlobalError::empty(MsgType const &trashhold) const {
diff --git a/apt-pkg/contrib/gpgv.h b/apt-pkg/contrib/gpgv.h
index 1d79a52ac..d9712d6a8 100644
--- a/apt-pkg/contrib/gpgv.h
+++ b/apt-pkg/contrib/gpgv.h
@@ -45,7 +45,7 @@ inline void ExecGPGV(std::string const &File, std::string const &FileSig,
int const &statusfd = -1) {
int fd[2];
ExecGPGV(File, FileSig, statusfd, fd);
-};
+}
#undef APT_noreturn
diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc
index 916e1d730..9d74ed495 100644
--- a/apt-pkg/contrib/progress.cc
+++ b/apt-pkg/contrib/progress.cc
@@ -125,14 +125,14 @@ bool OpProgress::CheckChange(float Interval)
// OpTextProgress::OpTextProgress - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-OpTextProgress::OpTextProgress(Configuration &Config) :
- NoUpdate(false), NoDisplay(false), LastLen(0)
+OpTextProgress::OpTextProgress(Configuration &Config) :
+ NoUpdate(false), NoDisplay(false), LastLen(0)
{
if (Config.FindI("quiet",0) >= 1 || Config.FindB("quiet::NoUpdate", false) == true)
NoUpdate = true;
if (Config.FindI("quiet",0) >= 2)
NoDisplay = true;
-};
+}
/*}}}*/
// OpTextProgress::Done - Clean up the display /*{{{*/
// ---------------------------------------------------------------------
@@ -150,12 +150,12 @@ void OpTextProgress::Done()
cout << endl;
OldOp = string();
}
-
+
if (NoUpdate == true && NoDisplay == false && OldOp.empty() == false)
{
OldOp = string();
- cout << endl;
- }
+ cout << endl;
+ }
}
/*}}}*/
// OpTextProgress::Update - Simple text spinner /*{{{*/
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index f8bb3890d..0d85b4fd3 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -153,7 +153,7 @@ char *_strrstrip(char *String)
End++;
*End = 0;
return String;
-};
+}
/*}}}*/
// strtabexpand - Converts tabs into 8 spaces /*{{{*/
// ---------------------------------------------------------------------
diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h
index 8d746f10e..3a6d38b75 100644
--- a/apt-pkg/contrib/strutl.h
+++ b/apt-pkg/contrib/strutl.h
@@ -37,8 +37,8 @@ namespace APT {
namespace String {
std::string Strip(const std::string &s);
bool Endswith(const std::string &s, const std::string &ending);
- };
-};
+ }
+}
bool UTF8ToCodeset(const char *codeset, const std::string &orig, std::string *dest);
@@ -104,17 +104,17 @@ int tolower_ascii(int const c) __attrib_const __hot;
std::string StripEpoch(const std::string &VerStr);
#define APT_MKSTRCMP(name,func) \
-inline int name(const char *A,const char *B) {return func(A,A+strlen(A),B,B+strlen(B));}; \
-inline int name(const char *A,const char *AEnd,const char *B) {return func(A,AEnd,B,B+strlen(B));}; \
-inline int name(const std::string& A,const char *B) {return func(A.c_str(),A.c_str()+A.length(),B,B+strlen(B));}; \
-inline int name(const std::string& A,const std::string& B) {return func(A.c_str(),A.c_str()+A.length(),B.c_str(),B.c_str()+B.length());}; \
-inline int name(const std::string& A,const char *B,const char *BEnd) {return func(A.c_str(),A.c_str()+A.length(),B,BEnd);};
+inline int name(const char *A,const char *B) {return func(A,A+strlen(A),B,B+strlen(B));} \
+inline int name(const char *A,const char *AEnd,const char *B) {return func(A,AEnd,B,B+strlen(B));} \
+inline int name(const std::string& A,const char *B) {return func(A.c_str(),A.c_str()+A.length(),B,B+strlen(B));} \
+inline int name(const std::string& A,const std::string& B) {return func(A.c_str(),A.c_str()+A.length(),B.c_str(),B.c_str()+B.length());} \
+inline int name(const std::string& A,const char *B,const char *BEnd) {return func(A.c_str(),A.c_str()+A.length(),B,BEnd);}
#define APT_MKSTRCMP2(name,func) \
-inline int name(const char *A,const char *AEnd,const char *B) {return func(A,AEnd,B,B+strlen(B));}; \
-inline int name(const std::string& A,const char *B) {return func(A.begin(),A.end(),B,B+strlen(B));}; \
-inline int name(const std::string& A,const std::string& B) {return func(A.begin(),A.end(),B.begin(),B.end());}; \
-inline int name(const std::string& A,const char *B,const char *BEnd) {return func(A.begin(),A.end(),B,BEnd);};
+inline int name(const char *A,const char *AEnd,const char *B) {return func(A,AEnd,B,B+strlen(B));} \
+inline int name(const std::string& A,const char *B) {return func(A.begin(),A.end(),B,B+strlen(B));} \
+inline int name(const std::string& A,const std::string& B) {return func(A.begin(),A.end(),B.begin(),B.end());} \
+inline int name(const std::string& A,const char *B,const char *BEnd) {return func(A.begin(),A.end(),B,BEnd);}
int stringcmp(const char *A,const char *AEnd,const char *B,const char *BEnd);
int stringcasecmp(const char *A,const char *AEnd,const char *B,const char *BEnd);
@@ -132,18 +132,18 @@ int stringcasecmp(std::string::const_iterator A,std::string::const_iterator AEnd
int stringcasecmp(std::string::const_iterator A,std::string::const_iterator AEnd,
std::string::const_iterator B,std::string::const_iterator BEnd);
-inline int stringcmp(std::string::const_iterator A,std::string::const_iterator Aend,const char *B) {return stringcmp(A,Aend,B,B+strlen(B));};
-inline int stringcasecmp(std::string::const_iterator A,std::string::const_iterator Aend,const char *B) {return stringcasecmp(A,Aend,B,B+strlen(B));};
+inline int stringcmp(std::string::const_iterator A,std::string::const_iterator Aend,const char *B) {return stringcmp(A,Aend,B,B+strlen(B));}
+inline int stringcasecmp(std::string::const_iterator A,std::string::const_iterator Aend,const char *B) {return stringcasecmp(A,Aend,B,B+strlen(B));}
#endif
-APT_MKSTRCMP2(stringcmp,stringcmp);
-APT_MKSTRCMP2(stringcasecmp,stringcasecmp);
+APT_MKSTRCMP2(stringcmp,stringcmp)
+APT_MKSTRCMP2(stringcasecmp,stringcasecmp)
// Return the length of a NULL-terminated string array
size_t strv_length(const char **str_array);
-inline const char *DeNull(const char *s) {return (s == 0?"(null)":s);};
+inline const char *DeNull(const char *s) {return (s == 0?"(null)":s);}
class URI
{
@@ -159,13 +159,13 @@ class URI
unsigned int Port;
operator std::string();
- inline void operator =(const std::string &From) {CopyFrom(From);};
+ inline void operator =(const std::string &From) {CopyFrom(From);}
inline bool empty() {return Access.empty();};
static std::string SiteOnly(const std::string &URI);
static std::string NoUserPassword(const std::string &URI);
- URI(std::string Path) {CopyFrom(Path);};
- URI() : Port(0) {};
+ URI(std::string Path) {CopyFrom(Path);}
+ URI() : Port(0) {}
};
struct SubstVar
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index a12e6963d..90d0c9314 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -1686,9 +1686,9 @@ bool pkgDepCache::Policy::IsImportantDep(DepIterator const &Dep)
/*}}}*/
// Policy::GetPriority - Get the priority of the package pin /*{{{*/
signed short pkgDepCache::Policy::GetPriority(pkgCache::PkgIterator const &Pkg)
-{ return 0; };
+{ return 0; }
signed short pkgDepCache::Policy::GetPriority(pkgCache::PkgFileIterator const &File)
-{ return 0; };
+{ return 0; }
/*}}}*/
pkgDepCache::InRootSetFunc *pkgDepCache::GetRootSetFunc() /*{{{*/
{
diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc
index 9ea244139..89c9d531f 100644
--- a/apt-pkg/indexcopy.cc
+++ b/apt-pkg/indexcopy.cc
@@ -646,12 +646,12 @@ bool SigVerify::RunGPGV(std::string const &File, std::string const &FileOut,
int const &statusfd, int fd[2]) {
ExecGPGV(File, FileOut, statusfd, fd);
return false;
-};
+}
bool SigVerify::RunGPGV(std::string const &File, std::string const &FileOut,
int const &statusfd) {
ExecGPGV(File, FileOut, statusfd);
return false;
-};
+}
/*}}}*/
bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/
vector &List, pkgCdromStatus *log)
diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc
index a3a4cc0e1..aec744360 100644
--- a/apt-pkg/install-progress.cc
+++ b/apt-pkg/install-progress.cc
@@ -371,5 +371,5 @@ bool PackageManagerText::StatusChanged(std::string PackageName,
-}; // namespace progress
-}; // namespace apt
+} // namespace progress
+} // namespace apt
diff --git a/apt-pkg/install-progress.h b/apt-pkg/install-progress.h
index 8a5b68a8f..8bcc32927 100644
--- a/apt-pkg/install-progress.h
+++ b/apt-pkg/install-progress.h
@@ -24,7 +24,7 @@ namespace Progress {
int last_reported_progress;
public:
- PackageManager()
+ PackageManager()
: percentage(0.0), last_reported_progress(-1) {};
virtual ~PackageManager() {};
@@ -32,8 +32,8 @@ namespace Progress {
virtual void Start(int child_pty=-1) {};
virtual void Stop() {};
- /* When dpkg is invoked (may happen multiple times for each
- * install/remove block
+ /* When dpkg is invoked (may happen multiple times for each
+ * install/remove block
*/
virtual void StartDpkg() {};
@@ -44,18 +44,18 @@ namespace Progress {
return 500000;
};
- virtual bool StatusChanged(std::string PackageName,
+ virtual bool StatusChanged(std::string PackageName,
unsigned int StepsDone,
unsigned int TotalSteps,
- std::string HumanReadableAction) ;
- virtual void Error(std::string PackageName,
+ std::string HumanReadableAction);
+ virtual void Error(std::string PackageName,
unsigned int StepsDone,
unsigned int TotalSteps,
- std::string ErrorMessage) {};
+ std::string ErrorMessage) {}
virtual void ConffilePrompt(std::string PackageName,
unsigned int StepsDone,
unsigned int TotalSteps,
- std::string ConfMessage) {};
+ std::string ConfMessage) {}
};
class PackageManagerProgressFd : public PackageManager
@@ -72,11 +72,11 @@ namespace Progress {
virtual void StartDpkg();
virtual void Stop();
- virtual bool StatusChanged(std::string PackageName,
+ virtual bool StatusChanged(std::string PackageName,
unsigned int StepsDone,
unsigned int TotalSteps,
std::string HumanReadableAction);
- virtual void Error(std::string PackageName,
+ virtual void Error(std::string PackageName,
unsigned int StepsDone,
unsigned int TotalSteps,
std::string ErrorMessage);
@@ -101,11 +101,11 @@ namespace Progress {
virtual void StartDpkg();
virtual void Stop();
- virtual bool StatusChanged(std::string PackageName,
+ virtual bool StatusChanged(std::string PackageName,
unsigned int StepsDone,
unsigned int TotalSteps,
std::string HumanReadableAction);
- virtual void Error(std::string PackageName,
+ virtual void Error(std::string PackageName,
unsigned int StepsDone,
unsigned int TotalSteps,
std::string ErrorMessage);
@@ -134,7 +134,7 @@ namespace Progress {
~PackageManagerFancy();
virtual void Start(int child_pty=-1);
virtual void Stop();
- virtual bool StatusChanged(std::string PackageName,
+ virtual bool StatusChanged(std::string PackageName,
unsigned int StepsDone,
unsigned int TotalSteps,
std::string HumanReadableAction);
@@ -143,14 +143,14 @@ namespace Progress {
class PackageManagerText : public PackageManager
{
public:
- virtual bool StatusChanged(std::string PackageName,
+ virtual bool StatusChanged(std::string PackageName,
unsigned int StepsDone,
unsigned int TotalSteps,
std::string HumanReadableAction);
};
-}; // namespace Progress
-}; // namespace APT
+} // namespace Progress
+} // namespace APT
#endif
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index 67a2a709d..7d57640c5 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -414,7 +414,7 @@ pkgCache::PkgIterator pkgCache::GrpIterator::NextPkg(pkgCache::PkgIterator const
// GrpIterator::operator ++ - Postfix incr /*{{{*/
// ---------------------------------------------------------------------
/* This will advance to the next logical group in the hash table. */
-void pkgCache::GrpIterator::operator ++(int)
+void pkgCache::GrpIterator::operator ++(int)
{
// Follow the current links
if (S != Owner->GrpP)
@@ -426,12 +426,12 @@ void pkgCache::GrpIterator::operator ++(int)
HashIndex++;
S = Owner->GrpP + Owner->HeaderP->GrpHashTable[HashIndex];
}
-};
+}
/*}}}*/
// PkgIterator::operator ++ - Postfix incr /*{{{*/
// ---------------------------------------------------------------------
/* This will advance to the next logical package in the hash table. */
-void pkgCache::PkgIterator::operator ++(int)
+void pkgCache::PkgIterator::operator ++(int)
{
// Follow the current links
if (S != Owner->PkgP)
@@ -443,7 +443,7 @@ void pkgCache::PkgIterator::operator ++(int)
HashIndex++;
S = Owner->PkgP + Owner->HeaderP->PkgHashTable[HashIndex];
}
-};
+}
/*}}}*/
// PkgIterator::State - Check the State of the package /*{{{*/
// ---------------------------------------------------------------------
@@ -475,26 +475,26 @@ pkgCache::PkgIterator::OkState pkgCache::PkgIterator::State() const
// ---------------------------------------------------------------------
/* Return string representing of the candidate version. */
const char *
-pkgCache::PkgIterator::CandVersion() const
+pkgCache::PkgIterator::CandVersion() const
{
//TargetVer is empty, so don't use it.
VerIterator version = pkgPolicy(Owner).GetCandidateVer(*this);
if (version.IsGood())
return version.VerStr();
return 0;
-};
+}
/*}}}*/
// PkgIterator::CurVersion - Returns the current version string /*{{{*/
// ---------------------------------------------------------------------
/* Return string representing of the current version. */
const char *
-pkgCache::PkgIterator::CurVersion() const
+pkgCache::PkgIterator::CurVersion() const
{
VerIterator version = CurrentVer();
if (version.IsGood())
return CurrentVer().VerStr();
return 0;
-};
+}
/*}}}*/
// ostream operator to handle string representation of a package /*{{{*/
// ---------------------------------------------------------------------
@@ -978,7 +978,7 @@ string pkgCache::PkgFileIterator::RelStr()
/*}}}*/
// VerIterator::TranslatedDescription - Return the a DescIter for locale/*{{{*/
// ---------------------------------------------------------------------
-/* return a DescIter for the current locale or the default if none is
+/* return a DescIter for the current locale or the default if none is
* found
*/
pkgCache::DescIterator pkgCache::VerIterator::TranslatedDescription() const
@@ -1012,7 +1012,7 @@ pkgCache::DescIterator pkgCache::VerIterator::TranslatedDescription() const
if (strcmp(Desc.LanguageCode(), "") == 0)
return Desc;
return DescriptionList();
-};
+}
/*}}}*/
// PrvIterator::IsMultiArchImplicit - added by the cache generation /*{{{*/
diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h
index 669904c84..9a88246a1 100644
--- a/apt-pkg/pkgcache.h
+++ b/apt-pkg/pkgcache.h
@@ -176,13 +176,13 @@ class pkgCache /*{{{*/
char *StrP;
virtual bool ReMap(bool const &Errorchecks = true);
- inline bool Sync() {return Map.Sync();};
- inline MMap &GetMap() {return Map;};
- inline void *DataEnd() {return ((unsigned char *)Map.Data()) + Map.Size();};
+ inline bool Sync() {return Map.Sync();}
+ inline MMap &GetMap() {return Map;}
+ inline void *DataEnd() {return ((unsigned char *)Map.Data()) + Map.Size();}
// String hashing function (512 range)
- inline unsigned long Hash(const std::string &S) const {return sHash(S);};
- inline unsigned long Hash(const char *S) const {return sHash(S);};
+ inline unsigned long Hash(const std::string &S) const {return sHash(S);}
+ inline unsigned long Hash(const char *S) const {return sHash(S);}
// Useful transformation things
const char *Priority(unsigned char Priority);
@@ -192,7 +192,7 @@ class pkgCache /*{{{*/
PkgIterator FindPkg(const std::string &Name);
PkgIterator FindPkg(const std::string &Name, const std::string &Arch);
- Header &Head() {return *HeaderP;};
+ Header &Head() {return *HeaderP;}
inline GrpIterator GrpBegin();
inline GrpIterator GrpEnd();
inline PkgIterator PkgBegin();
@@ -200,7 +200,7 @@ class pkgCache /*{{{*/
inline PkgFileIterator FileBegin();
inline PkgFileIterator FileEnd();
- inline bool MultiArchCache() const { return MultiArchEnabled; };
+ inline bool MultiArchCache() const { return MultiArchEnabled; }
inline char const * const NativeArch() const;
// Make me a function
@@ -212,7 +212,7 @@ class pkgCache /*{{{*/
static const char *DepType(unsigned char Dep);
pkgCache(MMap *Map,bool DoMap = true);
- virtual ~pkgCache() {};
+ virtual ~pkgCache() {}
private:
bool MultiArchEnabled;
@@ -662,26 +662,26 @@ struct pkgCache::StringItem
inline char const * const pkgCache::NativeArch() const
- { return StrP + HeaderP->Architecture; };
+ { return StrP + HeaderP->Architecture; }
#include
-inline pkgCache::GrpIterator pkgCache::GrpBegin()
- {return GrpIterator(*this);};
-inline pkgCache::GrpIterator pkgCache::GrpEnd()
- {return GrpIterator(*this,GrpP);};
-inline pkgCache::PkgIterator pkgCache::PkgBegin()
- {return PkgIterator(*this);};
-inline pkgCache::PkgIterator pkgCache::PkgEnd()
- {return PkgIterator(*this,PkgP);};
+inline pkgCache::GrpIterator pkgCache::GrpBegin()
+ {return GrpIterator(*this);}
+inline pkgCache::GrpIterator pkgCache::GrpEnd()
+ {return GrpIterator(*this,GrpP);}
+inline pkgCache::PkgIterator pkgCache::PkgBegin()
+ {return PkgIterator(*this);}
+inline pkgCache::PkgIterator pkgCache::PkgEnd()
+ {return PkgIterator(*this,PkgP);}
inline pkgCache::PkgFileIterator pkgCache::FileBegin()
- {return PkgFileIterator(*this,PkgFileP + HeaderP->FileList);};
+ {return PkgFileIterator(*this,PkgFileP + HeaderP->FileList);}
inline pkgCache::PkgFileIterator pkgCache::FileEnd()
- {return PkgFileIterator(*this,PkgFileP);};
+ {return PkgFileIterator(*this,PkgFileP);}
// Oh I wish for Real Name Space Support
class pkgCache::Namespace /*{{{*/
-{
+{
public:
typedef pkgCache::GrpIterator GrpIterator;
typedef pkgCache::PkgIterator PkgIterator;
@@ -690,7 +690,7 @@ class pkgCache::Namespace /*{{{*/
typedef pkgCache::DepIterator DepIterator;
typedef pkgCache::PrvIterator PrvIterator;
typedef pkgCache::PkgFileIterator PkgFileIterator;
- typedef pkgCache::VerFileIterator VerFileIterator;
+ typedef pkgCache::VerFileIterator VerFileIterator;
typedef pkgCache::Version Version;
typedef pkgCache::Description Description;
typedef pkgCache::Package Package;
diff --git a/apt-pkg/upgrade.h b/apt-pkg/upgrade.h
index c4973472f..436d38300 100644
--- a/apt-pkg/upgrade.h
+++ b/apt-pkg/upgrade.h
@@ -15,7 +15,7 @@ namespace APT {
// FIXME: make this "enum class UpgradeMode {" once we enable c++11
enum UpgradeMode {
FORBID_REMOVE_PACKAGES = 1,
- FORBID_INSTALL_NEW_PACKAGES = 2,
+ FORBID_INSTALL_NEW_PACKAGES = 2
};
bool Upgrade(pkgDepCache &Cache, int UpgradeMode);
}
diff --git a/apt-private/acqprogress.cc b/apt-private/acqprogress.cc
index d25ffef75..66e1600f1 100644
--- a/apt-private/acqprogress.cc
+++ b/apt-private/acqprogress.cc
@@ -42,12 +42,12 @@ AcqTextStatus::AcqTextStatus(unsigned int &ScreenWidth,unsigned int const Quiet)
// AcqTextStatus::Start - Downloading has started /*{{{*/
// ---------------------------------------------------------------------
/* */
-void AcqTextStatus::Start()
+void AcqTextStatus::Start()
{
- pkgAcquireStatus::Start();
+ pkgAcquireStatus::Start();
BlankLine[0] = 0;
ID = 1;
-};
+}
/*}}}*/
// AcqTextStatus::IMSHit - Called when an item got a HIT response /*{{{*/
// ---------------------------------------------------------------------
@@ -58,14 +58,14 @@ void AcqTextStatus::IMSHit(pkgAcquire::ItemDesc &Itm)
return;
if (Quiet <= 0)
- cout << '\r' << BlankLine << '\r';
-
+ cout << '\r' << BlankLine << '\r';
+
cout << _("Hit ") << Itm.Description;
if (Itm.Owner->FileSize != 0)
cout << " [" << SizeToStr(Itm.Owner->FileSize) << "B]";
cout << endl;
Update = true;
-};
+}
/*}}}*/
// AcqTextStatus::Fetch - An item has started to download /*{{{*/
// ---------------------------------------------------------------------
@@ -75,20 +75,20 @@ void AcqTextStatus::Fetch(pkgAcquire::ItemDesc &Itm)
Update = true;
if (Itm.Owner->Complete == true)
return;
-
+
Itm.Owner->ID = ID++;
-
+
if (Quiet > 1)
return;
if (Quiet <= 0)
cout << '\r' << BlankLine << '\r';
-
+
cout << _("Get:") << Itm.Owner->ID << ' ' << Itm.Description;
if (Itm.Owner->FileSize != 0)
cout << " [" << SizeToStr(Itm.Owner->FileSize) << "B]";
cout << endl;
-};
+}
/*}}}*/
// AcqTextStatus::Done - Completed a download /*{{{*/
// ---------------------------------------------------------------------
@@ -96,7 +96,7 @@ void AcqTextStatus::Fetch(pkgAcquire::ItemDesc &Itm)
void AcqTextStatus::Done(pkgAcquire::ItemDesc &Itm)
{
Update = true;
-};
+}
/*}}}*/
// AcqTextStatus::Fail - Called when an item fails to download /*{{{*/
// ---------------------------------------------------------------------
@@ -109,10 +109,10 @@ void AcqTextStatus::Fail(pkgAcquire::ItemDesc &Itm)
// Ignore certain kinds of transient failures (bad code)
if (Itm.Owner->Status == pkgAcquire::Item::StatIdle)
return;
-
+
if (Quiet <= 0)
cout << '\r' << BlankLine << '\r';
-
+
if (Itm.Owner->Status == pkgAcquire::Item::StatDone)
{
cout << _("Ign ") << Itm.Description << endl;
@@ -122,9 +122,9 @@ void AcqTextStatus::Fail(pkgAcquire::ItemDesc &Itm)
cout << _("Err ") << Itm.Description << endl;
cout << " " << Itm.Owner->ErrorText << endl;
}
-
+
Update = true;
-};
+}
/*}}}*/
// AcqTextStatus::Stop - Finished downloading /*{{{*/
// ---------------------------------------------------------------------
@@ -154,12 +154,12 @@ void AcqTextStatus::Stop()
bool AcqTextStatus::Pulse(pkgAcquire *Owner)
{
pkgAcquireStatus::Pulse(Owner);
-
+
if (Quiet > 0)
return true;
-
+
enum {Long = 0,Medium,Short} Mode = Medium;
-
+
char Buffer[sizeof(BlankLine)];
char *End = Buffer + sizeof(Buffer);
char *S = Buffer;
@@ -174,8 +174,8 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
I = Owner->WorkerStep(I))
{
S += strlen(S);
-
- // There is no item running
+
+ // There is no item running
if (I->CurrentItem == 0)
{
if (I->Status.empty() == false)
@@ -183,12 +183,12 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
snprintf(S,End-S," [%s]",I->Status.c_str());
Shown = true;
}
-
+
continue;
}
Shown = true;
-
+
// Add in the short description
if (I->CurrentItem->Owner->ID != 0)
snprintf(S,End-S," [%lu %s",I->CurrentItem->Owner->ID,
@@ -203,7 +203,7 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
snprintf(S,End-S," %s",I->CurrentItem->Owner->Mode);
S += strlen(S);
}
-
+
// Add the current progress
if (Mode == Long)
snprintf(S,End-S," %llu",I->CurrentSize);
@@ -213,7 +213,7 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
snprintf(S,End-S," %sB",SizeToStr(I->CurrentSize).c_str());
}
S += strlen(S);
-
+
// Add the total size and percent
if (I->TotalSize > 0 && I->CurrentItem->Owner->Complete == false)
{
@@ -223,7 +223,7 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
else
snprintf(S,End-S,"/%sB %.0f%%",SizeToStr(I->TotalSize).c_str(),
(I->CurrentSize*100.0)/I->TotalSize);
- }
+ }
S += strlen(S);
snprintf(S,End-S,"]");
}
@@ -231,26 +231,26 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
// Show something..
if (Shown == false)
snprintf(S,End-S,_(" [Working]"));
-
+
/* Put in the ETA and cps meter, block off signals to prevent strangeness
during resizing */
sigset_t Sigs,OldSigs;
sigemptyset(&Sigs);
sigaddset(&Sigs,SIGWINCH);
sigprocmask(SIG_BLOCK,&Sigs,&OldSigs);
-
+
if (CurrentCPS != 0)
- {
+ {
char Tmp[300];
unsigned long long ETA = (TotalBytes - CurrentBytes)/CurrentCPS;
sprintf(Tmp," %sB/s %s",SizeToStr(CurrentCPS).c_str(),TimeToStr(ETA).c_str());
unsigned int Len = strlen(Buffer);
unsigned int LenT = strlen(Tmp);
if (Len + LenT < ScreenWidth)
- {
+ {
memset(Buffer + Len,' ',ScreenWidth - Len);
strcpy(Buffer + ScreenWidth - LenT,Tmp);
- }
+ }
}
Buffer[ScreenWidth] = 0;
BlankLine[ScreenWidth] = 0;
@@ -268,7 +268,7 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
memset(BlankLine,' ',strlen(Buffer));
BlankLine[strlen(Buffer)] = 0;
-
+
Update = false;
return true;
diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc
index 20c6e8892..9aaebefd7 100644
--- a/cmdline/apt-cdrom.cc
+++ b/cmdline/apt-cdrom.cc
@@ -54,7 +54,7 @@ class pkgCdromTextStatus : public pkgCdromStatus /*{{{*/
{
protected:
OpTextProgress Progress;
- void Prompt(const char *Text);
+ void Prompt(const char *Text);
string PromptLine(const char *Text);
bool AskCdromName(string &name);
@@ -64,12 +64,12 @@ public:
virtual OpProgress* GetOpProgress();
};
-void pkgCdromTextStatus::Prompt(const char *Text)
+void pkgCdromTextStatus::Prompt(const char *Text)
{
char C;
cout << Text << ' ' << flush;
if (read(STDIN_FILENO,&C,1) < 0)
- _error->Errno("pkgCdromTextStatus::Prompt",
+ _error->Errno("pkgCdromTextStatus::Prompt",
"Failed to read from standard input (not a terminal?)");
if (C != '\n')
cout << endl;
@@ -78,37 +78,37 @@ void pkgCdromTextStatus::Prompt(const char *Text)
string pkgCdromTextStatus::PromptLine(const char *Text)
{
cout << Text << ':' << endl;
-
+
string Res;
getline(cin,Res);
return Res;
}
-bool pkgCdromTextStatus::AskCdromName(string &name)
+bool pkgCdromTextStatus::AskCdromName(string &name)
{
cout << _("Please provide a name for this Disc, such as 'Debian 5.0.3 Disk 1'") << flush;
name = PromptLine("");
-
+
return true;
}
-
-void pkgCdromTextStatus::Update(string text, int current)
+
+void pkgCdromTextStatus::Update(string text, int current)
{
if(text.size() > 0)
cout << text << flush;
}
-bool pkgCdromTextStatus::ChangeCdrom()
+bool pkgCdromTextStatus::ChangeCdrom()
{
Prompt(_("Please insert a Disc in the drive and press enter"));
return true;
}
-OpProgress* pkgCdromTextStatus::GetOpProgress()
-{
- return &Progress;
-};
+OpProgress* pkgCdromTextStatus::GetOpProgress()
+{
+ return &Progress;
+}
/*}}}*/
// SetupAutoDetect /*{{{*/
bool AutoDetectCdrom(pkgUdevCdromDevices &UdevCdroms, unsigned int &i, bool &automounted)
diff --git a/ftparchive/override.cc b/ftparchive/override.cc
index d2130db8a..82cbc4c19 100644
--- a/ftparchive/override.cc
+++ b/ftparchive/override.cc
@@ -201,7 +201,7 @@ bool Override::ReadExtraOverride(string const &File,bool const &Source)
}
/*}}}*/
-// Override::GetItem - Get a architecture specific item /*{{{*/
+// Override::GetItem - Get a architecture specific item /*{{{*/
// ---------------------------------------------------------------------
/* Returns a override item for the given package and the given architecture.
* Treats "all" special
@@ -232,10 +232,10 @@ Override::Item* Override::GetItem(string const &Package, string const &Architect
{
result->FieldOverride[foI->first] = foI->second;
}
- }
- }
+ }
+ }
return result;
-};
+}
// Override::Item::SwapMaint - Swap the maintainer field if necessary /*{{{*/
diff --git a/methods/cdrom.cc b/methods/cdrom.cc
index 22d4b9164..3c14d9dfb 100644
--- a/methods/cdrom.cc
+++ b/methods/cdrom.cc
@@ -62,7 +62,7 @@ CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly |
MountedByApt(false)
{
UdevCdroms.Dlopen();
-};
+}
/*}}}*/
// CDROMMethod::Exit - Unmount the disc if necessary /*{{{*/
// ---------------------------------------------------------------------
diff --git a/methods/http.cc b/methods/http.cc
index 42b31beeb..16c6d19e1 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -61,7 +61,7 @@ unsigned long long CircleBuf::BwReadLimit=0;
unsigned long long CircleBuf::BwTickReadData=0;
struct timeval CircleBuf::BwReadTick={0,0};
const unsigned int CircleBuf::BW_HZ=10;
-
+
// CircleBuf::CircleBuf - Circular input buffer /*{{{*/
// ---------------------------------------------------------------------
/* */
@@ -87,8 +87,8 @@ void CircleBuf::Reset()
{
delete Hash;
Hash = new Hashes;
- }
-};
+ }
+}
/*}}}*/
// CircleBuf::Read - Read from a FD into the circular buffer /*{{{*/
// ---------------------------------------------------------------------
diff --git a/methods/https.cc b/methods/https.cc
index febe6a0f0..b0c7ee71d 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -432,7 +432,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
delete File;
return true;
-};
+}
int main()
{
diff --git a/methods/mirror.cc b/methods/mirror.cc
index 085f3717b..977eddcf5 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -60,7 +60,7 @@ using namespace std;
MirrorMethod::MirrorMethod()
: HttpMethod(), DownloadedMirrorFile(false), Debug(false)
{
-};
+}
// HttpMethod::Configuration - Handle a configuration message /*{{{*/
// ---------------------------------------------------------------------
@@ -90,17 +90,17 @@ bool MirrorMethod::Clean(string Dir)
pkgSourceList list;
list.ReadMainList();
- DIR *D = opendir(Dir.c_str());
+ DIR *D = opendir(Dir.c_str());
if (D == 0)
return _error->Errno("opendir",_("Unable to read %s"),Dir.c_str());
-
+
string StartDir = SafeGetCWD();
if (chdir(Dir.c_str()) != 0)
{
closedir(D);
return _error->Errno("chdir",_("Unable to change to %s"),Dir.c_str());
}
-
+
for (struct dirent *Dir = readdir(D); Dir != 0; Dir = readdir(D))
{
// Skip some files..
@@ -123,23 +123,23 @@ bool MirrorMethod::Clean(string Dir)
// nothing found, nuke it
if (I == list.end())
unlink(Dir->d_name);
- };
+ }
closedir(D);
if (chdir(StartDir.c_str()) != 0)
return _error->Errno("chdir",_("Unable to change to %s"),StartDir.c_str());
- return true;
+ return true;
}
bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str)
{
- // not that great to use pkgAcquire here, but we do not have
+ // not that great to use pkgAcquire here, but we do not have
// any other way right now
string fetch = BaseUri;
fetch.replace(0,strlen("mirror://"),"http://");
-#if 0 // no need for this, the getArchitectures() will also include the main
+#if 0 // no need for this, the getArchitectures() will also include the main
// arch
// append main architecture
fetch += "?arch=" + _config->Find("Apt::Architecture");
@@ -173,7 +173,7 @@ bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str)
if(Debug)
clog << "MirrorMethod::DownloadMirrorFile() success: " << res << endl;
-
+
return res;
}
@@ -187,13 +187,13 @@ bool MirrorMethod::RandomizeMirrorFile(string mirror_file)
if (!FileExists(mirror_file))
return false;
- // read
+ // read
ifstream in(mirror_file.c_str());
while ( !in.eof() ) {
getline(in, line);
content.push_back(line);
}
-
+
// we want the file to be random for each different machine, but also
// "stable" on the same machine. this is to avoid running into out-of-sync
// issues (i.e. Release/Release.gpg different on each mirror)
@@ -422,10 +422,10 @@ bool MirrorMethod::Fetch(FetchItem *Itm)
if(Debug)
clog << "Fetch: " << Itm->Uri << endl << endl;
-
+
// now run the real fetcher
return HttpMethod::Fetch(Itm);
-};
+}
void MirrorMethod::Fail(string Err,bool Transient)
{
@@ -437,7 +437,7 @@ void MirrorMethod::Fail(string Err,bool Transient)
// try the next mirror on fail (if its not a expected failure,
// e.g. translations are ok to ignore)
- if (!Queue->FailIgnore && TryNextMirror())
+ if (!Queue->FailIgnore && TryNextMirror())
return;
// all mirrors failed, so bail out
diff --git a/methods/rsh.cc b/methods/rsh.cc
index 550f77eca..f065f6b89 100644
--- a/methods/rsh.cc
+++ b/methods/rsh.cc
@@ -368,7 +368,7 @@ RSHMethod::RSHMethod() : pkgAcqMethod("1.0",SendConfig)
signal(SIGINT,SigTerm);
Server = 0;
FailFd = -1;
-};
+}
/*}}}*/
// RSHMethod::Configuration - Handle a configuration message /*{{{*/
// ---------------------------------------------------------------------
diff --git a/methods/server.cc b/methods/server.cc
index ef90c809c..90e83d1af 100644
--- a/methods/server.cc
+++ b/methods/server.cc
@@ -119,10 +119,10 @@ bool ServerState::HeaderLine(string Line)
string::size_type Pos2 = Pos;
while (Pos2 < Line.length() && isspace(Line[Pos2]) != 0)
Pos2++;
-
+
string Tag = string(Line,0,Pos);
string Val = string(Line,Pos2);
-
+
if (stringcasecmp(Tag.c_str(),Tag.c_str()+4,"HTTP") == 0)
{
// Evil servers return no version
@@ -159,14 +159,14 @@ bool ServerState::HeaderLine(string Line)
}
return true;
- }
-
+ }
+
if (stringcasecmp(Tag,"Content-Length:") == 0)
{
if (Encoding == Closes)
Encoding = Stream;
HaveContent = true;
-
+
// The length is already set from the Content-Range header
if (StartPos != 0)
return true;
@@ -184,7 +184,7 @@ bool ServerState::HeaderLine(string Line)
HaveContent = true;
return true;
}
-
+
if (stringcasecmp(Tag,"Content-Range:") == 0)
{
HaveContent = true;
@@ -201,12 +201,12 @@ bool ServerState::HeaderLine(string Line)
return _error->Error(_("This HTTP server has broken range support"));
return true;
}
-
+
if (stringcasecmp(Tag,"Transfer-Encoding:") == 0)
{
HaveContent = true;
if (stringcasecmp(Val,"chunked") == 0)
- Encoding = Chunked;
+ Encoding = Chunked;
return true;
}
@@ -218,7 +218,7 @@ bool ServerState::HeaderLine(string Line)
Persistent = true;
return true;
}
-
+
if (stringcasecmp(Tag,"Last-Modified:") == 0)
{
if (RFC1123StrToTime(Val.c_str(), Date) == false)
@@ -413,7 +413,7 @@ bool ServerMethod::Fetch(FetchItem *)
}
return true;
-};
+}
/*}}}*/
// ServerMethod::Loop - Main loop /*{{{*/
int ServerMethod::Loop()
diff --git a/methods/server.h b/methods/server.h
index 2b81e6173..f1db9adf7 100644
--- a/methods/server.h
+++ b/methods/server.h
@@ -62,7 +62,7 @@ struct ServerState
/** \brief IO error while retrieving */
RUN_HEADERS_IO_ERROR,
/** \brief Parse error after retrieving */
- RUN_HEADERS_PARSE_ERROR,
+ RUN_HEADERS_PARSE_ERROR
};
/** \brief Get the headers before the data */
RunHeadersResult RunHeaders(FileFd * const File);
--
cgit v1.2.3-70-g09d2
From c3ccac9232c2684b15f75fa8622a9a290aeca123 Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Thu, 27 Feb 2014 03:11:54 +0100
Subject: warning: no previous declaration for foobar()
[-Wmissing-declarations]
Git-Dch: Ignore
Reported-By: gcc -Wmissing-declarations
---
apt-pkg/depcache.cc | 2 +-
apt-private/private-cmndline.cc | 14 ++++-----
apt-private/private-download.cc | 1 +
apt-private/private-install.cc | 2 +-
apt-private/private-list.cc | 2 +-
apt-private/private-moo.cc | 4 +--
apt-private/private-output.cc | 16 +++++-----
apt-private/private-show.cc | 3 +-
apt-private/private-update.cc | 1 +
cmdline/apt-cache.cc | 48 +++++++++++++++---------------
cmdline/apt-cdrom.cc | 8 ++---
cmdline/apt-config.cc | 6 ++--
cmdline/apt-dump-solver.cc | 2 +-
cmdline/apt-extracttemplates.cc | 8 ++---
cmdline/apt-get.cc | 36 +++++++++++-----------
cmdline/apt-helper.cc | 4 +--
cmdline/apt-internal-solver.cc | 2 +-
cmdline/apt-mark.cc | 12 ++++----
cmdline/apt-sortpkgs.cc | 4 +--
cmdline/apt.cc | 2 +-
debian/libapt-pkg4.12.symbols | 1 -
ftparchive/apt-ftparchive.cc | 18 +++++------
test/interactive-helper/aptwebserver.cc | 30 +++++++++----------
test/interactive-helper/extract-control.cc | 2 +-
test/interactive-helper/testdeb.cc | 2 +-
test/libapt/assert.h | 9 ++++++
test/libapt/compareversion_test.cc | 6 ++--
test/libapt/sourcelist_test.cc | 2 +-
test/libapt/tagfile_test.cc | 2 +-
29 files changed, 130 insertions(+), 119 deletions(-)
(limited to 'cmdline')
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 90d0c9314..946c1e254 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -889,7 +889,7 @@ bool pkgDepCache::IsDeleteOkProtectInstallRequests(PkgIterator const &Pkg,
and prevents mode changes for packages on hold for example.
If you want to check Mode specific stuff you can use the virtual public
IsOk methods instead */
-char const* PrintMode(char const mode)
+static char const* PrintMode(char const mode)
{
switch (mode)
{
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc
index b99443210..132da04d5 100644
--- a/apt-private/private-cmndline.cc
+++ b/apt-private/private-cmndline.cc
@@ -14,7 +14,7 @@
#include
/*}}}*/
-bool strcmp_match_in_list(char const * const Cmd, ...) /*{{{*/
+static bool strcmp_match_in_list(char const * const Cmd, ...) /*{{{*/
{
va_list args;
bool found = false;
@@ -33,7 +33,7 @@ bool strcmp_match_in_list(char const * const Cmd, ...) /*{{{*/
/*}}}*/
#define addArg(w,x,y,z) Args.push_back(CommandLine::MakeArgs(w,x,y,z))
#define CmdMatches(...) strcmp_match_in_list(Cmd, __VA_ARGS__, NULL)
-bool addArgumentsAPTCache(std::vector &Args, char const * const Cmd)/*{{{*/
+static bool addArgumentsAPTCache(std::vector &Args, char const * const Cmd)/*{{{*/
{
if (CmdMatches("depends", "rdepends", "xvcg", "dotty"))
{
@@ -82,7 +82,7 @@ bool addArgumentsAPTCache(std::vector &Args, char const * con
return true;
}
/*}}}*/
-bool addArgumentsAPTCDROM(std::vector &Args, char const * const Cmd)/*{{{*/
+static bool addArgumentsAPTCDROM(std::vector &Args, char const * const Cmd)/*{{{*/
{
if (CmdMatches("add", "ident") == false)
return false;
@@ -100,7 +100,7 @@ bool addArgumentsAPTCDROM(std::vector &Args, char const * con
return true;
}
/*}}}*/
-bool addArgumentsAPTConfig(std::vector &Args, char const * const Cmd)/*{{{*/
+static bool addArgumentsAPTConfig(std::vector &Args, char const * const Cmd)/*{{{*/
{
if (CmdMatches("dump"))
{
@@ -115,7 +115,7 @@ bool addArgumentsAPTConfig(std::vector &Args, char const * co
return true;
}
/*}}}*/
-bool addArgumentsAPTGet(std::vector &Args, char const * const Cmd)/*{{{*/
+static bool addArgumentsAPTGet(std::vector &Args, char const * const Cmd)/*{{{*/
{
if (CmdMatches("install", "remove", "purge", "upgrade", "dist-upgrade",
"dselect-upgrade", "autoremove"))
@@ -202,7 +202,7 @@ bool addArgumentsAPTGet(std::vector &Args, char const * const
return true;
}
/*}}}*/
-bool addArgumentsAPTMark(std::vector &Args, char const * const Cmd)/*{{{*/
+static bool addArgumentsAPTMark(std::vector &Args, char const * const Cmd)/*{{{*/
{
if (CmdMatches("auto", "manual", "hold", "unhold", "showauto",
"showmanual", "showhold", "showholds", "install",
@@ -222,7 +222,7 @@ bool addArgumentsAPTMark(std::vector &Args, char const * cons
return true;
}
/*}}}*/
-bool addArgumentsAPT(std::vector &Args, char const * const Cmd)/*{{{*/
+static bool addArgumentsAPT(std::vector &Args, char const * const Cmd)/*{{{*/
{
if (CmdMatches("list"))
{
diff --git a/apt-private/private-download.cc b/apt-private/private-download.cc
index f02991cde..80795f964 100644
--- a/apt-private/private-download.cc
+++ b/apt-private/private-download.cc
@@ -8,6 +8,7 @@
#include
#include "private-output.h"
+#include "private-download.h"
#include
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc
index 3adb00b23..ff609f567 100644
--- a/apt-private/private-install.cc
+++ b/apt-private/private-install.cc
@@ -386,7 +386,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety)
// DoAutomaticRemove - Remove all automatic unused packages /*{{{*/
// ---------------------------------------------------------------------
/* Remove unused automatic packages */
-bool DoAutomaticRemove(CacheFile &Cache)
+static bool DoAutomaticRemove(CacheFile &Cache)
{
bool Debug = _config->FindI("Debug::pkgAutoRemove",false);
bool doAutoRemove = _config->FindB("APT::Get::AutomaticRemove", false);
diff --git a/apt-private/private-list.cc b/apt-private/private-list.cc
index 44a766c84..bc4539aeb 100644
--- a/apt-private/private-list.cc
+++ b/apt-private/private-list.cc
@@ -99,7 +99,7 @@ private:
#undef PackageMatcher
};
/*}}}*/
-void ListAllVersions(pkgCacheFile &CacheFile, pkgRecords &records, /*{{{*/
+static void ListAllVersions(pkgCacheFile &CacheFile, pkgRecords &records,/*{{{*/
pkgCache::PkgIterator P,
std::ostream &outs,
bool include_summary=true)
diff --git a/apt-private/private-moo.cc b/apt-private/private-moo.cc
index 23255db6f..5d247041d 100644
--- a/apt-private/private-moo.cc
+++ b/apt-private/private-moo.cc
@@ -22,7 +22,7 @@
#include
/*}}}*/
-std::string getMooLine() { /*{{{*/
+static std::string getMooLine() { /*{{{*/
time_t const timenow = time(NULL);
struct tm special;
localtime_r(&timenow, &special);
@@ -60,7 +60,7 @@ std::string getMooLine() { /*{{{*/
return out.str();
}
/*}}}*/
-bool printMooLine() { /*{{{*/
+static bool printMooLine() { /*{{{*/
std::cerr << getMooLine() << std::endl;
return true;
}
diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc
index 420ca14d5..dec518392 100644
--- a/apt-private/private-output.cc
+++ b/apt-private/private-output.cc
@@ -63,7 +63,7 @@ bool InitOutput() /*{{{*/
return true;
}
/*}}}*/
-std::string GetArchiveSuite(pkgCacheFile &CacheFile, pkgCache::VerIterator ver) /*{{{*/
+static std::string GetArchiveSuite(pkgCacheFile &CacheFile, pkgCache::VerIterator ver) /*{{{*/
{
std::string suite = "";
if (ver && ver.FileList() && ver.FileList())
@@ -82,7 +82,7 @@ std::string GetArchiveSuite(pkgCacheFile &CacheFile, pkgCache::VerIterator ver)
return suite;
}
/*}}}*/
-std::string GetFlagsStr(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
+static std::string GetFlagsStr(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
{
pkgDepCache *DepCache = CacheFile.GetDepCache();
pkgDepCache::StateCache &state = (*DepCache)[P];
@@ -99,7 +99,7 @@ std::string GetFlagsStr(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
return flags_str;
}
/*}}}*/
-std::string GetCandidateVersion(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
+static std::string GetCandidateVersion(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
{
pkgPolicy *policy = CacheFile.GetPolicy();
pkgCache::VerIterator cand = policy->GetCandidateVer(P);
@@ -107,14 +107,14 @@ std::string GetCandidateVersion(pkgCacheFile &CacheFile, pkgCache::PkgIterator P
return cand ? cand.VerStr() : "(none)";
}
/*}}}*/
-std::string GetInstalledVersion(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
+static std::string GetInstalledVersion(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
{
pkgCache::VerIterator inst = P.CurrentVer();
return inst ? inst.VerStr() : "(none)";
}
/*}}}*/
-std::string GetVersion(pkgCacheFile &CacheFile, pkgCache::VerIterator V)/*{{{*/
+static std::string GetVersion(pkgCacheFile &CacheFile, pkgCache::VerIterator V)/*{{{*/
{
pkgCache::PkgIterator P = V.ParentPkg();
if (V == P.CurrentVer())
@@ -134,16 +134,16 @@ std::string GetVersion(pkgCacheFile &CacheFile, pkgCache::VerIterator V)/*{{{*/
return "(none)";
}
/*}}}*/
-std::string GetArchitecture(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
+static std::string GetArchitecture(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
{
pkgPolicy *policy = CacheFile.GetPolicy();
pkgCache::VerIterator inst = P.CurrentVer();
pkgCache::VerIterator cand = policy->GetCandidateVer(P);
-
+
return inst ? inst.Arch() : cand.Arch();
}
/*}}}*/
-std::string GetShortDescription(pkgCacheFile &CacheFile, pkgRecords &records, pkgCache::PkgIterator P)/*{{{*/
+static std::string GetShortDescription(pkgCacheFile &CacheFile, pkgRecords &records, pkgCache::PkgIterator P)/*{{{*/
{
pkgPolicy *policy = CacheFile.GetPolicy();
diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc
index 0a69debbf..94f944af1 100644
--- a/apt-private/private-show.cc
+++ b/apt-private/private-show.cc
@@ -24,6 +24,7 @@
#include "private-output.h"
#include "private-cacheset.h"
+#include "private-show.h"
/*}}}*/
namespace APT {
@@ -31,7 +32,7 @@ namespace APT {
// DisplayRecord - Displays the complete record for the package /*{{{*/
// ---------------------------------------------------------------------
-bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V,
+static bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V,
ostream &out)
{
pkgCache *Cache = CacheFile.GetPkgCache();
diff --git a/apt-private/private-update.cc b/apt-private/private-update.cc
index f6c12c26a..1f6fb6f79 100644
--- a/apt-private/private-update.cc
+++ b/apt-private/private-update.cc
@@ -31,6 +31,7 @@
#include "private-cachefile.h"
#include "private-output.h"
+#include "private-update.h"
#include "acqprogress.h"
#include
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 22778eb24..7e569f2fc 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -58,7 +58,7 @@ using namespace std;
// LocalitySort - Sort a version list by package file locality /*{{{*/
// ---------------------------------------------------------------------
/* */
-int LocalityCompare(const void *a, const void *b)
+static int LocalityCompare(const void *a, const void *b)
{
pkgCache::VerFile *A = *(pkgCache::VerFile **)a;
pkgCache::VerFile *B = *(pkgCache::VerFile **)b;
@@ -75,13 +75,13 @@ int LocalityCompare(const void *a, const void *b)
return A->File - B->File;
}
-void LocalitySort(pkgCache::VerFile **begin,
+static void LocalitySort(pkgCache::VerFile **begin,
unsigned long Count,size_t Size)
{
qsort(begin,Count,Size,LocalityCompare);
}
-void LocalitySort(pkgCache::DescFile **begin,
+static void LocalitySort(pkgCache::DescFile **begin,
unsigned long Count,size_t Size)
{
qsort(begin,Count,Size,LocalityCompare);
@@ -90,7 +90,7 @@ void LocalitySort(pkgCache::DescFile **begin,
// UnMet - Show unmet dependencies /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool ShowUnMet(pkgCache::VerIterator const &V, bool const Important)
+static bool ShowUnMet(pkgCache::VerIterator const &V, bool const Important)
{
bool Header = false;
for (pkgCache::DepIterator D = V.DependsList(); D.end() == false;)
@@ -163,7 +163,7 @@ bool ShowUnMet(pkgCache::VerIterator const &V, bool const Important)
}
return true;
}
-bool UnMet(CommandLine &CmdL)
+static bool UnMet(CommandLine &CmdL)
{
bool const Important = _config->FindB("APT::Cache::Important",false);
@@ -193,7 +193,7 @@ bool UnMet(CommandLine &CmdL)
// DumpPackage - Show a dump of a package record /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool DumpPackage(CommandLine &CmdL)
+static bool DumpPackage(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
APT::CacheSetHelper helper(true, GlobalError::NOTICE);
@@ -258,7 +258,7 @@ bool DumpPackage(CommandLine &CmdL)
// Stats - Dump some nice statistics /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool Stats(CommandLine &Cmd)
+static bool Stats(CommandLine &Cmd)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -371,7 +371,7 @@ bool Stats(CommandLine &Cmd)
// Dump - show everything /*{{{*/
// ---------------------------------------------------------------------
/* This is worthless except fer debugging things */
-bool Dump(CommandLine &Cmd)
+static bool Dump(CommandLine &Cmd)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -423,7 +423,7 @@ bool Dump(CommandLine &Cmd)
// ---------------------------------------------------------------------
/* This is needed to make dpkg --merge happy.. I spent a bit of time to
make this run really fast, perhaps I went a little overboard.. */
-bool DumpAvail(CommandLine &Cmd)
+static bool DumpAvail(CommandLine &Cmd)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -562,7 +562,7 @@ bool DumpAvail(CommandLine &Cmd)
}
/*}}}*/
// ShowDepends - Helper for printing out a dependency tree /*{{{*/
-bool ShowDepends(CommandLine &CmdL, bool const RevDepends)
+static bool ShowDepends(CommandLine &CmdL, bool const RevDepends)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -676,7 +676,7 @@ bool ShowDepends(CommandLine &CmdL, bool const RevDepends)
// Depends - Print out a dependency tree /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool Depends(CommandLine &CmdL)
+static bool Depends(CommandLine &CmdL)
{
return ShowDepends(CmdL, false);
}
@@ -684,7 +684,7 @@ bool Depends(CommandLine &CmdL)
// RDepends - Print out a reverse dependency tree /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool RDepends(CommandLine &CmdL)
+static bool RDepends(CommandLine &CmdL)
{
return ShowDepends(CmdL, true);
}
@@ -693,7 +693,7 @@ bool RDepends(CommandLine &CmdL)
// ---------------------------------------------------------------------
// Code contributed from Junichi Uekawa on 20 June 2002.
-bool XVcg(CommandLine &CmdL)
+static bool XVcg(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -905,7 +905,7 @@ bool XVcg(CommandLine &CmdL)
/* Dotty is the graphvis program for generating graphs. It is a fairly
simple queuing algorithm that just writes dependencies and nodes.
http://www.research.att.com/sw/tools/graphviz/ */
-bool Dotty(CommandLine &CmdL)
+static bool Dotty(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -1126,7 +1126,7 @@ static unsigned char const* skipDescriptionFields(unsigned char const * DescP)
++DescP;
return DescP;
}
-bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V)
+static bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V)
{
pkgCache *Cache = CacheFile.GetPkgCache();
if (unlikely(Cache == NULL))
@@ -1228,7 +1228,7 @@ struct ExDescFile
// Search - Perform a search /*{{{*/
// ---------------------------------------------------------------------
/* This searches the package names and package descriptions for a pattern */
-bool Search(CommandLine &CmdL)
+static bool Search(CommandLine &CmdL)
{
bool const ShowFull = _config->FindB("APT::Cache::ShowFull",false);
bool const NamesOnly = _config->FindB("APT::Cache::NamesOnly",false);
@@ -1388,7 +1388,7 @@ bool Search(CommandLine &CmdL)
}
/*}}}*/
/* ShowAuto - show automatically installed packages (sorted) {{{*/
-bool ShowAuto(CommandLine &CmdL)
+static bool ShowAuto(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -1415,7 +1415,7 @@ bool ShowAuto(CommandLine &CmdL)
// ShowPackage - Dump the package record to the screen /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool ShowPackage(CommandLine &CmdL)
+static bool ShowPackage(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
CacheSetHelperVirtuals helper(true, GlobalError::NOTICE);
@@ -1439,7 +1439,7 @@ bool ShowPackage(CommandLine &CmdL)
// ShowPkgNames - Show package names /*{{{*/
// ---------------------------------------------------------------------
/* This does a prefix match on the first argument */
-bool ShowPkgNames(CommandLine &CmdL)
+static bool ShowPkgNames(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
if (unlikely(CacheFile.BuildCaches(NULL, false) == false))
@@ -1478,7 +1478,7 @@ bool ShowPkgNames(CommandLine &CmdL)
// ShowSrcPackage - Show source package records /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool ShowSrcPackage(CommandLine &CmdL)
+static bool ShowSrcPackage(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
pkgSourceList *List = CacheFile.GetSourceList();
@@ -1515,7 +1515,7 @@ bool ShowSrcPackage(CommandLine &CmdL)
// Policy - Show the results of the preferences file /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool Policy(CommandLine &CmdL)
+static bool Policy(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -1644,7 +1644,7 @@ bool Policy(CommandLine &CmdL)
// Madison - Look a bit like katie's madison /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool Madison(CommandLine &CmdL)
+static bool Madison(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
pkgSourceList *SrcList = CacheFile.GetSourceList();
@@ -1717,7 +1717,7 @@ bool Madison(CommandLine &CmdL)
// GenCaches - Call the main cache generator /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool GenCaches(CommandLine &Cmd)
+static bool GenCaches(CommandLine &Cmd)
{
OpTextProgress Progress(*_config);
@@ -1728,7 +1728,7 @@ bool GenCaches(CommandLine &Cmd)
// ShowHelp - Show a help screen /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool ShowHelp(CommandLine &Cmd)
+static bool ShowHelp(CommandLine &Cmd)
{
ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc
index 9aaebefd7..dc0e050c3 100644
--- a/cmdline/apt-cdrom.cc
+++ b/cmdline/apt-cdrom.cc
@@ -111,7 +111,7 @@ OpProgress* pkgCdromTextStatus::GetOpProgress()
}
/*}}}*/
// SetupAutoDetect /*{{{*/
-bool AutoDetectCdrom(pkgUdevCdromDevices &UdevCdroms, unsigned int &i, bool &automounted)
+static bool AutoDetectCdrom(pkgUdevCdromDevices &UdevCdroms, unsigned int &i, bool &automounted)
{
bool Debug = _config->FindB("Debug::Acquire::cdrom", false);
@@ -155,7 +155,7 @@ bool AutoDetectCdrom(pkgUdevCdromDevices &UdevCdroms, unsigned int &i, bool &aut
sequence is to mount/umount the CD, Ident it then scan it for package
files and reduce that list. Then we copy over the package files and
verify them. Then rewrite the database files */
-bool DoAdd(CommandLine &)
+static bool DoAdd(CommandLine &)
{
pkgUdevCdromDevices UdevCdroms;
pkgCdromTextStatus log;
@@ -201,7 +201,7 @@ bool DoAdd(CommandLine &)
// DoIdent - Ident a CDROM /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool DoIdent(CommandLine &)
+static bool DoIdent(CommandLine &)
{
pkgUdevCdromDevices UdevCdroms;
string ident;
@@ -247,7 +247,7 @@ bool DoIdent(CommandLine &)
// ShowHelp - Show the help screen /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool ShowHelp(CommandLine &)
+static bool ShowHelp(CommandLine &)
{
ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc
index 9f20b3c1b..e83c4b64b 100644
--- a/cmdline/apt-config.cc
+++ b/cmdline/apt-config.cc
@@ -40,7 +40,7 @@ using namespace std;
// DoShell - Handle the shell command /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool DoShell(CommandLine &CmdL)
+static bool DoShell(CommandLine &CmdL)
{
for (const char **I = CmdL.FileList + 1; *I != 0; I += 2)
{
@@ -63,7 +63,7 @@ bool DoShell(CommandLine &CmdL)
// DoDump - Dump the configuration space /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool DoDump(CommandLine &CmdL)
+static bool DoDump(CommandLine &CmdL)
{
bool const empty = _config->FindB("APT::Config::Dump::EmptyValue", true);
std::string const format = _config->Find("APT::Config::Dump::Format", "%f \"%v\";\n");
@@ -78,7 +78,7 @@ bool DoDump(CommandLine &CmdL)
// ShowHelp - Show the help screen /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool ShowHelp(CommandLine &CmdL)
+static bool ShowHelp(CommandLine &CmdL)
{
ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
diff --git a/cmdline/apt-dump-solver.cc b/cmdline/apt-dump-solver.cc
index aa16b1271..c26cdc70a 100644
--- a/cmdline/apt-dump-solver.cc
+++ b/cmdline/apt-dump-solver.cc
@@ -18,7 +18,7 @@
// ShowHelp - Show a help screen /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool ShowHelp() {
+static bool ShowHelp() {
std::cout <<
PACKAGE " " PACKAGE_VERSION " for " COMMON_ARCH " compiled on " __DATE__ " " __TIME__ << std::endl <<
diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc
index 2408a7d9d..2b01968e3 100644
--- a/cmdline/apt-extracttemplates.cc
+++ b/cmdline/apt-extracttemplates.cc
@@ -212,7 +212,7 @@ bool DebFile::ParseInfo()
// ShowHelp - show a short help text /*{{{*/
// ---------------------------------------------------------------------
/* */
-int ShowHelp(void)
+static int ShowHelp(void)
{
ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
@@ -237,7 +237,7 @@ int ShowHelp(void)
// WriteFile - write the contents of the passed string to a file /*{{{*/
// ---------------------------------------------------------------------
/* */
-string WriteFile(const char *package, const char *prefix, const char *data)
+static string WriteFile(const char *package, const char *prefix, const char *data)
{
char fn[512];
static int i;
@@ -265,7 +265,7 @@ string WriteFile(const char *package, const char *prefix, const char *data)
// WriteConfig - write out the config data from a debian package file /*{{{*/
// ---------------------------------------------------------------------
/* */
-void WriteConfig(const DebFile &file)
+static void WriteConfig(const DebFile &file)
{
string templatefile = WriteFile(file.Package.c_str(), "template", file.Template);
string configscript = WriteFile(file.Package.c_str(), "config", file.Config);
@@ -279,7 +279,7 @@ void WriteConfig(const DebFile &file)
// InitCache - initialize the package cache /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool Go(CommandLine &CmdL)
+static bool Go(CommandLine &CmdL)
{
// Initialize the apt cache
MMap *Map = 0;
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index f8de80a91..253b2f4a5 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -97,7 +97,7 @@ using namespace std;
// ---------------------------------------------------------------------
/* This used to be inlined in DoInstall, but with the advent of regex package
name matching it was split out.. */
-bool TryToInstallBuildDep(pkgCache::PkgIterator Pkg,pkgCacheFile &Cache,
+static bool TryToInstallBuildDep(pkgCache::PkgIterator Pkg,pkgCacheFile &Cache,
pkgProblemResolver &Fix,bool Remove,bool BrokenFix,
bool AllowFail = true)
{
@@ -138,7 +138,7 @@ bool TryToInstallBuildDep(pkgCache::PkgIterator Pkg,pkgCacheFile &Cache,
// helper that can go wit hthe next ABI break
#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR < 13)
-std::string MetaIndexFileNameOnDisk(metaIndex *metaindex)
+static std::string MetaIndexFileNameOnDisk(metaIndex *metaindex)
{
// FIXME: this cast is the horror, the horror
debReleaseIndex *r = (debReleaseIndex*)metaindex;
@@ -159,7 +159,7 @@ std::string MetaIndexFileNameOnDisk(metaIndex *metaindex)
// GetReleaseForSourceRecord - Return Suite for the given srcrecord /*{{{*/
// ---------------------------------------------------------------------
/* */
-std::string GetReleaseForSourceRecord(pkgSourceList *SrcList,
+static std::string GetReleaseForSourceRecord(pkgSourceList *SrcList,
pkgSrcRecords::Parser *Parse)
{
// try to find release
@@ -194,7 +194,7 @@ std::string GetReleaseForSourceRecord(pkgSourceList *SrcList,
// FindSrc - Find a source record /*{{{*/
// ---------------------------------------------------------------------
/* */
-pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
+static pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
pkgSrcRecords &SrcRecs,string &Src,
CacheFile &CacheFile)
{
@@ -430,7 +430,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
}
/*}}}*/
/* mark packages as automatically/manually installed. {{{*/
-bool DoMarkAuto(CommandLine &CmdL)
+static bool DoMarkAuto(CommandLine &CmdL)
{
bool Action = true;
int AutoMarkChanged = 0;
@@ -475,7 +475,7 @@ bool DoMarkAuto(CommandLine &CmdL)
// DoDSelectUpgrade - Do an upgrade by following dselects selections /*{{{*/
// ---------------------------------------------------------------------
/* Follows dselect's selections */
-bool DoDSelectUpgrade(CommandLine &CmdL)
+static bool DoDSelectUpgrade(CommandLine &CmdL)
{
CacheFile Cache;
if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false)
@@ -551,7 +551,7 @@ bool DoDSelectUpgrade(CommandLine &CmdL)
// DoClean - Remove download archives /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool DoClean(CommandLine &CmdL)
+static bool DoClean(CommandLine &CmdL)
{
std::string const archivedir = _config->FindDir("Dir::Cache::archives");
std::string const pkgcache = _config->FindFile("Dir::cache::pkgcache");
@@ -599,7 +599,7 @@ class LogCleaner : public pkgArchiveCleaner
};
};
-bool DoAutoClean(CommandLine &CmdL)
+static bool DoAutoClean(CommandLine &CmdL)
{
// Lock the archive directory
FileFd Lock;
@@ -623,7 +623,7 @@ bool DoAutoClean(CommandLine &CmdL)
/*}}}*/
// DoDownload - download a binary /*{{{*/
// ---------------------------------------------------------------------
-bool DoDownload(CommandLine &CmdL)
+static bool DoDownload(CommandLine &CmdL)
{
CacheFile Cache;
if (Cache.ReadOnlyOpen() == false)
@@ -696,7 +696,7 @@ bool DoDownload(CommandLine &CmdL)
// ---------------------------------------------------------------------
/* Opening automatically checks the system, this command is mostly used
for debugging */
-bool DoCheck(CommandLine &CmdL)
+static bool DoCheck(CommandLine &CmdL)
{
CacheFile Cache;
Cache.Open();
@@ -715,7 +715,7 @@ struct DscFile
string Dsc;
};
-bool DoSource(CommandLine &CmdL)
+static bool DoSource(CommandLine &CmdL)
{
CacheFile Cache;
if (Cache.Open(false) == false)
@@ -1016,7 +1016,7 @@ bool DoSource(CommandLine &CmdL)
// ---------------------------------------------------------------------
/* This function will look at the build depends list of the given source
package and install the necessary packages to make it true, or fail. */
-bool DoBuildDep(CommandLine &CmdL)
+static bool DoBuildDep(CommandLine &CmdL)
{
CacheFile Cache;
@@ -1410,7 +1410,7 @@ bool DoBuildDep(CommandLine &CmdL)
* pool/ next to the deb itself)
* Example return: "pool/main/a/apt/apt_0.8.8ubuntu3"
*/
-string GetChangelogPath(CacheFile &Cache,
+static string GetChangelogPath(CacheFile &Cache,
pkgCache::PkgIterator Pkg,
pkgCache::VerIterator Ver)
{
@@ -1437,7 +1437,7 @@ string GetChangelogPath(CacheFile &Cache,
* apt-get changelog mplayer-doc:
* http://packages.medibuntu.org/pool/non-free/m/mplayer/mplayer_1.0~rc4~try1.dsfg1-1ubuntu1+medibuntu1.changelog
*/
-bool GuessThirdPartyChangelogUri(CacheFile &Cache,
+static bool GuessThirdPartyChangelogUri(CacheFile &Cache,
pkgCache::PkgIterator Pkg,
pkgCache::VerIterator Ver,
string &out_uri)
@@ -1462,7 +1462,7 @@ bool GuessThirdPartyChangelogUri(CacheFile &Cache,
/*}}}*/
// DownloadChangelog - Download the changelog /*{{{*/
// ---------------------------------------------------------------------
-bool DownloadChangelog(CacheFile &CacheFile, pkgAcquire &Fetcher,
+static bool DownloadChangelog(CacheFile &CacheFile, pkgAcquire &Fetcher,
pkgCache::VerIterator Ver, string targetfile)
/* Download a changelog file for the given package version to
* targetfile. This will first try the server from Apt::Changelogs::Server
@@ -1517,7 +1517,7 @@ bool DownloadChangelog(CacheFile &CacheFile, pkgAcquire &Fetcher,
/*}}}*/
// DoChangelog - Get changelog from the command line /*{{{*/
// ---------------------------------------------------------------------
-bool DoChangelog(CommandLine &CmdL)
+static bool DoChangelog(CommandLine &CmdL)
{
CacheFile Cache;
if (Cache.ReadOnlyOpen() == false)
@@ -1581,7 +1581,7 @@ bool DoChangelog(CommandLine &CmdL)
// ShowHelp - Show a help screen /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool ShowHelp(CommandLine &CmdL)
+static bool ShowHelp(CommandLine &CmdL)
{
ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
@@ -1677,7 +1677,7 @@ bool ShowHelp(CommandLine &CmdL)
// SigWinch - Window size change signal handler /*{{{*/
// ---------------------------------------------------------------------
/* */
-void SigWinch(int)
+static void SigWinch(int)
{
// Riped from GNU ls
#ifdef TIOCGWINSZ
diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc
index c1c8b2178..d8ea0435a 100644
--- a/cmdline/apt-helper.cc
+++ b/cmdline/apt-helper.cc
@@ -33,7 +33,7 @@
/*}}}*/
using namespace std;
-bool DoDownloadFile(CommandLine &CmdL)
+static bool DoDownloadFile(CommandLine &CmdL)
{
if (CmdL.FileSize() <= 2)
return _error->Error(_("Must specify at least one pair url/filename"));
@@ -55,7 +55,7 @@ bool DoDownloadFile(CommandLine &CmdL)
return true;
}
-bool ShowHelp(CommandLine &CmdL)
+static bool ShowHelp(CommandLine &CmdL)
{
ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc
index bf5b8c1fe..108e86b9a 100644
--- a/cmdline/apt-internal-solver.cc
+++ b/cmdline/apt-internal-solver.cc
@@ -30,7 +30,7 @@
// ShowHelp - Show a help screen /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool ShowHelp(CommandLine &CmdL) {
+static bool ShowHelp(CommandLine &CmdL) {
ioprintf(std::cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc
index d3a3a780b..1af17cd7a 100644
--- a/cmdline/apt-mark.cc
+++ b/cmdline/apt-mark.cc
@@ -35,7 +35,7 @@ ostream c1out(0);
ostream c2out(0);
ofstream devnull("/dev/null");
/* DoAuto - mark packages as automatically/manually installed {{{*/
-bool DoAuto(CommandLine &CmdL)
+static bool DoAuto(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -82,7 +82,7 @@ bool DoAuto(CommandLine &CmdL)
/* DoMarkAuto - mark packages as automatically/manually installed {{{*/
/* Does the same as DoAuto but tries to do it exactly the same why as
the python implementation did it so it can be a drop-in replacement */
-bool DoMarkAuto(CommandLine &CmdL)
+static bool DoMarkAuto(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -119,7 +119,7 @@ bool DoMarkAuto(CommandLine &CmdL)
}
/*}}}*/
/* ShowAuto - show automatically installed packages (sorted) {{{*/
-bool ShowAuto(CommandLine &CmdL)
+static bool ShowAuto(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -159,7 +159,7 @@ bool ShowAuto(CommandLine &CmdL)
}
/*}}}*/
/* DoHold - mark packages as hold by dpkg {{{*/
-bool DoHold(CommandLine &CmdL)
+static bool DoHold(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -335,7 +335,7 @@ bool DoHold(CommandLine &CmdL)
}
/*}}}*/
/* ShowHold - show packages set on hold in dpkg status {{{*/
-bool ShowHold(CommandLine &CmdL)
+static bool ShowHold(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -372,7 +372,7 @@ bool ShowHold(CommandLine &CmdL)
// ShowHelp - Show a help screen /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool ShowHelp(CommandLine &CmdL)
+static bool ShowHelp(CommandLine &CmdL)
{
ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
diff --git a/cmdline/apt-sortpkgs.cc b/cmdline/apt-sortpkgs.cc
index 46989044e..8d9cb23de 100644
--- a/cmdline/apt-sortpkgs.cc
+++ b/cmdline/apt-sortpkgs.cc
@@ -62,7 +62,7 @@ struct PkgName /*{{{*/
// DoIt - Sort a single file /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool DoIt(string InFile)
+static bool DoIt(string InFile)
{
FileFd Fd(InFile,FileFd::ReadOnly);
pkgTagFile Tags(&Fd);
@@ -142,7 +142,7 @@ bool DoIt(string InFile)
// ShowHelp - Show the help text /*{{{*/
// ---------------------------------------------------------------------
/* */
-int ShowHelp()
+static int ShowHelp()
{
ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
diff --git a/cmdline/apt.cc b/cmdline/apt.cc
index 7ef9060aa..040ed6c25 100644
--- a/cmdline/apt.cc
+++ b/cmdline/apt.cc
@@ -61,7 +61,7 @@
-bool ShowHelp(CommandLine &CmdL)
+static bool ShowHelp(CommandLine &CmdL)
{
ioprintf(c1out,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
diff --git a/debian/libapt-pkg4.12.symbols b/debian/libapt-pkg4.12.symbols
index 17b9f69fa..c1747bc9e 100644
--- a/debian/libapt-pkg4.12.symbols
+++ b/debian/libapt-pkg4.12.symbols
@@ -1197,7 +1197,6 @@ libapt-pkg.so.4.12 libapt-pkg4.12 #MINVER#
(c++)"APT::Configuration::setDefaultConfigurationForCompressors()@Base" 0.8.12
(c++)"pkgAcqMetaClearSig::Custom600Headers()@Base" 0.8.13
(c++|optional=private)"debListParser::NewProvidesAllArch(pkgCache::VerIterator&, std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)@Base" 0.8.13.2
- (c++|optional=private)"PrintMode(char)@Base" 0.8.13.2
(c++)"pkgDepCache::IsModeChangeOk(pkgDepCache::ModeList, pkgCache::PkgIterator const&, unsigned long, bool)@Base" 0.8.13.2
(c++)"pkgCache::DepIterator::IsNegative() const@Base" 0.8.15~exp1
(c++)"Configuration::CndSet(char const*, int)@Base" 0.8.15.3
diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc
index d14b68044..c28ad5c5c 100644
--- a/ftparchive/apt-ftparchive.cc
+++ b/ftparchive/apt-ftparchive.cc
@@ -438,7 +438,7 @@ bool PackageMap::GenContents(Configuration &Setup,
// ---------------------------------------------------------------------
/* This populates the PkgList with all the possible permutations of the
section/arch lists. */
-void LoadTree(vector &PkgList,Configuration &Setup)
+static void LoadTree(vector &PkgList,Configuration &Setup)
{
// Load the defaults
string DDir = Setup.Find("TreeDefault::Directory",
@@ -550,7 +550,7 @@ void LoadTree(vector &PkgList,Configuration &Setup)
// LoadBinDir - Load a 'bindirectory' section from the Generate Config /*{{{*/
// ---------------------------------------------------------------------
/* */
-void LoadBinDir(vector &PkgList,Configuration &Setup)
+static void LoadBinDir(vector &PkgList,Configuration &Setup)
{
mode_t const Permissions = Setup.FindI("Default::FileMode",0644);
@@ -586,7 +586,7 @@ void LoadBinDir(vector &PkgList,Configuration &Setup)
// ShowHelp - Show the help text /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool ShowHelp(CommandLine &CmdL)
+static bool ShowHelp(CommandLine &CmdL)
{
ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
@@ -639,7 +639,7 @@ bool ShowHelp(CommandLine &CmdL)
// SimpleGenPackages - Generate a Packages file for a directory tree /*{{{*/
// ---------------------------------------------------------------------
/* This emulates dpkg-scanpackages's command line interface. 'mostly' */
-bool SimpleGenPackages(CommandLine &CmdL)
+static bool SimpleGenPackages(CommandLine &CmdL)
{
if (CmdL.FileSize() < 2)
return ShowHelp(CmdL);
@@ -667,7 +667,7 @@ bool SimpleGenPackages(CommandLine &CmdL)
// SimpleGenContents - Generate a Contents listing /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool SimpleGenContents(CommandLine &CmdL)
+static bool SimpleGenContents(CommandLine &CmdL)
{
if (CmdL.FileSize() < 2)
return ShowHelp(CmdL);
@@ -689,7 +689,7 @@ bool SimpleGenContents(CommandLine &CmdL)
// SimpleGenSources - Generate a Sources file for a directory tree /*{{{*/
// ---------------------------------------------------------------------
/* This emulates dpkg-scanpackages's command line interface. 'mostly' */
-bool SimpleGenSources(CommandLine &CmdL)
+static bool SimpleGenSources(CommandLine &CmdL)
{
if (CmdL.FileSize() < 2)
return ShowHelp(CmdL);
@@ -722,7 +722,7 @@ bool SimpleGenSources(CommandLine &CmdL)
/*}}}*/
// SimpleGenRelease - Generate a Release file for a directory tree /*{{{*/
// ---------------------------------------------------------------------
-bool SimpleGenRelease(CommandLine &CmdL)
+static bool SimpleGenRelease(CommandLine &CmdL)
{
if (CmdL.FileSize() < 2)
return ShowHelp(CmdL);
@@ -747,7 +747,7 @@ bool SimpleGenRelease(CommandLine &CmdL)
// Generate - Full generate, using a config file /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool Generate(CommandLine &CmdL)
+static bool Generate(CommandLine &CmdL)
{
struct CacheDB::Stats SrcStats;
if (CmdL.FileSize() < 2)
@@ -911,7 +911,7 @@ bool Generate(CommandLine &CmdL)
// Clean - Clean out the databases /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool Clean(CommandLine &CmdL)
+static bool Clean(CommandLine &CmdL)
{
if (CmdL.FileSize() != 2)
return ShowHelp(CmdL);
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index 992f802a6..7ed984fa9 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -23,7 +23,7 @@
#include
#include
-char const * const httpcodeToStr(int const httpcode) /*{{{*/
+static char const * const httpcodeToStr(int const httpcode) /*{{{*/
{
switch (httpcode)
{
@@ -77,7 +77,7 @@ char const * const httpcodeToStr(int const httpcode) /*{{{*/
return NULL;
}
/*}}}*/
-void addFileHeaders(std::list &headers, FileFd &data) /*{{{*/
+static void addFileHeaders(std::list &headers, FileFd &data)/*{{{*/
{
std::ostringstream contentlength;
contentlength << "Content-Length: " << data.FileSize();
@@ -88,14 +88,14 @@ void addFileHeaders(std::list &headers, FileFd &data) /*{{{*/
headers.push_back(lastmodified);
}
/*}}}*/
-void addDataHeaders(std::list &headers, std::string &data) /*{{{*/
+static void addDataHeaders(std::list &headers, std::string &data)/*{{{*/
{
std::ostringstream contentlength;
contentlength << "Content-Length: " << data.size();
headers.push_back(contentlength.str());
}
/*}}}*/
-bool sendHead(int const client, int const httpcode, std::list &headers)/*{{{*/
+static bool sendHead(int const client, int const httpcode, std::list &headers)/*{{{*/
{
std::string response("HTTP/1.1 ");
response.append(httpcodeToStr(httpcode));
@@ -128,7 +128,7 @@ bool sendHead(int const client, int const httpcode, std::list &head
return Success;
}
/*}}}*/
-bool sendFile(int const client, FileFd &data) /*{{{*/
+static bool sendFile(int const client, FileFd &data) /*{{{*/
{
bool Success = true;
char buffer[500];
@@ -144,7 +144,7 @@ bool sendFile(int const client, FileFd &data) /*{{{*/
return Success;
}
/*}}}*/
-bool sendData(int const client, std::string const &data) /*{{{*/
+static bool sendData(int const client, std::string const &data) /*{{{*/
{
if (FileFd::Write(client, data.c_str(), data.size()) == false)
{
@@ -154,7 +154,7 @@ bool sendData(int const client, std::string const &data) /*{{{*/
return true;
}
/*}}}*/
-void sendError(int const client, int const httpcode, std::string const &request,/*{{{*/
+static void sendError(int const client, int const httpcode, std::string const &request,/*{{{*/
bool content, std::string const &error = "")
{
std::list headers;
@@ -179,13 +179,13 @@ void sendError(int const client, int const httpcode, std::string const &request,
if (content == true)
sendData(client, response);
}
-void sendSuccess(int const client, std::string const &request,
+static void sendSuccess(int const client, std::string const &request,
bool content, std::string const &error = "")
{
sendError(client, 200, request, content, error);
}
/*}}}*/
-void sendRedirect(int const client, int const httpcode, std::string const &uri,/*{{{*/
+static void sendRedirect(int const client, int const httpcode, std::string const &uri,/*{{{*/
std::string const &request, bool content)
{
std::list headers;
@@ -222,7 +222,7 @@ void sendRedirect(int const client, int const httpcode, std::string const &uri,/
sendData(client, response);
}
/*}}}*/
-int filter_hidden_files(const struct dirent *a) /*{{{*/
+static int filter_hidden_files(const struct dirent *a) /*{{{*/
{
if (a->d_name[0] == '.')
return 0;
@@ -236,7 +236,7 @@ int filter_hidden_files(const struct dirent *a) /*{{{*/
#endif
return 1;
}
-int grouped_alpha_case_sort(const struct dirent **a, const struct dirent **b) {
+static int grouped_alpha_case_sort(const struct dirent **a, const struct dirent **b) {
#ifdef _DIRENT_HAVE_D_TYPE
if ((*a)->d_type == DT_DIR && (*b)->d_type == DT_DIR);
else if ((*a)->d_type == DT_DIR && (*b)->d_type == DT_REG)
@@ -260,7 +260,7 @@ int grouped_alpha_case_sort(const struct dirent **a, const struct dirent **b) {
return strcasecmp((*a)->d_name, (*b)->d_name);
}
/*}}}*/
-void sendDirectoryListing(int const client, std::string const &dir, /*{{{*/
+static void sendDirectoryListing(int const client, std::string const &dir,/*{{{*/
std::string const &request, bool content)
{
std::list headers;
@@ -312,7 +312,7 @@ void sendDirectoryListing(int const client, std::string const &dir, /*{{{*/
sendData(client, response);
}
/*}}}*/
-bool parseFirstLine(int const client, std::string const &request, /*{{{*/
+static bool parseFirstLine(int const client, std::string const &request,/*{{{*/
std::string &filename, std::string ¶ms, bool &sendContent,
bool &closeConnection)
{
@@ -432,7 +432,7 @@ bool parseFirstLine(int const client, std::string const &request, /*{{{*/
return true;
}
/*}}}*/
-bool handleOnTheFlyReconfiguration(int const client, std::string const &request, std::vector const &parts)/*{{{*/
+static bool handleOnTheFlyReconfiguration(int const client, std::string const &request, std::vector const &parts)/*{{{*/
{
size_t const pcount = parts.size();
if (pcount == 4 && parts[1] == "set")
@@ -475,7 +475,7 @@ bool handleOnTheFlyReconfiguration(int const client, std::string const &request,
return false;
}
/*}}}*/
-void * handleClient(void * voidclient) /*{{{*/
+static void * handleClient(void * voidclient) /*{{{*/
{
int client = *((int*)(voidclient));
std::clog << "ACCEPT client " << client << std::endl;
diff --git a/test/interactive-helper/extract-control.cc b/test/interactive-helper/extract-control.cc
index 3f7feabcb..94fe9dca8 100644
--- a/test/interactive-helper/extract-control.cc
+++ b/test/interactive-helper/extract-control.cc
@@ -7,7 +7,7 @@
using namespace std;
-bool ExtractMember(const char *File,const char *Member)
+static bool ExtractMember(const char *File,const char *Member)
{
FileFd Fd(File,FileFd::ReadOnly);
debDebFile Deb(Fd);
diff --git a/test/interactive-helper/testdeb.cc b/test/interactive-helper/testdeb.cc
index d28f20114..89375af13 100644
--- a/test/interactive-helper/testdeb.cc
+++ b/test/interactive-helper/testdeb.cc
@@ -9,7 +9,7 @@ class NullStream : public pkgDirStream
virtual bool DoItem(Item &Itm,int &Fd) {return true;};
};
-bool Test(const char *File)
+static bool Test(const char *File)
{
FileFd Fd(File,FileFd::ReadOnly);
debDebFile Deb(Fd);
diff --git a/test/libapt/assert.h b/test/libapt/assert.h
index 113c057ed..cde6a6351 100644
--- a/test/libapt/assert.h
+++ b/test/libapt/assert.h
@@ -1,6 +1,11 @@
#include
#include
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wmissing-declarations"
+#endif
+
#define equals(x,y) assertEquals(y, x, __LINE__)
#define equalsNot(x,y) assertEqualsNot(y, x, __LINE__)
@@ -111,3 +116,7 @@ void dumpVector(X vec) {
v != vec.end(); ++v)
std::cout << *v << std::endl;
}
+
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
diff --git a/test/libapt/compareversion_test.cc b/test/libapt/compareversion_test.cc
index fdb1d5674..44f8e9d78 100644
--- a/test/libapt/compareversion_test.cc
+++ b/test/libapt/compareversion_test.cc
@@ -31,7 +31,7 @@
using namespace std;
-bool callDPkg(const char *val, const char *ref, const char &op) {
+static bool callDPkg(const char *val, const char *ref, const char &op) {
pid_t Process = ExecFork();
if (Process == 0)
{
@@ -50,7 +50,7 @@ bool callDPkg(const char *val, const char *ref, const char &op) {
return WIFEXITED(Ret) == true && WEXITSTATUS(Ret) == 0;
}
-void assertVersion(int const &CurLine, string const &A, string const &B, int const &Expected) {
+static void assertVersion(int const &CurLine, string const &A, string const &B, int const &Expected) {
int Res = debVS.CmpVersion(A.c_str(), B.c_str());
bool const dpkg = callDPkg(A.c_str(),B.c_str(), Expected);
Res = (Res < 0) ? -1 : ( (Res > 0) ? 1 : Res);
@@ -61,7 +61,7 @@ void assertVersion(int const &CurLine, string const &A, string const &B, int con
_error->Error("DPkg differ with line: %u. '%s' '%s' '%s' == false",CurLine,A.c_str(),((Expected == 1) ? "<<" : ( (Expected == 0) ? "=" : ">>")),B.c_str());
}
-bool RunTest(const char *File)
+static bool RunTest(const char *File)
{
if (FileExists(File) == false)
return _error->Error("Versiontestfile %s doesn't exist!", File);
diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc
index 0300ce929..e79b6d65e 100644
--- a/test/libapt/sourcelist_test.cc
+++ b/test/libapt/sourcelist_test.cc
@@ -9,7 +9,7 @@
char *tempfile = NULL;
int tempfile_fd = -1;
-void remove_tmpfile(void)
+static void remove_tmpfile(void)
{
if (tempfile_fd > 0)
close(tempfile_fd);
diff --git a/test/libapt/tagfile_test.cc b/test/libapt/tagfile_test.cc
index d12c74c95..effc3244b 100644
--- a/test/libapt/tagfile_test.cc
+++ b/test/libapt/tagfile_test.cc
@@ -9,7 +9,7 @@
char *tempfile = NULL;
int tempfile_fd = -1;
-void remove_tmpfile(void)
+static void remove_tmpfile(void)
{
if (tempfile_fd > 0)
close(tempfile_fd);
--
cgit v1.2.3-70-g09d2
From 655122418d714f342b5d9789f45f8035f3fe8b9a Mon Sep 17 00:00:00 2001
From: David Kalnischkies
Date: Sat, 1 Mar 2014 15:11:42 +0100
Subject: warning: unused parameter ‘foo’ [-Wunused-parameter]
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reported-By: gcc -Wunused-parameter
Git-Dch: Ignore
---
apt-inst/deb/debfile.cc | 2 +-
apt-inst/dirstream.cc | 2 +-
apt-inst/dirstream.h | 4 ++--
apt-inst/extract.cc | 2 +-
apt-pkg/acquire-item.cc | 20 ++++++++++----------
apt-pkg/cachefile.cc | 4 ++--
apt-pkg/cacheset.cc | 28 ++++++++++++++--------------
apt-pkg/cdrom.cc | 2 +-
apt-pkg/deb/debindexfile.h | 2 +-
apt-pkg/deb/dpkgpm.cc | 2 +-
apt-pkg/deb/dpkgpm.h | 4 ++--
apt-pkg/depcache.cc | 10 +++++-----
apt-pkg/depcache.h | 2 +-
apt-pkg/edsp.cc | 10 ++++------
apt-pkg/edsp.h | 6 ++----
apt-pkg/edsp/edspindexfile.cc | 2 +-
apt-pkg/edsp/edsplistparser.cc | 4 ++--
apt-pkg/edsp/edspsystem.cc | 6 +++---
apt-pkg/indexcopy.cc | 2 +-
apt-pkg/indexfile.cc | 6 +++---
apt-pkg/indexfile.h | 4 ++--
apt-pkg/install-progress.cc | 4 ++--
apt-pkg/install-progress.h | 18 +++++++++---------
apt-pkg/packagemanager.h | 4 ++--
apt-pkg/pkgcache.cc | 2 +-
apt-pkg/pkgcachegen.cc | 2 +-
apt-pkg/pkgcachegen.h | 4 ++--
apt-pkg/pkgrecords.h | 2 +-
apt-pkg/policy.cc | 2 +-
apt-pkg/vendor.cc | 2 +-
apt-private/acqprogress.cc | 2 +-
apt-private/private-cacheset.h | 8 ++++----
apt-private/private-moo.cc | 8 ++++----
apt-private/private-output.cc | 6 +++---
cmdline/apt-cache.cc | 12 ++++++------
cmdline/apt-cdrom.cc | 2 +-
cmdline/apt-config.cc | 2 +-
cmdline/apt-extracttemplates.cc | 2 +-
cmdline/apt-get.cc | 10 +++++-----
cmdline/apt-helper.cc | 2 +-
cmdline/apt-internal-solver.cc | 2 +-
cmdline/apt-mark.cc | 2 +-
cmdline/apt.cc | 2 +-
ftparchive/apt-ftparchive.cc | 2 +-
ftparchive/contents.cc | 2 +-
ftparchive/override.cc | 2 +-
ftparchive/writer.cc | 6 +++---
methods/ftp.cc | 2 +-
methods/gzip.cc | 2 +-
methods/https.cc | 8 ++++----
methods/https.h | 16 ++++++++--------
methods/mirror.cc | 2 +-
methods/rsh.cc | 4 ++--
test/interactive-helper/testdeb.cc | 7 ++++++-
test/libapt/cdromreducesourcelist_test.cc | 2 +-
test/libapt/configuration_test.cc | 2 +-
test/libapt/fileutl_test.cc | 2 +-
test/libapt/getarchitectures_test.cc | 2 +-
test/libapt/globalerror_test.cc | 2 +-
test/libapt/hashsums_test.cc | 5 +++++
test/libapt/parsedepends_test.cc | 2 +-
test/libapt/sourcelist_test.cc | 2 +-
test/libapt/strutil_test.cc | 2 +-
test/libapt/tagfile_test.cc | 2 +-
64 files changed, 153 insertions(+), 147 deletions(-)
(limited to 'cmdline')
diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc
index a811bbe88..8684f03f7 100644
--- a/apt-inst/deb/debfile.cc
+++ b/apt-inst/deb/debfile.cc
@@ -194,7 +194,7 @@ bool debDebFile::MemControlExtract::DoItem(Item &Itm,int &Fd)
// ---------------------------------------------------------------------
/* Just memcopy the block from the tar extractor and put it in the right
place in the pre-allocated memory block. */
-bool debDebFile::MemControlExtract::Process(Item &Itm,const unsigned char *Data,
+bool debDebFile::MemControlExtract::Process(Item &/*Itm*/,const unsigned char *Data,
unsigned long Size,unsigned long Pos)
{
memcpy(Control + Pos, Data,Size);
diff --git a/apt-inst/dirstream.cc b/apt-inst/dirstream.cc
index e06c30a57..085a0dcbf 100644
--- a/apt-inst/dirstream.cc
+++ b/apt-inst/dirstream.cc
@@ -110,7 +110,7 @@ bool pkgDirStream::FinishedFile(Item &Itm,int Fd)
// DirStream::Fail - Failed processing a file /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool pkgDirStream::Fail(Item &Itm,int Fd)
+bool pkgDirStream::Fail(Item &/*Itm*/, int Fd)
{
if (Fd < 0)
return true;
diff --git a/apt-inst/dirstream.h b/apt-inst/dirstream.h
index 9d1af2188..1be2688a1 100644
--- a/apt-inst/dirstream.h
+++ b/apt-inst/dirstream.h
@@ -49,8 +49,8 @@ class pkgDirStream
virtual bool DoItem(Item &Itm,int &Fd);
virtual bool Fail(Item &Itm,int Fd);
virtual bool FinishedFile(Item &Itm,int Fd);
- virtual bool Process(Item &Itm,const unsigned char *Data,
- unsigned long Size,unsigned long Pos) {return true;};
+ virtual bool Process(Item &/*Itm*/,const unsigned char * /*Data*/,
+ unsigned long /*Size*/,unsigned long /*Pos*/) {return true;};
virtual ~pkgDirStream() {};
};
diff --git a/apt-inst/extract.cc b/apt-inst/extract.cc
index b3dfccfc6..60edc702e 100644
--- a/apt-inst/extract.cc
+++ b/apt-inst/extract.cc
@@ -79,7 +79,7 @@ pkgExtract::pkgExtract(pkgFLCache &FLCache,pkgCache::VerIterator Ver) :
// Extract::DoItem - Handle a single item from the stream /*{{{*/
// ---------------------------------------------------------------------
/* This performs the setup for the extraction.. */
-bool pkgExtract::DoItem(Item &Itm,int &Fd)
+bool pkgExtract::DoItem(Item &Itm, int &/*Fd*/)
{
/* Strip any leading/trailing /s from the filename, then copy it to the
temp buffer and re-apply the leading / We use a class variable
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 88b10d4b1..3b22743e7 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -108,8 +108,8 @@ void pkgAcquire::Item::Start(string /*Message*/,unsigned long long Size)
// Acquire::Item::Done - Item downloaded OK /*{{{*/
// ---------------------------------------------------------------------
/* */
-void pkgAcquire::Item::Done(string Message,unsigned long long Size,string Hash,
- pkgAcquire::MethodConfig *Cnf)
+void pkgAcquire::Item::Done(string Message,unsigned long long Size,string /*Hash*/,
+ pkgAcquire::MethodConfig * /*Cnf*/)
{
// We just downloaded something..
string FileName = LookupTag(Message,"Filename");
@@ -253,10 +253,10 @@ string pkgAcqSubIndex::Custom600Headers()
return "\nIndex-File: true\nFail-Ignore: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
}
/*}}}*/
-void pkgAcqSubIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /*{{{*/
+void pkgAcqSubIndex::Failed(string Message,pkgAcquire::MethodConfig * /*Cnf*/)/*{{{*/
{
if(Debug)
- std::clog << "pkgAcqSubIndex failed: " << Desc.URI << std::endl;
+ std::clog << "pkgAcqSubIndex failed: " << Desc.URI << " with " << Message << std::endl;
Complete = false;
Status = StatDone;
@@ -544,10 +544,10 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile) /*{{{*/
return false;
}
/*}}}*/
-void pkgAcqDiffIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /*{{{*/
+void pkgAcqDiffIndex::Failed(string Message,pkgAcquire::MethodConfig * /*Cnf*/)/*{{{*/
{
if(Debug)
- std::clog << "pkgAcqDiffIndex failed: " << Desc.URI << std::endl
+ std::clog << "pkgAcqDiffIndex failed: " << Desc.URI << " with " << Message << std::endl
<< "Falling back to normal index file acquire" << std::endl;
new pkgAcqIndex(Owner, RealURI, Description, Desc.ShortDesc,
@@ -624,10 +624,10 @@ pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire *Owner,
}
}
/*}}}*/
-void pkgAcqIndexDiffs::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /*{{{*/
+void pkgAcqIndexDiffs::Failed(string Message,pkgAcquire::MethodConfig * /*Cnf*/)/*{{{*/
{
if(Debug)
- std::clog << "pkgAcqIndexDiffs failed: " << Desc.URI << std::endl
+ std::clog << "pkgAcqIndexDiffs failed: " << Desc.URI << " with " << Message << std::endl
<< "Falling back to normal index file acquire" << std::endl;
new pkgAcqIndex(Owner, RealURI, Description,Desc.ShortDesc,
ExpectedHash);
@@ -808,7 +808,7 @@ pkgAcqIndexMergeDiffs::pkgAcqIndexMergeDiffs(pkgAcquire *Owner,
QueueURI(Desc);
}
/*}}}*/
-void pkgAcqIndexMergeDiffs::Failed(string Message,pkgAcquire::MethodConfig *Cnf)/*{{{*/
+void pkgAcqIndexMergeDiffs::Failed(string Message,pkgAcquire::MethodConfig * /*Cnf*/)/*{{{*/
{
if(Debug)
std::clog << "pkgAcqIndexMergeDiffs failed: " << Desc.URI << " with " << Message << std::endl;
@@ -1698,7 +1698,7 @@ bool pkgAcqMetaIndex::VerifyVendor(string Message) /*{{{*/
// pkgAcqMetaIndex::Failed - no Release file present or no signature file present /*{{{*/
// ---------------------------------------------------------------------
/* */
-void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
+void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig * /*Cnf*/)
{
if (AuthPass == true)
{
diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc
index 7c2276185..2401b015e 100644
--- a/apt-pkg/cachefile.cc
+++ b/apt-pkg/cachefile.cc
@@ -99,7 +99,7 @@ bool pkgCacheFile::BuildCaches(OpProgress *Progress, bool WithLock)
// CacheFile::BuildSourceList - Open and build all relevant sources.list/*{{{*/
// ---------------------------------------------------------------------
/* */
-bool pkgCacheFile::BuildSourceList(OpProgress *Progress)
+bool pkgCacheFile::BuildSourceList(OpProgress * /*Progress*/)
{
if (SrcList != NULL)
return true;
@@ -113,7 +113,7 @@ bool pkgCacheFile::BuildSourceList(OpProgress *Progress)
// CacheFile::BuildPolicy - Open and build all relevant preferences /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool pkgCacheFile::BuildPolicy(OpProgress *Progress)
+bool pkgCacheFile::BuildPolicy(OpProgress * /*Progress*/)
{
if (Policy != NULL)
return true;
diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc
index 6b6fdb5ad..8a30d00a2 100644
--- a/apt-pkg/cacheset.cc
+++ b/apt-pkg/cacheset.cc
@@ -588,13 +588,13 @@ pkgCache::PkgIterator CacheSetHelper::canNotFindPkgName(pkgCacheFile &Cache,
}
/*}}}*/
// canNotFindTask - handle the case no package is found for a task /*{{{*/
-void CacheSetHelper::canNotFindTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern) {
+void CacheSetHelper::canNotFindTask(PackageContainerInterface * const /*pci*/, pkgCacheFile &/*Cache*/, std::string pattern) {
if (ShowError == true)
_error->Insert(ErrorType, _("Couldn't find task '%s'"), pattern.c_str());
}
/*}}}*/
// canNotFindRegEx - handle the case no package is found by a regex /*{{{*/
-void CacheSetHelper::canNotFindRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern) {
+void CacheSetHelper::canNotFindRegEx(PackageContainerInterface * const /*pci*/, pkgCacheFile &/*Cache*/, std::string pattern) {
if (ShowError == true)
_error->Insert(ErrorType, _("Couldn't find any package by regex '%s'"), pattern.c_str());
}
@@ -606,25 +606,25 @@ void CacheSetHelper::canNotFindFnmatch(PackageContainerInterface * const pci, pk
}
#endif /*}}}*/
// canNotFindPackage - handle the case no package is found from a string/*{{{*/
-void CacheSetHelper::canNotFindPackage(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &str) {
+void CacheSetHelper::canNotFindPackage(PackageContainerInterface * const /*pci*/, pkgCacheFile &/*Cache*/, std::string const &/*str*/) {
}
/*}}}*/
// canNotFindAllVer /*{{{*/
-void CacheSetHelper::canNotFindAllVer(VersionContainerInterface * const vci, pkgCacheFile &Cache,
+void CacheSetHelper::canNotFindAllVer(VersionContainerInterface * const /*vci*/, pkgCacheFile &/*Cache*/,
pkgCache::PkgIterator const &Pkg) {
if (ShowError == true)
_error->Insert(ErrorType, _("Can't select versions from package '%s' as it is purely virtual"), Pkg.FullName(true).c_str());
}
/*}}}*/
// canNotFindInstCandVer /*{{{*/
-void CacheSetHelper::canNotFindInstCandVer(VersionContainerInterface * const vci, pkgCacheFile &Cache,
+void CacheSetHelper::canNotFindInstCandVer(VersionContainerInterface * const /*vci*/, pkgCacheFile &/*Cache*/,
pkgCache::PkgIterator const &Pkg) {
if (ShowError == true)
_error->Insert(ErrorType, _("Can't select installed nor candidate version from package '%s' as it has neither of them"), Pkg.FullName(true).c_str());
}
/*}}}*/
// canNotFindInstCandVer /*{{{*/
-void CacheSetHelper::canNotFindCandInstVer(VersionContainerInterface * const vci, pkgCacheFile &Cache,
+void CacheSetHelper::canNotFindCandInstVer(VersionContainerInterface * const /*vci*/, pkgCacheFile &/*Cache*/,
pkgCache::PkgIterator const &Pkg) {
if (ShowError == true)
_error->Insert(ErrorType, _("Can't select installed nor candidate version from package '%s' as it has neither of them"), Pkg.FullName(true).c_str());
@@ -655,13 +655,13 @@ pkgCache::VerIterator CacheSetHelper::canNotFindInstalledVer(pkgCacheFile &Cache
}
/*}}}*/
// showTaskSelection /*{{{*/
-void CacheSetHelper::showTaskSelection(pkgCache::PkgIterator const &pkg,
- std::string const &pattern) {
+void CacheSetHelper::showTaskSelection(pkgCache::PkgIterator const &/*pkg*/,
+ std::string const &/*pattern*/) {
}
/*}}}*/
// showRegExSelection /*{{{*/
-void CacheSetHelper::showRegExSelection(pkgCache::PkgIterator const &pkg,
- std::string const &pattern) {
+void CacheSetHelper::showRegExSelection(pkgCache::PkgIterator const &/*pkg*/,
+ std::string const &/*pattern*/) {
}
/*}}}*/
#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
@@ -672,10 +672,10 @@ void CacheSetHelper::showFnmatchSelection(pkgCache::PkgIterator const &pkg,
/*}}}*/
#endif
// showSelectedVersion /*{{{*/
-void CacheSetHelper::showSelectedVersion(pkgCache::PkgIterator const &Pkg,
- pkgCache::VerIterator const Ver,
- std::string const &ver,
- bool const verIsRel) {
+void CacheSetHelper::showSelectedVersion(pkgCache::PkgIterator const &/*Pkg*/,
+ pkgCache::VerIterator const /*Ver*/,
+ std::string const &/*ver*/,
+ bool const /*verIsRel*/) {
}
/*}}}*/
}
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc
index ea5ed7e92..6f946b030 100644
--- a/apt-pkg/cdrom.cc
+++ b/apt-pkg/cdrom.cc
@@ -369,7 +369,7 @@ bool pkgCdrom::DropRepeats(vector &List,const char *Name)
// ---------------------------------------------------------------------
/* This takes the list of source list expressed entires and collects
similar ones to form a single entry for each dist */
-void pkgCdrom::ReduceSourcelist(string CD,vector &List)
+void pkgCdrom::ReduceSourcelist(string /*CD*/,vector &List)
{
sort(List.begin(),List.end());
diff --git a/apt-pkg/deb/debindexfile.h b/apt-pkg/deb/debindexfile.h
index 9e64d4476..e079d40c2 100644
--- a/apt-pkg/deb/debindexfile.h
+++ b/apt-pkg/deb/debindexfile.h
@@ -33,7 +33,7 @@ class debStatusIndex : public pkgIndexFile
virtual const Type *GetType() const;
// Interface for acquire
- virtual std::string Describe(bool Short) const {return File;};
+ virtual std::string Describe(bool /*Short*/) const {return File;};
// Interface for the Cache Generator
virtual bool Exists() const;
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 91893c4e1..adf59516e 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -1581,7 +1581,7 @@ bool pkgDPkgPM::GoNoABIBreak(APT::Progress::PackageManager *progress)
return true;
}
-void SigINT(int sig) {
+void SigINT(int /*sig*/) {
pkgPackageManager::SigINTStop = true;
}
/*}}}*/
diff --git a/apt-pkg/deb/dpkgpm.h b/apt-pkg/deb/dpkgpm.h
index 02e12a6d9..c144f78e1 100644
--- a/apt-pkg/deb/dpkgpm.h
+++ b/apt-pkg/deb/dpkgpm.h
@@ -109,10 +109,10 @@ class pkgDPkgPM : public pkgPackageManager
void DoDpkgStatusFd(int statusfd);
void ProcessDpkgStatusLine(char *line);
#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR < 13)
- void DoDpkgStatusFd(int statusfd, int unused) {
+ void DoDpkgStatusFd(int statusfd, int /*unused*/) {
DoDpkgStatusFd(statusfd);
}
- void ProcessDpkgStatusLine(int unused, char *line) {
+ void ProcessDpkgStatusLine(int /*unused*/, char *line) {
ProcessDpkgStatusLine(line);
}
#endif
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 946c1e254..b45f5d9b5 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -222,7 +222,7 @@ bool pkgDepCache::readStateFile(OpProgress *Prog) /*{{{*/
return true;
}
/*}}}*/
-bool pkgDepCache::writeStateFile(OpProgress *prog, bool InstalledOnly) /*{{{*/
+bool pkgDepCache::writeStateFile(OpProgress * /*prog*/, bool InstalledOnly) /*{{{*/
{
bool const debug_autoremove = _config->FindB("Debug::pkgAutoRemove",false);
@@ -868,7 +868,7 @@ bool pkgDepCache::IsDeleteOk(PkgIterator const &Pkg,bool rPurge,
return IsDeleteOkProtectInstallRequests(Pkg, rPurge, Depth, FromUser);
}
bool pkgDepCache::IsDeleteOkProtectInstallRequests(PkgIterator const &Pkg,
- bool const rPurge, unsigned long const Depth, bool const FromUser)
+ bool const /*rPurge*/, unsigned long const Depth, bool const FromUser)
{
if (FromUser == false && Pkg->CurrentVer == 0)
{
@@ -1297,7 +1297,7 @@ bool pkgDepCache::IsInstallOk(PkgIterator const &Pkg,bool AutoInst,
return IsInstallOkMultiArchSameVersionSynced(Pkg,AutoInst, Depth, FromUser);
}
bool pkgDepCache::IsInstallOkMultiArchSameVersionSynced(PkgIterator const &Pkg,
- bool const AutoInst, unsigned long const Depth, bool const FromUser)
+ bool const /*AutoInst*/, unsigned long const Depth, bool const FromUser)
{
if (FromUser == true) // as always: user is always right
return true;
@@ -1685,9 +1685,9 @@ bool pkgDepCache::Policy::IsImportantDep(DepIterator const &Dep)
}
/*}}}*/
// Policy::GetPriority - Get the priority of the package pin /*{{{*/
-signed short pkgDepCache::Policy::GetPriority(pkgCache::PkgIterator const &Pkg)
+signed short pkgDepCache::Policy::GetPriority(pkgCache::PkgIterator const &/*Pkg*/)
{ return 0; }
-signed short pkgDepCache::Policy::GetPriority(pkgCache::PkgFileIterator const &File)
+signed short pkgDepCache::Policy::GetPriority(pkgCache::PkgFileIterator const &/*File*/)
{ return 0; }
/*}}}*/
pkgDepCache::InRootSetFunc *pkgDepCache::GetRootSetFunc() /*{{{*/
diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h
index a02a86b87..50f810806 100644
--- a/apt-pkg/depcache.h
+++ b/apt-pkg/depcache.h
@@ -61,7 +61,7 @@ class pkgDepCache : protected pkgCache::Namespace
class InRootSetFunc
{
public:
- virtual bool InRootSet(const pkgCache::PkgIterator &pkg) {return false;};
+ virtual bool InRootSet(const pkgCache::PkgIterator &/*pkg*/) {return false;};
virtual ~InRootSetFunc() {};
};
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc
index e90598392..dbd2dba46 100644
--- a/apt-pkg/edsp.cc
+++ b/apt-pkg/edsp.cc
@@ -44,7 +44,7 @@ bool EDSP::WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress)
for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; ++Ver, ++p)
{
WriteScenarioVersion(Cache, output, Pkg, Ver);
- WriteScenarioDependency(Cache, output, Pkg, Ver);
+ WriteScenarioDependency(output, Ver);
fprintf(output, "\n");
if (Progress != NULL && p % 100 == 0)
Progress->Progress(p);
@@ -64,7 +64,7 @@ bool EDSP::WriteLimitedScenario(pkgDepCache &Cache, FILE* output,
for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; ++Ver)
{
WriteScenarioVersion(Cache, output, Pkg, Ver);
- WriteScenarioLimitedDependency(Cache, output, Pkg, Ver, pkgset);
+ WriteScenarioLimitedDependency(output, Ver, pkgset);
fprintf(output, "\n");
if (Progress != NULL && p % 100 == 0)
Progress->Progress(p);
@@ -111,8 +111,7 @@ void EDSP::WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::PkgI
}
/*}}}*/
// EDSP::WriteScenarioDependency /*{{{*/
-void EDSP::WriteScenarioDependency(pkgDepCache &Cache, FILE* output, pkgCache::PkgIterator const &Pkg,
- pkgCache::VerIterator const &Ver)
+void EDSP::WriteScenarioDependency( FILE* output, pkgCache::VerIterator const &Ver)
{
std::string dependencies[pkgCache::Dep::Enhances + 1];
bool orGroup = false;
@@ -148,8 +147,7 @@ void EDSP::WriteScenarioDependency(pkgDepCache &Cache, FILE* output, pkgCache::P
}
/*}}}*/
// EDSP::WriteScenarioLimitedDependency /*{{{*/
-void EDSP::WriteScenarioLimitedDependency(pkgDepCache &Cache, FILE* output,
- pkgCache::PkgIterator const &Pkg,
+void EDSP::WriteScenarioLimitedDependency(FILE* output,
pkgCache::VerIterator const &Ver,
APT::PackageSet const &pkgset)
{
diff --git a/apt-pkg/edsp.h b/apt-pkg/edsp.h
index fd4436f60..828ee3753 100644
--- a/apt-pkg/edsp.h
+++ b/apt-pkg/edsp.h
@@ -35,11 +35,9 @@ class EDSP /*{{{*/
void static WriteScenarioVersion(pkgDepCache &Cache, FILE* output,
pkgCache::PkgIterator const &Pkg,
pkgCache::VerIterator const &Ver);
- void static WriteScenarioDependency(pkgDepCache &Cache, FILE* output,
- pkgCache::PkgIterator const &Pkg,
+ void static WriteScenarioDependency(FILE* output,
pkgCache::VerIterator const &Ver);
- void static WriteScenarioLimitedDependency(pkgDepCache &Cache, FILE* output,
- pkgCache::PkgIterator const &Pkg,
+ void static WriteScenarioLimitedDependency(FILE* output,
pkgCache::VerIterator const &Ver,
APT::PackageSet const &pkgset);
public:
diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc
index 98ce4497a..80b9f79ea 100644
--- a/apt-pkg/edsp/edspindexfile.cc
+++ b/apt-pkg/edsp/edspindexfile.cc
@@ -63,7 +63,7 @@ bool edspIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
class edspIFType: public pkgIndexFile::Type
{
public:
- virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const
+ virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator) const
{
// we don't have a record parser for this type as the file is not presistent
return NULL;
diff --git a/apt-pkg/edsp/edsplistparser.cc b/apt-pkg/edsp/edsplistparser.cc
index bcfdb1017..37959f37b 100644
--- a/apt-pkg/edsp/edsplistparser.cc
+++ b/apt-pkg/edsp/edsplistparser.cc
@@ -84,8 +84,8 @@ bool edspListParser::ParseStatus(pkgCache::PkgIterator &Pkg,
}
/*}}}*/
// ListParser::LoadReleaseInfo - Load the release information /*{{{*/
-bool edspListParser::LoadReleaseInfo(pkgCache::PkgFileIterator &FileI,
- FileFd &File, std::string component)
+bool edspListParser::LoadReleaseInfo(pkgCache::PkgFileIterator & /*FileI*/,
+ FileFd & /*File*/, std::string /*component*/)
{
return true;
}
diff --git a/apt-pkg/edsp/edspsystem.cc b/apt-pkg/edsp/edspsystem.cc
index aae969d9d..b509fa001 100644
--- a/apt-pkg/edsp/edspsystem.cc
+++ b/apt-pkg/edsp/edspsystem.cc
@@ -49,7 +49,7 @@ bool edspSystem::Lock()
}
/*}}}*/
// System::UnLock - Drop a lock /*{{{*/
-bool edspSystem::UnLock(bool NoErrors)
+bool edspSystem::UnLock(bool /*NoErrors*/)
{
return true;
}
@@ -58,7 +58,7 @@ bool edspSystem::UnLock(bool NoErrors)
// ---------------------------------------------------------------------
/* we can't use edsp input as input for real installations - just a
simulation can work, but everything else will fail bigtime */
-pkgPackageManager *edspSystem::CreatePM(pkgDepCache *Cache) const
+pkgPackageManager *edspSystem::CreatePM(pkgDepCache * /*Cache*/) const
{
return NULL;
}
@@ -81,7 +81,7 @@ bool edspSystem::Initialize(Configuration &Cnf)
}
/*}}}*/
// System::ArchiveSupported - Is a file format supported /*{{{*/
-bool edspSystem::ArchiveSupported(const char *Type)
+bool edspSystem::ArchiveSupported(const char * /*Type*/)
{
return false;
}
diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc
index 38356df18..59afa86ec 100644
--- a/apt-pkg/indexcopy.cc
+++ b/apt-pkg/indexcopy.cc
@@ -551,7 +551,7 @@ bool SigVerify::CopyMetaIndex(string CDROM, string CDName, /*{{{*/
}
/*}}}*/
bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, /*{{{*/
- vector PkgList,vector SrcList)
+ vector /*PkgList*/,vector /*SrcList*/)
{
if (SigList.empty() == true)
return true;
diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc
index 642a750d4..875c80336 100644
--- a/apt-pkg/indexfile.cc
+++ b/apt-pkg/indexfile.cc
@@ -47,7 +47,7 @@ pkgIndexFile::Type *pkgIndexFile::Type::GetType(const char *Type)
// IndexFile::ArchiveInfo - Stub /*{{{*/
// ---------------------------------------------------------------------
/* */
-std::string pkgIndexFile::ArchiveInfo(pkgCache::VerIterator Ver) const
+std::string pkgIndexFile::ArchiveInfo(pkgCache::VerIterator /*Ver*/) const
{
return std::string();
}
@@ -63,8 +63,8 @@ pkgCache::PkgFileIterator pkgIndexFile::FindInCache(pkgCache &Cache) const
// IndexFile::SourceIndex - Stub /*{{{*/
// ---------------------------------------------------------------------
/* */
-std::string pkgIndexFile::SourceInfo(pkgSrcRecords::Parser const &Record,
- pkgSrcRecords::File const &File) const
+std::string pkgIndexFile::SourceInfo(pkgSrcRecords::Parser const &/*Record*/,
+ pkgSrcRecords::File const &/*File*/) const
{
return std::string();
}
diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h
index a0096fa34..9a5c74200 100644
--- a/apt-pkg/indexfile.h
+++ b/apt-pkg/indexfile.h
@@ -78,10 +78,10 @@ class pkgIndexFile
virtual bool Exists() const = 0;
virtual bool HasPackages() const = 0;
virtual unsigned long Size() const = 0;
- virtual bool Merge(pkgCacheGenerator &Gen, OpProgress* Prog) const { return false; };
+ virtual bool Merge(pkgCacheGenerator &/*Gen*/, OpProgress* /*Prog*/) const { return false; };
__deprecated virtual bool Merge(pkgCacheGenerator &Gen, OpProgress &Prog) const
{ return Merge(Gen, &Prog); };
- virtual bool MergeFileProvides(pkgCacheGenerator &Gen,OpProgress* Prog) const {return true;};
+ virtual bool MergeFileProvides(pkgCacheGenerator &/*Gen*/,OpProgress* /*Prog*/) const {return true;};
__deprecated virtual bool MergeFileProvides(pkgCacheGenerator &Gen, OpProgress &Prog) const
{return MergeFileProvides(Gen, &Prog);};
virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc
index aec744360..657330b60 100644
--- a/apt-pkg/install-progress.cc
+++ b/apt-pkg/install-progress.cc
@@ -41,10 +41,10 @@ PackageManager* PackageManagerProgressFactory()
return progress;
}
-bool PackageManager::StatusChanged(std::string PackageName,
+bool PackageManager::StatusChanged(std::string /*PackageName*/,
unsigned int StepsDone,
unsigned int TotalSteps,
- std::string HumanReadableAction)
+ std::string /*HumanReadableAction*/)
{
int reporting_steps = _config->FindI("DpkgPM::Reporting-Steps", 1);
percentage = StepsDone/(float)TotalSteps * 100.0;
diff --git a/apt-pkg/install-progress.h b/apt-pkg/install-progress.h
index 8bcc32927..baf245376 100644
--- a/apt-pkg/install-progress.h
+++ b/apt-pkg/install-progress.h
@@ -29,7 +29,7 @@ namespace Progress {
virtual ~PackageManager() {};
/* Global Start/Stop */
- virtual void Start(int child_pty=-1) {};
+ virtual void Start(int /*child_pty*/=-1) {};
virtual void Stop() {};
/* When dpkg is invoked (may happen multiple times for each
@@ -48,14 +48,14 @@ namespace Progress {
unsigned int StepsDone,
unsigned int TotalSteps,
std::string HumanReadableAction);
- virtual void Error(std::string PackageName,
- unsigned int StepsDone,
- unsigned int TotalSteps,
- std::string ErrorMessage) {}
- virtual void ConffilePrompt(std::string PackageName,
- unsigned int StepsDone,
- unsigned int TotalSteps,
- std::string ConfMessage) {}
+ virtual void Error(std::string /*PackageName*/,
+ unsigned int /*StepsDone*/,
+ unsigned int /*TotalSteps*/,
+ std::string /*ErrorMessage*/) {}
+ virtual void ConffilePrompt(std::string /*PackageName*/,
+ unsigned int /*StepsDone*/,
+ unsigned int /*TotalSteps*/,
+ std::string /*ConfMessage*/) {}
};
class PackageManagerProgressFd : public PackageManager
diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h
index 853b9bac8..d684463eb 100644
--- a/apt-pkg/packagemanager.h
+++ b/apt-pkg/packagemanager.h
@@ -89,9 +89,9 @@ class pkgPackageManager : protected pkgCache::Namespace
virtual bool Configure(PkgIterator /*Pkg*/) {return false;};
virtual bool Remove(PkgIterator /*Pkg*/,bool /*Purge*/=false) {return false;};
#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
- virtual bool Go(APT::Progress::PackageManager *progress) {return true;};
+ virtual bool Go(APT::Progress::PackageManager * /*progress*/) {return true;};
#else
- virtual bool Go(int statusFd=-1) {return true;};
+ virtual bool Go(int /*statusFd*/=-1) {return true;};
#endif
virtual void Reset() {};
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index 7d57640c5..9c14e626e 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -695,7 +695,7 @@ void pkgCache::DepIterator::GlobOr(DepIterator &Start,DepIterator &End)
// ---------------------------------------------------------------------
/* Deps like self-conflicts should be ignored as well as implicit conflicts
on virtual packages. */
-bool pkgCache::DepIterator::IsIgnorable(PkgIterator const &Pkg) const
+bool pkgCache::DepIterator::IsIgnorable(PkgIterator const &/*Pkg*/) const
{
if (IsNegative() == false)
return false;
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index 006f3952b..185b9ca45 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -1580,7 +1580,7 @@ static bool IsDuplicateDescription(pkgCache::DescIterator Desc,
}
/*}}}*/
// CacheGenerator::FinishCache /*{{{*/
-bool pkgCacheGenerator::FinishCache(OpProgress *Progress)
+bool pkgCacheGenerator::FinishCache(OpProgress * /*Progress*/)
{
return true;
}
diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h
index 428e8459b..e8901025e 100644
--- a/apt-pkg/pkgcachegen.h
+++ b/apt-pkg/pkgcachegen.h
@@ -170,8 +170,8 @@ class pkgCacheGenerator::ListParser
virtual bool Step() = 0;
inline bool HasFileDeps() {return FoundFileDeps;};
- virtual bool CollectFileProvides(pkgCache &Cache,
- pkgCache::VerIterator &Ver) {return true;};
+ virtual bool CollectFileProvides(pkgCache &/*Cache*/,
+ pkgCache::VerIterator &/*Ver*/) {return true;};
ListParser() : FoundFileDeps(false) {};
virtual ~ListParser() {};
diff --git a/apt-pkg/pkgrecords.h b/apt-pkg/pkgrecords.h
index 3658435e8..ca0984bbf 100644
--- a/apt-pkg/pkgrecords.h
+++ b/apt-pkg/pkgrecords.h
@@ -70,7 +70,7 @@ class pkgRecords::Parser /*{{{*/
virtual std::string Homepage() {return std::string();}
// An arbitrary custom field
- virtual std::string RecordField(const char *fieldName) { return std::string();};
+ virtual std::string RecordField(const char * /*fieldName*/) { return std::string();};
// The record in binary form
virtual void GetRec(const char *&Start,const char *&Stop) {Start = Stop = 0;};
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc
index d0f97441d..2176f1f42 100644
--- a/apt-pkg/policy.cc
+++ b/apt-pkg/policy.cc
@@ -349,7 +349,7 @@ signed short pkgPolicy::GetPriority(pkgCache::PkgFileIterator const &File)
all over the place rather than forcing a special format */
class PreferenceSection : public pkgTagSection
{
- void TrimRecord(bool BeforeRecord, const char* &End)
+ void TrimRecord(bool /*BeforeRecord*/, const char* &End)
{
for (; Stop < End && (Stop[0] == '\n' || Stop[0] == '\r' || Stop[0] == '#'); Stop++)
if (Stop[0] == '#')
diff --git a/apt-pkg/vendor.cc b/apt-pkg/vendor.cc
index fc03ec845..f19534171 100644
--- a/apt-pkg/vendor.cc
+++ b/apt-pkg/vendor.cc
@@ -31,7 +31,7 @@ const std::string Vendor::LookupFingerprint(std::string Print) const
return (*Elt).second;
}
-bool Vendor::CheckDist(std::string Dist)
+bool Vendor::CheckDist(std::string /*Dist*/)
{
return true;
}
diff --git a/apt-private/acqprogress.cc b/apt-private/acqprogress.cc
index 66e1600f1..d08ed072f 100644
--- a/apt-private/acqprogress.cc
+++ b/apt-private/acqprogress.cc
@@ -93,7 +93,7 @@ void AcqTextStatus::Fetch(pkgAcquire::ItemDesc &Itm)
// AcqTextStatus::Done - Completed a download /*{{{*/
// ---------------------------------------------------------------------
/* We don't display anything... */
-void AcqTextStatus::Done(pkgAcquire::ItemDesc &Itm)
+void AcqTextStatus::Done(pkgAcquire::ItemDesc &/*Itm*/)
{
Update = true;
}
diff --git a/apt-private/private-cacheset.h b/apt-private/private-cacheset.h
index 322b3be6b..26c7f1ac2 100644
--- a/apt-private/private-cacheset.h
+++ b/apt-private/private-cacheset.h
@@ -42,8 +42,8 @@ typedef APT::VersionContainer<
class Matcher {
public:
- virtual bool operator () (const pkgCache::PkgIterator &P) {
- return true;};
+ virtual bool operator () (const pkgCache::PkgIterator &/*P*/) {
+ return true;}
};
// FIXME: add default argument for OpProgress (or overloaded function)
@@ -111,8 +111,8 @@ public:
Pkg.FullName(true).c_str(), pattern.c_str());
explicitlyNamed = false;
}
- virtual void showSelectedVersion(pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const Ver,
- std::string const &ver, bool const verIsRel) {
+ virtual void showSelectedVersion(pkgCache::PkgIterator const &/*Pkg*/, pkgCache::VerIterator const Ver,
+ std::string const &ver, bool const /*verIsRel*/) {
if (ver == Ver.VerStr())
return;
selectedByRelease.push_back(make_pair(Ver, ver));
diff --git a/apt-private/private-moo.cc b/apt-private/private-moo.cc
index 5d247041d..9c4f6bf15 100644
--- a/apt-private/private-moo.cc
+++ b/apt-private/private-moo.cc
@@ -65,7 +65,7 @@ static bool printMooLine() { /*{{{*/
return true;
}
/*}}}*/
-bool DoMoo1(CommandLine &CmdL) /*{{{*/
+bool DoMoo1(CommandLine &) /*{{{*/
{
// our trustworthy super cow since 2001
if (_config->FindI("quiet") >= 2)
@@ -83,7 +83,7 @@ bool DoMoo1(CommandLine &CmdL) /*{{{*/
return true;
}
/*}}}*/
-bool DoMoo2(CommandLine &CmdL) /*{{{*/
+bool DoMoo2(CommandLine &) /*{{{*/
{
// by Fernando Ribeiro in lp:56125
if (_config->FindI("quiet") >= 2)
@@ -117,7 +117,7 @@ bool DoMoo2(CommandLine &CmdL) /*{{{*/
return true;
}
/*}}}*/
-bool DoMoo3(CommandLine &CmdL) /*{{{*/
+bool DoMoo3(CommandLine &) /*{{{*/
{
// by Robert Millan in deb:134156
if (_config->FindI("quiet") >= 2)
@@ -134,7 +134,7 @@ bool DoMoo3(CommandLine &CmdL) /*{{{*/
return true;
}
/*}}}*/
-bool DoMooApril(CommandLine &CmdL) /*{{{*/
+bool DoMooApril(CommandLine &) /*{{{*/
{
// by Christopher Allan Webber and proposed by Paul Tagliamonte
// in a "Community outreach": https://lists.debian.org/debian-devel/2013/04/msg00045.html
diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc
index dec518392..52f65d794 100644
--- a/apt-private/private-output.cc
+++ b/apt-private/private-output.cc
@@ -63,7 +63,7 @@ bool InitOutput() /*{{{*/
return true;
}
/*}}}*/
-static std::string GetArchiveSuite(pkgCacheFile &CacheFile, pkgCache::VerIterator ver) /*{{{*/
+static std::string GetArchiveSuite(pkgCacheFile &/*CacheFile*/, pkgCache::VerIterator ver) /*{{{*/
{
std::string suite = "";
if (ver && ver.FileList() && ver.FileList())
@@ -107,14 +107,14 @@ static std::string GetCandidateVersion(pkgCacheFile &CacheFile, pkgCache::PkgIte
return cand ? cand.VerStr() : "(none)";
}
/*}}}*/
-static std::string GetInstalledVersion(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
+static std::string GetInstalledVersion(pkgCacheFile &/*CacheFile*/, pkgCache::PkgIterator P)/*{{{*/
{
pkgCache::VerIterator inst = P.CurrentVer();
return inst ? inst.VerStr() : "(none)";
}
/*}}}*/
-static std::string GetVersion(pkgCacheFile &CacheFile, pkgCache::VerIterator V)/*{{{*/
+static std::string GetVersion(pkgCacheFile &/*CacheFile*/, pkgCache::VerIterator V)/*{{{*/
{
pkgCache::PkgIterator P = V.ParentPkg();
if (V == P.CurrentVer())
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 7e569f2fc..d50e0c724 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -258,7 +258,7 @@ static bool DumpPackage(CommandLine &CmdL)
// Stats - Dump some nice statistics /*{{{*/
// ---------------------------------------------------------------------
/* */
-static bool Stats(CommandLine &Cmd)
+static bool Stats(CommandLine &)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -371,7 +371,7 @@ static bool Stats(CommandLine &Cmd)
// Dump - show everything /*{{{*/
// ---------------------------------------------------------------------
/* This is worthless except fer debugging things */
-static bool Dump(CommandLine &Cmd)
+static bool Dump(CommandLine &)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -423,7 +423,7 @@ static bool Dump(CommandLine &Cmd)
// ---------------------------------------------------------------------
/* This is needed to make dpkg --merge happy.. I spent a bit of time to
make this run really fast, perhaps I went a little overboard.. */
-static bool DumpAvail(CommandLine &Cmd)
+static bool DumpAvail(CommandLine &)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -1388,7 +1388,7 @@ static bool Search(CommandLine &CmdL)
}
/*}}}*/
/* ShowAuto - show automatically installed packages (sorted) {{{*/
-static bool ShowAuto(CommandLine &CmdL)
+static bool ShowAuto(CommandLine &)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
@@ -1717,7 +1717,7 @@ static bool Madison(CommandLine &CmdL)
// GenCaches - Call the main cache generator /*{{{*/
// ---------------------------------------------------------------------
/* */
-static bool GenCaches(CommandLine &Cmd)
+static bool GenCaches(CommandLine &)
{
OpTextProgress Progress(*_config);
@@ -1728,7 +1728,7 @@ static bool GenCaches(CommandLine &Cmd)
// ShowHelp - Show a help screen /*{{{*/
// ---------------------------------------------------------------------
/* */
-static bool ShowHelp(CommandLine &Cmd)
+static bool ShowHelp(CommandLine &)
{
ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc
index dc0e050c3..8e1d27e52 100644
--- a/cmdline/apt-cdrom.cc
+++ b/cmdline/apt-cdrom.cc
@@ -93,7 +93,7 @@ bool pkgCdromTextStatus::AskCdromName(string &name)
}
-void pkgCdromTextStatus::Update(string text, int current)
+void pkgCdromTextStatus::Update(string text, int /*current*/)
{
if(text.size() > 0)
cout << text << flush;
diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc
index e83c4b64b..26f0ea161 100644
--- a/cmdline/apt-config.cc
+++ b/cmdline/apt-config.cc
@@ -78,7 +78,7 @@ static bool DoDump(CommandLine &CmdL)
// ShowHelp - Show the help screen /*{{{*/
// ---------------------------------------------------------------------
/* */
-static bool ShowHelp(CommandLine &CmdL)
+static bool ShowHelp(CommandLine &)
{
ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc
index 2b01968e3..a27008233 100644
--- a/cmdline/apt-extracttemplates.cc
+++ b/cmdline/apt-extracttemplates.cc
@@ -137,7 +137,7 @@ bool DebFile::DoItem(Item &I, int &Fd)
// DebFile::Process examine element in package and copy /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool DebFile::Process(Item &I, const unsigned char *data,
+bool DebFile::Process(Item &/*I*/, const unsigned char *data,
unsigned long size, unsigned long pos)
{
switch (Which)
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 253b2f4a5..9a4eb0881 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -475,7 +475,7 @@ static bool DoMarkAuto(CommandLine &CmdL)
// DoDSelectUpgrade - Do an upgrade by following dselects selections /*{{{*/
// ---------------------------------------------------------------------
/* Follows dselect's selections */
-static bool DoDSelectUpgrade(CommandLine &CmdL)
+static bool DoDSelectUpgrade(CommandLine &)
{
CacheFile Cache;
if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false)
@@ -551,7 +551,7 @@ static bool DoDSelectUpgrade(CommandLine &CmdL)
// DoClean - Remove download archives /*{{{*/
// ---------------------------------------------------------------------
/* */
-static bool DoClean(CommandLine &CmdL)
+static bool DoClean(CommandLine &)
{
std::string const archivedir = _config->FindDir("Dir::Cache::archives");
std::string const pkgcache = _config->FindFile("Dir::cache::pkgcache");
@@ -599,7 +599,7 @@ class LogCleaner : public pkgArchiveCleaner
};
};
-static bool DoAutoClean(CommandLine &CmdL)
+static bool DoAutoClean(CommandLine &)
{
// Lock the archive directory
FileFd Lock;
@@ -696,7 +696,7 @@ static bool DoDownload(CommandLine &CmdL)
// ---------------------------------------------------------------------
/* Opening automatically checks the system, this command is mostly used
for debugging */
-static bool DoCheck(CommandLine &CmdL)
+static bool DoCheck(CommandLine &)
{
CacheFile Cache;
Cache.Open();
@@ -1581,7 +1581,7 @@ static bool DoChangelog(CommandLine &CmdL)
// ShowHelp - Show a help screen /*{{{*/
// ---------------------------------------------------------------------
/* */
-static bool ShowHelp(CommandLine &CmdL)
+static bool ShowHelp(CommandLine &)
{
ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc
index d8ea0435a..8ff2fa037 100644
--- a/cmdline/apt-helper.cc
+++ b/cmdline/apt-helper.cc
@@ -55,7 +55,7 @@ static bool DoDownloadFile(CommandLine &CmdL)
return true;
}
-static bool ShowHelp(CommandLine &CmdL)
+static bool ShowHelp(CommandLine &)
{
ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc
index 108e86b9a..0c2ff0f43 100644
--- a/cmdline/apt-internal-solver.cc
+++ b/cmdline/apt-internal-solver.cc
@@ -30,7 +30,7 @@
// ShowHelp - Show a help screen /*{{{*/
// ---------------------------------------------------------------------
/* */
-static bool ShowHelp(CommandLine &CmdL) {
+static bool ShowHelp(CommandLine &) {
ioprintf(std::cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc
index 1af17cd7a..53b5ec158 100644
--- a/cmdline/apt-mark.cc
+++ b/cmdline/apt-mark.cc
@@ -372,7 +372,7 @@ static bool ShowHold(CommandLine &CmdL)
// ShowHelp - Show a help screen /*{{{*/
// ---------------------------------------------------------------------
/* */
-static bool ShowHelp(CommandLine &CmdL)
+static bool ShowHelp(CommandLine &)
{
ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
diff --git a/cmdline/apt.cc b/cmdline/apt.cc
index 040ed6c25..1b7626948 100644
--- a/cmdline/apt.cc
+++ b/cmdline/apt.cc
@@ -61,7 +61,7 @@
-static bool ShowHelp(CommandLine &CmdL)
+static bool ShowHelp(CommandLine &)
{
ioprintf(c1out,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc
index c28ad5c5c..f13e4648a 100644
--- a/ftparchive/apt-ftparchive.cc
+++ b/ftparchive/apt-ftparchive.cc
@@ -586,7 +586,7 @@ static void LoadBinDir(vector &PkgList,Configuration &Setup)
// ShowHelp - Show the help text /*{{{*/
// ---------------------------------------------------------------------
/* */
-static bool ShowHelp(CommandLine &CmdL)
+static bool ShowHelp(CommandLine &)
{
ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
COMMON_ARCH,__DATE__,__TIME__);
diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc
index 80fe6e17e..be4d2a61e 100644
--- a/ftparchive/contents.cc
+++ b/ftparchive/contents.cc
@@ -316,7 +316,7 @@ bool ContentsExtract::Read(debDebFile &Deb)
// ContentsExtract::DoItem - Extract an item /*{{{*/
// ---------------------------------------------------------------------
/* This just tacks the name onto the end of our memory buffer */
-bool ContentsExtract::DoItem(Item &Itm,int &Fd)
+bool ContentsExtract::DoItem(Item &Itm, int &/*Fd*/)
{
unsigned long Len = strlen(Itm.Name);
diff --git a/ftparchive/override.cc b/ftparchive/override.cc
index 82cbc4c19..38d76a6a3 100644
--- a/ftparchive/override.cc
+++ b/ftparchive/override.cc
@@ -129,7 +129,7 @@ bool Override::ReadOverride(string const &File,bool const &Source)
// Override::ReadExtraOverride - Read the extra override file /*{{{*/
// ---------------------------------------------------------------------
/* This parses the extra override file and reads it into the map */
-bool Override::ReadExtraOverride(string const &File,bool const &Source)
+bool Override::ReadExtraOverride(string const &File,bool const &/*Source*/)
{
if (File.empty() == true)
return true;
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
index 7ecfe78ed..edc0fddea 100644
--- a/ftparchive/writer.cc
+++ b/ftparchive/writer.cc
@@ -72,9 +72,9 @@ FTWScanner::FTWScanner(string const &Arch): Arch(Arch)
/*}}}*/
// FTWScanner::Scanner - FTW Scanner /*{{{*/
// ---------------------------------------------------------------------
-/* This is the FTW scanner, it processes each directory element in the
+/* This is the FTW scanner, it processes each directory element in the
directory tree. */
-int FTWScanner::ScannerFTW(const char *File,const struct stat *sb,int Flag)
+int FTWScanner::ScannerFTW(const char *File,const struct stat * /*sb*/,int Flag)
{
if (Flag == FTW_DNR)
{
@@ -951,7 +951,7 @@ bool ContentsWriter::ReadFromPkgs(string const &PkgFile,string const &PkgCompres
// ReleaseWriter::ReleaseWriter - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-ReleaseWriter::ReleaseWriter(string const &DB)
+ReleaseWriter::ReleaseWriter(string const &/*DB*/)
{
if (_config->FindB("APT::FTPArchive::Release::Default-Patterns", true) == true)
{
diff --git a/methods/ftp.cc b/methods/ftp.cc
index 5a87ded1c..4108b2da3 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -1098,7 +1098,7 @@ bool FtpMethod::Fetch(FetchItem *Itm)
}
/*}}}*/
-int main(int argc,const char *argv[])
+int main(int, const char *argv[])
{
setlocale(LC_ALL, "");
diff --git a/methods/gzip.cc b/methods/gzip.cc
index a2844e969..3269ffbb8 100644
--- a/methods/gzip.cc
+++ b/methods/gzip.cc
@@ -120,7 +120,7 @@ bool GzipMethod::Fetch(FetchItem *Itm)
}
/*}}}*/
-int main(int argc, char *argv[])
+int main(int, char *argv[])
{
setlocale(LC_ALL, "");
diff --git a/methods/https.cc b/methods/https.cc
index b0c7ee71d..041214179 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -83,9 +83,9 @@ HttpsMethod::write_data(void *buffer, size_t size, size_t nmemb, void *userp)
return size*nmemb;
}
-int
-HttpsMethod::progress_callback(void *clientp, double dltotal, double dlnow,
- double ultotal, double ulnow)
+int
+HttpsMethod::progress_callback(void *clientp, double dltotal, double /*dlnow*/,
+ double /*ultotal*/, double /*ulnow*/)
{
HttpsMethod *me = (HttpsMethod *)clientp;
if(dltotal > 0 && me->Res.Size == 0) {
@@ -95,7 +95,7 @@ HttpsMethod::progress_callback(void *clientp, double dltotal, double dlnow,
}
// HttpsServerState::HttpsServerState - Constructor /*{{{*/
-HttpsServerState::HttpsServerState(URI Srv,HttpsMethod *Owner) : ServerState(Srv, NULL)
+HttpsServerState::HttpsServerState(URI Srv,HttpsMethod * /*Owner*/) : ServerState(Srv, NULL)
{
TimeOut = _config->FindI("Acquire::https::Timeout",TimeOut);
Reset();
diff --git a/methods/https.h b/methods/https.h
index ab0dd3407..3199b29f2 100644
--- a/methods/https.h
+++ b/methods/https.h
@@ -25,23 +25,23 @@ class FileFd;
class HttpsServerState : public ServerState
{
protected:
- virtual bool ReadHeaderLines(std::string &Data) { return false; }
- virtual bool LoadNextResponse(bool const ToFile, FileFd * const File) { return false; }
+ virtual bool ReadHeaderLines(std::string &/*Data*/) { return false; }
+ virtual bool LoadNextResponse(bool const /*ToFile*/, FileFd * const /*File*/) { return false; }
public:
- virtual bool WriteResponse(std::string const &Data) { return false; }
+ virtual bool WriteResponse(std::string const &/*Data*/) { return false; }
/** \brief Transfer the data from the socket */
- virtual bool RunData(FileFd * const File) { return false; }
+ virtual bool RunData(FileFd * const /*File*/) { return false; }
virtual bool Open() { return false; }
virtual bool IsOpen() { return false; }
virtual bool Close() { return false; }
- virtual bool InitHashes(FileFd &File) { return false; }
+ virtual bool InitHashes(FileFd &/*File*/) { return false; }
virtual Hashes * GetHashes() { return NULL; }
- virtual bool Die(FileFd &File) { return false; }
- virtual bool Flush(FileFd * const File) { return false; }
- virtual bool Go(bool ToFile, FileFd * const File) { return false; }
+ virtual bool Die(FileFd &/*File*/) { return false; }
+ virtual bool Flush(FileFd * const /*File*/) { return false; }
+ virtual bool Go(bool /*ToFile*/, FileFd * const /*File*/) { return false; }
HttpsServerState(URI Srv, HttpsMethod *Owner);
virtual ~HttpsServerState() {Close();};
diff --git a/methods/mirror.cc b/methods/mirror.cc
index 977eddcf5..b30636758 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -132,7 +132,7 @@ bool MirrorMethod::Clean(string Dir)
}
-bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str)
+bool MirrorMethod::DownloadMirrorFile(string /*mirror_uri_str*/)
{
// not that great to use pkgAcquire here, but we do not have
// any other way right now
diff --git a/methods/rsh.cc b/methods/rsh.cc
index f065f6b89..8088cac38 100644
--- a/methods/rsh.cc
+++ b/methods/rsh.cc
@@ -390,7 +390,7 @@ bool RSHMethod::Configuration(std::string Message)
// RSHMethod::SigTerm - Clean up and timestamp the files on exit /*{{{*/
// ---------------------------------------------------------------------
/* */
-void RSHMethod::SigTerm(int sig)
+void RSHMethod::SigTerm(int)
{
if (FailFd == -1)
_exit(100);
@@ -519,7 +519,7 @@ bool RSHMethod::Fetch(FetchItem *Itm)
}
/*}}}*/
-int main(int argc, const char *argv[])
+int main(int, const char *argv[])
{
setlocale(LC_ALL, "");
diff --git a/test/interactive-helper/testdeb.cc b/test/interactive-helper/testdeb.cc
index 89375af13..9520d1b50 100644
--- a/test/interactive-helper/testdeb.cc
+++ b/test/interactive-helper/testdeb.cc
@@ -6,7 +6,7 @@
class NullStream : public pkgDirStream
{
public:
- virtual bool DoItem(Item &Itm,int &Fd) {return true;};
+ virtual bool DoItem(Item &/*Itm*/, int &/*Fd*/) {return true;};
};
static bool Test(const char *File)
@@ -33,6 +33,11 @@ static bool Test(const char *File)
int main(int argc, const char *argv[])
{
+ if (argc != 2) {
+ std::cout << "One parameter expected - given " << argc << std::endl;
+ return 100;
+ }
+
Test(argv[1]);
_error->DumpErrors();
return 0;
diff --git a/test/libapt/cdromreducesourcelist_test.cc b/test/libapt/cdromreducesourcelist_test.cc
index 729da23a6..b0314769d 100644
--- a/test/libapt/cdromreducesourcelist_test.cc
+++ b/test/libapt/cdromreducesourcelist_test.cc
@@ -15,7 +15,7 @@ public:
}
};
-int main(int argc, char const *argv[]) {
+int main() {
Cdrom cd;
std::vector List;
std::string CD("/media/cdrom/");
diff --git a/test/libapt/configuration_test.cc b/test/libapt/configuration_test.cc
index 957e905d5..d2efc1b4b 100644
--- a/test/libapt/configuration_test.cc
+++ b/test/libapt/configuration_test.cc
@@ -5,7 +5,7 @@
#include "assert.h"
-int main(int argc,const char *argv[]) {
+int main() {
Configuration Cnf;
std::vector fds;
diff --git a/test/libapt/fileutl_test.cc b/test/libapt/fileutl_test.cc
index 462bdefd9..d256ea55a 100644
--- a/test/libapt/fileutl_test.cc
+++ b/test/libapt/fileutl_test.cc
@@ -10,7 +10,7 @@
#include