252 Commits (37ce9a08387133b625c46c696cc901b42ee98d7e)

Author SHA1 Message Date
Adriaan de Groot a47b3f8d14 [libcalamares] Document special-case translations 7 years ago
Adriaan de Groot b9ed96d4f8 [libcalamares] Special case sr@latin
QLocale::name() doesn't include script information, and if it did
it would probably use sr_RS@Latin; when searching for translation
files it won't consider dropping just the country.
7 years ago
Adriaan de Groot 00a5baa3d9 [libcalamares] Improve process logging
- Don't insert a space before the output of a process
 - To do this, suppress space and quoting on the output, and to do
   that move the labeling-output for warnings and errors into
   the constructor (so that an idiomatic .nospace() does the right thing).
7 years ago
Adriaan de Groot b5c3fc8cf6 [libcalamares] Improve process logging
- Log output on crash
 - If debugging is on (-d) then also log output on success

FIXES #925
7 years ago
Adriaan de Groot 4d459f7fc0 [libcalamares] Move non-UI stuff from libcalamaresui
- Settings is just a settings class, no UI involved, so
   move to libcalamares where it can be used also from
   system helpers.
 - YAML utilities are useful at a lower level of the stack, too.
7 years ago
Adriaan de Groot 240efd30f1 [libcalamares] Add support for formatted, table-like output
- Use DebugRow for one-row-at-a-time output with continuations.
 - Use DebugList for one-item-per-line with continuations.
 - Use DebugMap for one-row-at-a-time output of a QVariantMap.
