- because mount() returns an exit code, and 0 is "success",
the if (!code) was backwards: when mounting succeeded, the
TemporaryMount object thought it failed.
- This leads to temp-mounts being left *all over* the place
from os-prober and fstab-handling.
- See editorial in the code-comment. Still need to test that
chroot(8) doesn't need a full path, otherwise this will
go to /usr/bin/env udevadm to force lookup (redundantly
if not in a chroot)
- !failed() also means "didn't write the file because it already
exists", which is sometimes acceptable -- but not here.
Use the more-strict bool() conversion, which is only when
the file was actually written.
- Unconditionally **not** overwriting the target file isn't an option:
writing hostname, for instance, expects that to be done even
if `/etc/hostname` already exists on the target filesystem.
- Make tests more resilient: do them in a temp-dir, and clean it
up after successful tests. This was prompted by tests failing
because of things hanging around in /tmp.
- Follow original patch from Gabriel Craciunescu: just drop
the *bufsize* parameter and stick to binary reads.
Text mode was associated in my testing with multiple hangs,
which didn't show up during binary-reads.
- By the time the GS is actually written, new (for partition state)
is always false. So "new" is the wrong thing to track. It should
have had a better name anyway,
- We store custom properties on the partition objects to indicate
what happens to them; use those properties (instead of state,
as done originally), call it "claimed" to indicate that the partition
is part of this installation.
For now, only new (as in, formatted, created-by-us) partitions are
claimed.
- The effect here is that only "new" swap will be added to the system,
so in erase-disk installations, or manual partitioning.
- Install-alongside and replace will now **not** claim the swap already
on the disk; I think we'll need another UI knob for that one.
FIXES#1316
- `createPartitionList()` is called for the summary widget (via
`prettyDescription()`), and from `exec()`. Only the latter
actually *writes* to Global Storage, so it's misleading to
think that the pretty-printed version ends up in GS.
- This makes the "new" key useless, since by the time `exec()` is called
the partitoons are no longer new.
- These tests don't actually test anything in this specific module,
they do test CalamaresUtils::System.
- Wrangling System and JobQueue and GlobalStorage instances is fraught
- Allow TranslatedString to get a context parameter; if it has
one, it will try to use the regular tr()-infrastructure
**as fallback** for the translations from the config file itself.
- This makes it possible to offer -- and translate -- some "standard"
phrases in the module, while allowing the config file the knob
to change strings. Using one of the standard strings gets translations
for "free", while introducing something entirely new means sourcing
translations for it as well.
- The model always has two columns, and the column names are always
the same. We don't need to specially set headers for that.
- Use QCoreApplication::translation() to re-use the existing
translations and avoid creating "new" strings (in a new context).
- Now that multiple netinstall pages may be supported, it's annoying
that they all have the same name. Copy the approach from other
modules (e.g. notesQML) of having the sidebar and other labels
configured in the config file.
- Since operations are added each time you leave this page,
the existing operations (from a previous visit) need to be
cleaned up. With the old setup of only **one** possible
set of operations, this wasn't a problem. Now, merging
in operations is necessary. Implement that by looking for
the *source* property in an operation.
FIXES#1303
- Different libraries should have different EXPORTs, so that
you can IMPORT one while building the other. Reported (and
kindly explained) by Kevin Kofler.
- Stick to one header file, though.
While here, update copyright on file.
- Having the widget do creation ties the step heavily to that UI;
start moving towards a state where we have a Config object (not
here yet; it still queries the UI part) that moves data around
between UI and ViewStep.
- This makes linking easier,
- Adds the right includes (needed on FreeBSD),
- Lets us drop silly GUI setting for non-GUI tests (I think this was
a side-effect of compiling on FreeBSD, where UI would pull in
/usr/local/include).
- Let's just have one header definining export- and visibility-
macros for Calamares. They are still selected based on the
export flags (*_PRO), just defined in one header instead of two.
- The scattering of DLL export macro's is kind of useless;
there are several headers, and then the export macro isn't
even applied consistently. Just drop the one for UI exports,
which was only used in libcalamaresui.
- If the test failed, you'd get a cryptic message like
FAIL! : NetworkTests::testPing() 'r' returned FALSE. ()
So rename the variable so the failure mode is more obvious.
(Could have used QVERIFY2() instead, this is simpler)
- Use the createTargetFile() convenience functions to do the
actual work.
- This probably involves more copying around of buffers, since it's
creating one big QString and sending that off, rather than writing
little chunks to a file, but I feel this is worth the code simplification.
- Drops all the error checking for creation, though, because the API for
createTargetFile() lousy.