]> cygwin.com Git - cygwin-apps/setup.git/log
cygwin-apps/setup.git
6 years agoDrop in SolvableVersion as a replacement for packageversion
Jon Turney [Sat, 29 Apr 2017 14:39:46 +0000 (15:39 +0100)]
Drop in SolvableVersion as a replacement for packageversion

6 years agoRemove packageversion class
Jon Turney [Fri, 28 Apr 2017 16:39:26 +0000 (17:39 +0100)]
Remove packageversion class

Remove packageversion, _packageversion, defaultversion classes

6 years agoRemove cygpackage class
Jon Turney [Fri, 28 Apr 2017 14:26:05 +0000 (15:26 +0100)]
Remove cygpackage class

v2:
Fix typo in bootstrap.sh (kbrown)

6 years agoChange to using a libsolv pool for storing package information
Jon Turney [Fri, 7 Apr 2017 20:52:17 +0000 (21:52 +0100)]
Change to using a libsolv pool for storing package information

Add class SolverVersion, a wrapper around a Solvable Id. The interface is
similar to class packageversion, the name change is just to make sure I've
got everything.

Place test packages into separate repos.

Expressing that curr: packages are preferred to prev: ones when that is not
the version number ordering should be done with epoch numbers.

Wire up various bits of data in packageversion to Solvable attributes,
including sourcepackage, stability, archive (packagesource) and depends.

Store sourcePackage() by the id rather than name, for much faster lookup.

SolverVersions for the same package can be ordered and compared by evr.

Factor out packagedb:addBinary() and also use it in IniDBBuilder, rather
that inlining the process of adding a package there. Add an analagous
packagedb:addSource() to do the same thing for source packages.

Change to reading installed.db after setup.ini's have been read, so we can
supplement the installed.db packages with information from setup.ini.

Make packagemeta::add_version() check for successful insertion of version.
Record the version at a stability level. The last version wins in setting
curr/test.

Use a Solver object inside packagedb

v2:
Link with libregex rather than libgnurx

Use -lregex rather than -lgnurx, as the Fedora mingw{32,63}-libgnurx
cross-packages only contain the library under that name.

(The Cygwin mingw63-{i686,x86_64}-libgnurx cross-packages have both names).

Check for libregex at configure time
(Done properly this should use PKG_CHECK_MODULES, rather than checking
for the header...)

Update build instructions

6 years agoStore package stability in class packageversion
Jon Turney [Mon, 24 Apr 2017 19:17:36 +0000 (20:17 +0100)]
Store package stability in class packageversion

6 years agoFactor out reading installed.db
Jon Turney [Sat, 20 May 2017 15:17:44 +0000 (16:17 +0100)]
Factor out reading installed.db

Rather that doing implicitly the first time a packagedb is constructed, do
it explicitly at a certain point in time that is early enough.

6 years agoOpaque how PackageDepends is stored
Jon Turney [Fri, 5 May 2017 11:36:42 +0000 (12:36 +0100)]
Opaque how PackageDepends is stored

We want to be more opaque about how the PackageDepends for a packageversion
is stored, so rather than exposing a pointer to a PackageDepends object
inside class packageversion, access it by value.

This also makes us be more explicit about set/get of package depends()

Fix some iterations to deal with depends() returning a value rather than a
pointer.

Also adjust dumpPackageDepends() appropriately

6 years agoMake any MessageBox shown by the GuiParseFeedback class modal to the progress page
Jon Turney [Sat, 20 Jan 2018 19:58:49 +0000 (19:58 +0000)]
Make any MessageBox shown by the GuiParseFeedback class modal to the progress page

6 years agoQuery the user if a corrupt local file is found
Ken Brown [Tue, 9 Jan 2018 17:04:20 +0000 (12:04 -0500)]
Query the user if a corrupt local file is found

Also reorganize package validation.

Move the size-validation code in download.cc and the hash-validation
code in install.cc into new member functions of the packagesource
class.  Add a bool member 'validated' to the class to make sure that
the checking is done only once.

Change download.cc:check_for_cached() so that it offers to delete a
corrupt package file instead of throwing an exception.  The latter
previously caused a fatal error when check_for_cached() was called
from do_download_thread and download_one.  Now we get a fatal error
only if the user chooses not to delete the file.

Also make check_for_cached() check the hash of the file in addition to
the size.  Similarly, check the hash in addition to the size after
downloading a file.

6 years agoImprove help text release_2.884
Jon Turney [Sun, 7 Jan 2018 19:46:26 +0000 (19:46 +0000)]
Improve help text

Various clarifications to option descriptions
Consistently start option descriptions with a capital letter
Add an extra line to mention download & install/download/install modes

6 years agoFix 'Keep' button marking all installed packages as 'reinstall' not 'keep'
Jon Turney [Sun, 7 Jan 2018 20:10:27 +0000 (20:10 +0000)]
Fix 'Keep' button marking all installed packages as 'reinstall' not 'keep'

Regressed by commit 4209699 'Hoist pick() up to packagemeta'

