]> cygwin.com Git - cygwin-apps/setup.git/log
cygwin-apps/setup.git
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

7 years agoRemove an obsolete prototype
Jon Turney [Sat, 21 Jan 2017 13:20:37 +0000 (13:20 +0000)]
Remove an obsolete prototype

add_correct_version() was moved into IniDBBuilderPackage in commit 076654e7

7 years agoRemove unused cvsid
Jon Turney [Fri, 20 Jan 2017 21:26:31 +0000 (21:26 +0000)]
Remove unused cvsid

7 years agoRemove redundant parser rule
Jon Turney [Thu, 19 Jan 2017 21:36:20 +0000 (21:36 +0000)]
Remove redundant parser rule

Remove parser rules for undocumented redundant syntax

7 years agoRemove unused syntax for separate size and hash lines
Jon Turney [Thu, 19 Jan 2017 21:33:56 +0000 (21:33 +0000)]
Remove unused syntax for separate size and hash lines

Size:, MD5sum:, SHA512: are never used as the size and hash are always given
in install: or source: lines

7 years agoRemove parser rules which store data which is never used.
Jon Turney [Thu, 19 Jan 2017 20:45:41 +0000 (20:45 +0000)]
Remove parser rules which store data which is never used.

Remove parser rules for undocumented syntax which store data which is never
used.

Architecture:
Binary:
Conflicts:
Description:
Installed-Size:
Pre-Depends:
Priority:
Provides:
Recommends:
Replaces:
Suggests:

7 years agoRemove parser rules which do nothing
Jon Turney [Wed, 14 Dec 2016 13:00:51 +0000 (13:00 +0000)]
Remove parser rules which do nothing

Remove parser rules for undocumented sytax which does nothing

MAINTAINER
STANDARDSVERSION
FORMAT
DIRECTORY
FILES

Either the parser rules are empty, or call functions which do nothing

7 years agoRemove unused lexer tokens
Jon Turney [Wed, 14 Dec 2016 00:22:38 +0000 (00:22 +0000)]
Remove unused lexer tokens

Terminals unused in grammar

   APATH
   PPATH
   INCLUDE_SETUP
   EXCLUDE_PACKAGE
   DOWNLOAD_URL
   DESCRIPTION
   EMAIL
   OPENSQUARE
   CLOSESQUARE

EXCLUDE_PACKAGE and DESCRIPTION aren't even produced by any lexer rule

OPENSQUARE and CLOSESQUARE are unused since 3074ce5e, EXCLUDE_PACKAGE seems
to have done something in 2001, the rest never seem to have been used.

7 years agoMake package size and checksum mandatory in setup.ini
Jon Turney [Wed, 14 Dec 2016 00:00:02 +0000 (00:00 +0000)]
Make package size and checksum mandatory in setup.ini

The setup.ini grammar is written such that size and checksum are optional in
install: lines, and checksum is optional in source: lines.  Presumably this
had some historical use.

Change to make package size and checksum mandatory.

Future work: We keep the asymmetry between install: and source: where
buildPackageSource() sets both pathname and size, but buildPackageInstall()
only sets pathname, relying on a separate buildInstallSize() to set the size
later for the moment, as fixing that ripples through to other place.

7 years agoRemove unused grammar for dependent package architecture information release_2.877
Jon Turney [Tue, 30 Aug 2016 22:07:25 +0000 (23:07 +0100)]
Remove unused grammar for dependent package architecture information

A dependency package entry can apparently end with '[architecturelist]', but
this would be completely ignored if anything ever generated it...

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoFully initialize PROPSHEETPAGE
Jon Turney [Sat, 10 Sep 2016 16:56:27 +0000 (17:56 +0100)]
Fully initialize PROPSHEETPAGE

Avoids uninitilized data access errors reported by Dr.Memory

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoUse English button labels 'Keep', 'Current' and 'Test'
Jon Turney [Fri, 9 Dec 2016 14:56:25 +0000 (14:56 +0000)]
Use English button labels 'Keep', 'Current' and 'Test'

Use the English words 'Keep', 'Current' and 'Test' as button labels, rather
than 'Keep', 'Curr' and 'Exp'.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoAllow setup to parse more than 3 versions from the setup.ini file
Jon Turney [Wed, 31 Aug 2016 10:31:22 +0000 (11:31 +0100)]
Allow setup to parse more than 3 versions from the setup.ini file

