Robert Collins [Wed, 28 Nov 2001 12:05:27 +0000 (12:05 +0000)]
2001-11-26 Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
* nio-http.cc (NetIO_HTTP::NetIO_HTTP): Stop header parsing when
SimpleSocket::gets() returns a zero-length string, so that we
don't end up eating the entire stream thinking it's all header info.
Robert Collins [Thu, 22 Nov 2001 23:53:15 +0000 (23:53 +0000)]
2001-11-23 Robert Collins <rbtcollins@hotmail.com>
* Makefile.in (OBJS): Add package_version.
* ategory.cc (Category::Category): Update constructors.
* category_list.cc (CategoryList::register_category): Insert correctly.
* choose.cc: Include package_version.h, not package.h.
* cygpackage.cc: Ditto.
(cygpackage::uninstall): New method.
* cygpackage.h (cygpackage): Rename genericpackage to packageversion.
New method uninstall.
* hash.cc (add, has, enumerate): Change prototype to be accurate.
* hash.h (hash): Change prototypes to be accurate.
* ini.h (_Info): New parameterless constructor.
(CategoryPackage): New constructor.
(Package): Ditto.
* install.cc: Don't include unneeded headers.
Include package database headers.
(hash::add_subdirs): Remove.
(uninstall_one): Use packagemeta->uninstall to perform the uninstallation.
Don't uninstall source packages.
(do_install): Just can uninstall_one once as we ignore source packages now.
Don't copy the installed.old database accross, instead iterate through the
packagedb packages list and write the isntalled packages out.
* package_db.cc: Include package_version.h, not package.h.
(packagedb::packagedb): Never let db be undefined.
Record the installation filename, so we can reconstruct installed.db.
(packagedb::addpackage): Insert packages in alpha sorted order.
(packagedb::categories): Initialise correctly.
* package_meta.cc: Include win32 and mount headers as a workaround to
current io_stream limitations. Include a TODO about that.
(standard_dirs): New, from install.cc.
(hash::add_subdirs): New, from install.cc.
(packagemeta::set_installed): Rename genericpackage to packageversion.
(packagemeta::uninstall): New method.
* package_meta.h: Rename genericpackage to packageversion.
(packagemeta): Update constructor.
(add_version, set_installed): Rename genericpackage to packageversion.
(uninstall): New method.
(installed_from): New member.
* package_source.cc: New file.
* package_source.h: New file.
* package_version.cc: New file.
* package_version.h: New file.
* package.cc: Removed.
* package.h: Removed.
Robert Collins [Wed, 21 Nov 2001 11:14:09 +0000 (11:14 +0000)]
2001-11-21 Robert Collins <rbtcollins@hotmail.com>
* Makefile.in (OBJS): Add category.o and category_list.o.
* category.h: New file.
* category.cc: New file.
* category_list.h: New file.
* category_list.cc: New file.
* choose.cc: Include category headers.
(fill_missing_category): Use package_db to access global categories.
(_view::insert_pkg): Ditto.
(_view::insert_category): Ditto.
(set_view_mode): Ditto.
(getcategorybyname): Remove.
* cygpackage.h: Include category_list.h to parse this correctly.
(cygpackage): New virtual &Categories.
* ini.h (_CategoryPackage): More C to C++ conversion.
(Category): Remove.
(getcategorybyname): Remove.
(register_category): Remove.
* iniparse.y: Include package db and category headers.
(categories): Use package_db to access global categories.
(category): Remove.
(ncategories): Remove.
(register_category): Remove.
* package.h: New virtual &Categories.
* package_db.cc (packagedb::packagedb): Don't read the installed db twice.
(packagedb::categories): Declare.
* package_db.h (packagedb): New member categories for global categories list.
Robert Collins [Wed, 21 Nov 2001 03:44:34 +0000 (03:44 +0000)]
2001-11-21 Robert Collins <rbtcollins@hotmail.com>
* Makefile.in (OBJS): Add package abstraction objects.
* choose.cc: Include package abstraction headers.
(read_installed_db): Use packagedb class and ignore installed sources.
* cygpackage.cc: New file.
* cygpackage.h: New file.
* filemanip.h (get_file_size): Use unixy types.
* package.h: New file.
* package.cc: New file.
* package_db.cc: New file.
* package_db.h: New file.
* package_meta.cc: New file.
* package_meta.h:
Robert Collins [Wed, 14 Nov 2001 09:21:59 +0000 (09:21 +0000)]
2001-11-14 Robert Collins <rbtcollins@hotmail.com>
* Makefile.in (OBJS): Include io_stream_memory in setup.exe.
* archive_tar.cc (archive_tar::write): New prototype.
(archive_tar::seek): New method.
* archive.h (archive_tar_file): Update write() and add seek().
(archive_tar): Ditto.
* archive_tar_file.cc (archive_tar_file::write): New prototype.
(archive_tar_file::seek): New method.
* compress_bz.cc (compress_bz::write): New prototype.
(compress_bz::seek): New function.
* compress_bz.h (compress_bz): Update write() and add seek().
* compress_gz.cc (compress_gz::write): New prototype.
(compress_gz::seek): New function.
* compress_gz.h (compress_gz): Update write() and add seek().
* geturl.cc: Include io_stream headers.
(GUBuf): Remove.
(get_url_to_string): Use a io_stream_memory buffer instead of GUBuf.
* io_stream.h (io_stream_seek_t): New enum.
(io_stream): Update write() and add seek().
* io_stream_cygfile.cc (io_stream_cygfile::write): New prototype.
(io_stream_cygfile::seek): New function.
* io_stream_cygfile.h (io_stream_cygfile): Update write() and add seek().
* io_stream_file.cc (io_stream_file::write): New prototype.
(io_stream_file::seek): New function.
* io_stream_file.h (io_stream_file): Update write() and add seek().
Robert Collins [Wed, 14 Nov 2001 00:11:35 +0000 (00:11 +0000)]
2001-11-13 Brian Keener <bkeener@thesoftwaresource.com>
* localdir.cc: Add headers unistd.h and port.h.
(save_local_dir): Expand search logic to include local directory for
location of file last-cache.
(dialog_cmd): Skip IDD_ROOT when downloading and use Back button.
(do_local_dir): Expand search logic to include local directory for file
last-cache.
* res.rc (IDD_CHOOSE_DIALOG): Add hotkey to View button.
* Source.cc (dialog_cmd): Skip IDD_ROOT if select Download from
Internet.
(do_source): Default to Install from Internet on first entry or
previous selection if backing up from IDD_ROOT or IDD_LOCAL_DIR.
Robert Collins [Fri, 9 Nov 2001 14:12:00 +0000 (14:12 +0000)]
2001-11-10 Robert Collins <rbtcollins@hotmail.com>
* ini.h (actions): Remove - transferred to choose.h.
(views): Ditto.
* choose.h: Protect class's from "C" compilers.
(actions): New enum, from ini.h. This may not be the 'right' place
but that place doesn't exist yet.
(_views): New enum, from ini.h.
* choose.cc (set_action): Handle installed packages with a version not in
setup.ini.
(choose_caption): Ditto.
* iniparse.y: Rearrange header order to handle new ini.h.
Robert Collins [Fri, 9 Nov 2001 13:03:02 +0000 (13:03 +0000)]
2001-11-08 Pavel Tsekov <ptsekov@syntrex.com>
* simpsock.h (SimpleSocket::invalidate): Declare new method.
* simpsock.cc (SimpleSocket::invalidate): Implement new method.
(SimpleSocket::SimpleSocket): Initialize buf to zero. Do not allocate
memory for buf in the constructor.
(SimpleSocket::~SimpleSocket): Use SimpleSocket::invalidate().
(SimpleSocket::printf): Use SimpleSocket::write() instead of send().
(SimpleSocket::write): Check object consistency - return -1 on error.
invalidate() the object on socket write error.
(SimpleSocket::fill): Check object consistency - return -1 on error.
invalidate() the object if socket read error is encountered and there
is no more data available in the internal read buffer.
Allocate memory for the internal read buffer.
(SimpleSocket::gets): Return zero (NULL pointer) if error is encountered
during fill() and no more data is available in the internal read buffer.
(SimpleSocket::read): Check object consistency - return -1 on error.
invalidate() the object if socket read error is encountered.
* nio-ftp.cc (NetIO_FTP:NetIO_FTP): Allow 125 as valid response code to
the RETR command (fix for MS IIS ftp server 5 - possibly others too).
(NetIO_FTP::ok): Check if the SimpleSocket object is ok().
(NetIO_FTP::read): Use NetIO_FTP::ok().
* nio-http.cc: Check for valid return value of SimpleSocket::gets().
(NetIO_HTTP::ok): Check if the SimpleSocket object is ok().
Robert Collins [Mon, 5 Nov 2001 13:00:36 +0000 (13:00 +0000)]
2001-11-06 Pavel Tsekov <ptsekov@syntrex.com>
* fromcwd.cc (found_file): Free() memory containing the version and
filepath information for a given package, before replacing the pointers which
reference this memory.
Robert Collins [Fri, 2 Nov 2001 05:00:34 +0000 (05:00 +0000)]
2001-11-02 Robert Collins <rbtcollins@hotmail.com>
* choose.cc: Ran indent.
(set_action): When the requested trust level is missing and the level was not
user requested, set the action to ACTION_SAME_CURR.
Robert Collins [Fri, 2 Nov 2001 00:50:19 +0000 (00:50 +0000)]
2001-11-02 Pavel Tsekov <ptsekov@syntrex.com>
* geturl.cc (is_showing): Remove.
(is_local_install): New static variable. Controls whether the
progress dialog and the supporting thread will be created.
(dialog_proc): Return TRUE to WM_INITDIALOG as specified by the WIN32 API.
(init_dialog): Remove usage of SetForegroundWindow and is_showing.
This prevents the progress dialog to gain control over the
application and fixes the "setup.exe going to background" problem.
(progress): Use is_local_install.
(get_url_to_string): Set is_local_install.
(dismiss_url_status_dialog): Use is_local_install.
* install.cc (dialog_proc): Return TRUE as specified in WIN32 API.
(init_dialog): Remove usage of SetForegroundWindow.
This prevents the progress dialog to gain control over the
application and fixes the "setup.exe going to background" problem.
Robert Collins [Fri, 2 Nov 2001 00:38:26 +0000 (00:38 +0000)]
2001-11-02 Robert Collins <rbtcollins@hotmail.com>
* choose.cc (list_click): Change r to row for clarity.
When we shrink the list below 1 page, scroll to the top of the list.
(_view::click): Return the actual change for contractions.
(dialog_proc): Return TRUE to WM_INITDIALOG as specified by the Win32 API.
Robert Collins [Thu, 1 Nov 2001 13:22:46 +0000 (13:22 +0000)]
2001-11-02 Robert Collins <rbtcollins@hotmail.com>
* choose.cc (dialog_cmd): Swap cygwin root selection and local dir selection order.
* localdir.cc: Ran indent.
(get_root_dir_now): New function.
(save_local_dir): New function.
(dialog_cmd): Use it and swap cygwin root selection and local dir selection order.
(do_local_dir): If there is a saved local dir, read it in.
* net.cc (dialog_cmd): Swap cygwin root selection and local dir selection order.
* root.cc (dialog_cmd): Ditto.
* source.cc (dialog_cmd): Ditto.
Robert Collins [Wed, 31 Oct 2001 13:15:06 +0000 (13:15 +0000)]
2001-11-01 Matt Hargett <matt@use.net>
* geturl.cc (progress): Change int to unsigned int to eliminate
lint warnings.
* (get_url_to_string): Check for NULL pointer.
* mount.cc (find2): Use free instead of delete for malloc'd
memory.
* nio-http.cc (NetIO_HTTP::NetIO_HTTP): Fix memory leak.
Robert Collins [Wed, 31 Oct 2001 13:00:11 +0000 (13:00 +0000)]
2001-10-31 Robert Collins <rbtcollins@hotmail.com>
* choose.cc(_view::insert_under): Handle linen > nlines and lines[linen] with neither
a package nor a category. The lines[linen] bug was reported by Matt (matt@usa.net).
(read_installed_db): Bugfix for testing whether a package has a source tarball.
Reported by Matt (matt@usa.net).
* geturl.cc(dialog): Rename gw_dialog to local_gw_dialog to avoid programmer
confusion and lint errors. Reported by Matt (matt@usa.net).
Robert Collins [Wed, 31 Oct 2001 09:39:13 +0000 (09:39 +0000)]
2001-10-31 Robert Collins <rbtcollins@hotmail.com>
* argv.cc: New file, converts arguments for -mwindows programs. (Simplified derivation
from dcrt0.cc.)
* argv.h: New file.
* Makefile,in: Add argv.o and mingw_getopt.o to setup.exe object list.
Add mingw_getopt.o build rule.
* main.cc(WinMain): Initialise argv and argc for use by getopt.
* desktop.cc (make_passwd_group): Move file creation earlier in the process to
ensure that passwd-grp.bat reflects desired operation.
* postinstall.cc (each): Remove "*.done" file else rename will fail.
Copyrights.
* autoload.c: Add dynamic load statements for NT/W2K
advapi32 functions not available in 9x/ME.
* main.cc (set_default_dacl): New function.
(WinMain): Call `set_default_dacl' if running on NT/W2K.
* ini.h (_CategoryPackage): Change pkg field to pkgname for consistency.
* choose.cc: Use pkgname field when referencing _CategoryPackage throughout.
(fill_missing_category): Don't add excluded packages.
(default_trust): Ditto.
(_view::insert_pkg): Ditto.
* iniparse.y (register_category): Use consistent variable name.
* choose.cc (set_action): Use default trust for determining reinstall and
source only.
(default_trust): Set default trust.
(pick_line::paint): Allow source selection when reinstalling or retrieving.
* choose.cc (isinstalled): Modify to properly accomodate special case of
"download only".
(set_action): Check downloaded components, not installed components if
"download only".
(set_existence): Always include full list of files when "download only".
* res.rc (IDD_LOCAL_DIR): Change caption to match the other dialog boxes.
(IDD_CHOOSE))))))))): Adjust horizontal size so package names are visible.
* choose.cc: Restore some more changes from 2001-06-25, throughout.
(paint): Wrap some excessively long lines.
(pick_line::paint): Ditto. Move the arrow in the "Current" column right to
where it belongs. Move the source checkbox slightly to the right.
(do_choose): List categories and required packages in setup.log.full.
* choose.cc (scan2): Restore source scanning eliminated by previous checkin.
* ini.h (struct _Info): Add "derived" element.
* choose.cc (scan2): Try to place unknown tar files into proper slot when
package exists in setup.ini but tar file does not.
*ini.h: Reapply 2001-06-25 changes.
* choose.cc (add_required): Ditto. Default to "Keep" state if UNINSTALL and
product is installed. Default to curr state if SKIP, etc.
(keep_or_skip): New function. Returns skip or keep state depending on
installed state of package.
(default_trust): Use keep_or_skip to set state.
(_view::insert_pkg): Use calloc to allocate lines.
(set_view_mode): Adapt 2001-06-25 change to set_full_list here.
Robert Collins [Sat, 30 Jun 2001 01:37:55 +0000 (01:37 +0000)]
Sat Jun 30 11:01:00 2001 Robert Collins <rbtcollins@hotmail.com>
* choose.cc: Remove globals full_list, headers, package_indexes and
nindexes.
Add globals cat_headers, pkg_headers and chooser.
(add_required): New function.
(paint): Use the chooser for header details.
Call into the chooser to paint each line.
(list_click): Use new global variables.
Call into the chooser to handle the click.
Repaint the entire view if packages have been added or removed.
(note_width): Get passed a headers struct rather than using a global
variable.
(fill_missing_category): New function.
(default_trust): Skip non-"Required" or "Misc" packages.
(pick_line::set_line (Package *)): New function.
(pick_line::set_line (Category *)): New function.
(pick_line::paint): New function.
(pick_line::click): New function.
(_view::_view): New function.
(_view::set_view_mode): New function.
(_view::mode_caption): New function.
(_view::set_headers): New function.
(_view::init_header): New function.
(_view::insert_pkg): New function.
(_view::insert_category): New function.
(_view::insert_at): New function.
(_view::insert_under): New function.
(_view::clear_view): New function.
(viewsplusplus): New function.
(_view::client): New function.
(set_view_mode): Use new chooser functionality.
(set_full_list): Use new global variables.
(create_listview): Instantiate chooser.
Remove all hardcoded headers[] code.
(dialog_cmd): On trust changes, check dependencies.
(getcategorybyname): New function.
(getpackagecategorybyname): New function.
(scan2): Use case-insensitive package comparison.
(do_choose): Use fill_missing_category ().
Show some category data.
* ini.h: Protect against multiple inclusion.
(views) New enum.
(_CategoryPackage): New struct.
(_Category): New struct.
(_Package): Change category to Category * from char *.
(extern Category category): New global variable.
(extern in ncategories): Ditto.
(getcategorybyname): New prototype.
(catpackagecategorybyname): New prototype.
(register_category): New prototype.
(add_category): New prototype.
* iniparse.y: Parse multiple categories per package.
category: New global variable.
ncategories: New global variable.
(new_package): Compare package against NULL, not 0.
(new_requirement): Source formatting fix.
(register_category): New function.
(add_category): New function.
* res.rc: Change IDC_CHOOSE_FULLPART to IDC_CHOOSE_VIEW.
IDC_CHOOSE_VIEWCAPTION: New control.
* resource.h: Change IDC_CHOOSE_FULLPART to IDC_CHOOSE_VIEW.
IDC_CHOOSE_VIEWCAPTION: New control.
Increment _APS_NEXT_CONTROL_VALUE.
* choose.cc (paint): Wrap lines excessively long lines.
(list_click): Ditto.
(create_listview): Ditto.
(do_choose): Ditto. Replace TABs and remove CRs in lines written to
setup.log.full. Allow "Yes" for source exists in setup.log.full when
installing from local directories.
* choose.cc (set_action): Only clear srcpicked when moving to next state.
Allow source installation if it exists in the current "trust" state. Don't
move to skip state when package is installed.
(list_click): Don't allow source clicking when no source is available.
(set_full_list): Display package when not is_full_action.
* ini.h (is_full_action): Define.
* install.cc (check_for_old_cygwin): New function. First stab at checking for
old cygwin versions.
(do_install): Call check_for_old_cygwin if there were no errors during the
install.
* choose.cc (set_existence): Use pointer method for indexing in trust array.
(create_listview): Ditto.
(scan2): Ditto. Also, use consistent variable name for indexing into trust
array.
* ini.h (Package): Reorganize info array for easier scanning.
* choose.cc (isinstalled): Eliminate special download only test.
(set_action): Don't move to next state if in ACTION_SAME range and not
incrementing.
(choose_caption): Display "Retrieve" rather than "Reinstall" when just
downloading.
(do_choose): Sort packages after all packages have been read. Accomodate the
fact that first element in trust array is empty so that log files don't report
the wrong trust value.
* iniparse.y (new_package): Malloc space for package name or suffer memory
corruption.