6 years agoThrow exceptions instead of exiting with error codes
Ken Brown [Tue, 19 Dec 2017 16:10:22 +0000 (11:10 -0500)]
Throw exceptions instead of exiting with error codes

There were two places in PickView.cc and one in choose.cc where setup
would silently die with an error code.  Change this so that setup now
throws exceptions.  The exceptions are caught by
TOPLEVEL_CATCH("DialogProc") in PropertyPage::DialogProc().

6 years agoUpdate displayed copyright to 2018
Jon Turney [Sun, 7 Jan 2018 19:08:36 +0000 (19:08 +0000)]
Update displayed copyright to 2018

6 years agoSplit WISHLIST out from README
Jon Turney [Mon, 11 Dec 2017 23:18:33 +0000 (23:18 +0000)]
Split WISHLIST out from README

Also remove old CHANGES file

6 years agoGive TOPLEVEL_CATCH an owner window
Ken Brown [Tue, 19 Dec 2017 00:46:36 +0000 (19:46 -0500)]
Give TOPLEVEL_CATCH an owner window

The fatal message box produced by TOPLEVEL_CATCH had a NULL owner
window.  This meant that the box could be hidden by whatever window
was previously being displayed, so that setup appeared to hang.  In
addition, the user could interact with the propsheet window while the
message box was displayed.

Fix this by giving TOPLEVEL_CATCH an "owner" parameter.  In all uses
but one (TOPLEVEL_CATCH("main")), there is a non-NULL owner available
that we can use.

6 years agoSimplify LocalDirPage::OnNext() release_2.883
Jon Turney [Sat, 4 Nov 2017 16:09:01 +0000 (16:09 +0000)]
Simplify LocalDirPage::OnNext()

Never go directly to IDD_CHOOSE from LocalDirPage::OnNext(), go to
IDD_INSTATUS with WM_APP_START_SETUP_INI_DOWNLOAD (if source ==
IDC_SOURCE_LOCALDIR), otherwise IDD_NET (which eventually leads there)

6 years agoMake do_ini() succeed if found_ini_list is empty
Jon Turney [Sat, 4 Nov 2017 15:37:58 +0000 (15:37 +0000)]
Make do_ini() succeed if found_ini_list is empty

Rather than count the number of .ini files read in do_{local,remote}_ini,
and assume success if greater than zero, actually track if an error occured.

This is a subtle change of behaviour if more than one .ini file is read:
previously all we needed was one to succeed, now we need them all to
succeed.

(Note that site_list should never be empty, and it's still an error if we
don't find an .ini file from a site, so the practical effect is to make
do_local_ini succeed with an empty found_ini_list)

6 years agoFix invalid iterator use in packagedb::removeEmptyCategories()
Jon Turney [Sun, 29 Oct 2017 17:20:51 +0000 (17:20 +0000)]
Fix invalid iterator use in packagedb::removeEmptyCategories()

6 years agoMake removeEmptyCategories() explicit, rather than a side effect of defaultTrust()
Jon Turney [Fri, 29 Sep 2017 13:18:44 +0000 (14:18 +0100)]
Make removeEmptyCategories() explicit, rather than a side effect of defaultTrust()

It's unclear that this can ever do anything.  The list of categories is
built as we see packages in those categories, so I don't know how we can
ever get an empty category.

6 years agoHoist scan() up from packageversion to packagemeta
Jon Turney [Wed, 26 Apr 2017 15:22:30 +0000 (16:22 +0100)]
Hoist scan() up from packageversion to packagemeta

6 years agoHoist uninstall up to Installer::uninstallOne()
Jon Turney [Tue, 25 Apr 2017 22:44:08 +0000 (23:44 +0100)]
Hoist uninstall up to Installer::uninstallOne()

This calls packagemeta, which applies to packageversion (which delegates
through packageversion_ to cygpackage) to return lines from the .lst.gz file
(pretending that we know it contains a file list for that specific version)
and to remove the .lst.gz file when done.

Move this all up into Installer::uninstallOne(), where it's all in the same
place as the operation it is reversing, Installer::installOne().

6 years agoHoist pick() up to packagemeta
Jon Turney [Wed, 26 Apr 2017 14:20:14 +0000 (15:20 +0100)]
Hoist pick() up to packagemeta

We are always writing packagemeta.desired.pick(bool, packagemeta).  This
kind of suggests something not quite right.

The pick flag means install/reinstall, so despite being stored per
packageversion, is only significant to download/install for the desired
version.

There's a slight wrinkle in that we want to also set/clear this flag for the
source packageversion.  We can't change this to point to packagemeta rather
than packageversion, as that may not be the same for all versions, so
instead just track this flag separately as srcpicked.

Note that there is still a complicated mapping between the state of desired
and pick and the action represented in the UI:

desired == empty, installed == desired : skip
desired == empty, installed != desired : uninstall
desired == installed, pick == true     : reinstall
desired == installed, pick == false    : keep
desired != installed, pick == true     : upgrade
desired != installed, pick == false    : invalid

