Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions build-tools/xaprepare/xaprepare/Application/Program.ArchLinux.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,38 @@ public ArchLinuxProgram (string packageName, string? executableName = null)

protected override bool CheckWhetherInstalled ()
{
throw new NotImplementedException ();
return Utilities.RunCommand ("pacman", "-Q", PackageName);
}

#pragma warning disable CS1998
public override async Task<bool> Install ()
{
throw new NotImplementedException ();
var runner = new ProcessRunner ("sudo", "pacman", "-S", "--noconfirm", PackageName) {
EchoStandardOutput = true,
EchoStandardError = true,
ProcessTimeout = TimeSpan.FromMinutes (30),
};

bool failed = await Task.Run (() => !runner.Run ());
if (failed) {
Log.Error ($"Installation of {PackageName} timed out");
failed = true;
}

if (runner.ExitCode != 0) {
Log.Error ($"Installation failed with error code {runner.ExitCode}");
failed = true;
}

return !failed;
}
#pragma warning restore CS1998

protected override bool DeterminePackageVersion()
{
throw new NotImplementedException();
var output = Utilities.GetStringFromStdout ("pacman", "-Q", PackageName).Split(' ');
CurrentVersion = output.Length == 2 ? output[1] : null;
return !String.IsNullOrEmpty (CurrentVersion);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ protected override bool InitOS ()
if (!base.InitOS ())
return false;

Log.Todo ("Implement");
return false;
return true;
}
};
}