Commit Graph

1120 Commits

Author SHA1 Message Date
Adriaan de Groot
932ab17c9a [libcalamares] Avoid parameter name 'stdin' 2022-02-07 12:54:16 +01:00
Adriaan de Groot
ebdcb15703 [libcalamares] Don't use reserved identifiers 2022-02-07 12:51:22 +01:00
Adriaan de Groot
660b198da0 [libcalamares] Avoid more moc warnings with recent Clang 2022-02-07 12:51:06 +01:00
Adriaan de Groot
3ea25a901e [libcalamares] Avoid compiler warnings when stdin is defined to something else 2022-02-07 11:32:22 +01:00
Adriaan de Groot
d5c6a70442 [libcalamares] Use signed sizes 2022-02-07 11:22:13 +01:00
Adriaan de Groot
ffeab32403 [libcalamares] Apply coding style 2022-01-31 23:41:37 +01:00
Adriaan de Groot
80300e412c [libcalamares] When logging extra lines to warning or error, suppress label
Avoid logs like

23:29:57 [2]: void Config::setConfigurationMap(const QVariantMap&)
    WARNING: Configuration for *initialSwapChoice* is not one of the *userSwapChoices*
WARNING:    .. Choice "small" added.

where the label is duplicated.
2022-01-31 23:27:35 +01:00
Adriaan de Groot
0070dd2c01 [libcalamares] Add a convenience for reading mtab
- used by umount and cleartempmounts (in future)
2022-01-18 13:22:20 +01:00
Adriaan de Groot
a93126a6d0 [libcalamares] More meaningful name for JobResult success 2022-01-17 14:19:28 +01:00
Adriaan de Groot
e6813949af [libcalamares] Hook up Python's error() to error, rather than warning 2022-01-17 13:47:47 +01:00
Adriaan de Groot
bc2713ccbb [libcalamares] Add string functions for lstrip() and rstrip()-like 2021-12-08 14:08:37 +01:00
Adriaan de Groot
4611545f93 [libcalamares] Warnings-- on switch()
- some switch statements handle a bunch of items explicitly,
  then default the rest. Clang complains about that. Turn off
  the warning for these specific switches, since there's dozens
  of values that simply do not need to be handled.
2021-12-07 15:42:14 +01:00
Adriaan de Groot
32da51b44c [libcalamares] Avoid warnings in Boost::Python macros 2021-12-07 14:48:19 +01:00
Adriaan de Groot
890c17cd71 [libcalamares] Expand error-logging when creating files 2021-12-06 14:46:26 +01:00
Adriaan de Groot
6ef7acc108 [libcalamares] Add minor tests for new readTargetFile 2021-12-06 14:46:26 +01:00
Adriaan de Groot
baf8297cc4 [libcalamares] Reading a file from target system 2021-12-06 14:46:26 +01:00
Adriaan de Groot
65488ca174 [libcalamares] More verbose when loading YAML for Python 2021-11-29 14:19:06 +01:00
Adriaan de Groot
fcbe8d3a3e [libcalamares] API for YAML-loading from Python 2021-11-29 12:59:30 +01:00
Adriaan de Groot
7f643010b2 [libcalamares] Expose error() and warn() to Python 2021-11-29 12:26:07 +01:00
Adriaan de Groot
e9970474f5 [libcalamares] Allow Python to log an Error as well 2021-11-29 12:22:02 +01:00
Adriaan de Groot
5a4e2b73ab [libcalamares][partition] Give RedactedName a convert-to-QString
- use hex-trailer
- while here, convert DebugRow to use a copy rather than a reference,
  to avoid dangling references when applied to temporaries
- convert *partition* module to use the RedactedNames
2021-11-16 15:22:04 +01:00
Adriaan de Groot
152b3c333b [libcalamares] Introduce redaction-of-names class for logging
- redacted names are stable inside of one run of Calamares
- random, private displays of a given string for a context

SEE #1593
2021-11-16 14:47:13 +01:00
Adriaan de Groot
7b3c4db8f0 [libcalamares] Redacted -> RedactedCommand
- For logging (shell) commands where a password might become visible, use
  RedactedCommand. Rename it to allow for other kinds of redaction, too.
2021-11-16 14:21:46 +01:00
Adriaan de Groot
3dd02edc78 [libcalamares] Document how to interpret percents
- use 0..1 in floats for percentages (I suppose you could
  call that a perunage, but that would be weird).