v2:
Make explicit that when desired == empty, pick is false (previously this was
implict, as setting pick for defaultversion was ignored)

6 years agoHoist addScript() etc. up from packageversion to packagemeta
Jon Turney [Tue, 23 May 2017 21:19:15 +0000 (22:19 +0100)]
Hoist addScript() etc. up from packageversion to packagemeta

We're only interesting in storing scripts and later running them from the
desired version as we install it, so despite being stored per
packageversion, this is only significant for the desired version.

Hoist it up from packageversion to packagemeta.

6 years agoReset dependency list for each requires:/depends:
Jon Turney [Wed, 6 Dec 2017 19:37:38 +0000 (19:37 +0000)]
Reset dependency list for each requires:/depends:

Reset dependency list for each requires:/depends:, otherwise, they are
concatenated.

Also, drop useless dump of dependency list before we start reading it.

6 years agoFix response to enter in the chooser search textbox
Ken Brown [Tue, 5 Dec 2017 17:21:12 +0000 (12:21 -0500)]
Fix response to enter in the chooser search textbox

Make 'enter' after we've started typing into the search textbox cause the
search filter to immediately take effect.

We don't change the default control immediately on EN_SETFOCUS unless there
is already text in the search textbox, so pressing 'enter' with the focus on
the search textbox (the initial state of the dialog) without typing anything
into the search textbox moves to the next page, as previously.

Also improve a bit of debug output from ChooserPage::OnMessageCmd()

v2:
Explicitly add/remove the defpushbutton style from the "Next" button when
the default button changes

v3:
Refine behaviour so default control is changed on EN_SETFOCUS if some
search text is present.

6 years agoMake Enter in the user URL box cause ADD instead of NEXT
Ken Brown [Mon, 4 Dec 2017 15:53:55 +0000 (10:53 -0500)]
Make Enter in the user URL box cause ADD instead of NEXT

6 years agoFix a typo in filenames for upload target in Makefile
Jon Turney [Thu, 23 Nov 2017 17:52:12 +0000 (17:52 +0000)]
Fix a typo in filenames for upload target in Makefile

6 years agoRemove references to "last-extrakeys"
Ken Brown [Tue, 28 Nov 2017 13:54:37 +0000 (08:54 -0500)]
Remove references to "last-extrakeys"

Extra gpg keys used to be stored in a file /etc/setup/last-extrakeys.
These keys are now saved in the "extrakeys" user setting, but there
were still references to "last-extrakeys" in comments and in a help
string.

6 years agoChange the interpretation of '#' in setup.rc
Ken Brown [Tue, 28 Nov 2017 13:45:44 +0000 (08:45 -0500)]
Change the interpretation of '#' in setup.rc

'#' was treated as a comment character in all circumstances.  Since
saved gpg keys contain '#', this caused the "extrakeys" user setting
to get truncated.  Change this so that '#' only indicates a comment if
it's the first non-whitespace character in a line.

6 years agoFix the reading and writing of the "extrakeys" user setting
Ken Brown [Mon, 27 Nov 2017 18:14:15 +0000 (13:14 -0500)]
Fix the reading and writing of the "extrakeys" user setting

ExtraKeysSetting::keybuffer is terminated by LF rather than NUL.  So
we have to replace NUL by LF after calling
UserSettings::get("extrakeys") in the ExtraKeysSetting constructor.
Otherwise the last saved key is discarded.  Also, bufsize has to be
set appropriately before the call to count_keys(), or else all saved
keys are discarded.

Similarly, the final LF in keybuffer has to be replaced by NUL in the
ExtraKeysSetting destructor before the call to
UserSettings::set("extrakeys", keybuffer).  Otherwise we get garbage
at the end of the "extrakeys" setting in setup.rc.

6 years agosite.cc, site.h: code cleanup
Ken Brown [Fri, 24 Nov 2017 17:29:27 +0000 (12:29 -0500)]
site.cc, site.h: code cleanup

Remove site_list_type::init(), which was introduced to work around a
problem with gcc-2.95.

Add a bool member 'from_mirrors_lst' to the site_list_type class.  Use
it to distinguish mirrors listed in mirrors.lst from user-added sites.
This replaces the (undocumented) use of
site_list_type::servername.size() for this purpose.

When registerSavedSite is called on a URL that's already in
'all_site_list', add the version from 'all_site_list' to 'site_list'
rather than adding a temporary version that contains no information
other than the URL.

Similarly, if the user adds a site that was already in
'all_site_list', don't replace the existent version with the new one
(which contains only the URL).

6 years agoMake 'System Proxy Settings' the default, rather than 'Direct'
Jon Turney [Thu, 16 Nov 2017 15:50:44 +0000 (15:50 +0000)]
Make 'System Proxy Settings' the default, rather than 'Direct'

Make 'System Proxy Settings' the default, rather than 'Direct', and re-order
the network connection options so that option is first.

If you don't need a proxy, the system proxy setting should be for direct
connection, anyhow.

