diff options
Diffstat (limited to 'cmdline')
-rw-r--r-- | cmdline/apt-cdrom.cc | 2 | ||||
-rw-r--r-- | cmdline/apt-get.cc | 28 | ||||
-rwxr-xr-x | cmdline/apt-report-mirror-failure | 29 | ||||
-rw-r--r-- | cmdline/makefile | 6 |
4 files changed, 63 insertions, 2 deletions
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()) diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 44235e358..eaf04eee7 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2306,6 +2306,33 @@ 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-"); + 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(); + 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 retrieve the latest (possibly unreleased) " + "updates to the package.\n"), + uri.c_str()); + break; + } + // Back track vector<pkgSrcRecords::File> Lst; if (Last->Files(Lst) == false) @@ -2968,7 +2995,6 @@ int main(int argc,const char *argv[]) /*{{{*/ {"remove",&DoInstall}, {"purge",&DoInstall}, {"autoremove",&DoInstall}, - {"purge",&DoInstall}, {"markauto",&DoMarkAuto}, {"unmarkauto",&DoMarkAuto}, {"dist-upgrade",&DoDistUpgrade}, diff --git a/cmdline/apt-report-mirror-failure b/cmdline/apt-report-mirror-failure new file mode 100755 index 000000000..7c390642a --- /dev/null +++ b/cmdline/apt-report-mirror-failure @@ -0,0 +1,29 @@ +#!/usr/bin/python +# +# This is a stub that is meant to support failure reporting of +# mirrors to a central database +# +# its currently not used + +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) + +print "Reporting mirror failure to '%s'" % url + +data = {} +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() + + diff --git a/cmdline/makefile b/cmdline/makefile index 3260e375b..917ccc96a 100644 --- a/cmdline/makefile +++ b/cmdline/makefile @@ -58,3 +58,9 @@ SOURCE=apt-mark TO=$(BIN) TARGET=program include $(COPY_H) + +# The apt-report-mirror-failure program +#SOURCE=apt-report-mirror-failure +#TO=$(BIN) +#TARGET=program +#include $(COPY_H) |