2021-11-15 23:16:58 +01:00
Adriaan de Groot
5e6d292235 FIXUP 2021-11-05 16:31:47 +01:00
Adriaan de Groot
faf1d68d32 [libcalamares] Tidy up processing of process output
- force C locale on processes
- split trailing output if output per-line-processing is active
2021-11-05 16:26:45 +01:00
Adriaan de Groot
2800128a8d [libcalamares] Expand the output-processing API
- support host and target runs
- add stdin and timeout values
- allow automatic output to list
2021-11-03 13:45:15 +01:00
Adriaan de Groot
3120abbce8 [libcalamares] Introduce host_env_process_output, too
- run commands consistently, with optional output-processing,
  in host or target;
- raises exception on error, like the check_* functions.
2021-11-03 12:23:39 +01:00
Adriaan de Groot
e5323ec487 [libcalamares] Expand Runner documentation
- document a bit more of the methods
- provide convenience method enableOutputProcessing() alongside
  an explicit setter; adjust tests to the changed API.
- add an executable() information method.
2021-11-03 12:20:36 +01:00
Adriaan de Groot
f2142bc4b3 [libcalamares] Move Python callback to utils submodule
- don't need the job to do the callback
- allow callable objects from Python
- doesn't actually run the process yet
2021-11-03 11:53:44 +01:00
Adriaan de Groot
2088502e57 [libcalamares] Don't use QProcess directly outside of Runner 2021-11-02 23:46:26 +01:00
Adriaan de Groot
57c174c37f [libcalamares] Clean up QProcess includes 2021-11-02 23:46:26 +01:00
Adriaan de Groot
5c82cb32ab [libcalamares] Expand tests to show last-output-line 2021-11-02 23:20:22 +01:00
Adriaan de Groot
aa315c0696 [libcalamares] Handle last-output-line without newline 2021-11-02 22:58:41 +01:00
Adriaan de Groot
0a339a5402 [libcalamares] Test Runner output-processing 2021-11-02 22:55:41 +01:00
Adriaan de Groot
953b899f75 [libcalamares] Allow Runner instances to collect output 2021-11-02 22:50:13 +01:00
Adriaan de Groot
870009e815 [libcalamares] Replace runCommand internals by Runner 2021-11-02 22:27:33 +01:00
Adriaan de Groot
89824a9e0d [libcalamares] Fix up Runner (as a replacement for current system code) 2021-11-02 22:27:33 +01:00
Adriaan de Groot
24ca64deac [libcalamares] Chase moved redacted-logging 2021-11-02 22:27:33 +01:00
Adriaan de Groot
85debfc69b [libcalamares] Add Redacted logging
- this was an internal class for logging commands, let's lift
  it up to the Logger framework where it might be more generally
  useful (or not .. everything needs special-casing for actual
  redaction).
2021-11-02 22:27:33 +01:00
Adriaan de Groot
f0104af1c3 [libcalamares] Expand tests on Runner internals 2021-11-02 22:27:33 +01:00
Adriaan de Groot
e5fa58b890 [libcalamares] Add tests for relativeCangeDirectory() 2021-11-02 22:27:32 +01:00
Adriaan de Groot
0b943e801c [libcalamares] Begin implementing Runner
This copies a bunch of code from the System methods for running,
and then #if 0's them to get it to compile. Add some basic
directory-management.
2021-11-02 22:27:32 +01:00
Adriaan de Groot
b9dac6eef8 [libcalamares] Small step in implementation 2021-11-02 22:27:32 +01:00
Adriaan de Groot
e0fdde06c9 [libcalamares] Python API for callbacks from processes
This is an experiment in Python API that will allow a callback
function in the Python module to be called for each output line.
It builds on the run-a-process extensions that are being built
simultaneously.
2021-11-02 22:27:32 +01:00
Adriaan de Groot
2de09d4001 [libcalamares] Start refactor of running-a-process support
The background idea is that, while CalamaresUtils::System::runCommand()
is a useful general API, it is
- still missing flexibility
- lacking a way to process output from the command "as it happens"

Waiting until the process ends, and then reading all stdout, is
inconvenient for processes that produce a **lot** of output,
and also makes it impossible to report progress. One module
in calamares-extensions has its own run-a-process implementation
for reading output, and this branch aims to introduce something
similar into Calamares core.
2021-11-02 22:27:32 +01:00
Adriaan de Groot
d3d4690a81 [libcalamares] Move const to a better spot 2021-10-29 11:25:13 +02:00
Adriaan de Groot
ebf8d63669
Merge pull request #1809 from dalto8/ismoduleenabled
[libcalamares] Add isModuleEnabled function
2021-10-29 11:20:07 +02:00
dalto
f7d8384bff Use key().module() instead of key().first 2021-10-28 14:49:44 -05:00
dalto
be513813e6 Clean-up from initial review 2021-10-28 14:46:38 -05:00