So, at the moment, this is just a button you're supposed to know you need to
press to make it work, when you are behind a proxy.

This setting is persisted (as 'net-method'), so this change only effects new
installations.

6 years agoRemove the ScanFindVisitor class
Ken Brown [Fri, 27 Oct 2017 18:47:23 +0000 (14:47 -0400)]
Remove the ScanFindVisitor class

This class was used for local installs in which the repository contains no
setup.ini file.

This seems of questionable usefulness, since it doesn't know anything about
dependencies

It also doesn't correctly handle filenames with colons.

There are now good instructions at
https://cygwin.com/package-server.html#overlay for creating a valid
repository, so we just remove the class instead of trying to fix it.

6 years agoDon't fatal() on unexpected early window messages
Jon Turney [Fri, 22 Sep 2017 20:56:27 +0000 (21:56 +0100)]
Don't fatal() on unexpected early window messages

There's no good reason for this to be immediately fatal, and we have at
least one report of this happening [1], so don't fatal(), just warn.

[1] https://cygwin.com/ml/cygwin/2017-07/msg00428.html

6 years agoAdd upload target to Makefile
Jon Turney [Wed, 5 Jul 2017 17:06:36 +0000 (18:06 +0100)]
Add upload target to Makefile

6 years agoRemove remaining CVS keyword cruft
Jon Turney [Sun, 29 Oct 2017 16:38:32 +0000 (16:38 +0000)]
Remove remaining CVS keyword cruft

6 years agoQuery user after download error in interactive mode
Ken Brown [Mon, 13 Nov 2017 17:27:58 +0000 (12:27 -0500)]
Query user after download error in interactive mode

Instead of just giving the user a "Try again?" Yes/No choice that goes
to IDD_SITE on Yes, create a dialog IDD_DOWNLOAD_ERROR with the
following choices: 'Retry' (retry the download), 'Back' (return to
IDD_CHOOSE), 'Continue' (ignore the errors), or 'Cancel' (exit).

The dialog lists the packages that had download errors so that the
user can make an informed choice.

Users who liked the old behavior (IDD_SITE) can select Back twice.

6 years agoRemove "Try again?" from exit message
Ken Brown [Mon, 13 Nov 2017 17:23:35 +0000 (12:23 -0500)]
Remove "Try again?" from exit message

6 years agoFix off-by-one error in download retry report
Ken Brown [Fri, 10 Nov 2017 14:43:36 +0000 (09:43 -0500)]
Fix off-by-one error in download retry report

'retries' was decremented after it was tested but before it was
reported in the log, so the reported number was always 1 too low.

6 years agoJust retry download after error in unattended mode
Ken Brown [Fri, 10 Nov 2017 14:43:35 +0000 (09:43 -0500)]
Just retry download after error in unattended mode

After a download error, setup was going back to IDD_SITE.  This is
pointless in unattended mode, since no changes in the mirrors or
packages can be made.

Change misleading comment about retries in unattended mode; the Yes/No
dialog is not used in that case.

6 years agoAdd OS version to user-agent string release_2.882
Jon Turney [Fri, 20 Oct 2017 12:30:48 +0000 (13:30 +0100)]
Add OS version to user-agent string

6 years agoAdd bitness to user-agent string
Jon Turney [Wed, 18 Oct 2017 16:57:54 +0000 (17:57 +0100)]
Add bitness to user-agent string

We have no idea about the proportion of 32-bit and 64-bit Cygwin installs.

Add a 'Win32', 'WoW64' or 'Win64' token to the user-agent string to report
bitness.

Future work: it might be useful to report the OS version as well

6 years agoFix -Werror=misleading-indentation errors seen with gcc 6
Jon Turney [Thu, 19 Oct 2017 01:20:55 +0000 (02:20 +0100)]
Fix -Werror=misleading-indentation errors seen with gcc 6

This looks like an actual bug which has been lurking here since forever,
fortunately not exposed since hardly anything uses Option::Optional...

libgetopt++/src/OptionSet.cc: In member function 'void OptionSet::doOption(std::__cxx11::string&, const size_type&)':
libgetopt++/src/OptionSet.cc:125:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
                         if (!isOption(maybepos))
                         ^~
libgetopt++/src/OptionSet.cc:128:8: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
        argv.erase(argv.begin() + 1);
        ^~~~
libgetopt++/src/OptionSet.cc:159:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
                         if (!isOption(maybepos))
                         ^~
libgetopt++/src/OptionSet.cc:161:8: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
        argv.erase(argv.begin() + 1);
        ^~~~

6 years agoFix -Werror=unused-const-variable error seen with gcc 6
Jon Turney [Wed, 27 Sep 2017 16:49:29 +0000 (17:49 +0100)]
Fix -Werror=unused-const-variable error seen with gcc 6

sha2.c:199:24: error: 'sha224_initial_hash_value' defined but not used [-Werror=unused-const-variable=]

6 years agoFix spinning after replace-on-reboot failure or skipped
Jon Turney [Tue, 10 Oct 2017 16:10:57 +0000 (17:10 +0100)]
Fix spinning after replace-on-reboot failure or skipped

