Jon Turney [Mon, 13 Jun 2022 13:54:50 +0000 (14:54 +0100)]
Fix '-t -P package-with-only-a-test-version'
Fix how 'install any version' operates in that case.
Also make '-t' have an effect when used with '-P' but without '-g'.
Future work: The language around '-t' perhaps needs refining, since it's
absence just lowers the priority of test packages, not prohibiting their
use (so in this particular case, package-with-only-a-test-version will
be installed, even without '-t')
Jon Turney [Wed, 9 Sep 2020 13:39:26 +0000 (14:39 +0100)]
Use a .pot translation template
Add a res.pot file, created with rc2po.
Add rule to generate a .po file containing current translations using rc2po.
Add rule to incorporate updated translations from .po file using po2rc.
Both tools are part of the python translate toolkit [1]
Jon Turney [Mon, 6 Jun 2022 16:59:33 +0000 (17:59 +0100)]
Adjustment to dialog layout for translation
To enable the english resource to be used as a template, adjust the size
of the IDD_SOURCE.IDC_SOURCE_NETINST control so it's large enough for
translated text.
Jon Turney [Thu, 10 Feb 2022 15:38:56 +0000 (15:38 +0000)]
Handle tar type flag 'K' (GNU long link extension)
Handle tar type flag'K' (GNU long link extension)
Also report unexpected filename in headers with long name extension type
Also clean up some cruft in archive_tar.cc
Currently, the only existing package which contains type flag 'K'
entries is f21-backgrounds-extras.
This also now correctly handles tar archive header linknames of exactly
100 characters (even when not preceeded by a 'K' type header), where the
linkname field is not null terminated as it should be, rather than
allowing the 'ustar\0' magic immediately following it to be interpreted
as part of the linkname.
Jon Turney [Mon, 7 Feb 2022 14:52:26 +0000 (14:52 +0000)]
Show overall progress for checking packages in package cache
Show overall progress for testing presence and validating packages in
package cache.
This gives a better sense of progress when installing many packages
which are already cached (e.g. a fresh install, but all required
packagea are already in the package cache, so this step, rather than the
download one, dominates).
Jon Turney [Thu, 27 Jan 2022 22:07:28 +0000 (22:07 +0000)]
Unconditionally fixup source package ids
In the case when a given package version appears in setup.ini first
with, then without an install: line, the source package is recreated by
packagemeta::add_version() to add the additional package source site,
but the install package is not - so it now contains a stale source
package id.
Unconditionally fixup source package ids, so that install package points
to the correct source package.
Also internalize libsolv attributes after doing fixup, the changes it
makes are visible (so this was probably never working right).
Jon Turney [Mon, 24 Jan 2022 17:07:15 +0000 (17:07 +0000)]
Don't create install package if there's no install: line
Don't erroneously create an install package if there's no install: line
for that version.
If it's for the latest version and something depends on this package,
the solver will produce a solution containing that package & version,
so we'll try to download it without having a path to fetch it from,
leading to download errors which are impossible to resolve.
Jon Turney [Sun, 19 Dec 2021 21:22:55 +0000 (21:22 +0000)]
When in unattended mode, ignore attempts to close via GUI
Perhaps this should be controlled by a separate option, but making setup
non-interactive seems like a reasonable fit with the intent of
'--quiet-mode'.
This doesn't stop the installer being killed by TerminateProcess().
Jon Turney [Fri, 7 Jan 2022 15:18:02 +0000 (15:18 +0000)]
Further fix symlinks to absolute paths made for ' --symlink-type native'
After using 'to' with NtOpenFile(), convert it back to Win322
filenamespace form before using it with CreateSymbolicLinkW(), so that
the symlink works with native tools.
Jon Turney [Thu, 2 Dec 2021 22:28:32 +0000 (22:28 +0000)]
Push some dynamic download/install dialog text into IDD_LOCAL_DIR DIALOG resource
Move the localizable dialog text which is dynamically modified depending
on install or download mode into the IDD_LOCAL_DIR DIALOG resource, and
show or hide it as appropriate.
After some staring at the code, it looks like it's possible that the
cause of this report is the linked list containing log entries to be
damaged if multiple threads call endLog() simultaneously.
Currently 'Changing gid to Administrators' is logged by the call to
nt_sec.setAdminGroup() just after the WM_APP_POSTINSTALL_THREAD_COMPLETE
message is been sent.
'Ending cygwin install' is logged just before main exits.
Make sending the WM_APP_POSTINSTLL_THREAD_COMPLETE message the last
thing that the postinstall thread does This should avoid the potential
for endLog() becing called by multiple threads simultaenously.
Logging is still lousy with race conditions as the std::stringbuf all
threads are writing to is global (leading to messages from multiple
threads being concatenated here), and appending to the linked list isn't
thread-safe, but this should at least avoid this particular infinite
loop.
Jon Turney [Thu, 15 Apr 2021 19:12:27 +0000 (20:12 +0100)]
Add an option to set the GUI language
Add an option to set the GUI language, primarily for testing purposes.
We need to call SetThreadUILanguage() not only in the main thread, but
in every thread which might access localized resources (directly or
indirectly).
Jon Turney [Mon, 10 May 2021 22:15:30 +0000 (23:15 +0100)]
Use generic formatting mbox wrapper
Use generic formatting mbox wrapper for some:
- message boxes whose contents are currently hand-made using a format string.
- message boxes whose contents can be put into a string resource.
This also makes the various captions used by these messageboxes
consistent.
Future work: Aim to phase out remaining uses of the existing mbox()
wrapper:
- via note(), fatal(), yesno()
- where we a need to use a fully dynamic string (e.g. from ini parser)
Jon Turney [Thu, 11 Nov 2021 22:17:12 +0000 (22:17 +0000)]
Fix uses of MessageBox() which could be problematic in unattended mode
Direct uses of MessageBox should be avoided, as they need special
attention to check that they are avoided in unattended mode (as they
could cause setup to stop and wait for user interaction).
Fix a few remaining uses that aren't guarded by checks of
unattended_mode, by using mbox() instead.
(These are new or slightly non-trivial uses which didn't get changed in a123de66).
Jon Turney [Mon, 10 May 2021 18:42:13 +0000 (19:42 +0100)]
Push some dynamic download/install dialog text into IDD_DESKTOP DIALOG resource
Move the localizable dialog text which is dynamically modified depending
on install or download mode into the IDD_DESKTOP DIALOG resource, and
show or hide it as appropriate.
Jon Turney [Mon, 10 May 2021 18:01:38 +0000 (19:01 +0100)]
Push some dynamic download/install dialog text into IDD_CHOOSE DIALOG resource
Move the localizable dialog text which is dynamically modified depending
on install or download mode into the IDD_CHOOSE DIALOG resource, and
show or hide it as appropriate.
Jon Turney [Fri, 1 Oct 2021 14:34:53 +0000 (15:34 +0100)]
Make '--quiet' imply 'download and install packages'
Make '--quiet' imply 'download and install packages', rather than
'whatever source mode was chosen in the last run'. This aligns
behaviour with the help text about installation type.
This can be overriden with '--download' or '--local-install'. Specifying
both already has the meaning 'download and install packages', but let's
not require than in combination with '--quiet' to get definite
behaviour.
Jon Turney [Sun, 18 Jul 2021 14:11:39 +0000 (15:11 +0100)]
Factor out StringChoiceOption
Factor out logic for 'a string option which is one of a set of choices'
from CompactOsStringOption as StringChoiceOption.
v2:
Allow different behaviour for option without a choice, and option absent.
Future work: This doesn't say anything other that "Error during option
processing" if you've given an invalid choice string, or left it out
when it's required, because libgetopt++ doesn't output anything, just
returns success or failure after processing the command line arguments.
Jon Turney [Sun, 25 Jul 2021 14:58:30 +0000 (15:58 +0100)]
Add separate symlink-creation phase when extracting archive
Add a separate symlink-creation phase when extracting an archive, by
ignoring symlinks on the first pass, rewinding the archive, and
then extracting only symlinks on the second pass.
This helps a lot with native symlinks (which require the destination to
exist when created, so we can determine if it is a file or directory).
Alternative implementations:
We could collect symlinks, and defer making them until the end of
extracting the archive. We'd also need to report errors if making those
symlinks failed.
We could close and re-open the archive, rather than rewinding it. Error
handling if the archive isn't accessible the second time could be
complex.
Jon Turney [Sat, 17 Jul 2021 12:56:31 +0000 (13:56 +0100)]
Only build for x86_64 in github workflow
Only build for x86_64 in github workflow, since the requirements for
i686 are now impossible to obtain (Fedora <=31 for non-DW2 EH compiler,
but coprs for EOL'ed Fedoras have been expired)
Christian Franke [Fri, 14 May 2021 07:50:12 +0000 (09:50 +0200)]
Add new option '--compact-os ALGORITHM'.
If specified, selected Compact OS compression algorithm is applied
to files below /bin, /sbin and /usr. Most DLL files are excluded
because rebase will open these files again for writing.
Jon Turney [Wed, 14 Jul 2021 14:39:09 +0000 (15:39 +0100)]
Fix a crash in ListView StringCache
Fix a sporadic crash in chooser introduced in f34a20e7.
Limit the mempcy() to fill StringCache to the size of the string we are
putting in the cache, not the the size of the cache (which will fault if
it happens to over-run into a inaccessible page).
Jon Turney [Wed, 12 May 2021 12:50:42 +0000 (13:50 +0100)]
Fix which column we size to accomodate action labels
This wasn't actually operating on the right column (due to a typo in ce9f6dd0), but fortunately that was benign (as the longest version is
probably longer than any action).
Jon Turney [Thu, 27 Aug 2020 14:48:06 +0000 (15:48 +0100)]
Handle '--packages package=version'
Handle '--packages package=version' to allow specifing the version of a
package to install on the command line.
isManuallyWanted() now returns the target packageversion (if specified),
or an empty packageversion (which is translated into an instruction to
the solver to choose the version).
In the 'upgrade' case, this changes from using the complex logic of
packagemeta::trustp() to determine the target version, when unspecified
on the command line, to allowing the solver to make that decision (which
should be broadly the same i.e. not downgrading test versions, etc.).
This also subtly changes the behaviour when the package version is not
specified. Instead of forcing the current version, we allow the solver
to choose the version, so it may not pick that version, if other
constraints exist, which prevent a solution containing that version.
There's probably some future work which can be done to simplify the
remaining uses packagemeta::trustp(), which are only related to the UI.
Jon Turney [Sun, 11 Apr 2021 15:52:05 +0000 (16:52 +0100)]
Check compiler exception handling model during configure
Since F32, Fedora ships a MinGW x86 compiler which uses DW2 exception
handling [1]. This does not support throwing exceptions from Windows
callbacks, which we use.
Jon Turney [Tue, 16 Mar 2021 15:55:59 +0000 (15:55 +0000)]
Turn on __USE_MINGW_ANSI_STDIO everywhere
__USE_MINGW_ANSI_STDIO is turned on by C++ STL headers, so we're getting
this define due to that in most places, except where we happen to
include stdio.h before them. archive_tar.cc happens to do that, and
wants ANSI stdio since da31ad35, so turn it on unconditionally.
It's also turned on for C++11 by MinGW headers >= 8.0.0, which Cygwin
already has, so this already works when building there, and we're going
to have to deal with any other problem that might cause elsewhere in the
source eventually anyhow.
This fixes building since da31ad35 on F33, which only has mingw-headers
7.0.0.