|
@@ -54,8 +54,28 @@
|
|
|
#include <apt-private/private-upgrade.h>
|
|
#include <apt-private/private-upgrade.h>
|
|
|
#include <apt-private/private-show.h>
|
|
#include <apt-private/private-show.h>
|
|
|
#include <apt-private/private-main.h>
|
|
#include <apt-private/private-main.h>
|
|
|
|
|
+#include <apt-private/private-utils.h>
|
|
|
/*}}}*/
|
|
/*}}}*/
|
|
|
|
|
|
|
|
|
|
+// EditSource - EditSourcesList /*{{{*/
|
|
|
|
|
+// ---------------------------------------------------------------------
|
|
|
|
|
+bool EditSources(CommandLine &CmdL)
|
|
|
|
|
+{
|
|
|
|
|
+ // FIXME: suport CmdL.FileList to specify sources.list.d files
|
|
|
|
|
+
|
|
|
|
|
+ std::string sourceslist = _config->FindFile("Dir::Etc::sourcelist");
|
|
|
|
|
+
|
|
|
|
|
+ // FIXME: take hash before,
|
|
|
|
|
+ // when changed display message to apt update
|
|
|
|
|
+ // do syntax check after save (like visudo)
|
|
|
|
|
+
|
|
|
|
|
+ EditFileInSensibleEditor(sourceslist);
|
|
|
|
|
+
|
|
|
|
|
+ return true;
|
|
|
|
|
+}
|
|
|
|
|
+ /*}}}*/
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
bool ShowHelp(CommandLine &CmdL)
|
|
bool ShowHelp(CommandLine &CmdL)
|
|
|
{
|
|
{
|
|
|
ioprintf(c1out,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
|
|
ioprintf(c1out,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
|
|
@@ -74,6 +94,8 @@ bool ShowHelp(CommandLine &CmdL)
|
|
|
" update - update list of available packages\n"
|
|
" update - update list of available packages\n"
|
|
|
" install - install packages\n"
|
|
" install - install packages\n"
|
|
|
" upgrade - upgrade the systems packages\n"
|
|
" upgrade - upgrade the systems packages\n"
|
|
|
|
|
+ "\n"
|
|
|
|
|
+ " edit-sources - edit the source information file\n"
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
return true;
|
|
return true;
|
|
@@ -89,6 +111,8 @@ int main(int argc, const char *argv[]) /*{{{*/
|
|
|
{"remove", &DoInstall},
|
|
{"remove", &DoInstall},
|
|
|
{"update",&DoUpdate},
|
|
{"update",&DoUpdate},
|
|
|
{"upgrade",&DoUpgradeWithAllowNewPackages},
|
|
{"upgrade",&DoUpgradeWithAllowNewPackages},
|
|
|
|
|
+ // misc
|
|
|
|
|
+ {"edit-sources",&EditSources},
|
|
|
// helper
|
|
// helper
|
|
|
{"moo",&DoMoo},
|
|
{"moo",&DoMoo},
|
|
|
{"help",&ShowHelp},
|
|
{"help",&ShowHelp},
|