If:
- extracting a file failed AND --no-replaceonreboot was used
- OR, writing the .new file for replacing on reboot failed
we don't advance to the next file in the archive, so we just sit there,
trying the same operation repeatedly.

Yes, this seems to mean that --no-replaceonreboot never worked usefully.

Also advance to next file in extract_other error case.

See https://cygwin.com/ml/cygwin/2017-10/msg00090.html

6 years agoAdd TAGS to .gitignore
Ken Brown [Sat, 16 Sep 2017 16:06:58 +0000 (12:06 -0400)]
Add TAGS to .gitignore

7 years agoAccept sites using https:// and ftps:// protocols in mirrors.lst release_2.881
Jon Turney [Mon, 19 Jun 2017 10:46:27 +0000 (11:46 +0100)]
Accept sites using https:// and ftps:// protocols in mirrors.lst

Also report when a line from mirrors.lst is being discarded due to a URL
using an unknown protocol.

7 years agoAvoid messagebox spam with file:// protocol URLs release_2.880
Ake Rehnman [Tue, 2 May 2017 18:55:07 +0000 (20:55 +0200)]
Avoid messagebox spam with file:// protocol URLs

When using a file:// protocol URL for package repo, don't spam messageboxes
warning about absence of compressed setup files.  We don't do that for
ftp:// or http:// protocol URLs.

A warning is still given we couldn't find a useable setup.ini from the URL
provided

7 years agoFix useless error message
Jon Turney [Thu, 25 May 2017 15:07:53 +0000 (16:07 +0100)]
Fix useless error message

If source.Cached() is empty, we produce the amazingly helpful error message
"Can't open (null) for reading: No such file".

Improve the error message so it reports that we can't open the archive since
we don't know a filename for the locally cached archive file.

This can occur if download failed for an archive, but we chose to continue.

7 years agoFix that clicking on any column changes "Keep" to "Uninstall"
Jon Turney [Fri, 2 Jun 2017 16:46:14 +0000 (17:46 +0100)]
Fix that clicking on any column changes "Keep" to "Uninstall"

A package's status is only changed by clicking on the "New" column, with one
exception: If the status is "Keep", it is changed to "Uninstall" after a
click (even accidental) on any other column.

"Keep" means desired == installed, picked = false.  Only run the code which
is supposed to detect both "src?" and "bin?" unchecked when clicking on
those columns.

Addresses: https://cygwin.com/ml/cygwin/2017-05/msg00525.html

7 years agoAllow click-to-activate in PickView list control
Jon Turney [Fri, 2 Jun 2017 15:01:39 +0000 (16:01 +0100)]
Allow click-to-activate in PickView list control

This helps somewhat with the problem reported in
https://cygwin.com/ml/cygwin/2017-05/msg00513.html

7 years agoAllow user-agent string to be customized
Jon Turney [Tue, 16 May 2017 11:42:18 +0000 (12:42 +0100)]
Allow user-agent string to be customized

If the option is present without a string, this means that no user-agent
header should be added.

Also include version in default user agent string

v2:
Add logging of User-Agent: header override

v3:
Be more careful about scope User-Agent std::string object

7 years agoAdd Option::isPresent() method
Jon Turney [Fri, 2 Jun 2017 11:20:36 +0000 (12:20 +0100)]
Add Option::isPresent() method

Add Option::isPresent() method, so we can distinguish between the cases of
an option which is present with the default value, and an option which is
absent.

7 years agoAccess StringOption's value by reference
Jon Turney [Fri, 2 Jun 2017 11:12:08 +0000 (12:12 +0100)]
Access StringOption's value by reference

Access StringOption's value by reference, to avoid unnecessary temporaries.

7 years agoAlphabetically sort options in usage help
Jon Turney [Tue, 16 May 2017 23:12:40 +0000 (00:12 +0100)]
Alphabetically sort options in usage help

7 years agoAllow options which only have long names
Jon Turney [Tue, 16 May 2017 23:00:14 +0000 (00:00 +0100)]
Allow options which only have long names

We're kind of running out of letters for short options :)

7 years agoRemove OR from grammar
Jon Turney [Mon, 22 May 2017 21:04:21 +0000 (22:04 +0100)]
Remove OR from grammar

Unused since removal of complex dependency rules in 60b4f6ca

7 years agoImprove error recovery in setup.ini parsing
Jon Turney [Mon, 22 May 2017 18:22:45 +0000 (19:22 +0100)]
Improve error recovery in setup.ini parsing

Following the error token with a NL allows the parser to discard tokens
until a NL is found to resynchronize, rather than aborting.

This doesn't help hugely, as *any* parse errors are considered fatal by
do_remote_ini()/do_local_ini() and won't let us proceed.

7 years agoFix infinite recursion in grammar for depends
Jon Turney [Mon, 22 May 2017 15:18:04 +0000 (16:18 +0100)]
Fix infinite recursion in grammar for depends