This recognizes any "[foo]" line as introducing the information for another
version, which doesn't have one of the trust levels [curr], [prev] or
[test], and so isn't automatically selected when setup is told to install
all packages at that trust level (by default, [curr]).

Setup already does all the necessary sorting in version order etc. to use
these additional versions.

The value of <foo> carries no meaning, but the setup.ini specification
will be amended to mandate the use of "[ver<digits>]".

* PackageTrust.h (trusts): Add TRUST_OTHER.
* inilex.ll: tokenize any other [version] as the T_OTHER token.
* iniparse.yy: Add T_OTHER token and set package trust
to TRUST_OTHER when it is used.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoStrip symbols to setup.dbg
Jon Turney [Tue, 22 Nov 2016 16:05:58 +0000 (16:05 +0000)]
Strip symbols to setup.dbg

As noted in https://cygwin.com/ml/cygwin/2016-11/msg00254.html debugging the
distributed setup executable is a lost cause at the moment.  Preserve
symbols so it's not quite as hopeless.

Note: to debug the distributed setup executable with gdb, it will be
necessary to decompress the setup executable with 'upx -d', and, if the .dbg
file has been renamed to match the renamed setup executable, explicitly load
it into gdb with the 'symbol-file' command.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoSimplify PickView::insert_pkg
Jon Turney [Fri, 16 Sep 2016 18:53:53 +0000 (19:53 +0100)]
Simplify PickView::insert_pkg

This is only called from PickView::setViewMode(), and only when view_style
is not views::Category, so checking that again is redundant.

7 years agoStart chooser in "Pending" view if this is not a first time installation
Jon Turney [Sun, 11 Sep 2016 21:09:27 +0000 (22:09 +0100)]
Start chooser in "Pending" view if this is not a first time installation

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoIgnore malformed lines in a site-list
Jon Turney [Fri, 26 Aug 2016 10:03:22 +0000 (11:03 +0100)]
Ignore malformed lines in a site-list

Ignore malformed lines in a site-list, rather than crashing

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoFix validation in RootPage
Jon Turney [Fri, 26 Aug 2016 09:19:10 +0000 (10:19 +0100)]
Fix validation in RootPage

RootPage is supposed to disable the next button if the rootdir edit box is
empty, but this currently doesn't work.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoGive search edit box autohscroll style
Jon Turney [Wed, 7 Sep 2016 16:54:26 +0000 (17:54 +0100)]
Give search edit box autohscroll style

This enables searching for package names longer than will fit in the edit
box, by allowing the text in the edit box to horizontally scroll...

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoRestore Alt-V accelerator for view selection control in chooser
Jon Turney [Sat, 10 Sep 2016 10:37:01 +0000 (11:37 +0100)]
Restore Alt-V accelerator for view selection control in chooser

Also make the view selection control a tabstop

Also give "Curr" a unique accelerator, 'C' is already being used by "Clear"

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoCall Logger ().exit instead of exit() when leaving release_2.876
Corinna Vinschen [Fri, 2 Sep 2016 10:26:00 +0000 (12:26 +0200)]
Call Logger ().exit instead of exit() when leaving

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoRefuse to run on Windows XP and earlier
Jon Turney [Thu, 1 Sep 2016 19:30:44 +0000 (20:30 +0100)]
Refuse to run on Windows XP and earlier

Refuse to run on Windows versions less than 6.0 (XP or previous), as they
are no longer supported by Cygwin.

Future work: The version checked against should be read from setup.ini,
rather than hard-coded here, so that this version of setup cannot be used to
download a future version of Cygwin which isn't compatible with the Windows
version it's running on...

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoNTSecurity::GetPosixPerms: Simplify creation of ACEs
Corinna Vinschen [Thu, 1 Sep 2016 18:47:29 +0000 (20:47 +0200)]
NTSecurity::GetPosixPerms: Simplify creation of ACEs

Use AddAccessAllowedAceEx to avoid having to change the
inheritance flags afterwards.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoFix incorrect heap memory access in SimpleSocket::gets()
Jon Turney [Thu, 1 Sep 2016 18:21:55 +0000 (19:21 +0100)]
Fix incorrect heap memory access in SimpleSocket::gets()

nl is dereferenced to check if it's '\n' or '\r', before we check if we have
passed the start of the buffer.  Re-order the check so we check if we have
passed the start of the buffer first.

