Skip to content

Commit

Permalink
fix miktex links uninstall (#1172)
Browse files Browse the repository at this point in the history
  • Loading branch information
edocevoli committed Jan 17, 2023
1 parent 5fcbe12 commit 29dd20f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Fixed issues

- [1172](https://github.com/MiKTeX/miktex/issues/1172): Change link target directory does not work in versions 22.8 and 22.8.28 in Monterey 12.4
- [1246](https://github.com/MiKTeX/miktex/issues/1246): installation log is printed in the stdout of kpsewhich

## 22.12 - 2022-12-12
Expand Down
18 changes: 7 additions & 11 deletions Programs/MiKTeX/miktex/topics/links/commands/uninstall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @author Christian Schenk
* @brief links uninstall
*
* @copyright Copyright © 2021-2022 Christian Schenk
* @copyright Copyright © 2021-2023 Christian Schenk
*
* This file is part of One MiKTeX Utility.
*
Expand Down Expand Up @@ -70,16 +70,20 @@ enum Option
OPT_AAA = 1,
};

static const struct poptOption options[] =
static const struct poptOption uninstall_options[] =
{
POPT_AUTOHELP
POPT_TABLEEND
};

int UninstallCommand::Execute(ApplicationContext& ctx, const vector<string>& arguments)
{
if (ctx.session->IsSharedSetup() && !ctx.session->IsAdminMode())
{
ctx.ui->FatalError(T_("this command must be run in admin mode"));
}
auto argv = MakeArgv(arguments);
PoptWrapper popt(static_cast<int>(argv.size() - 1), &argv[0], options);
PoptWrapper popt(static_cast<int>(argv.size() - 1), &argv[0], uninstall_options);
int option;
while ((option = popt.GetNextOpt()) >= 0)
{
Expand All @@ -92,14 +96,6 @@ int UninstallCommand::Execute(ApplicationContext& ctx, const vector<string>& arg
{
ctx.ui->IncorrectUsage(T_("unexpected command arguments"));
}
if (ctx.session->IsSharedSetup() && !ctx.session->IsAdminMode())
{
ctx.ui->FatalError(T_("this command must be run in admin mode"));
}
if (arguments.size() != 2)
{
ctx.ui->IncorrectUsage(T_("unexpected command arguments"));
}
LinksManager mgr;
mgr.Init(ctx);
mgr.Uninstall();
Expand Down

0 comments on commit 29dd20f

Please sign in to comment.