Allowing listseparator to be empty allows an infinite recursion in the
versionedpackagelist rule

Also make the comment documenting versionedpackageentry is non-empty
consistent with all other similar comments

Also allow lower-case depends:

7 years agoFold build(Install|Source)(MD5|SHA512) into buildPackage(Install|Source)
Jon Turney [Fri, 28 Apr 2017 21:11:47 +0000 (22:11 +0100)]
Fold build(Install|Source)(MD5|SHA512) into buildPackage(Install|Source)

Fold build(Install|Source)(MD5|SHA512) into buildPackage(Install|Source), so
the (pathname, size, hash) information from an install: or source: line is
all processed together.

7 years agoFold IniDBBuilderPackage::buildInstallSize() into buildPackageInstall()
Jon Turney [Fri, 28 Apr 2017 20:35:29 +0000 (21:35 +0100)]
Fold IniDBBuilderPackage::buildInstallSize() into buildPackageInstall()

As mentioned in 5a3799dc, this ripples through into ScanFindVisitor as well.

7 years agoMove and rename dumpAndList()
Jon Turney [Tue, 16 May 2017 17:53:55 +0000 (18:53 +0100)]
Move and rename dumpAndList()

7 years agoMake PrereqChecker::setTrust() a static method
Jon Turney [Thu, 18 May 2017 15:33:26 +0000 (16:33 +0100)]
Make PrereqChecker::setTrust() a static method

Rather than instantiating PrereqChecker just to call an accessor method
which changes a static data member, make that method static as well.

7 years agoRename category "Misc" to "Orphaned"
Jon Turney [Sun, 21 May 2017 18:45:29 +0000 (19:45 +0100)]
Rename category "Misc" to "Orphaned"

Packages which have no category are placed into this category.  Since a
category is mandatory for all packages in setup.ini, this effectively means
packages which are "orphaned" in the sense that they are installed, but
don't appear in any setup.ini.

Usually it's safe to uninstall such packages (with --delete-orphans), unless
you are actually using them, or have locally built packages which rely on
them.

7 years agoCorrectly calculate total data to checksum when using IncludeSource
Jon Turney [Sun, 21 May 2017 18:40:32 +0000 (19:40 +0100)]
Correctly calculate total data to checksum when using IncludeSource

Correctly account for source packages installed due to IncludeSource in the
total amount of data to checksum.

The fact that this obvious bug is unreported kind of suggests that no-one is
actually using this option...

7 years agoisBinary() should return true for orphaned packages
Jon Turney [Sat, 20 May 2017 15:46:53 +0000 (16:46 +0100)]
isBinary() should return true for orphaned packages

Test added in c23d96d6 is incorrect and results in orphaned packages being
omitted from picker.

7 years agoRestore a missing NULL-ness check
Jon Turney [Tue, 23 May 2017 13:40:24 +0000 (14:40 +0100)]
Restore a missing NULL-ness check

Accidentally dropped in 249e9360.  This could go away if
packagesource::Canonical() was changed to return std::string and other uses
checked empty() rather than against NULL.

7 years agoAdd some progress reporting during preremove and uninstall
Jon Turney [Mon, 15 May 2017 13:45:16 +0000 (14:45 +0100)]
Add some progress reporting during preremove and uninstall

7 years agoMake PackageDepends a type
Jon Turney [Thu, 4 May 2017 23:07:26 +0000 (00:07 +0100)]
Make PackageDepends a type

Make PackageDepends a type, rather than repeating it's definition
everywhere.

7 years agoAll, rather than just the first (usually current) version should get dependencies
Jon Turney [Thu, 4 May 2017 21:21:45 +0000 (22:21 +0100)]
All, rather than just the first (usually current) version should get dependencies

It seems that dependencies are only recorded against the first version
encountered, which is fortunately usually the current version.  If one were
to install a different version than that the first time a package is
installed, it's dependencies wouldn't be installed.

More zany hijinks from the wacky world of setup :)

7 years agoStop pretending to support complex dependencies
Jon Turney [Thu, 4 May 2017 18:58:35 +0000 (19:58 +0100)]
Stop pretending to support complex dependencies

We pretend that we can parse dependencies of the form "A | B".  But
PrereqChecker will just treat that as "A".

This is a hard problem to solve, as we'd need UI to ask, or policy to know
if A or B is preferred.

So just remove the pretense, simplifying lots of stuff.

7 years agoRemove useless PackageSpecification methods
Jon Turney [Thu, 4 May 2017 17:53:57 +0000 (18:53 +0100)]
Remove useless PackageSpecification methods

Remove unused PackageSpecification::serialise()

Remove dangerous PackageSpecification::operator= which doesn't copy all
object state

7 years agoChange PackageSpecification::_operator to an enum
Jon Turney [Thu, 4 May 2017 17:22:48 +0000 (18:22 +0100)]
Change PackageSpecification::_operator to an enum