Detected by Dr.Memory, e.g:

Error #7: UNADDRESSABLE ACCESS beyond heap bounds: reading 0x053f3067-0x053f3068 1 byte(s)
 0 SimpleSocket::gets                           [/wip/cygwin-setup/build.x86/../simpsock.cc:177]
 1 NetIO_HTTP::NetIO_HTTP                       [/wip/cygwin-setup/build.x86/../nio-http.cc:195]
 2 NetIO::open                                  [/wip/cygwin-setup/build.x86/../netio.cc:154]
 3 getUrlToStream                               [/wip/cygwin-setup/build.x86/../geturl.cc:119]
 4 get_url_to_membuf                            [/wip/cygwin-setup/build.x86/../geturl.cc:161]
 5 get_url_to_string                            [/wip/cygwin-setup/build.x86/../geturl.cc:186]
 6 get_site_list                                [/wip/cygwin-setup/build.x86/../site.cc:324]
 7 do_download_site_info_thread@4               [/wip/cygwin-setup/build.x86/../site.cc:410]
 8 KERNEL32.dll!BaseThreadInitThunk            +0x23     (0x76fb62c4 <KERNEL32.dll+0x162c4>)
Note: @0:00:20.016 in thread 280888
Note: refers to 1 byte(s) before next malloc
Note: next higher malloc: 0x053f3068-0x053f346b
Note: prev lower malloc:  0x053f2fc8-0x053f3048
Note: instruction: movzx  (%eax) -> %eax

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoClean up some cruft in propsheet.cc
Jon Turney [Thu, 1 Sep 2016 18:12:05 +0000 (19:12 +0100)]
Clean up some cruft in propsheet.cc

Clean up some cruft no longer needed after 67fb0b58

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoFix scope problem in NetIO_HTTP::NetIO_HTTP
Corinna Vinschen [Thu, 1 Sep 2016 13:58:46 +0000 (15:58 +0200)]
Fix scope problem in NetIO_HTTP::NetIO_HTTP

Also reformat slightly for better readability

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoFix scope problem with the FileInUse dialog
Jon Turney [Thu, 1 Sep 2016 12:45:59 +0000 (13:45 +0100)]
Fix scope problem with the FileInUse dialog

The std::string we make for dlg_data.msg must remain in scope while the
FileInUse modal dialog is shown.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoFix invalid deleting of a local pointer in UserSettings::UserSettings
Corinna Vinschen [Thu, 1 Sep 2016 12:46:21 +0000 (14:46 +0200)]
Fix invalid deleting of a local pointer in UserSettings::UserSettings

Convert buf to a unique_ptr instead.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoConvert deprecated auto_ptr to C++11-conformant unique_ptr
Corinna Vinschen [Thu, 1 Sep 2016 12:25:20 +0000 (14:25 +0200)]
Convert deprecated auto_ptr to C++11-conformant unique_ptr

Remove -Wno-deprecated-declarations option from Makefile.am
because it was only added for this single expression.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoFix scope problem when using the return value of get_root_dir()
Corinna Vinschen [Thu, 1 Sep 2016 11:52:33 +0000 (13:52 +0200)]
Fix scope problem when using the return value of get_root_dir()

Let get_root_dir return a reference instead of a temporary
std::string object.  In directory_is_absolute() and
directory_is_rootdir(), use std::string methods rather than
falling back to plain C techniques.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoUse a drop-down list to directly select chooser view filter release_2.875
Jon Turney [Sun, 28 Aug 2016 20:26:25 +0000 (21:26 +0100)]
Use a drop-down list to directly select chooser view filter

Rather than a button for cycling through views, use a drop-down list to
choose the view

Remove not very useful PickView::views::Unknown enum value so that enum can
start from 0, so it can be used directly as a drop-down list index.

8 years agoRename PickView::Package to PickView::PackagePending
Jon Turney [Wed, 3 Aug 2016 21:35:05 +0000 (22:35 +0100)]
Rename PickView::Package to PickView::PackagePending

Rename PickView::Package to PickView::PackagePending, as that's what that
view is

8 years agoChange PickView::view into an enum
Jon Turney [Wed, 3 Aug 2016 21:31:05 +0000 (22:31 +0100)]
Change PickView::view into an enum

Change PickView::view from a class, into an enum

