]>
git.saurik.com Git - apt.git/blob - apt-private/private-sources.cc
eb9c5b971e9d9d72f765e101937104f7ecb70cd1
2 #include <apt-pkg/hashes.h>
5 #include "private-output.h"
6 #include "private-sources.h"
7 #include "private-utils.h"
9 // EditSource - EditSourcesList /*{{{*/
10 // ---------------------------------------------------------------------
11 bool EditSources(CommandLine
&CmdL
)
17 // FIXME: suport CmdL.FileList to specify sources.list.d files
18 std::string sourceslist
= _config
->FindFile("Dir::Etc::sourcelist");
21 before
.FromFile(sourceslist
);
24 EditFileInSensibleEditor(sourceslist
);
25 _error
->PushToStack();
26 res
= sl
.Read(sourceslist
);
28 strprintf(outs
, _("Failed to parse %s. Edit again? "),
31 res
= !YnPrompt(true);
33 _error
->RevertToStack();
34 } while (res
== false);
36 if (!before
.VerifyFile(sourceslist
)) {
38 outs
, _("Your '%s' file changed, please run 'apt-get update'."),
40 std::cout
<< outs
<< std::endl
;