7 years agoInitial setting of trust should be TRUST_CURR
Jon Turney [Tue, 2 May 2017 20:42:31 +0000 (21:42 +0100)]
Initial setting of trust should be TRUST_CURR

7 years agoFix comments and indentation in check_for_cached
Jon Turney [Mon, 1 May 2017 10:07:24 +0000 (11:07 +0100)]
Fix comments and indentation in check_for_cached

7 years agoSimplify class packagesource
Jon Turney [Sat, 29 Apr 2017 22:23:31 +0000 (23:23 +0100)]
Simplify class packagesource

packagesource::Filename() is unused

packagesource::Base() was only used in reporting progress in install.
Instead report the package name and package version.  (It would be nice to
do so consistently in uninstall well, but we don't really know what version
we are uninstalling)

The default copy constructor is not overriden, which is unsafe, as the class
contains a pointer to new-ed memory. Use std::string instead, retaining the
relied-upon behaviour of returning NULL for an empty string.

7 years agoRemove unneeded virtual from class packagesource's methods
Jon Turney [Sat, 29 Apr 2017 21:33:30 +0000 (22:33 +0100)]
Remove unneeded virtual from class packagesource's methods

This class has no subclasses, and there are no plans for such.

Also remove some irrelevant comments which seem to have been cut-and-pasted
from packageversion.h

7 years agoRemove unused forward declaration of non-existent class category
Jon Turney [Sat, 29 Apr 2017 17:51:45 +0000 (18:51 +0100)]
Remove unused forward declaration of non-existent class category

7 years agoRemove packageversion::sources(), only packageversion::source() is useful
Jon Turney [Fri, 28 Apr 2017 18:59:25 +0000 (19:59 +0100)]
Remove packageversion::sources(), only packageversion::source() is useful

The comments seems to indicate this was for supporting a package consisting
of multiple archives.

We only supported downloading such packages, not describing them in
setup.ini or installing them.

No such mythical beast has been sighted.

7 years agoRename "Internet Explorer Proxy Settings" to "System Proxy Settings"
Jon Turney [Tue, 2 May 2017 09:45:30 +0000 (10:45 +0100)]
Rename "Internet Explorer Proxy Settings" to "System Proxy Settings"

Nowadays, these settings are set via the settings app, and are used by
applications other than IE.

Also remove unused IDS_WININET

7 years agoDon't bother storing prev version
Jon Turney [Tue, 2 May 2017 12:25:21 +0000 (13:25 +0100)]
Don't bother storing prev version

There's no means to select it since ec9c1d70, so don't bother remembering
which version is the prev version.

7 years agoUse INTERNET_FLAG_RESYNCHRONIZE when fetching cacheable URLs with wininet release_2.879
Jon Turney [Thu, 18 May 2017 12:01:06 +0000 (13:01 +0100)]
Use INTERNET_FLAG_RESYNCHRONIZE when fetching cacheable URLs with wininet

It seems this is needed for correct cache behaviour when the server doesn't
add an ETags header (i.e. sending an If-Modified-Since: request).  Why would
we want sane behaviour by default, eh?

7 years agoLog if URL fetch was satisified from cache
Jon Turney [Wed, 17 May 2017 17:28:38 +0000 (18:28 +0100)]
Log if URL fetch was satisified from cache

7 years agoImprove logging of URL fetching and wininet errors
Jon Turney [Wed, 10 May 2017 11:46:58 +0000 (12:46 +0100)]
Improve logging of URL fetching and wininet errors

7 years agoAdd Makefile rule to rename build products to form used when uploading
Jon Turney [Tue, 2 May 2017 14:54:09 +0000 (15:54 +0100)]
Add Makefile rule to rename build products to form used when uploading

Also clean all .dbg and .exe files

7 years agoUpdate displayed copyright to 2017 release_2.878
Jon Turney [Mon, 1 May 2017 22:38:20 +0000 (23:38 +0100)]
Update displayed copyright to 2017

7 years agoUse wininet for fetching URLs in direct (non-proxy) case
Jon Turney [Thu, 30 Mar 2017 10:48:44 +0000 (11:48 +0100)]
Use wininet for fetching URLs in direct (non-proxy) case

From the discussion in [1], I was somewhat surprised to learn that setup
doesn't support https or ftps.

