This tests only the termbin ("fiche") paste by sending it
a derpy fixed string. Prints the resulting URL, doesn't
verify in particular.
It'd be rude to run this test too often.
- mark functions with STATICTEST so they can be compiled into a test
- move logfile-reading so we can call the pastebin-upload functions
with an arbitrary payload.
- The Paste API promises just a (string) URL back, not
a whole message, so return just the URL from the
abstract API and the concrete (fiche) implementation.
- Set clipboard contents from the UI
- Build (translated) message in the UI code
- have a namespace Paste with just one entry point, which will handle
untangling type &c.
This doesn't compile, but indicates the direction to take the API
- Use just type and url, since port can be specified in
a URL. Note that we only use host and port, not the
scheme (or the path, for that matter).
- Factor out understanding the *uploadServer* key to a function.
- get a QByteArray rather than going through a char[] buffer
- bytes-read is not important since the RE can only match if
there **are** that many characters.
- it might not be very current, and it's *probably* better to
use dbus-activation / kf5dbus, but let's not call it
deprecated until very sure that the dbus version does the
right thing.
- Add a toggle() to the debug-window manager, for convenience
- Make the manager available to QML
- Use the debug-window manager (code imported from KaOS)
Move the management of the (a?) DebugWindow to a separate
class, and hang on to that manager in CalamaresWindow.
This is prep-work towards making it available from QML as well.
The Quit button can have its own logic at a QML level for
show/hide. It **ought** to follow the *quitVisible* property,
but can do additional work. Here, document how a distro might
choose to hide the Quit button on the last page (generally,
that's the "finished" page).
It's possible to ignore the "user setting" for restart-now
and call doRestart(true) directly. This is intended for
use with specific UIs that make that choice clear for the user.
Hook up both [finished] and [finishedq] to the "traditional"
restart-if-the-box-is-ticked logic although the example
QML doesn't expose that box.
- Add function for mapping panel sides to an orientation (H/V)
- Pass that into the creation functions
This is prep-work for handling vertical navigation and horizontal
progress reporting cleanly.
- using the QML sidebar would not highlight the first step on startup,
only after next / prev would the highlight show up. Now, notify
when all the modules are loaded (and number 0 is active).
module builds & runs, config connections are not registering
no errors
finishedq.qml is offering a different option though, running commands directly in qml
plasma-framework executer is used for that
- move most of the business logic to Config
- make retranslate of the page more robust (e.g. changing language
after failure would restore the un-failed message)
There's still some bits left.
*If* the distro has GeoIP enabled and auto-selects the language for
Calamares, then Belarus now selects Russian, rather the Belarusian.
This is based on some personal input, mostly, and Wikipedia census data.
FIXES#1634
- the configuration is still duplicated in the widget, and
functionality still needs to move to the Config object
- the ViewStep is cut down to almost nothing
- the host system's /etc/group is being read, and that varies between
host OS versions; since I was doing today's release on KaOS, the
test was failing because of arbitrary differences between the
default groups on each Linux flavor.
FIXES#1604
(Admittedly, this fixes the problem only when there's Plasma Solid automount
present, and not any of the other kinds; but none of those have been reported
yet, and adding them into AutoMount.cpp is opaque to the rest of the
system)
- It shouldn't be necessary to explicitly .get() pointers for
logging, and it's convenient to know when a pointer is smart.
* no annotation means raw (e.g. @0x0)
* S means shared
* U means unique
- switch logging in job to VERBOSE because we don't want to be printing
pointers to the regular session log
- switch logging in test to VERBOSE to actually see the messages from the Job
- hook the test into the build
The popup now cuts down messages to a manageable length.
Hopefully the part that is preserved, will still show
something meaningful for the user (8 lines of text should
be sufficient for the kind of things we do).
FIXES#1613
- Although unique_ptr is only used when ICU is enabled, include it
always because it is likely that we'll use more unique_ptr
in the implementation at some point.
Ever since signed shim binaries for multiple architectures became
available, the shim binaries installed in Linux distributions have
been renamed to include the EFI architecture in the binary names.
This started in Fedora, but is now used in openSUSE and Ubuntu too.
Reference for shim binary names comes from shim spec in Fedora:
d8c3c8e392/f/shim.spec (_23-32)
- Some minor bits snuck in with the string-truncation code
- While here, make UPDATE_BUTTON_PROPERTY more statement-like
so it doesn't confuse code-formatters.
Writing `Logger::NoQuote{}`` has annoyed me for a while, so
switch it to a constant, like SubEntry, so it looks more
like a regular manipulator object.
The value inside a unique_ptr can't be opaque, it needs to be known
at any site where the pointer may be deleted. shared_ptr does not
have that (deletion is part of the shared_ptr object, which is larger
than the unique_ptr) and so can be used for opaque deletions.
The QLatin1String() might be replaced by char[], that trades one
initialization for two but with a simpler data section; this
probably is not worth profiling.
With Qt 5.15.2 (and clang), `k->first` works, but this breaks
with Qt 5.11 (and gcc), this is not available and the dereference
must be written differently, `(*k).first`.
- This kind of runs around the selection model on the view,
but we're drawing radio buttons ourselves **anyway**
and the list of themes knows which is selected / current
independent of the view.
- make ThemeInfo and ThemeInfoList internal, expose only
ThemesModel to the rest of the PlasmaLnF module
- don't build the widget anymore (needs to be replaced by
a delegate)
- also individual changes need to be signalled
- use QSignalBlocker to avoid spamming changes when calling
aggregate change methods
- refactor findById() so that also a row number can be
obtained, which is needed for the change signals.
- put a filter model in place, so only the themes with "show" set
are displayed
- rip out the messing about with widgets, soon to introduce a model-
based UI
This is the bugfix part (rather than the "clean up this widgets mess")
of issue-1573, ensuring that the LookAndFeelPackage setting is
saved to the target system config file.
- Need to update the variant that is in use, **and**
explicitly update it in the widget, in order to re-load
the keyboard image for the newly-selected layout+variant.
- Make explicit which one runs in the host, which one is selectable.
- Document *location* parameter in the selectable version.
- Tidy up alignment of apidox.
The lookandfeeltool does not (always?) write the LookAndFeelPackage
key that the KCM does -- and which this module reads on startup
to find the default LnF. This seems to be a regression in recent
lookandfeeltool versions (or in the KCM code that backs it).
Workaround supplied by jghodd.
Fixes#1573
The module preserves the extended attributes at rsync and the overlay
filesystem stores extended attributes by inodes.
The overlay filesystem keeps traces of the lower directory by encoding
and storing its UUID to the attribute trusted.overlay.origin. If the
index feature is on, that attribute is compared to the UUID of the lower
directory at every subsequent mounts and causes mount to fail with
ESTATE if it does not match.
This filters the namespace trusted.overlay.* by using the rsync option
--filter='-x trusted.overlay.*' to make sure the overlays extended
attributes are not preserved.
Fixes:
# mount -t overlay -o lowerdir=...,upperdir,...,workdir= overlay /mnt/etc
mount: /var/mnt/etc: mount(2) system call failed: Stale file handle.
# dmesg
(...)
overlayfs: "xino" feature enabled using 32 upper inode bits.
overlayfs: failed to verify origin (/etc, ino=524292, err=-116)
overlayfs: failed to verify upper root origin
Previously, the auxerror information was never stored, and
the messages were all un-numbered or un-explained.
Now, consume that information and store it when check()
is called, ready to be used when (possibly much later,
or after a translation change) explanation() is called.
Mount guesses the filesystem if it is unset or if it is set to auto,
thanks to blkid. That is the case for the bind mountpoints like /dev or
/run/udev in mount.conf. See `mount(8)` for more details.
The drop-down of zones was initially unfiltered, so you could start
in Europe/Amsterdam and the zones drop-down would also show Australian
zones; picking Perth would have weird effects, since Europe/Perth
doesn't exist and so you'd end up in New York instead.
- set the filtering region immediately, rather than only when the
region changes.
Various file writes were not being checked, and the code
was a bit tangled; specifically keyboardq did **not**
configure properly on KaOS and now seems ok.
The root mount-point can end with a / while the mount-point read from
the file /etc/mtab does not end with a /.
This leads to skip the unmounting of the root mount-point and causes the
removal of the root mountpoint directory to fail with EBUSY because it
is still mounted.
This uses the python functions os.path.normpath() to normalize the root
mount-point (i.e. to drop the trailing /) and os.path.commonprefix() to
determine the longest common prefix between the two mount-points. If the
returned prefix is identical to the normalized root mount-point then the
mount-point must be added to the list of the mount-points to unmount.
More generally, the python modules should rely on the os.path functions
to compare for paths instead of using strings. It covers this way lots
of corner cases (path with "//", "/../", "/./", ...).
- put the writing of each kind of file in its own block -- this should
become separate functions -- so that variables become more local
and debugging can be improved.
- while here, fix the error message for /etc/default/keyboard:
it would complain and name the vconsole file path if it ever failed.
- factor out the flags-we-want from the flags-we-already-have
- the use of ->activeFlags() meant that the state on *disk* was
being compared with the flags-we-want; if a partition was re-edited,
then you couldn't change the flags back to the state-on-disk
(eg. enable a flag, then change your mind and disable it).
- set the flags before refreshing the partition, because the
refresh checks for EFI bootability and that needs the new flags,
not the old ones.
- remove the m_defaultFSType from PartitionLayout, because it is
set on construction -- which is too early, before the configuration
has been read.
- make the default FS explicit in the init() calls which pass in
a configuration; this needs support in the intermediate
PartitionCoreModule.
- the "simple" constructor for PartitionEntry left the FS type
set as the constructor left it -- which is Unknown by default.
This leads to install failures in systems that don't set a
special layout but just want a single / -- because the FS is
set to Unknown.
- massage the constructor and consumer of the code, push
Ext4 FS in the tests and use the configured default in production.
The return of the call to libcalamares.utils.mount is never tested and
it may fail silently; this causes some mounpoints to be missing.
This adds a warning if mountpoint cannot be mounted.
chcon: failed to get security context of '/tmp/verity': Operation not supported
06:44:23 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
Running "env" ("mount", "-t", "unformatted", "/dev/sdb2", "/tmp/calamares-root-kv8dqgb5/tmp/verity")
.. Finished. Exit code: 32
.. Target cmd: ("mount", "-t", "unformatted", "/dev/sdb7", "/tmp/calamares-root-kv8dqgb5/tmp/verity") output:
mount: /tmp/calamares-root-kv8dqgb5/tmp/verity: unknown filesystem type 'unformatted'.
Some compile flags changed recently, triggering assert()
in the jobqueue when there is more than one. There's no
real reason for JobQueue to be a singleton, but it wants
to be. So clean up pointers a little more enthusiastically.
- Use classes to prompt lupdate to extract with a better
context (e.g. the class name, rather than plain "QObject")
so that the translation-lookup can use the named context.
- Add hard-coded "default" variant
- Add totally bogus Tajik translations, for testing purposes
This is the Wrong Thing To Do, but we'll do it for now: build the
keyboard translations into the executable. In the medium term
they should move to the modules that use them, with the re-vamp
of how translation changes are signalled.
Now that Calamares is compiled as C++17, we get this:
src/modules/locale/timezonewidget/TimeZoneImage.cpp:28:55: warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Wdeprecated]
/* static constexpr */ const QSize TimeZoneImageList::imageSize;
The code doesn't match the comment: there are no by-ref captures
in the code, and the shadowing of parameters and local variables
is confusing. Remove one variable that is passed in as an argument
(and just pass the value as argument) and copy-capture the other
rather than doing weird argument passing.
- remove unused this captures from lambda
- rename variables that are short, cryptic, and shadowed
- remove documentation for parameters that don't exist
This commit adds the new configuration `swapPartitionName` to the file
partition.conf.
This option sets the partition name to the swap partition that is
created. If this option is unset, the partition is left unnamed.
- only widgets get language change events, so we need to
hook that up to the ViewSteps and inform the Config
object so that it can (re)load translations for the
keyboard data.
- Rename the "size" locals using "sectors" in their name. Size may be
confusing or not enough specific as it can be interpreted a size in
Byte.
partSizeMap -> partSectorsMap,
totalSize -> totalSectors,
availablesize -> availableSectors,
size -> sectors,
minSize -> minSectors
maxSize -> maxSectors
- Create a the new local currentSector to iterate over the sectors;
instead of using the parameter firstSector.
- Remove the variable end that does not help much; too many variable
already. Expand its expression instead.
- Introduces new constructors for PartitionEntry: copy constructory and
constructor with all attributes.
- Use the new constructor in method addEntry().
- The variant helper toString() takes a default value since commit
c9f942ad6 ([libcalamares] Add default value to variant helpers).
- Set the default value to 0 and simplify the retreival of size values
by calling the helper toString() and removing the temporary variables.
- The logic of the method initLayout belongs to the object
PartitionLayout. Move logic to that object.
- Use a single method initLayout in object PartitionCoreModule.
- Member m_partLayout in object PartitionCoreModule is no longer
allocated.
The translation happens whenever this code is run, which may
not match the language the user subsequently selects.
It also causes general problems with the translation,
since we end up with a possibly-partly-translated name.
- With debugging and untangling done, the lambdas are simple
and short, so return to using them. One point of improvement
might be to give the models suitable slots themselves,
to avoid even this indirection.