Robert Collins [Wed, 3 Jul 2002 22:39:14 +0000 (22:39 +0000)]
2002-07-03 Pavel Tsekov <ptsekov@gmx.net>
* filemanip.cc (parse_filename): Do not try to parse empty
strings (filenames).
* package_db.cc (packagedb::packagedb): For each line check if sscanf()
extracted good package name and filename.
Robert Collins [Wed, 3 Jul 2002 14:31:23 +0000 (14:31 +0000)]
2002-07-03 Robert Collins <rbtcollins@hotmail.com>
* package_meta.cc (packagemeta::set_requirements): Automatically select
version of dependent packages that satisfies the requirements.
Use processOneDependency to trigger the install of those packages.
(checkForInstalled): Check that the package remains installed.
(processOneDependency): Helper function for dependent packages.
* IniDBBuilderPackage.cc (IniDBBuilderPackage::buildPackage): Add more
debug information.
Clear out all current state on new packages.
(IniDBBuilderPackage::add_correct_version): Copy the dependency list
across.
Robert Collins [Tue, 2 Jul 2002 12:13:32 +0000 (12:13 +0000)]
2002-07-02 Robert Collins <rbtcollins@hotmail.com>
* Makefile.am (inilint_SOURCES): Add PackageSpecification sources.
nb: inilint is still incomplete, as the packageversion code is not
ready for database-less linking.
* site.cc (get_site_list): When the same site is reentered by the user
replace the old one. (Suggested by John Marshall).
Robert Collins [Mon, 1 Jul 2002 20:58:54 +0000 (20:58 +0000)]
2002-07-01 Robert Collins <rbtcollins@hotmail.com>
* IniDBBuilder.cc (IniDBBuilder::buildPackageRequirement): Remove.
* IniDBBuilder.h (IniDBBuilder::buildPackageRequirement): Ditto.
* IniDBBuilderPackage.cc: Use the STL algorithms.
Change cpv to cbpv throughout. Adjust -> to ., and use the new accessor
functions for the same variable throughout.
(IniDBBuilderPackage::IniDBBuilderPackage): Initialise new members.
(IniDBBuilderPackage::buildPackage): Use new cygpackage syntax,
and set an empty source package.
(IniDBBuilderPackage::buildPackageInstall): Use the new source member
to record an install package.
(IniDBBuilderPackage::buildPackageSource): Move source package logic
out from process_src, as it now occurs at separate times.
(IniDBBuilderPackage::buildPackageRequirement): Remove.
(IniDBBuilderPackage::buildSourceName): Use renamed package
specifiation accessor for clarity.
(IniDBBuilderPackage::buildSourceNameVersion): Ditto.
(IniDBBuilderPackage::add_correct_version): Use STL iterators rather
than custom code.
Remove source package references.
(IniDBBuilderPackage::process_src): Remove source package code as it's
now handled separately.
Set Path information before merging versions, to prevent dangling
pointers.
* IniDBBuilderPackage.h (IniDBBuilderPackage::buildPackageRequirement):
Remove.
(IniDBBuilderPackage::cpv): Remove.
(IniDBBuilderPackage::cbpv): New generic binary working variable.
(IniDBBuilderPackage::cspv): Ditto, but for source packages.
(IniDBBuilderPackage::csp): Source package variable for disjoint
source packages.
* Makefile.am (AM_CFLAGS): Remove -Winline to allow stl set code
to compile. If it compiles cleanly in gcc 3.1, then reinstate.
* PickPackageLine.cc: Adjust packageversion accessors to the new
reference calls. (i.e. -> to .) throughout.
(PickPackageLine::paint): Use accessible() for clarity.
Use new split out source package logic.
(PickPackageLine::click): Ditto.
* PickView.cc (PickView::init_headers): Adjust packageversion accessors
to the new reference calls. (i.e. -> to .) throughout.
Use new split out source package logic.
* choose.cc: Don't depend on a specific package type.
Adjust packageversion accessors to the new reference calls. (i.e. -> to
.) throughout.
(set_existence): Use accessible () for clarity.
(default_trust): Simplify a little.
(scanAVersion): Factored out code from scan_downloaded_files for
clarity.
(scan_downloaded_files): Factor out inner loop for clarity.
(ChooserPage::OnNext): Don't dump the dependency list,
it's parsing is robust now!.
* cygpackage.cc (createInstance): Use a factory method to create new
objects.
(cygpackage::cygpackage): Make this private for use by the factory.
(cygpackage::setCanonicalVersion): Renamed from set_canonical_version.
Remove key usage as it's obsolete.
* cygpackage.h (cygpackage): Inherit from _packageversion, not
packageversion.
(cygpackage::createInstance): New factory.
(cygpackage::cygpackage): Make private.
* desktop.cc (make_passwd_group): Use new packageversion reference.
* download.cc (do_download_thread): Use changeRequested() for clarity.
Use new packageversion reference calls.
* iniparse.y (REQUIRES): Reuse the packageList code and dump the one-off
requires code.
* install.cc: Adjust -> to ., and use the new accessor functions for
packageversion throughout.
* package_db.cc: Adjust -> to ., and use the new accessor functions for
packageversion throughout.
(packagedb::packagedb): Use the new cygpackage factory.
(packagedb::flush): Leverage String to remove buffer overflow chance in
sprintf.
(packagedb::findBinary): Find a binary meta package that has a version
matching a given specification.
(packagedb::findSource): Ditto, but for source.
* package_db.h (packagedb::findBinary): Declare.
(packagedb::findSource): Ditto.
* package_meta.cc: Adjust packageversion accessors to the new
reference calls. (i.e. -> to .) throughout.
Include the package_meta header first to ensure it parses standalone.
Use the STL algorithms.
(packagemeta::packagemeta): Create a copy constructor to allowing
cloning binary package metadata to source package metadata.
(packagemeta::~packagemeta): Use the STL coleltion code rather than
custom collection code.
(packagemeta::add_version): Ditto.
(packagemeta::set_installed): Ditto.
(packagemeta::SDesc): Ditto.
(hasSDesc): Helper function for find_if.
(checkForInstalled): Ditto.
(checkForUpgradeable): Ditto.
(checkForSatisfiable): Ditto.
(packagemeta::action_caption): Update for split out source packages.
(packagemeta::set_action): Ditto.
(packagemeta::set_requirements): Support multi-valued dependency
lists - a|b & c|d - with versioned package specifications.
(packagemeta::accessible): Helper member to improve abstraction.
(packagemeta::sourceAccessible): Ditto.
* package_meta.h: Adjust packageversion accessors to the new
reference calls. (i.e. "->" to "." and"*" to "" ) throughout.
(packagemeta::packagemeta): Declare copy constructor.
Remove self initialising members.
(packagemeta::set_action): Update parameters for new packageversion.
(packagemeta::trustp): Ditto.
(packagemeta::versions): Becomes an STL set.
* package_source.h (packagesource::Cached): Const correctness change.
* package_version.cc: Rewrite the packageversion interface to remove
the cygpackage nonvirtual members, and provide a copy by value,
pointer semantics reference counting wrapper class to ease use and
comparison of packageversions.
Change existing packageversion class to _packageversion throughout.
(_defaultversion): A trivial concrete class to prevent specialcasing
the default constructor for packageversion;
(packageversion::packageversion): Implement.
(packageversion::~packageversion): Ditto.
(packageversion::operator=): Ditto.
(packageversion::operator !): Ditto.
(packageversion::operator bool): Ditto.
(packageversion::operator ==): Ditto.
(packageversion::operator !=): Ditto.
(packageversion::operator <): Ditto.
(packageversion::Name): Ditto.
(packageversion::Canonical_version): Ditto.
(packageversion::setCanonicalVersion): Ditto.
(packageversion::getfirstfile): Ditto.
(packageversion::getnextfile): Ditto.
(packageversion::SDesc): Ditto.
(packageversion::set_sdesc): Ditto.
(packageversion::LDesc): Ditto.
(packageversion::set_ldesc): Ditto.
(packageversion::sourcePackage): Ditto.
(packageversion::sourcePackageSpecification): Ditto.
(packageversion::setSourcePackageSpecification): Ditto.
(packageversion::depends): Ditto.
(packageversion::predepends): Ditto.
(packageversion::recommends): Ditto.
(packageversion::suggests): Ditto.
(packageversion::replaces): Ditto.
(packageversion::conflicts): Ditto.
(packageversion::provides): Ditto.
(packageversion::picked): Ditto.
(packageversion::pick): Ditto.
(packageversion::changeRequested): Ditto.
(packageversion::uninstall): Ditto.
(packageversion::source): Ditto.
(packageversion::accessible): Ditto.
(_packageversion::sourcePackage): Ditto.
(_packageversion::accessible): Ditto.
(_packageversion::changeRequested): Ditto.
* package_version.h: Rewrite the packageversion interface to remove
the cygpackage nonvirtual members, and provide a copy by value,
pointer semantics reference counting wrapper class to ease use and
comparison of packageversions.
Change existing packageversion class to _packageversion throughout.
(Dependency): Remove.
(packageversion): New wrapper class.
(_packageversion): Renamed from packageversion.
(_packageversion::setCanonicalVersion): New method.
(_packageversion::sourcePackage): Ditto.
(_packageversion::sourcePackageSpecification): Ditto.
(_packageversion::setSourcePackageSpecification): Ditto.
(_packageversion::changeRequested): Ditto.
(_packageversion::bin): Rename to source.
(_packageversion::src): Remove.
(_packageversion::accessible): New method.
(_packageversion::references): Allow reference counting.
(_packageversion::sourceVersion): Cached the best-match source
package version.
Robert Collins [Thu, 27 Jun 2002 11:48:42 +0000 (11:48 +0000)]
2002-06-27 Robert Collins <rbtcollins@hotmail.com>
* compress_bz.h (compress_bz::position): Track how much has been read.
* compress_bz.cc (compress_bz::compress_bz): And initialise it.
(compress_bz::read): Track amount read by the client.
(compress_bz::tell): And report it when asked.
Robert Collins [Wed, 26 Jun 2002 21:35:16 +0000 (21:35 +0000)]
(IniDBBuilderPackage::process_src): Streamline and split out
functionality.
(IniDBBuilderPackage::setSourceSize): From process_src.
* IniDBBuilderPackage.h: Declare the IniDBBuilderPackage.cc changes.
(IniDBBuilderPackage::currentSpec): Track the in-progress specifiation.
(IniDBBuilderPackage::currentOrList): Track the current Or list.
(IniDBBuilderPackage::currentAndList): Track the current And list.
* IniParseFeedback.cc (IniParseFeedback::progress): Provide completion progress on parsing.
(IniParseFeedback::iniName): Tell what ini filename we are currently
processing.
* IniParseFeedback.h: Declare IniParseFeedback.cc changes.
* IniParseFindVisitor.cc (IniParseFindVisitor::IniParseFindVisitor):
Make the feedback object non-const to allow mutating methods which are
needed when the object has state.
(IniParseFindVisitor::visitFile): Tell the caller the name of each
.ini found.
Initialise the parser with the feedback object to allow it to tell of
progress.
* IniParseFindVisitor.h: Declare IniParseFindVisitor.cc changes.
* Makefile.am (inilinst_SOURCES): Add more requisite classes.
(setup_SOURCES): Add the new PackageSpecification sources.
* ScanFindVisitor.cc (ScanFindVisitor::visitFile): Use the new
builder syntax to setup binary package details.
* choose.cc: Use the LogSingleton calls throughout.
* configure.in: Create the INILINT substitution correctly for recent
autotool configurations.
* cygpackage.cc (cygpackage::getfirstfile): Return an empty String rather than a string built from an int. Thanks to Pavel Tsekov for identifying the bug.
(cygpackage::getnextfile): Ditto.
* download.cc: Use LogSIngletion calls throughout.
(validateCachedPackage): A refactoring of the
check_for_cached code to eliminate duplciation.
(check_for_cached): Use validateCachedPackage to check packages.
* ini.cc (GuiParseFeedback): Provide gui feedback on ini name and
parsing progress.
(do_remote_ini): Ditto.
* ini.h (ini_init): Pass a IniParseFeedback to the parser, to allow
progress reporting.
* inilex.l: Identify new symbols - operators, and multi line plain text. Releases files.
* inilintmain.cc (show_help): Provide basic infomation on inilint.
* iniparse.y: Adjust for the new builder syntax, and process debian
Release files.
* io_stream_file.cc: Always include mkdir.h.
* list.h: Factor index location into a private routine.
(list::findindex): Implement this.
* mkdir.cc (mkdir_p): Make the use of WIN32 code conditional on mingw
builds. NB: This breaks cygwin build functionality still.
* package_meta.cc: Use the LogSingleton calls throughout.
(packagemeta::set_requirements): Adjust for object changes in
dependencies.
* package_meta.h (packagemeta::packagemeta): Initialise new members.
(packagemeta::architecture): What platform does this package run on? This may need to move in the future to a per packagefile object.
(packagemeta::priority): What priority does this package have?
* package_source.h (packagesource::packagesource): Initialise new
members.
(packagesource::installedSize): How much space does the package need?
(packagesource::setInstalledSize): Tell the amount.
(packagesource::_installedSize): And store it.
* package_version.cc (packageversion::sourcePackage): return the source package.
(packageversion::setSourcePackage): And set it.
* package_version.h: Declare the package_version.cc changes.
(packageversion::depends): New package specification AND list. (packageversion::predepends): Ditto.
(packageversion::recommends): Ditto.
(packageversion::suggests): Ditto. (packageversion::replaces): Ditto.
(packageversion::conflicts): Ditto.
(packageversion::provides): Ditto.
(packageversion::sourcePackage): What source package is needed?
* threebar.cc (ThreeBarProgressPage::SetText4): Set the label beside
the bottom bar.
* threebar.h: Declare the threebar.cc change.
Robert Collins [Mon, 20 May 2002 07:03:18 +0000 (07:03 +0000)]
2002-05-20 Robert Collins <rbtcollins@hotmail.com>
* package_meta.cc (packagemeta::set_action): Don't allow reinstall
when local with no cached file, and install the default source if the
default version has no binary.
Robert Collins [Sun, 19 May 2002 12:54:16 +0000 (12:54 +0000)]
2002-05-19 Robert Collins <rbtcollins@hotmail.com>
* IniDBBuilderPackage.cc (IniDBBuilderPackage::IniDBBuilderPackage): New
method.
(IniDBBuilderPackage::buildVersion): Provide a warning when a newer
setup version created the ini file.
* IniDBBuilderPackage.h (IniDBBuilderPackage::IniDBBuilderPackage): New
method.
* IniParseFindVisitor.cc (IniParseFindVisitor::visitFile): Use the new
feedback strategy.
* IniParseFindVisitor.h (IniParseFindVisitor::IniParseFindVisitor):
Require a feedback strategy.
* Makefile.am (setup_SOURCES): Add IniParseFeedback sources.
* Makefile.in: Regenerate.
Robert Collins [Sun, 19 May 2002 08:51:19 +0000 (08:51 +0000)]
2002-05-19 Robert Collins <rbtcollins@hotmail.com>
* io_stream_file.cc (io_stream_file::remove): Use the SetFileAttributes
trick to delete read only files.
* io_stream_cygfile.cc (io_stream_cygfile::remove): Use file:// to
remove files.
* Makefile.am (release): Tweak to be more helpful.
* Makefile.in: Regenerate.
Robert Collins [Sun, 19 May 2002 06:23:37 +0000 (06:23 +0000)]
2002-05-19 Robert Collins <rbtcollins@hotmail.com>
* choose.cc (scan_downloaded_files): When a non-installed version
has neither bin nor src cached files for local installs,
remove the version from availability.
Robert Collins [Sun, 19 May 2002 03:07:54 +0000 (03:07 +0000)]
2002-05-19 Robert Collins <rbtcollins@hotmail.com>
* rsync: New support library, contains librsync. This is not (yet)
rsync interoperable.
* configure.in: --with-rsync to enable rsync support. (Not complete).
* Makefile.am: Enable building with rsync.
* Makefile.in: Regenerate.
* configure: Ditto.
* IniDBBuilder.cc (IniDBBuilder::buildPackageInstall): Pass the md5 as
an array.
(IniDBBuilder::buildPackageSource): Ditto.
* IniDBBuilder.h: Ditto.
* IniDBBuilderPackage.cc: Ditto.
* IniDBBuilderPackage.h: Ditto.
* FindVisitor.cc: New file.
* FindVisitor.h: New file, interface for visiting a file system
aggregate.
* IniParseFindVisitor.cc: New file.
* IniParseFindVisitor.h: New file, concrete FindVisitor that parses
found setup.ini's.
* README: Update TODO's.
* String++.cc (String::String): New constructor for <string> inter-
operability.
(String::substr): New method.
* String++.h: Ditto.
* choose.cc (scan2): Remove.
(scan_downloaded_files): Simplify.
* dialog.h: Include parsing pre-requirements.
* download.cc (check_for_cached): Fullname was used incorrectly - fix.
* filemanip.cc (parse_filename): -src packages where incorrectly parsed.
* find.cc: Rewrite. Now uses a Visitor pattern and is re-entrant.
* find.h: Ditto.
* fromcwd.cc: Remove unneeded includes.
(is_test_version): Remove.
(found_file): Remove.
(SetupFindVisitor): Trivial visitor to detect setup.ini's.
(found_ini): Remove.
(do_fromcwd): Remove commented code that has be replaced elsewhere.
* ini.cc (local_ini): Remove.
(findBuilder): Remove.
(find_routine): Remove.
(do_local_ini): Use new IniParseFindVisitor.
* iniparse.y: Typecase MD5 arrays, as we know they are allocated as
unsigned char.
* postinstall.cc: Remove non-core includes.
(run_script_in_postinstall): Remove.
(RunFindVisitor): Trivial Visitor, runs each found script.
(do_postinstall): Use new find syntax.
* ini.cc (find_routine): Don't clear buffer it it's NULL.
* filemanip.h (trail): Declare.
* filemanip.cc (trail): New function.
(find_tar_ext): Use trail() instead of strstr().
* fromcwd.cc (check_ini): Ditto.
* ini.cc (find_routine): Ditto. Don't tack local_dir to path since it should
now be fully qualified. Set ini_filename. Reset error_buf and error_count for
any subsequent ini file parsing.
(ini_filename): New static variable for parse error reporting.
(yyerror): Use full path of setup.ini in error message. Subtract one from line
number if at bol.
* find.cc (found_part): Eliminate.
(find_sub): Call for_each with full path found rather than just file component.
(find): Don't calculate found_part.
* inilex.l (ini_init): Flush input buffer and reset line number.
(yybol): New function. Exports YY_AT_BOL.
* iniparse.y: Increase stack depth to allow more tokens to be processed.
(yyparse): Remove newline from error condition to allow subsequent per-line
error processing to proceed normally.
* find.cc (find_sub): Be more defensive in preserving trailing parts of
components when doing recursive directory searches or calling user supplied
for_each().
* ini.cc (find_routine): Don't assume that any path name with "setup.ini" in it
is actually a setup.ini file. Only honor trailing components. Copy path
argument to temporary storage when unescaping to prevent nuking of argument.
Robert Collins [Sun, 12 May 2002 11:28:22 +0000 (11:28 +0000)]
2002-04-02 Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
* choose.cc: Run indent.
(nextbutton): Remove static variable.
(default_trust): Remove use of nextbutton.
(set_view_mode): Ditto.
(create_listview): Add IDC_CHOOSE_PREV and IDC_CHOOSE_NEXT to ta[] so
rbset() sets the prev/next/curr radio buttons properly.
(dialog_cmd): Delete function.
(dialog_proc): Delete function. Move WM_INITDIALOG functionality to
ChooserPage::OnInit.
(do_choose): Delete function. Move pre-DialogBox() code to
ChooserPage::OnInit(), post-DialogBox() code to ChooserPage::OnNext.
(WM_APP_START_CHOOSE): Remove define.
(WM_APP_CHOOSE_IS_FINISHED): Remove define.
(do_choose_thread): Delete function.
(ChooserPage::OnActivate): Delete method.
(ChooserPage::OnMessageApp): Delete method.
(ChooserPage::OnInit): New method.
(ChooserPage::OnNext): New method.
(ChooserPage::OnBack): New method.
(ChooserPage::OnMessageCmd): New method.
* choose.h: Run indent.
(ChooserPage::OnMessageApp): Delete declaration.
(ChooserPage::OnActivate): Ditto.
(ChooserPage::OnMessageCmd): New declaration.
(ChooserPage::OnInit): Ditto.
(ChooserPage::OnNext): Ditto.
(ChooserPage::OnBack): Ditto.
* desktop.cc (DesktopSetupPage::OnBack): Replace use of IDD_CHOOSER
with IDD_CHOOSE.
* fromcwd.cc (do_fromcwd): Replace use of IDD_CHOOSER with IDD_CHOOSE.
* ini.cc (do_ini_thread): Replace use of IDD_CHOOSER with IDD_CHOOSE.
* res.rc (IDD_CHOOSE): Remove dialog template.
(IDD_CHOOSER): Alter dialog template to fit wizard size and format.
Robert Collins [Fri, 10 May 2002 11:03:18 +0000 (11:03 +0000)]
2002-05-10 Robert Collins <rbtcollins@hotmail.com>
* Makefile.in: Regenerate.
* iniparse.y: Use left recursion, not right in the lines rule to
avoid stack overflows.
* README: Update TODO's.
* io_stream_file.cc: Native builds need to include sys/stat.h
Robert Collins [Mon, 6 May 2002 14:34:53 +0000 (14:34 +0000)]
2002-05-05 Robert Collins <rbtcollins@hotmail.com>
* Makefile.am (inlint_SOURCES): Add conditional objects to inilint
depending on platform.
Add file:// support.
* configure.in: Set conditional MINGWTARGET if compiling against mingw
libraries.
* Makefile.in: Regenerate.
* configure: Ditto.
* io_stream_file.cc: Only use win32 calls when building for mingw.
Robert Collins [Sun, 5 May 2002 04:02:01 +0000 (04:02 +0000)]
2002-05-05 Robert Collins <rbtcollins@hotmail.com>
* Makefile.am (noinst_PROGRAMS): Make inilint configurable.
* configure.in: Ditto.
Fix incorrect header checking syntax.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* Makefile.in: Regenerate.
* io_stream.cc: Remove platform specific and provider specific code.
(io_stream::registerProvider): New method, registers a Url provider with
the io_stream code.
Make all methods consistently throw invalid_argument exceptions when
a provider that is requested is not present.
(findProvider): New private function, finds a provider.
* io_stream.h: Declare io_stream::registerProvider.
* io_stream_cygfile.cc: Create a Provider class to register with
io_stream.cc.
* io_stream_file.cc: Ditto.
* archive.cc: Remove unneeded includes.
* archive_tar.cc: Remove unneeded includes.
* archive_tar.h: Add required include.
* archive_tar_file.cc: Remove unneded includes.
* choose.cc: Remove unneeded includes:
Robert Collins [Sat, 4 May 2002 12:15:56 +0000 (12:15 +0000)]
2002-05-04 Robert Collins <rbtcollins@hotmail.com>
* log.cc (log): Reimplement via LogSingleton.
(log_save): Remove.
(exit_setup): Remove.
* log.h (log_save): Remove.
(exit_setup): Remove.
* LogSingleton.cc: New file.
* LogSingleton.h: New file.
* LogFile.cc: New file.
* LogFile.h: New file.
* Makefile.am (inilint_SOURCES): Add the new log interface.
(setup_SOURCES): Add the new log interface and the concrete File
implementation.
* Makefile.in: Regenerate.
* archive.cc: Use the new log interface thruout.
* archive_tar.cc: Ditto.
* main.cc: Ditto.
* dialog.cc (fatal): Use the new log interface.
* ini.cc (do_ini_thread): Use the log interface to exit.
* isntall.cc (do_install_thread): Ditto.
* netio.cc (auth_cmd): Ditto.
* msg.cc (fatal): Ditto.
* localdir.cc (save_local_dir): Save to different files depending on
the mode, and if a root dir exists.
Robert Collins [Sat, 4 May 2002 04:26:01 +0000 (04:26 +0000)]
2002-05-04 Robert Collins <rbtcollins@hotmail.com>
* IniDBBuilder.cc: New file.
* IniDBBuilder.h: New file.
* IniDBBuilderPackage.cc: New file.
* IniDBBuilderPackage.h: New file.
* PackageTrust.h: New file.
* IniState.h: Remove, wasn't thought out well enough.
* Makefile.am (inilint_SOURCES): Add more requirements.
(setup_SOURCES): Add new Builder base and concrete classes.
* Makefile.in: Regenerate.
* String++.cc (String::String): Implement int contructor.
* String++.h (String): Declare int constructor.
* archive_tar.cc (archive_tar::next_file_name): Return String() when
no filename exists.
* archive_tar.h (archive_tar_file): Remove get_next_filename method,
it's not needed.
* ini.cc: Replace IniState wuth IniDBBuilderPacakge.
(find_routine): Use new IniDBBuilder to configure the parser.
(do_local_ini): Ditto.
(do_remote_ini): Ditto.
* ini.h: Use IniDBBuilder to initialise parsing.
* inilex.l (MD5): Parse the MD5 string correctly, we had the nibbles
swapped.
(ini_init): Use an IniDBBuilder rather than static variables.
* iniparse.y: Hand off all the object creation to a builder, rather
than hardcoding the behaviour. This allows run-time configured
behaviour.
* io_stream_cygfile.h (io_stream_cygfile): Remove get_next_filename
method, it's not needed.
* io_stream_file.h (io_stream_file): Ditto.
* mount.cc (cygpath): Return String() for missing mounts.
* package_meta.cc (packagemeta::SDesc): Return String() for blank
descriptions.
* package_meta.h (trusts): Remove - replaced by PackageTrust.h.
(packagemeta::packagemeta): Fix incorrect syntax in String constructor
usage.
* cygpackage.cc (cygpackage::cygpackage): Fix incorrect syntax in
String constructor usage.
* site.h (site_list_type): Ditto.
Robert Collins [Fri, 3 May 2002 11:41:30 +0000 (11:41 +0000)]
2002-05-03 Robert Collins <rbtcollins@hotmail.com>
* String++.h: Declare a << operator that accepts String objects.
* String++.cc: We need iostream for..
(operator <<): this. Provide a << operator that accepts String objects.
* ini.cc (yyerror): Remove the "C" classifier - it's not needed.
Change from vargs to a String parameter.
* inilintmail.cc: Remove the gui related headers.
(yyerror): Implement this for parsing.
* iniparse.y: Use the new yyerror syntax.
Robert Collins [Fri, 3 May 2002 09:40:55 +0000 (09:40 +0000)]
2002-05-03 Robert Collins <rbtcollins@hotmail.com>
* Makefile.am: Add IniState.h.
* Makefile.in: Regenerate.
* IniState.h: New file.
* choose.cc: Don't include ini.h - it's not needed.
* configure: Regenerate.
* desktop.cc: Don't include ini.h - it's not needed.
* download.cc: Ditto.
* fromcwd.cc: Ditto.
* ini.cc: Use IniState.h to track each parsing calling.
(find_routine): Ditto.
(do_remote_ini): Ditto.
(do_ini_thread): Ditto.
* ini.h (ini_init): Adjust parameters to include state object.
* inilex.l: Declare parser state variable.
(ini_init): Adjust parameters to include state object.
* iniparse.y: Remove obsolete setup_timestamp and setup_version
declarations.
(setup_header): Use new state variable to track time and version.
(add_correct_version): Ditto.
* install.cc: Don't include ini.h - it's not needed.
Robert Collins [Fri, 3 May 2002 08:28:12 +0000 (08:28 +0000)]
2002-05-03 Robert Collins <rbtcollins@hotmail.com>
* nio-files.cc (NetIO): Use io_stream syntax for get_file_size.
* io_stream_file.cc: Don't include filemanip.h.
(io_stream_file::get_size): Implement here to remove filemanip
dependency.
* io_stream_cygfile.cc: Don't include filemanip.h.
(io_stream_cygfile::get_size): Implement here to remove filemanip
dependency.
Implement a stat based version for when win32 is not available.
* filemanip.h (get_file_size): Return size_t - it's more appropriate.
* filemanip.cc: Don't include win32.h - be platform independent.
Include strings.h and io_stream.h as part of that.
(get_file_size): Leverage io_streams and remove win32 implementation.
* download.cc (check_for_cached): Use io_stream syntax for
get_file_size.
(download_one): Ditto.
Robert Collins [Wed, 1 May 2002 11:16:17 +0000 (11:16 +0000)]
2002-05-01 Robert Collins <rbtcollins@hotmail.com>
Oops! forgot to list these in the last checkin.
* inilintmain.cc: New file.
* md5.h: New file - imported md5 source, BSD style licence.
* md5.cc: New file - imported md5 source, BSD style licence.
* Exception.cc: New file.
* Exception.h: New file.
* MD5++.cc: New file.
* MD5++.h: New file.
Robert Collins [Wed, 1 May 2002 11:13:16 +0000 (11:13 +0000)]
2002-05-01 Robert Collins <rbtcollins@hotmail.com>
* Makefile.am (AM_CFLAGS): Remove -mwindows, it's a linker flag.
Remove -fno-rtti, we need it for exceptions.
(AM_CXXFLAGS): Ditto.
(WARNONLY_CFLAGS): Ditto.
(EXTRA_PROGRAMS): Add with initial linter sources - not functional yet.
(setup_LDFLAGS): Add and set to -mwindows.
(setup_SOURCES): Add new sources.
* Makefile.in: Regenerate.
* README: Update TODO.
* choose.cc (scan_downloaded_files): Use ini information if it's
available.
* configure: Regenerate.
* download.cc (check_for_cached): Make reusable from elsewhere.
Throw exceptions on errors (as opposed to failures).
Check MD5 sum when it's known.
(download_one): Never force a download.
Handle corrupt package exceptions.
* ini.cc (find_routine): Reverse escape the URL to correctly identify
the site URL.
* inilex.l (MD5): Provide a parsing rule (note: lowercase is required).
* iniparse.y: Allow calculation of MD5 sums, and allow src only
packages.
(process_src): New helper function.
* isntall.cc (install_one_source): Check MD5 sums when possible.
Throw exceptions on errors.
(do_install_thread): Handle exceptions for installation calls.
* package_source.h: Store MD5 information.
* propsheet.cc (PropSheet::Create): Add a useful comment.
* res.rc (IDS_INSTALL_ERROR): Define.
(IDS_CORRUPT_PACKAGE): Define.
* resource.h (IDS_INSTALL_ERROR): Define.
(IDS_CORRUPT_PACKAGE): Define.
* rfc1738.cc (rfc1738_unescape_part): Implement.
* rfc1738.h (rfc1738_unescape_part): Declare.
Robert Collins [Mon, 29 Apr 2002 11:07:40 +0000 (11:07 +0000)]
2002-04-29 Robert Collins <rbtcollins@hotmail.com>
* Makefile.am: Remove dependecy rules that automake emits.
Correct badly copied dependency info for manually compiled files.
(setup_SOURCES): Add all used headers.
(EXTRA_DIST): Include non compilate but required sources.
(setup_LDADD): Remove mingw32, it is autodetected.
* Makefile.in: Regenerate.
* String++.h: sys/types is a system header.
* choose.cc (do_choose_thread): Make into a Win32 thread routine.
Use ExitThread.
(ChooserPage::OnMessageApp): Use Win32 threads. (_beginthread is not
portable).
* configure: Regenerate.
* configure.in: Check for mingw32/cygwin specific headers and libraries.
* cygpackage.h: Include the win32.h header to get correct macro
definitions in all situations.
* download.cc (do_download_reflector): Make into a Win32 thread routine.
Use ExitThread.
(do_download): Use Win32 threads.
* ini.cc: Ditto.
* install.cc: Ditto.
* (WinMain): Adjust to build valid command line using application
under both mingw32 and cygwin.
* mount.cc (set)cygdrive_flags): Create new system flags if the
user requests system and the value does not exist.
* nio-http.cc: Define a _strnicmp for cygwin.
* package_db.cc: Include <errno.h> if it exists.
* site.cc (do_download_site_info_thread): Make into a Win32 thread
routine.
Use ExitThread.
(do_download_site-Info): Use Win32 threads.
* state.cc: Explicity declare variables to avoid header conflicts
caused by '#define extern" on cygwin.
* win32.h: Include <alloca.h> if it exists.
(_MAX_PATH): Define as MAX_PATH when not defined by windows.h.
(_access): Define as access if not defined by windows.h.
Robert Collins [Fri, 26 Apr 2002 23:46:39 +0000 (23:46 +0000)]
2002-04-23 Robert Collins <rbtcollins@hotmail.com>
* include/cdefs.h: New file, support for getopt.h.
* include/getopt.h: New file, for platforms without getopt.h.
* src/getopt.c: New file, implementation of getopt.
* COPYING: New file, GPL v2 text.
* Makefile.am: Change AM_CXXFLAGS to INCLUDES.
Add getopt.c to the library source.
Add new headers to the source list.
* configure.in: Remove unneeded macro calls.
* include/getopt++/StringOption.h: Change String to string throughout.
* src/StringOption.cc: Ditto.
* include/getopt++/BoolOption.h: Ditto.
* src/BoolOption.cc: Ditto.
* src/OptionSet.cc: Ditto.
* include/getopt++/Option.h: Ditto.
Remove String++ includes, it's not needed anymore.
* include/getopt++/OptionSet.h: Make the destructor virtual.
Robert Collins [Fri, 26 Apr 2002 11:04:26 +0000 (11:04 +0000)]
2002-04-26 Robert Collins <rbtcollins@hotmail.com>
* aclocal.m4: New file, cached macros.
* bootstrap.sh: New file, calls required autotools in appropriate
order.
* Makefile.am: New file, input Makefile for automake.
* Makefile,in: Now a generated file - regenerate.
* configure: Regenerate.
* configure.in: Add automake support.
* inilex.l: Change VERSION to PACKAGEVERSION to avoid a collision with
automake's VERSION define.
* iniparse.y: Ditto.
Robert Collins [Fri, 26 Apr 2002 08:10:33 +0000 (08:10 +0000)]
2002-04-26 Robert Collins <rbtcollins@hotmail.com>
* cdefs.h: New file, imported to allow getopt.c to build without
cygwin headers.
* getopt.h: New file, imported to allow building without cygwin headers.
* getopt.c: Ditto.
* bz2lib: New directory, contains copy of bz2lib.
* cfgaux: New directory, contains autotool helper scripts.
* Makefile,in: Adjust library and target definitions for building
outside the sourceware tree.
* compress_bz.h: Use new bz2lib header location.
* mount.cc: Import key defines and enums to be independent of cygwin
headers.
* configure.in: Update to autoconf 2.53, and to be sourceware
independent.
* configure: Regenerate.
Robert Collins [Sat, 20 Apr 2002 07:35:04 +0000 (07:35 +0000)]
2002-04-20 Robert Collins <rbtcollins@hotmail.com>
* Makefile.am (libgetopt___la_SOURCES): Add OptionSet.cc and
StringOption.cc for new functionality.
(getoptinclude_HEADERS): Install the new headers.
* include/getopt++/BoolOption.h (BoolOption::shortOption): Change
to align with new Option header.
* include/getopt++/Option.h (Option::shortOption): Change to allow
short options with arguments.
* include/getopt++/OptionSet.h: Implement ParameterUsage to show
program options.
Change Process to include a fallback OptionSet - for picking up
non-option arguments.
* include/getopt++/StringOption.h: New file.
* src/BoolOption.cc (BoolOption::shortOption): Change as per the header.
* src/OptionSet.cc (OptionSet::Process): Pass on umnparameterised
arguments.
(OptionSet::ParameterUsage): Implement.
* src/StringOption.cc: New file.
Robert Collins [Sun, 14 Apr 2002 14:07:05 +0000 (14:07 +0000)]
2002-04-14 Robert Collins <rbtcollins@hotmail.com>
* include/BoolOption.h: Move to
* include/getopt++/BoolOption.h: here.
* include/GetOption.h: Implement multiple-sets as per design.
Move to ...
* include/getopt++/GetOption.h: here.
* include/Option.h: Move to
* include/getopt++/Option.h: here.
* include/getopt++/OptionSet.h: New file.
* src/GetOption.cc: Move core functions to OptionSet.cc.
Adjust for new header locations.
* src/OptionSet.cc: New file.
* src/BoolOption.cc: Adjust for new header locations.
* src/Option.cc: Adjust for new header locations.
* tests/testoption.cc: Adjust for new header locations.
Robert Collins [Sun, 14 Apr 2002 02:23:32 +0000 (02:23 +0000)]
2002-04-14 Robert Collins <rbtcollins@hotmail.com>
* Makefile.am: New file.
* README: New file.
* bootstrap.sh: New file.
* configure.in: New file.
* include/BoolOption.h: New file.
* include/GetOption.h: New file.
* include/Option.h: New file.
* src/BoolOption.cc: New file.
* src/GetOption.cc: New file.
* src/Option.cc: New file.
* tests/testoption.cc: New file.
Robert Collins [Wed, 27 Mar 2002 04:20:45 +0000 (04:20 +0000)]
2003-03-27 Robert Collins <rbtcollins@hotmail.com>
* Makefile.in (OBJS): Add new commandline objects.
* desktop.cc (NoShortCutsOption): New option code.
(DesktopSetupPage::OnInit): Check whether to skip shortcuts.
* desktop.h (NoShortCutsOption): New concrete command line option class.
* main.cc (WinMain): Process command line options.
* GetOption.h: New file, singleton command line class.
* GetOption.cc: New file, implementation of the above.
* Option.h : New file, abstract option for GetOption.
* Option.cc: New file, implement constructor and destructor.
2003-03-26 Robert Collins <rbtcollins@hotmail.com>
* io_stream_cygfile.cc (cwd): New static for cwd storage.
(io_stream_cygfile::normalise): New method.
(io_stream_cygfile::io_stream_cygfile): Use it.
(io_stream_cygfile::exists): Ditto.
(io_stream_cygfile::remove): Ditto.
(io_stream_cygfile::mklink): And again.
(cygmkdir_p): Yes, again.
(io_stream_cygfile::move): And once more.
* io_stream_cygfile.h (io_stream_cygfile::normalise): Declare.
(io_stream_cygfile::cwd): Ditto.
Robert Collins [Tue, 26 Mar 2002 00:25:15 +0000 (00:25 +0000)]
2003-03-26 Robert Collins <rbtcollins@hotmail.com>
* package_meta.cc (package_meta::~package_meta): Remove duplicate.
(CategoryPackage::~CategoryPackage): Ditto. (Thanks to Ton van
Overbeek for the report).
* mklink2.cc: Moved from mklink2.c to avoid 'not a prototype error'.
Make g++ compatible.
* mklink2.c: Remove.
* site.cc (site_list_type::init): Delete the correct memory addres.
Thanks to Pavel Tsekov for tracking this down.
Robert Collins [Tue, 19 Feb 2002 04:33:28 +0000 (04:33 +0000)]
2002-02-19 Robert Collins <rbtcollins@hotmail.com>
* choose.cc: Include cygpackage.h for scan2 use.
(set_existence): Ignore setup.ini mirrors when installing from cwd.
(scan2): Process any valid file.
Add cache entries when a file matching a setup.ini listed version is found.
* filemanip.cc (parse_filename): Remove pkgtar - not used anywhere else.
* filemanip.h (filemanip::pkgtar): Remove.
* package_meta.cc (CategoryPackage::~CategoryPackage): New method.
(packagemeta::~packagemeta): Move from package_meta.h
Remove and delete all version and category information.
* package_meta.h (CategoryPackage): Create a destructor.
(packagemeta::~packagemeta): Move to .cc file.
2002-02-19 Robert Collins <rbtcollins@hotmail.com>
* install.cc (install_one_source): Make NULL cached package names cause
errors.
Robert Collins [Mon, 18 Feb 2002 13:53:07 +0000 (13:53 +0000)]
2002-02-19 Robert Collins <rbtcollins@hotmail.com>
* configure.in (CXXFLAGS): Substitute at configure time, not runtime.
* configure (CXXFLAGS): Regenerate.
* Makefile.in (iniparse.o): Build via default rules - no errors now.
* README: TODO list updates.
2002-02-19 Michael A Chase <mchase@ix.netcom.com>
* String++.cc (String::concat):: Remove.
(String::vconcat):: Ditto.
* String++.h (String::concat):: Remove.
(String::vconcat):: Ditto.
* archive_tar.cc: Don't include concat.h.
* archive_tar_file.cc: Don't include concat.h.
* compress_bz.cc (compress_bz::peek): Don't log unneeded messages.
(compress_bz::seek): Ditto.
(compress_bz::~compress_bz): Ditto.
* compress_gz.cc (compress_gz::peek): Ditto.
(compress_gz::error): Ditto.
(compress_gz::~compress_gz): Ditto.
* concat.cc (vconcat): Remove.
(concat): Ditto.
* concat.h (vconcat): Remove.
(concat): Ditto.
* desktop.cc (desktop_icon): Use new cygpath.
(make_etc_profile): Ditto.
(uexists): Ditto.
(make_passwd_group): Ditto.
(save_icon): Ditto.
(check_desktop): Remove concat use.
(check_start_menu): Ditto.
* download.cc (download_one): Use new mkpath_p correctly.
Use LOG_PLAIN.
* fromcwd.cc: Don't include concat.h.
* geturl.cc (get_url_to_membuf): Use String log() call.
(get_url_to_file): Ditto.
* install.cc: Don't include concat.h.
(uninstall_one): Use LOG_PLAIN.
(replace_one): Ditto.
(install_one_source): Ditto.
(install_one): More char to String conversion.
(do_install_thread): Use new cygpath.
Use new create_mount.
* io_stream.cc (io_stream::move): Use new log().
* io_stream_cygfile (io_stream_cygfile::io_stream_cygfile): Use new cygpath.
(io_stream_cygfile::exists): Ditto.
(io_stream_cygfile::remove): Ditto.
(io_stream_cygfile::mklink): Ditto.
(io_stream_cygfile::write): Ditto.
(cygmkdir_p): Ditto.
(io_stream_cygfile::move): Ditto.
* io_stream_file.cc: Don't include log.h.
(io_stream_file::write): Don't log unneeded messages.
* localdir.cc: Don't include concat.h.
(LocalDirPage::OnNext): Use LOG_PLAIN.
* log.cc: Don't include log.h.
(exit_setup): Use new cygpath.
* log.h (log_level): Add new level LOG_PLAIN.
* main.cc (WinMain): Use new log().
* mount.cc (SLASH_P): New macro from concat.h.
(cygpath): Make String version globally visible.
Remove varargs version.
* mount,h: Ditto.
* msg.cc (mbox): Use LOG_PLAIN.
* net.cc (NetPage::OnNext): Ditto.
* nio-ftp.cc (ftp_line): Use new log().
* nio-http.cc: Don't include log.h.
(retry_get): Use alternative url variable.
* package_db.cc: Don't include concat.h.
(packagedb::flush): Don't use concat.
* package_meta.cc: Don't include concat.h.
(packagemeta::uninstall): Use new cygpath.
* postinstall.cc (do_postinstall): Ditto.
* root.cc (RootPage::OnNext): Use LOG_PLAIN.
* script.cc: Don't include concat.h.
(init_run_script): Use new cygpath.
(run_script): More char * to String conversion.
(try_run_script): Ditto.
* site.cc: Don't include concat.h.
(SitePage::OnNext): Use LOG_PLAIN.
(SitePage::OnMessageCmd): Use new log().
* source.cc (SourcePage::OnDeactivate): Use LOG_PLAIN.
Robert Collins [Sun, 27 Jan 2002 11:17:54 +0000 (11:17 +0000)]
2002-01-27 Robert Collins <rbtcollins@hotmail.com>
* README: Update Todo's.
* list.h: Run indent.
(list): New methods checksize and insert to reduce code duplication.
(list::registerbykey): Use them.
(list::registerbyobject): Ditto.
(list::removebyindex): Copy each object individually - safe for non trivial
objects.
(list::checksize): Implement.
(list::insert): Implement.
Robert Collins [Sun, 27 Jan 2002 06:36:06 +0000 (06:36 +0000)]
2002-01-27 Robert Collins <rbtcollins@hotmail.com>
* Makefile.in: Remove the dlmalloc object by default.
* install.cc (do_install_thread): Remove the mallinfo call for 'working around'
the crashing issue.
* package_db.h: Include <string.h> - it's needed to parse this.
* package_source.cc (site::site): Move here from the header file.
* package_source.h (site): Stop the constructor being inlinable.
Robert Collins [Sat, 26 Jan 2002 04:21:34 +0000 (04:21 +0000)]
2002-01-26 Robert Collins <rbtcollins@hotmail.com>
* filemanip.cc (find_tar_ext): Add a descriptive comment.
2002-01-25 Michael A Chase <mchase@ix.netcom.com>
* filemanip.cc (find_tar_ext): Clean up tests for .tar.gz and .tar.
* fromcwd.cc (do_fromcwd): Expand FIXME comment in source file check.
* install.cc (install_one_source): Add space between words in log() call.
Robert Collins [Tue, 22 Jan 2002 11:35:10 +0000 (11:35 +0000)]
2002-01-22 Robert Collins <rbtcollins@hotmail.com>
* archive.cc (extract_file): Separate out the prefix and the URL scheme.
* archive.h (archive::extract_file): Ditto.
* install.cc (install_one_source): Ditto.
Use the new archive::extract_file syntax.
(replace_one): Use the new syntax.
(io_stream.cc): Add some log info for links.
Robert Collins [Tue, 22 Jan 2002 09:03:55 +0000 (09:03 +0000)]
2002-01-22 Robert Collins <rbtcollins@hotmail.com>
* PickCategoryLine.cc (PickCategoryLine::actiontext): Remove.
(PickCategoryLine::paint): Use the new action method.
(PickCategoryLine::click): Set the action for all children.
(PickCategoryLine::set_action): New method.
* PickCategoryLine.h (PickCategoryLine::-actions): Remove.
(PickCategoryLine::current_default): Use packagemeta _actions class.
* PickLine.h (PickLine::set_action): New abstract method that requires including
package_meta.h.
* PickPackageLine.cc (PickPackageLine::set_action): New method.
* PickPackageLine.h (PickPackageLine::set_action): Declare this.
* list.h (getbykey): A const correctness fix.
* package_meta.cc: Run indent.
(packagemeta::Default_action): New const.
(packagemeta::Install_action): Ditto.
(packagemeta::Reinstall_action): Ditto.
(packagemeta::Uninstall_action): Ditto.
(packagemeta::_actions::caption): New method.
(packagemeta::_actions::operator++): Ditto.
(packagemeta::set_action): New overload.
* package_meta.h (packagemeta::_actions): New class.
(packagemeta::set_action): Declare this.