From b47081521b0df1f835a2111254fa1fcd77240a85 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 23 Jan 2007 18:43:42 +0100 Subject: * cmdline/report-mirror-failure - basic mirror failure script added --- cmdline/report-mirror-failure | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 cmdline/report-mirror-failure (limited to 'cmdline') diff --git a/cmdline/report-mirror-failure b/cmdline/report-mirror-failure new file mode 100755 index 000000000..8301ed079 --- /dev/null +++ b/cmdline/report-mirror-failure @@ -0,0 +1,21 @@ +#!/usr/bin/python + +import sys +import urllib +import apt_pkg + +apt_pkg.init() +url = apt_pkg.Config.Find("Acquire::Mirror::ReportFailures", + "http://people.ubuntu.com:9000/mirror-failure") + #"http://localhost:9000/mirror-failure") +if not url: + sys.exit(0) + +data = {} +data['url'] = sys.argv[1] +data['error'] = sys.argv[2] +f = urllib.urlopen(url, urllib.urlencode(data)) +f.read() +f.close() + + -- cgit v1.2.3 From 362d29343e5d25248bcd84300aa1b18effe891e7 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 24 Jan 2007 14:42:17 +0100 Subject: make the mirror failures actually produce a error message --- cmdline/makefile | 6 ++++++ cmdline/report-mirror-failure | 21 --------------------- 2 files changed, 6 insertions(+), 21 deletions(-) delete mode 100755 cmdline/report-mirror-failure (limited to 'cmdline') diff --git a/cmdline/makefile b/cmdline/makefile index 882a0e1b5..f07c7da3b 100644 --- a/cmdline/makefile +++ b/cmdline/makefile @@ -52,3 +52,9 @@ SOURCE=apt-key TO=$(BIN) TARGET=program include $(COPY_H) + +# The apt-key program +SOURCE=apt-report-mirror-failure +TO=$(LIB) +TARGET=program +include $(COPY_H) diff --git a/cmdline/report-mirror-failure b/cmdline/report-mirror-failure deleted file mode 100755 index 8301ed079..000000000 --- a/cmdline/report-mirror-failure +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/python - -import sys -import urllib -import apt_pkg - -apt_pkg.init() -url = apt_pkg.Config.Find("Acquire::Mirror::ReportFailures", - "http://people.ubuntu.com:9000/mirror-failure") - #"http://localhost:9000/mirror-failure") -if not url: - sys.exit(0) - -data = {} -data['url'] = sys.argv[1] -data['error'] = sys.argv[2] -f = urllib.urlopen(url, urllib.urlencode(data)) -f.read() -f.close() - - -- cgit v1.2.3 From 36280399db0ae203d3f1ae4d44b946f31e9a38ce Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 1 Feb 2007 12:32:50 +0100 Subject: * commited the latest mirror failure detection code --- cmdline/apt-report-mirror-failure | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 cmdline/apt-report-mirror-failure (limited to 'cmdline') diff --git a/cmdline/apt-report-mirror-failure b/cmdline/apt-report-mirror-failure new file mode 100755 index 000000000..70b16cf4f --- /dev/null +++ b/cmdline/apt-report-mirror-failure @@ -0,0 +1,23 @@ +#!/usr/bin/python + +import sys +import urllib +import apt_pkg + +print "apt-report-mirror-failure" + +apt_pkg.init() +url = apt_pkg.Config.Find("Acquire::Mirror::ReportFailures", + "http://people.ubuntu.com:9000/mirror-failure") + #"http://localhost:9000/mirror-failure") +if not url: + sys.exit(0) + +data = {} +data['url'] = sys.argv[1] +data['error'] = sys.argv[2] +f = urllib.urlopen(url, urllib.urlencode(data)) +f.read() +f.close() + + -- cgit v1.2.3 From 361593e92a44255cc0ef98417e7457911716cab5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 1 Feb 2007 13:02:47 +0100 Subject: * get the mirror failure stuff really working --- cmdline/apt-report-mirror-failure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-report-mirror-failure b/cmdline/apt-report-mirror-failure index 70b16cf4f..277b23e9a 100755 --- a/cmdline/apt-report-mirror-failure +++ b/cmdline/apt-report-mirror-failure @@ -4,8 +4,6 @@ import sys import urllib import apt_pkg -print "apt-report-mirror-failure" - apt_pkg.init() url = apt_pkg.Config.Find("Acquire::Mirror::ReportFailures", "http://people.ubuntu.com:9000/mirror-failure") @@ -13,6 +11,8 @@ url = apt_pkg.Config.Find("Acquire::Mirror::ReportFailures", if not url: sys.exit(0) +print "Reporting mirror failure to '%s'" % url + data = {} data['url'] = sys.argv[1] data['error'] = sys.argv[2] -- cgit v1.2.3 From f0b509cdb44cb5e79e9c5ddd7ebec46965138534 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 5 Feb 2007 19:06:42 +0100 Subject: * apt-pkg/acquire-item.cc: - use FailReason in pkgAcquire::Item::Failed when available * methods/mirror.cc: - move some debug output into if(Debug) --- cmdline/apt-report-mirror-failure | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-report-mirror-failure b/cmdline/apt-report-mirror-failure index 277b23e9a..fb43f0e74 100755 --- a/cmdline/apt-report-mirror-failure +++ b/cmdline/apt-report-mirror-failure @@ -14,8 +14,9 @@ if not url: print "Reporting mirror failure to '%s'" % url data = {} -data['url'] = sys.argv[1] -data['error'] = sys.argv[2] +data['mirror'] = sys.argv[1] +data['failurl'] = sys.argv[2] +data['error'] = sys.argv[3] f = urllib.urlopen(url, urllib.urlencode(data)) f.read() f.close() -- cgit v1.2.3 From 3f599bb721c4ac58d8ff18991c9704b5f30eaa2b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 6 Feb 2007 10:49:25 +0100 Subject: * apt-pkg/acquire-item.cc: - default to "/usr/lib/apt/apt-report-mirror-failure" * cmdline/apt-report-mirror-failure: - no default comit url for now * debian/rules: - move apt-report-mirror-failure into /usr/lib/apt * doc/examples/configure-index: - more documentation * methods/mirror.cc: - updated TODO --- cmdline/apt-report-mirror-failure | 4 ++-- cmdline/makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-report-mirror-failure b/cmdline/apt-report-mirror-failure index fb43f0e74..1567e78e3 100755 --- a/cmdline/apt-report-mirror-failure +++ b/cmdline/apt-report-mirror-failure @@ -5,8 +5,8 @@ import urllib import apt_pkg apt_pkg.init() -url = apt_pkg.Config.Find("Acquire::Mirror::ReportFailures", - "http://people.ubuntu.com:9000/mirror-failure") +url = apt_pkg.Config.Find("Acquire::Mirror::ReportFailures", None) + #"http://people.ubuntu.com:9000/mirror-failure") #"http://localhost:9000/mirror-failure") if not url: sys.exit(0) diff --git a/cmdline/makefile b/cmdline/makefile index f07c7da3b..8d284c2f3 100644 --- a/cmdline/makefile +++ b/cmdline/makefile @@ -55,6 +55,6 @@ include $(COPY_H) # The apt-key program SOURCE=apt-report-mirror-failure -TO=$(LIB) +TO=$(BIN) TARGET=program include $(COPY_H) -- cgit v1.2.3 From ba688e8d8be99334b96f32a861ad23a0abb9b886 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 13 Mar 2007 12:02:38 +0100 Subject: * cmdline/apt-get.cc: - fix version output in autoremove list (LP#68941) --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 765591b14..4ffb9414b 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1446,7 +1446,7 @@ bool DoAutomaticRemove(CacheFile &Cache) std::cout << "We could delete %s" << Pkg.Name() << std::endl; autoremovelist += string(Pkg.Name()) + " "; - autoremoveversions += string(Cache[Pkg].CandVersion) + " "; + autoremoveversions += string(Cache[Pkg].CandVersion) + "\n"; if (doAutoRemove) { if(Pkg.CurrentVer() != 0 && -- cgit v1.2.3 From 7db98f31498a85da22cc00e446bce8ac8c319554 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 14 Mar 2007 13:10:42 +0100 Subject: * cmdline/apt-get.cc: - "apt-get install foo" on a already installed package foo will clean the automatic installed flag --- cmdline/apt-get.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 4ffb9414b..430b1bccb 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1556,6 +1556,7 @@ bool DoInstall(CommandLine &CmdL) if (Cache->BrokenCount() != 0) BrokenFix = true; + unsigned int AutoMarkChanged = 0; unsigned int ExpectedInst = 0; unsigned int Packages = 0; pkgProblemResolver Fix(Cache); @@ -1692,6 +1693,18 @@ bool DoInstall(CommandLine &CmdL) return false; if (TryToInstall(Pkg,Cache,Fix,Remove,BrokenFix,ExpectedInst) == false) return false; + + // see if we need to fix the auto-mark flag + // e.g. apt-get install foo + // where foo is marked automatic + if(Cache[Pkg].Install() == false && + (Cache[Pkg].Flags & pkgCache::Flag::Auto)) + { + ioprintf(c1out,_("%s set to manual installed.\n"), + Pkg.Name()); + Cache->MarkAuto(Pkg,false); + AutoMarkChanged++; + } } } @@ -1854,6 +1867,14 @@ bool DoInstall(CommandLine &CmdL) } + // if nothing changed in the cache, but only the automark information + // we write the StateFile here, otherwise it will be written in + // cache.commit() + if (AutoMarkChanged > 0 && + Cache->DelCount() == 0 && Cache->InstCount() == 0 && + Cache->BadCount() == 0) + Cache->writeStateFile(NULL); + // See if we need to prompt if (Cache->InstCount() == ExpectedInst && Cache->DelCount() == 0) return InstallPackages(Cache,false,false); -- cgit v1.2.3 From 28e454d68b9cc6ba60e19dcbcfe3a97c151ef8f8 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 14 Mar 2007 13:47:49 +0100 Subject: - do not show packages already marked for removal as auto-installed --- cmdline/apt-get.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 430b1bccb..d1d6ab7b4 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1444,9 +1444,13 @@ bool DoAutomaticRemove(CacheFile &Cache) if(Pkg.CurrentVer() != 0 || Cache[Pkg].Install()) if(Debug) std::cout << "We could delete %s" << Pkg.Name() << std::endl; - - autoremovelist += string(Pkg.Name()) + " "; - autoremoveversions += string(Cache[Pkg].CandVersion) + "\n"; + + // only show stuff in the list that is not yet marked for removal + if(Cache[Pkg].Delete() == false) + { + autoremovelist += string(Pkg.Name()) + " "; + autoremoveversions += string(Cache[Pkg].CandVersion) + "\n"; + } if (doAutoRemove) { if(Pkg.CurrentVer() != 0 && @@ -1697,7 +1701,8 @@ bool DoInstall(CommandLine &CmdL) // see if we need to fix the auto-mark flag // e.g. apt-get install foo // where foo is marked automatic - if(Cache[Pkg].Install() == false && + if(!Remove && + Cache[Pkg].Install() == false && (Cache[Pkg].Flags & pkgCache::Flag::Auto)) { ioprintf(c1out,_("%s set to manual installed.\n"), -- cgit v1.2.3 From 31dc104687b79d3d9dea7d8c0e1a2bde80598ff0 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 14 Mar 2007 17:11:25 +0100 Subject: * cmdline/apt-mark: fix chmod()/rename() ordering --- cmdline/apt-mark | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-mark b/cmdline/apt-mark index 728f083dc..dadc01366 100755 --- a/cmdline/apt-mark +++ b/cmdline/apt-mark @@ -60,5 +60,5 @@ if __name__ == "__main__": else: outfile.write(str(tagfile.Section)+"\n") # all done, rename the tmpfile - os.rename(outfile.name, STATE_FILE) os.chmod(outfile.name, 0644) + os.rename(outfile.name, STATE_FILE) -- cgit v1.2.3 From 3238423f4d0bebf02c02fa6e5ca5b6db4fca56c5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 18 Jun 2007 14:06:21 +0200 Subject: * implement warning when Vcs-*: header is found in source record --- cmdline/apt-get.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 554677f39..51bcfde12 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2114,6 +2114,28 @@ bool DoSource(CommandLine &CmdL) if (Last == 0) return _error->Error(_("Unable to find a source package for %s"),Src.c_str()); + string srec = Last->AsStr(); + string::size_type pos = srec.find("\nVcs-"); + if (pos != string::npos ) + { + pos += strlen("\nVcs-"); + string vcs = srec.substr(pos,srec.find(":",pos)-pos); + pos += vcs.length()+2; + string::size_type epos = srec.find("\n", pos); + string uri = srec.substr(pos,epos-pos).c_str(); + ioprintf(c1out, _("WARNING: '%s' is maintained in " + "the '%s' version control system at:\n" + "'%s'\n"), + Src.c_str(), vcs.c_str(), uri.c_str()); + if(vcs == "Bzr") + ioprintf(c1out,_("Please use: 'bzr get %s'\n" + "to modify the package.\n"), + uri.c_str()); + ioprintf(c1out, "Are you sure you want to continue [yN]? "); + if(!YnPrompt(false)) + return _error->Error(_("Abort.")); + } + // Back track vector Lst; if (Last->Files(Lst) == false) -- cgit v1.2.3 From 541c83b92a4919ba0aed6150f71e227d07f93a02 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 27 Jun 2007 13:34:34 +0200 Subject: * cmdline/apt-get.cc: - fix InstallTask code when a pkgRecord ends with a single '\n' (thanks to Soren Hansen for reporting) --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 51bcfde12..974427f51 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1519,7 +1519,7 @@ bool TryInstallTask(pkgDepCache &Cache, pkgProblemResolver &Fix, // build regexp for the task char S[300]; - snprintf(S, sizeof(S), "^Task:.*[^a-z]%s[^a-z].*\n", taskname); + snprintf(S, sizeof(S), "^Task:.*[^a-z]%s[^a-z].*$", taskname); regcomp(&Pattern,S, REG_EXTENDED | REG_NOSUB | REG_NEWLINE); bool found = false; -- cgit v1.2.3 From 927677f0ae5f92bb6935c91b08ee6ffe220d4bfa Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 28 Jun 2007 18:19:58 +0200 Subject: * cmdline/apt-get.cc: - make the ouput more friendly for copy and paste (thanks to Matt Zimmerman) --- cmdline/apt-get.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 51bcfde12..930d88d99 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2128,7 +2128,8 @@ bool DoSource(CommandLine &CmdL) "'%s'\n"), Src.c_str(), vcs.c_str(), uri.c_str()); if(vcs == "Bzr") - ioprintf(c1out,_("Please use: 'bzr get %s'\n" + ioprintf(c1out,_("Please use:\n" + "bzr get %s\n" "to modify the package.\n"), uri.c_str()); ioprintf(c1out, "Are you sure you want to continue [yN]? "); -- cgit v1.2.3 From 8756297c0f5987d2320955c21e5c64395ce311cc Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 28 Jun 2007 18:38:55 +0200 Subject: * cmdline/apt-get.cc: - remove '' around xs-vcs-$repo to make pasting easier --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 930d88d99..fa7ae32eb 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2125,7 +2125,7 @@ bool DoSource(CommandLine &CmdL) string uri = srec.substr(pos,epos-pos).c_str(); ioprintf(c1out, _("WARNING: '%s' is maintained in " "the '%s' version control system at:\n" - "'%s'\n"), + "%s\n"), Src.c_str(), vcs.c_str(), uri.c_str()); if(vcs == "Bzr") ioprintf(c1out,_("Please use:\n" -- cgit v1.2.3 From 774a66876919712d5b8e12174f01f0337d2f3393 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 29 Jun 2007 13:04:17 +0200 Subject: * cmdline/apt-get.cc: - ignore Vcs-Browser flag (#121770) --- cmdline/apt-get.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index fa7ae32eb..08bb1bc34 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2116,10 +2116,15 @@ bool DoSource(CommandLine &CmdL) string srec = Last->AsStr(); string::size_type pos = srec.find("\nVcs-"); - if (pos != string::npos ) + while (pos != string::npos) { pos += strlen("\nVcs-"); string vcs = srec.substr(pos,srec.find(":",pos)-pos); + if(vcs == "Browser") + { + pos = srec.find("\nVcs-", pos); + continue; + } pos += vcs.length()+2; string::size_type epos = srec.find("\n", pos); string uri = srec.substr(pos,epos-pos).c_str(); @@ -2135,6 +2140,8 @@ bool DoSource(CommandLine &CmdL) ioprintf(c1out, "Are you sure you want to continue [yN]? "); if(!YnPrompt(false)) return _error->Error(_("Abort.")); + else + break; } // Back track -- cgit v1.2.3 From b799e134fc730519cc8f0c0ea4387badffac4092 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 8 Aug 2007 12:52:56 +0200 Subject: * cmdline/apt-get.cc: - remove YnPrompt when a XS-Vcs- tag is found, improve the notice (LP: #129575) --- cmdline/apt-get.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index ead053136..e7b7d5204 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2130,20 +2130,17 @@ bool DoSource(CommandLine &CmdL) pos += vcs.length()+2; string::size_type epos = srec.find("\n", pos); string uri = srec.substr(pos,epos-pos).c_str(); - ioprintf(c1out, _("WARNING: '%s' is maintained in " + ioprintf(c1out, _("NOTICE: '%s' packaging is maintained in " "the '%s' version control system at:\n" "%s\n"), Src.c_str(), vcs.c_str(), uri.c_str()); if(vcs == "Bzr") ioprintf(c1out,_("Please use:\n" "bzr get %s\n" - "to modify the package.\n"), + "to retrieve the latest (possible unreleased) " + "updates to the package.\n"), uri.c_str()); - ioprintf(c1out, "Are you sure you want to continue [yN]? "); - if(!YnPrompt(false)) - return _error->Error(_("Abort.")); - else - break; + break; } // Back track -- cgit v1.2.3 From fd9a8ca2ed30994a7946acbf54f25d27fe2b10cb Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 13 Feb 2008 19:52:12 +0100 Subject: cmdline/apt-key: import net_update key from the project/ directory for now --- cmdline/apt-key | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-key b/cmdline/apt-key index e0c4b5e48..7d6f9c589 100755 --- a/cmdline/apt-key +++ b/cmdline/apt-key @@ -12,7 +12,7 @@ GPG="$GPG_CMD --keyring /etc/apt/trusted.gpg" MASTER_KEYRING=/usr/share/keyrings/ubuntu-master-keyring.gpg ARCHIVE_KEYRING=/usr/share/keyrings/ubuntu-archive-keyring.gpg REMOVED_KEYS=/usr/share/keyrings/ubuntu-archive-removed-keys.gpg -ARCHIVE_KEYRING_URI=http://archive.ubuntu.com/ubuntu/ubuntu-archive-keyring.gpg +ARCHIVE_KEYRING_URI=http://archive.ubuntu.com/ubuntu/project/ubuntu-archive-keyring.gpg add_keys_with_verify_against_master_keyring() { ADD_KEYRING=$1 -- cgit v1.2.3 From 6f320e7b0fe9e9f1e1ac4452ba7a4c1eca297842 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 11 Mar 2008 09:54:45 +0100 Subject: * cmdline/apt-get.cc: - fix incorrect help output for -f (LP: #57487) --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 8956332a3..c522d4f87 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2662,7 +2662,7 @@ bool ShowHelp(CommandLine &CmdL) " -d Download only - do NOT install or unpack archives\n" " -s No-act. Perform ordering simulation\n" " -y Assume Yes to all queries and do not prompt\n" - " -f Attempt to continue if the integrity check fails\n" + " -f Attempt to correct a system with broken dependencies in place\n" " -m Attempt to continue if archives are unlocatable\n" " -u Show a list of upgraded packages as well\n" " -b Build the source package after fetching it\n" -- cgit v1.2.3 From 95717122196eb888bc81f5c3e8daa74cad8db649 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 11 Mar 2008 17:41:55 +0100 Subject: - run the problemResolver after a task was installed so that it can correct any missing dependencies --- cmdline/apt-get.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index c522d4f87..c8671447e 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1506,10 +1506,13 @@ bool TryInstallTask(pkgDepCache &Cache, pkgProblemResolver &Fix, buf[end-start] = 0x0; if (regexec(&Pattern,buf,0,0,0) != 0) continue; - res &= TryToInstall(Pkg,Cache,Fix,Remove,false,ExpectedInst); + res &= TryToInstall(Pkg,Cache,Fix,Remove,true,ExpectedInst); found = true; } + // now let the problem resolver deal with any issues + Fix.Resolve(true); + if(!found) _error->Error(_("Couldn't find task %s"),taskname); -- cgit v1.2.3 From c22356d86150dfee4903ff146a64cd5ad63be827 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 13 Mar 2008 23:42:43 +0100 Subject: * cmdline/apt-get.cc: - do two passes when installing tasks, first ignoring dependencies, then resolving them and run the problemResolver at the end so that it can correct any missing dependencies. This should fix livecd building for kubuntu (thanks to Jonathan Riddell for reporting the problem) --- cmdline/apt-get.cc | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index c8671447e..cabbde5cb 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1495,19 +1495,24 @@ bool TryInstallTask(pkgDepCache &Cache, pkgProblemResolver &Fix, bool found = false; bool res = true; - for (Pkg = Cache.PkgBegin(); Pkg.end() == false; Pkg++) + + // two runs, first ignore dependencies, second install any missing + for(int IgnoreBroken=1; IgnoreBroken >= 0; IgnoreBroken--) { - pkgCache::VerIterator ver = Cache[Pkg].CandidateVerIter(Cache); - if(ver.end()) - continue; - pkgRecords::Parser &parser = Recs.Lookup(ver.FileList()); - parser.GetRec(start,end); - strncpy(buf, start, end-start); - buf[end-start] = 0x0; - if (regexec(&Pattern,buf,0,0,0) != 0) - continue; - res &= TryToInstall(Pkg,Cache,Fix,Remove,true,ExpectedInst); - found = true; + for (Pkg = Cache.PkgBegin(); Pkg.end() == false; Pkg++) + { + pkgCache::VerIterator ver = Cache[Pkg].CandidateVerIter(Cache); + if(ver.end()) + continue; + pkgRecords::Parser &parser = Recs.Lookup(ver.FileList()); + parser.GetRec(start,end); + strncpy(buf, start, end-start); + buf[end-start] = 0x0; + if (regexec(&Pattern,buf,0,0,0) != 0) + continue; + res &= TryToInstall(Pkg,Cache,Fix,Remove,IgnoreBroken,ExpectedInst); + found = true; + } } // now let the problem resolver deal with any issues -- cgit v1.2.3 From 397d56f56b3ffaf38df57571c11f0699e2810902 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 8 Apr 2008 14:20:06 +0200 Subject: * cmdline/apt-key: - only check against master-keys in net-update to not break custom CDs (thanks to Colin Watson) --- cmdline/apt-key | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-key b/cmdline/apt-key index 77a2a4623..de04d16da 100755 --- a/cmdline/apt-key +++ b/cmdline/apt-key @@ -29,9 +29,8 @@ add_keys_with_verify_against_master_keyring() { # when adding new keys, make sure that the archive-master-keyring # is honored. so: - # all keys that are exported and have the name - # "Ubuntu Archive Automatic Signing Key" must have a valid signature - # from a key in the ubuntu-master-keyring + # all keys that are exported must have a valid signature + # from a key in the $distro-master-keyring add_keys=`$GPG_CMD --keyring $ADD_KEYRING --with-colons --list-keys | grep ^pub | cut -d: -f5` master_keys=`$GPG_CMD --keyring $MASTER --with-colons --list-keys | grep ^pub | cut -d: -f5` for add_key in $add_keys; do @@ -81,13 +80,14 @@ update() { exit 1 fi - # add new keys, if no MASTER_KEYRING is used, use the traditional - # way - if [ -z "$MASTER_KEYRING" ]; then - $GPG_CMD --quiet --batch --keyring $ARCHIVE_KEYRING --export | $GPG --import - else - add_keys_with_verify_against_master_keyring $ARCHIVE_KEYRING $MASTER_KEYRING - fi + # add new keys from the package; + + # we do not use add_keys_with_verify_against_master_keyring here, + # because we "update" is run on regular package updates. A + # attacker might as well replace the master-archive-keyring file + # in the package and add his own keys. so this check wouldn't + # add any security. we *need* this check on net-update though + $GPG_CMD --quiet --batch --keyring $ARCHIVE_KEYRING --export | $GPG --import # remove no-longer supported/used keys keys=`$GPG_CMD --keyring $REMOVED_KEYS --with-colons --list-keys | grep ^pub | cut -d: -f5` -- cgit v1.2.3 From 9772f307fdf1f4cc94690b4ba3705a8f891033fe Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 8 Dec 2008 09:37:09 -0800 Subject: * cmdline/apt-get.cc: - fix "apt-get source pkg=ver" if binary name != source name (LP: #202219) * doc/makefile: - add examples/apt-https-method-example.conf --- cmdline/apt-get.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index bd95e917b..ea7d45952 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1295,9 +1295,9 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, { string Ver = Parse->Version(); - // Skip name mismatches - if (IsMatch == true && Parse->Package() != Src) - continue; + // show name mismatches + if (IsMatch == true && Parse->Package() != Src) + ioprintf(c1out, _("No source package '%s' picking '%s' instead"), Parse->Package(), Src); if (VerTag.empty() == false) { -- cgit v1.2.3 From 71da8af4dabe8680802ef291267c2f53d7942d18 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 16 Dec 2008 07:38:42 +0100 Subject: Clarify the --help for 'purge' (LP: #243948) --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index ea7d45952..d5869da43 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2659,7 +2659,7 @@ bool ShowHelp(CommandLine &CmdL) " install - Install new packages (pkg is libc6 not libc6.deb)\n" " remove - Remove packages\n" " autoremove - Remove automatically all unused packages\n" - " purge - Remove and purge packages\n" + " purge - Remove packages and config files\n" " source - Download source archives\n" " build-dep - Configure build-dependencies for source packages\n" " dist-upgrade - Distribution upgrade, see apt-get(8)\n" -- cgit v1.2.3 From 236527f0fffe30fc8988e17d926778c23ac1f902 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 28 Jan 2009 17:39:37 +0100 Subject: LP: #263089 --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index d5869da43..38775f70d 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1297,7 +1297,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, // show name mismatches if (IsMatch == true && Parse->Package() != Src) - ioprintf(c1out, _("No source package '%s' picking '%s' instead"), Parse->Package(), Src); + ioprintf(c1out, _("No source package '%s' picking '%s' instead"), Parse->Package().c_str(), Src.c_str()); if (VerTag.empty() == false) { -- cgit v1.2.3 From 4bfb7a7756eed967c1edad63bc16a37b741cafaa Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 9 Feb 2009 14:34:50 +0100 Subject: * cmdline/apt-get.cc: - default to "false" for the "APT::Get::Build-Dep-Automatic" option (follow debian here) --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 38775f70d..2117a7f2a 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2542,7 +2542,7 @@ bool DoBuildDep(CommandLine &CmdL) { // We successfully installed something; skip remaining alternatives skipAlternatives = hasAlternatives; - if(_config->FindB("APT::Get::Build-Dep-Automatic", true) == true) + if(_config->FindB("APT::Get::Build-Dep-Automatic", false) == true) Cache->MarkAuto(Pkg, true); continue; } -- cgit v1.2.3 From 5ef499349c609f5ef50bd633692faa2665f4f96f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 9 Mar 2009 16:33:39 +0100 Subject: * cmdline/apt-get.cc - fix "apt-get source pkg" if there is a binary package and a source package of the same name but from different packages (LP: #330103) --- cmdline/apt-get.cc | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 2117a7f2a..0339afdf1 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1272,16 +1272,23 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, } } } - - // No source package name.. - if (Src.empty() == true) - Src = TmpSrc; - + // The best hit pkgSrcRecords::Parser *Last = 0; unsigned long Offset = 0; string Version; bool IsMatch = false; + bool MatchSrcOnly = false; + + // No source package name.. + if (Src.empty() == true) + Src = TmpSrc; + else + // if we have a source pkg name, make sure to only search + // for srcpkg names, otherwise apt gets confused if there + // is a binary package "pkg1" and a source package "pkg1" + // with the same name but that comes from different packages + MatchSrcOnly = true; // If we are matching by version then we need exact matches to be happy if (VerTag.empty() == false) @@ -1291,13 +1298,13 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, binary packages in the search */ pkgSrcRecords::Parser *Parse; SrcRecs.Restart(); - while ((Parse = SrcRecs.Find(Src.c_str(),false)) != 0) + while ((Parse = SrcRecs.Find(Src.c_str(), MatchSrcOnly)) != 0) { string Ver = Parse->Version(); // show name mismatches if (IsMatch == true && Parse->Package() != Src) - ioprintf(c1out, _("No source package '%s' picking '%s' instead"), Parse->Package().c_str(), Src.c_str()); + ioprintf(c1out, _("No source package '%s' picking '%s' instead\n"), Parse->Package().c_str(), Src.c_str()); if (VerTag.empty() == false) { -- cgit v1.2.3 From 5dad4134da37576de12721f34165c1fe4d138b3c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 19 Mar 2009 15:42:25 +0100 Subject: * methods/mirror.cc: - when download the mirror file and the server is down, return a propper error message (LP: #278635) --- cmdline/apt-report-mirror-failure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-report-mirror-failure b/cmdline/apt-report-mirror-failure index 1567e78e3..ef77d4954 100755 --- a/cmdline/apt-report-mirror-failure +++ b/cmdline/apt-report-mirror-failure @@ -5,7 +5,7 @@ import urllib import apt_pkg apt_pkg.init() -url = apt_pkg.Config.Find("Acquire::Mirror::ReportFailures", None) +url = apt_pkg.Config.Find("Acquire::Mirror::ReportFailures", "") #"http://people.ubuntu.com:9000/mirror-failure") #"http://localhost:9000/mirror-failure") if not url: -- cgit v1.2.3 From 6b802e56f55a43e9967cd8d41148646fd95ea8e3 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 26 Mar 2009 23:52:26 +0000 Subject: * cmdline/acqprogress.cc: - Call pkgAcquireStatus::Pulse even if quiet, so that we still get dlstatus messages on the status-fd (LP: #290234). --- cmdline/acqprogress.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmdline') diff --git a/cmdline/acqprogress.cc b/cmdline/acqprogress.cc index a5fee1db5..b3ded4142 100644 --- a/cmdline/acqprogress.cc +++ b/cmdline/acqprogress.cc @@ -145,11 +145,11 @@ void AcqTextStatus::Stop() bandwidth and ETA indicator. */ bool AcqTextStatus::Pulse(pkgAcquire *Owner) { + pkgAcquireStatus::Pulse(Owner); + if (Quiet > 0) return true; - pkgAcquireStatus::Pulse(Owner); - enum {Long = 0,Medium,Short} Mode = Long; char Buffer[sizeof(BlankLine)]; -- cgit v1.2.3 From 28b5ff3f76e63f0b4bbed5980b9c13f4a7c3cecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Minier?= Date: Sun, 10 May 2009 12:12:29 +0200 Subject: Drop duplicate "purge" in command list. --- cmdline/apt-get.cc | 1 - 1 file changed, 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 0339afdf1..988abe216 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2778,7 +2778,6 @@ int main(int argc,const char *argv[]) {"remove",&DoInstall}, {"purge",&DoInstall}, {"autoremove",&DoInstall}, - {"purge",&DoInstall}, {"dist-upgrade",&DoDistUpgrade}, {"dselect-upgrade",&DoDSelectUpgrade}, {"build-dep",&DoBuildDep}, -- cgit v1.2.3 From 3d513bbd0c7cdcfb962403645dd9f05f0a127938 Mon Sep 17 00:00:00 2001 From: Brian Murray Date: Thu, 13 Aug 2009 13:25:21 -0700 Subject: incorporate string-fix patch from Matthew East for LP: #370094 --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 04f3944a9..7385c3dd3 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2127,7 +2127,7 @@ bool DoSource(CommandLine &CmdL) if(vcs == "Bzr") ioprintf(c1out,_("Please use:\n" "bzr get %s\n" - "to retrieve the latest (possible unreleased) " + "to retrieve the latest (possibly unreleased) " "updates to the package.\n"), uri.c_str()); break; -- cgit v1.2.3 From a69a3a044be84f72508fb468cdf13d9e5f724dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Minier?= Date: Fri, 28 Aug 2009 12:03:39 +0200 Subject: * cmdline/apt-key: - Emit a warning if removed keys keyring is missing and skip associated checks (LP: #218971) --- cmdline/apt-key | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-key b/cmdline/apt-key index 26aa55633..b579e5a53 100755 --- a/cmdline/apt-key +++ b/cmdline/apt-key @@ -90,13 +90,17 @@ update() { # add any security. we *need* this check on net-update though $GPG_CMD --quiet --batch --keyring $ARCHIVE_KEYRING --export | $GPG --import - # remove no-longer supported/used keys - keys=`$GPG_CMD --keyring $REMOVED_KEYS --with-colons --list-keys | grep ^pub | cut -d: -f5` - for key in $keys; do - if $GPG --list-keys --with-colons | grep ^pub | cut -d: -f5 | grep -q $key; then - $GPG --quiet --batch --delete-key --yes ${key} - fi - done + if [ -r "$REMOVED_KEYS" ]; then + # remove no-longer supported/used keys + keys=`$GPG_CMD --keyring $REMOVED_KEYS --with-colons --list-keys | grep ^pub | cut -d: -f5` + for key in $keys; do + if $GPG --list-keys --with-colons | grep ^pub | cut -d: -f5 | grep -q $key; then + $GPG --quiet --batch --delete-key --yes ${key} + fi + done + else + echo "Warning: removed keys keyring $REMOVED_KEYS missing or not readable" >&2 + fi } -- cgit v1.2.3 From 4df70e7528c21f948dfb7032271c499c53a21515 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 3 Feb 2010 09:42:36 -0800 Subject: * cmdline/apt-cdrom.cc: - make Acquire::cdrom::AutoDetect default, this can be turned off with "--no-auto-detect" --- cmdline/apt-cdrom.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc index 0c9aab28c..8b9eacae6 100644 --- a/cmdline/apt-cdrom.cc +++ b/cmdline/apt-cdrom.cc @@ -147,7 +147,7 @@ bool DoAdd(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; if (AutoDetect && UdevCdroms.Dlopen()) -- cgit v1.2.3 From 7a511e5d959f59ec6062a84b3a1ae372ff4f8e86 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 26 Mar 2010 17:25:04 +0100 Subject: * cmdline/apt-get.cc, apt-pkg/cdrom.cc: - fix memory leaks in error conditions in DoSource() --- cmdline/apt-get.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index ea236676b..0bc8fc571 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2315,6 +2315,7 @@ bool DoSource(CommandLine &CmdL) { for (unsigned I = 0; I != J; I++) ioprintf(cout,_("Fetch source %s\n"),Dsc[I].Package.c_str()); + delete[] Dsc; return true; } @@ -2325,6 +2326,7 @@ bool DoSource(CommandLine &CmdL) for (; I != Fetcher.UriEnd(); I++) cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl; + delete[] Dsc; return true; } @@ -2350,6 +2352,7 @@ bool DoSource(CommandLine &CmdL) if (_config->FindB("APT::Get::Download-only",false) == true) { c1out << _("Download complete and in download only mode") << endl; + delete[] Dsc; return true; } @@ -2411,7 +2414,8 @@ bool DoSource(CommandLine &CmdL) _exit(0); } - + delete[] Dsc; + // Wait for the subprocess int Status = 0; while (waitpid(Process,&Status,0) != Process) -- cgit v1.2.3 From a4787a959bbed2e16f6017c8e3238ae9cf98bc69 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 31 Mar 2010 22:00:36 +0200 Subject: cherry pick -r 1983..1984 lp:~donkult/apt/sid --- cmdline/apt-get.cc | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 0bc8fc571..5de3fb036 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1270,12 +1270,26 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, { if(VerTag.empty() == false || DefRel.empty() == false) { + bool fuzzy = false; // we have a default release, try to locate the pkg. we do it like // this because GetCandidateVer() will not "downgrade", that means // "apt-get source -t stable apt" won't work on a unstable system - for (pkgCache::VerIterator Ver = Pkg.VersionList(); - Ver.end() == false; Ver++) + for (pkgCache::VerIterator Ver = Pkg.VersionList();; Ver++) { + // try first only exact matches, later fuzzy matches + if (Ver.end() == true) + { + if (fuzzy == true) + break; + fuzzy = true; + Ver = Pkg.VersionList(); + } + // We match against a concrete version (or a part of this version) + if (VerTag.empty() == false && + (fuzzy == true || Cache.VS().CmpVersion(VerTag, Ver.VerStr()) != 0) && // exact match + (fuzzy == false || strncmp(VerTag.c_str(), Ver.VerStr(), VerTag.size()) != 0)) // fuzzy match + continue; + for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; VF++) { @@ -1288,10 +1302,6 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, pkgCache::Flag::NotSource && Pkg.CurrentVer() != Ver) continue; - // We match against a concrete version (or a part of this version) - if (VerTag.empty() == false && strncmp(VerTag.c_str(), Ver.VerStr(), VerTag.size()) != 0) - continue; - // or we match against a release if(VerTag.empty() == false || (VF.File().Archive() != 0 && VF.File().Archive() == DefRel) || @@ -1302,10 +1312,9 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, // no SourcePkg name, so it is the "binary" name if (Src.empty() == true) Src = TmpSrc; - // no Version, so we try the Version of the SourcePkg - - // and after that the version of the binary package - if (VerTag.empty() == true) - VerTag = Parse.SourceVer(); + // the Version we have is possibly fuzzy or includes binUploads, + // so we use the Version of the SourcePkg (empty if same as package) + VerTag = Parse.SourceVer(); if (VerTag.empty() == true) VerTag = Ver.VerStr(); break; @@ -1371,7 +1380,8 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, const string Ver = Parse->Version(); // Ignore all versions which doesn't fit - if (VerTag.empty() == false && strncmp(VerTag.c_str(), Ver.c_str(), VerTag.size()) != 0) + if (VerTag.empty() == false && + Cache.VS().CmpVersion(VerTag, Ver) != 0) // exact match continue; // Newer version or an exact match? Save the hit -- cgit v1.2.3 From b1fd12d41f9be5d5f33e4768761ed28f87953082 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 8 Apr 2010 21:14:03 +0200 Subject: * cmdline/apt-get.cc: - fix crash when pkg.VersionList() is empty (LP: #556056) --- cmdline/apt-get.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 5de3fb036..b379dc82f 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1283,6 +1283,10 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, break; fuzzy = true; Ver = Pkg.VersionList(); + // exit right away from the Pkg.VersionList() loop if we + // don't have any versions + if (Ver.end() == true) + break; } // We match against a concrete version (or a part of this version) if (VerTag.empty() == false && -- cgit v1.2.3 From 164fed49362b28c0264c293a14a06d167e32b76f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 2 Jun 2010 21:43:55 +0200 Subject: cmdline/apt-report-mirror-failure: port to latest python-apt --- cmdline/apt-report-mirror-failure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-report-mirror-failure b/cmdline/apt-report-mirror-failure index ef77d4954..e8ffdc2c7 100755 --- a/cmdline/apt-report-mirror-failure +++ b/cmdline/apt-report-mirror-failure @@ -5,7 +5,7 @@ import urllib import apt_pkg apt_pkg.init() -url = apt_pkg.Config.Find("Acquire::Mirror::ReportFailures", "") +url = apt_pkg.Config.find("Acquire::Mirror::ReportFailures", "") #"http://people.ubuntu.com:9000/mirror-failure") #"http://localhost:9000/mirror-failure") if not url: -- cgit v1.2.3