7 years ago
Adriaan de Groot 6bb72d173d [libcalamares] Drop generic cLog()
- Use cWarning or cError() for errors
 - Use cDebug(level) for other uses (but there aren't any)
7 years ago
Adriaan de Groot ad6227ce21 [libcalamares] Remove internal functions from the logging API 7 years ago
Adriaan de Groot cdf80615b8 [libcalamares] Rename the log file 7 years ago
Adriaan de Groot 0f289e2552 [calamares]: Improve startup logging
- Don't bother with the address of the main thread
 - Do put a marker on restart into the log file
 - Do put the Calamares version into the log file (previously, the version
   was printed through cDebug() before the log file was opened, so it was
   lost to the on-disk log).
7 years ago
Adriaan de Groot 09f30194d7 CMake: revert un-versioning of libcalamares*.so
The install-bits branch commit 83639b182b
dropped .so-versioning for libcalamares and the creation of the Python-
support symlink. This broke KDE Neon dev-unstable because the embedded
Python can no longer find libcalamares.

Installing unversioned .so's straight to LIBDIR is also not a good thing
(according to Debian), so revert to the original scheme with versioned
.so and a Python-support symlink.

Medium-term fix is to install unversioned straight into LIBDIR/calamares
and fix up the RPATH for the executable.
7 years ago
Adriaan de Groot 73a5e0bbcd [libcalamares] Fix up debugging
Using plain cLog() is weird, it doesn't attach a debugging level
so it seems like it's level 0, beyond-critical.
7 years ago
Adriaan de Groot 36ef4556b4 Merge branch 'install-bits'
FIXES #729
7 years ago
Adriaan de Groot db0c1ffd6d CMake: just install unversioned .so
- Applies to libcalamares and libcalamaresui.so, install with no
   version, just the bare .so. Since Calamares doesn't do versioning
   anyway, and its plugins should be re-compiled for any change,
   putting them in lib as unversioned .so's should make Calamares
   happy and silence lintian.
7 years ago
Adriaan de Groot a1cbb161ee [libcalamares] Make setup of log-level explicit
- Replace the implicit setting of a logging level
   (the first time logging is called) with explicit
   setupLogLevel().
7 years ago
Adriaan de Groot 84d599625f [libcalamares] Give Python jobs a warning()
- Add libcalamares.utils.warning() alongside debug() for
   Python modules to output warnings.
7 years ago
Adriaan de Groot dbbec4f76d [libcalamares] Use cDebug, polish messages 7 years ago
Adriaan de Groot d62c7b93c6 [libcalamares] Polish weird namespace use 7 years ago
Adriaan de Groot cf02f7aab5 [libcalamares] Avoid nullptr crashes
- The Python testmodule script can end up calling in to System
   methods (via System::instance()). This is unusual, and the
   System instance has not been created at that point.
   Now, create an instance and warn about it.
7 years ago
Adriaan de Groot 83639b182b CMake: try installing outside of regular lib/
- Install unversioned libraries
 - Install to lib/calamares instead of directly to lib/
7 years ago
Adriaan de Groot df0d9dcb88 [libcalamares] Provide convenience functions for warning and error 7 years ago
Adriaan de Groot 79d81700b3 [libcalamares] Use -D for just debug-level setting
- Original flag -d sets debugging but also changes behavior
 - New -D just sets debugging
 - Simplify QStringList (use C++ 11)
7 years ago
Adriaan de Groot ae5511c2f3 [libcalamares] Rationalize logging
- Move logging-levels to an enum
 - (re-)Order logging-levels so that the normal debug statement is
   not the most-important (lowest level).
 - Drop using namespace std;
7 years ago
Adriaan de Groot 874514a4e4 i18n: drop orphaned #undefs (thanks Kevin Kofler) 7 years ago
Adriaan de Groot d27675d660 i18n: drop superfluous QObject* parent
These additional pointers were introduced for translations,
and needed their own tricks to get lupdate to recognize the
strings. Using QCoreApplication::translate() removes the
need to a QObject to provide context. Drop the now-unneeded
parameters.
7 years ago
Adriaan de Groot c71385e93f i18n: fix broken translation in CommandList 7 years ago
Adriaan de Groot f954496acf i18n: avoid translation tricks, use QCoreApplication::translate
Instead of using tr and some macro hacks to get lupdate to
recognize the translation, instead use QCoreApplication::translate()
which takes its own context for translation.
7 years ago
Adriaan de Groot aed904e3b4 Merge branch 'i897-timeout'
FIXES #897
7 years ago
Adriaan de Groot 2da430fa36 [libcalamares] Allow CommandLine to have unset timeout
- Introduce enum for the appropriate constant
 - If the timeout isn't set, then defer to the timeout set
   on the commandlist when running the commands.
7 years ago
Adriaan de Groot c641f5dec6 [libcalamares] Implement object-style command line
- handle command: and timeout: entries
 - test for setting the values
7 years ago
Adriaan de Groot fe2be46d3f [libcalamares] Extend command-list with timeouts
- Replace plain StringList with a list of <String, timeout> pairs,
   and run that instead. All code paths still use the default 10sec
   timeout and there's no way to change that.
7 years ago
Adriaan de Groot 778feb50e8 [libcalamares] Additional convenience for doubles 7 years ago
Adriaan de Groot 54a9bbb949 [libcalamares] Don't eat output on timeout.
- Copy stdout from timed-out process into the output variable,
   instead of just dumping it into the log file. This will
   improve the user experience, too, because they will get some
   feedback / explanation of what the process has done.
7 years ago
Adriaan de Groot 26dfd56f6d [libcalamares] Additional convenience function extracting int 7 years ago
Adriaan de Groot b828580464 Merge remote-tracking branch 'origin/simplify-plugin' 7 years ago
Adriaan de Groot 9a9c6da6db i18n: try to trick Transifex into recognizing these strings 7 years ago
Adriaan de Groot 97fb83c743 [libcalamares] Change debug logging of how job name is derived 7 years ago
Adriaan de Groot abc6914528 [libcalamares] Enforce singleton-ness of CalamaresPython::Helper
- unset instance pointer on destruction
 - make constructor private, and the instance accessor
   should create an instance if there isn't one.
7 years ago
Adriaan de Groot 86b899566e [libcalamares] Silence compiler warnings about PluginFactories
- d_ptr shadows QObject d_ptr, which clang complains about
 - rename, and don't use Q_D and similar because it messes with internals.
7 years ago
Adriaan de Groot 510af704d8 [libcalamares] Improve documentation
- reference to _WITH_JSON is bogus copy-replace from other code
 - fix style of sample code.
7 years ago
Adriaan de Groot 0020fd885c [libcalamares] Remove unused extern declaration 7 years ago
Adriaan de Groot a2bdc12f25 [libcalamares] Drop unused plugin defines
- Remove some superfluous intermediate defines
 - baseFactory was not used (always Calamares::PluginFactory)
 - Move DECLARATION and DEFINITIONS apart
 - CALAMARES_PLUGIN_FACTORY_DEFINITION was redefined (identically)
 - CALAMARES_PLUGIN_FACTORY_DECLARATION was redefined (identically)
 - __VA_ARGS__ was constant
7 years ago
Adriaan de Groot f01c7cda6b [libcalamares] Fix debug output classname 7 years ago
Adriaan de Groot 913690650f [libcalamares] Move CommandList into libcalamares
- Move CommandList so it can be used from more modules than
   just ShellProcess
 - Allow a CommandList to run itself. This centralizes
   code for executing one or more commands and simplifies
   the ShellProcess module.

Various small cleanups:
 - mention instance id in log message
 - code formatting / style
7 years ago
Adriaan de Groot 60f4dd7b3b [libcalamares] Improve explanation of failed processes. 7 years ago
Adriaan de Groot 4ff1a0d5ea [libcalamares] another convenience for running commands
Back targetEnvCommand() with a more general runCommand()
that takes an argument selecting the location to run
the command in. This allows us also to use the same
API for running processes in the host during install,
as we do for running them in the target system.

One reason for this change is wanting to run (user-specified)
commands and independently from the global dontChroot setting,
run those commands in the live system or the target.

This changes the ABI of the DLL, since targetEnvCommand()
is no longer exported. Plugins will need to be recompiled.

 - refactor targetEnvCommand() into more general runCommand().
 - While here, allow host system commands to run even if
   there is no global storage.
 - provide convenience accessors for ProcessResult members
 - Move explanation of process errors out of ProcessJob
   - Move from ProcessJob to ProcessResult, so it can be
     reused outside of ProcessJob (e.g. from ShellProcessJob).
   - Add some convenience functions, too.
7 years ago
Adriaan de Groot f8a53f9646 [libcalamares] Refactor explanation of process-job errors 7 years ago
Adriaan de Groot 762ad54344 Documentation: change http links to GitHub to https 7 years ago
Adriaan de Groot 8a053f3c9b [libcalamares] Allow retrieving chroot mode from system (as well as settings) 7 years ago
Adriaan de Groot 298ff0cbeb Merge branch '3.1.x-stable' 7 years ago