Use a C++11 scoped enum so we don't have to change all the uses of it's
values.

8 years agoBuild C++ code with -std=gnu++11
Jon Turney [Wed, 3 Aug 2016 21:15:25 +0000 (22:15 +0100)]
Build C++ code with -std=gnu++11

Use BASECXXFLAGS rather then AM_CXXFLAGS to make AM_CFLAGS
Rationalize BASECXXFLAGS, adding -Werror and removing -Wno-uninitialized
(since the bug preventing it being used is long fixed)
Fix a bug detected by -Wuninitialized
Build C++ code with -std=gnu++11 -Wno-deprecated-declarations

8 years agoReserve paths starting "." for package metadata
Jon Turney [Tue, 2 Aug 2016 11:40:01 +0000 (12:40 +0100)]
Reserve paths starting "." for package metadata

Reserve pathnames starting "." (i.e. dotfiles in the root directory) for
package metadata, so don't extract them.

There are no current uses of these pathnames

8 years agoAdd an additional filter view, showing packages which were user picked
Jon Turney [Mon, 1 Aug 2016 17:05:14 +0000 (18:05 +0100)]
Add an additional filter view, showing packages which were user picked

Add an additional filter view, showing installed packages which were
selected for installation by the user, not installed as dependencies.

Future work:

Why is PickView::views is not an enum?

The view button would make more sense as a pop-up menu, allowing a specific
filter view to be directly selected, rather than cycling around the possible
filter views (and this situation is made worse by adding another filter
view)

8 years agoTrack if a package was installed by user, or as a dependency
Jon Turney [Tue, 2 Aug 2016 11:19:09 +0000 (12:19 +0100)]
Track if a package was installed by user, or as a dependency

Update the installed.db file format to version 3, containing the user_picked
flag.

This extends the semantics of user_pick somewhat: currently it is only used
for UI purposes, to record if a package was picked in the current session.

Now we also use it to record if an installed package has ever been picked
via the UI (otherwise it is only installed because it is a dependency).

So, we are careful not to set it when a currently installed package has it's
installed version adjusted via the GUI.

We also arrange for user_pick to be set when a package was selected for
installation via CLI.

Add a heuristic to initially populate user_pick when upgrading from older
installed.db formats: All non-base installed packages which aren't
dependencies are assumed to be user_pick-ed.

Note: other tools (e.g. cygcheck) which read the installed.db file will need
updating appropriately

v2:
Don't gratuitously break compatiblity with other existing readers of
installed.db, keep recording version as a notional filename.

Don't treat unknown future installed.db format versions as format version 1,
instead treat setup downgrading as a fatal error.

8 years agoRemove unused fn member from cygpackage
Jon Turney [Mon, 1 Aug 2016 12:45:40 +0000 (13:45 +0100)]
Remove unused fn member from cygpackage

This is set, but never used.

8 years agoRemove obsolete installed_from member from packagemeta
Jon Turney [Mon, 1 Aug 2016 12:43:34 +0000 (13:43 +0100)]
Remove obsolete installed_from member from packagemeta

This just stores a made-up tarfile name read from installed.db, and is never
used.

8 years agoProperly report progress in PrereqChecker::isMet
Jon Turney [Thu, 7 Jul 2016 13:34:22 +0000 (14:34 +0100)]
Properly report progress in PrereqChecker::isMet

Properly report progress in PrereqChecker::isMet after additional dependency
work is found.

8 years agoDowngrade "Running preremove script" logging to debug
Jon Turney [Tue, 21 Jun 2016 15:25:22 +0000 (16:25 +0100)]
Downgrade "Running preremove script" logging to debug

This is emitted for every package, regardless of it has any scripts or not.
Actual script execution is logged separately.

Also a cosmetic fix to remove a doubled space.

8 years agoAdd lex and yacc generated files to .gitignore
Jon Turney [Mon, 1 Aug 2016 11:16:14 +0000 (12:16 +0100)]
Add lex and yacc generated files to .gitignore

8 years agoPrevent libtool warning that a getopt++ shared library cannot be built
Jon Turney [Fri, 8 Jul 2016 11:06:10 +0000 (12:06 +0100)]
Prevent libtool warning that a getopt++ shared library cannot be built

libtool: warning: undefined symbols not allowed in i686-w64-mingw32 shared libraries; building static only

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