From: Michael Vogt Date: Tue, 18 Aug 2015 09:54:05 +0000 (+0200) Subject: Merge branch 'debian/experimental' into feature/srv-records X-Git-Tag: 1.1.exp10~5^2~4 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/21248c0f00ee71412dbadc6ebf84011cf974346d Merge branch 'debian/experimental' into feature/srv-records Conflicts: cmdline/apt-helper.cc cmdline/makefile --- 21248c0f00ee71412dbadc6ebf84011cf974346d diff --cc cmdline/apt-helper.cc index aeeccf06d,a97fc903f..482e64dd1 --- a/cmdline/apt-helper.cc +++ b/cmdline/apt-helper.cc @@@ -54,33 -81,9 +82,32 @@@ static bool DoDownloadFile(CommandLine return true; } +static bool DoSrvLookup(CommandLine &CmdL) +{ + if (CmdL.FileSize() < 1) + return _error->Error(_("Must specifc at least one srv record")); + + std::vector srv_records; + for(int i=1; CmdL.FileList[i] != NULL; i++) + { + if(GetSrvRecords(CmdL.FileList[i], srv_records) == false) + _error->Warning(_("GetSrvRec failed for %s"), CmdL.FileList[i]); + for (std::vector::const_iterator I = srv_records.begin(); + I != srv_records.end(); ++I) + { + c1out << (*I).target.c_str() << " " + << (*I).priority << " " + << (*I).weight << " " + << (*I).port << " " + << std::endl; + } + } + return true; +} + static bool ShowHelp(CommandLine &) { - ioprintf(std::cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, - COMMON_ARCH,__DATE__,__TIME__); + ioprintf(std::cout, "%s %s (%s)\n", PACKAGE, PACKAGE_VERSION, COMMON_ARCH); if (_config->FindB("version") == true) return true; @@@ -103,7 -107,7 +131,8 @@@ int main(int argc,const char *argv[] { CommandLine::Dispatch Cmds[] = {{"help",&ShowHelp}, {"download-file", &DoDownloadFile}, + {"srv-lookup", &DoSrvLookup}, + {"auto-detect-proxy", &DoAutoDetectProxy}, {0,0}}; std::vector Args = getCommandArgs( diff --cc cmdline/makefile index a24738e63,816038c3b..6d21b0803 --- a/cmdline/makefile +++ b/cmdline/makefile @@@ -49,8 -49,8 +49,8 @@@ include $(PROGRAM_H # The apt-helper PROGRAM=apt-helper -SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) +SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -lresolv - LIB_MAKES = apt-pkg/makefile + LIB_MAKES = apt-pkg/makefile apt-private/makefile SOURCE = apt-helper.cc include $(PROGRAM_H)