Switch to using wininet for fetching URLs in the direct (non-proxy) case, as
well. (It's already used in proxy case). This allows https and ftps
protocols to be used.

For the moment, we keep around the existing, hand-built URL fetching as
'Direct (legacy)'.

Arrange for mirrors.lst and setup.ini to be cached by wininet, but not
package archives (as setup maintains it's own cache of those)

Read from wininet in 64K chunks rather than the whole file, so we can report
progress feedback as we download.

Close rather than leak InternetOpenUrl() handles with errors.

Also fix up some bad indentation.

I think the reason we have a handbuilt HTTP client is that back in 2000 or
so, we were concerned about the case where IE5 wasn't installed and so
wininet wasn't available.  But who knows...

[1] https://cygwin.com/ml/cygwin/2017-03/msg00384.html

7 years agoRemove obsolete ChangeLog
Jon Turney [Fri, 28 Apr 2017 14:26:35 +0000 (15:26 +0100)]
Remove obsolete ChangeLog

7 years agoDon't show source-only packages in package list
Jon Turney [Sat, 21 Jan 2017 16:03:02 +0000 (16:03 +0000)]
Don't show source-only packages in package list

external-source: packages which have no binary package will be marked skip:
and so won't show up in setup.ini at all.

If we change to using the Source: line to identify a source package, which
is (by definition) source only, these will appear in setup.ini, but without
any install: lines, so we need to explcitly avoid showing them in the
package list.

Future work: perhaps add another view to show just source packages?

7 years agoMake building with DEBUG less useless
Jon Turney [Fri, 28 Apr 2017 11:27:42 +0000 (12:27 +0100)]
Make building with DEBUG less useless

Showing a messagebox with ldesc for every single package is annoying.

7 years agoDon't do unneeded work when changing stability level
Jon Turney [Tue, 25 Apr 2017 18:15:16 +0000 (19:15 +0100)]
Don't do unneeded work when changing stability level

Since 2c4487b3, we stopped recomputing all the dependencies every time
something was changed in the PickView.  Remove all the depsolver code which
was used to do that.

The only remaining use was when we changed stability level, to select all
the package versions at that stability level.  That work is already being
done by packagedb::defaultTrust() (called by ChooserPage::changeTrust()).

(Note that this changes behaviour slightly: New dependencies of currently
installed packages used to be shown in the PickView, but now they won't be
reported until the PrereqChecker)

(This still leaves the crude depsolver we actually use in PrereqChecker,
which just selects all the unmet dependencies with the current trust level)

7 years agoDon't handle missing 'version:'
Jon Turney [Wed, 26 Apr 2017 20:03:01 +0000 (21:03 +0100)]
Don't handle missing 'version:'

If the setup.ini is missing a 'version:' line, parse the version number out
of the 'install:' filename.  Let's not do that anymore...

7 years agopackageversion::sourcePackageSpecification() is const
Jon Turney [Wed, 26 Apr 2017 19:13:21 +0000 (20:13 +0100)]
packageversion::sourcePackageSpecification() is const

7 years agoUse const version of packageversion::depends() in PrereqChecker
Jon Turney [Wed, 26 Apr 2017 15:24:43 +0000 (16:24 +0100)]
Use const version of packageversion::depends() in PrereqChecker

7 years agoMake packageversion::source(|s) const
Jon Turney [Wed, 26 Apr 2017 13:59:59 +0000 (14:59 +0100)]
Make packageversion::source(|s) const

Make packageversion::source() and sources() const

Remove a temporary used to dererence an packageversion iterator to avoid
problems with const-correctness

7 years agoRemove cygpackage::destroy() because it does nothing
Jon Turney [Tue, 25 Apr 2017 23:07:25 +0000 (00:07 +0100)]
Remove cygpackage::destroy() because it does nothing

7 years agoRemove unused package_status_t stored in packageversion class
Jon Turney [Tue, 25 Apr 2017 10:54:25 +0000 (11:54 +0100)]
Remove unused package_status_t stored in packageversion class

The package installed/not installed status is tracked by the packagemeta
class, currently

7 years agoRemove pointless abstract base class IniDBBuilder
Jon Turney [Fri, 7 Apr 2017 19:11:08 +0000 (20:11 +0100)]
Remove pointless abstract base class IniDBBuilder

There can be no instances of IniDBBuilder (it has pure virtual methods).
There is only one derived class IniDBBuilderPackage.
We can't think of any use for other derived classes.

7 years agoRemove uses of stderr for reporting file/directory pathname clashes
Jon Turney [Mon, 24 Apr 2017 17:12:02 +0000 (18:12 +0100)]
Remove uses of stderr for reporting file/directory pathname clashes

Convert output which directly used fprintf(stderr,...), which isn't normally
going anywhere useful, to using logging.

7 years agoAdd --allow-unsupported-windows option
Jon Turney [Sat, 21 Jan 2017 18:07:02 +0000 (18:07 +0000)]
Add --allow-unsupported-windows option

This patch was suggested in a discussion with Peter Castro.

The concern is that using old versions of setup to install time machine
mirrors is not ideal, as it misses possible fixes in newer versions of
setup.

However, we do want to make it hard for someone to destroy their working XP
installation, so allowing setup to simply run on XP, which will break it by
upgrading it to the latest version (which doesn't work on XP), seems
contraindicated.

When --allow-unsupported-windows is on:
- Don't check the windows version
- Don't read the mirror list from cygwin.com
- Don't use any stored mirror selection in the 'last-mirror' key (as this
may point to a cygwin mirror, which, if we install from will break things)
- Retain the mirror selection (presumably a time machine circa given with
--site or via the GUI) in an alternate key 'last-mirror-unsupported'

Also, for discoverability, rearrange things so --help works even on
unsupported windows versions

This page took 0.078167 seconds and 5 git commands to generate.