[setup PATCH] Fix DEBUG mode in IniDBBuilderPackage, and improve Category column contents.
Here is a patch for setup. IniDBBuilderPackage.cc: Fix DEBUG mode Hunk 1: Remove a DEBUG message box which otherwise pops up once per package during ini parsing, thus rendering DEBUG unusable. Hunk 2 3: Update DEBUG code to match current layout of data structures. PickPackageLine.cc: Show all Categories in package list, not just the first alphabetically. NB1: I'm sure there is a more concise way to say struct _Rb_tree_iteratorString,const String ,const String *, but I'm an STL novice. NB2: This rebuilds the string of all package names every time this line is painted. I see no performance impact on my machine when scrolling, but my machine is fast. Plus, when we get a resizable setup, then we could have many more lines on display. Am I worrying about nothing, or should I refactor the patch to calculate the string only once? NB3: Should we change the column header from Category to Catergories now? Max. BEGIN_PATCH Index: IniDBBuilderPackage.cc === RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/IniDBBuilderPackage.cc,v retrieving revision 2.12 diff -u -p -r2.12 IniDBBuilderPackage.cc --- IniDBBuilderPackage.cc 2002/07/15 11:27:03 2.12 +++ IniDBBuilderPackage.cc 2002/09/19 09:56:28 -102,9 +102,6 void IniDBBuilderPackage::buildPackageLDesc (String const theDesc) { cbpv.set_ldesc(theDesc); -#if DEBUG - _feedback.warning(theDesc.cstr_oneuse()); -#endif } void -232,7 +229,7 IniDBBuilderPackage::buildInstalledSize { cbpv.source()-setInstalledSize (atoi(size.cstr_oneuse())); #if DEBUG - log (LOG_BABBLE) Installed size for cp-name is cpv-bin.installedSize() endLog; + log (LOG_BABBLE) Installed size for cp-name is cbpv.source()-installedSize() endLog; #endif } -382,7 +379,7 IniDBBuilderPackage::buildSourceName (St { cbpv.setSourcePackageSpecification (PackageSpecification (name)); #if DEBUG - log (LOG_BABBLE) \ cpv-sourcePackageSpecification() + log (LOG_BABBLE) \ cbpv.sourcePackageSpecification() \ is the source package for cp-name . endLog; #endif } Index: PickPackageLine.cc === RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/PickPackageLine.cc,v retrieving revision 2.9 diff -u -p -r2.9 PickPackageLine.cc --- PickPackageLine.cc 2002/07/13 14:00:37 2.9 +++ PickPackageLine.cc 2002/09/19 09:06:34 -137,10 +137,19 PickPackageLine::paint (HDC hdc, int x, if (pkg.categories.size () show_cat) { String catName; - if (pkg.categories.find (All) == pkg.categories.begin () - pkg.categories.size () 1) - catName = *(++pkg.categories.begin()); - else catName = * pkg.categories.begin (); + bool first = true; + struct _Rb_tree_iteratorString,const String ,const String * it = pkg.categories.begin(); + struct _Rb_tree_iteratorString,const String ,const String * end = pkg.categories.end(); + struct _Rb_tree_iteratorString,const String ,const String * all = pkg.categories.find(All); + for(; it != end; it++) { + if (all == it) + continue; + if (first) + first = false; + else + catName += , ; + catName += *(it); + } IntersectClipRect (hdc, x + theView.headers[theView.cat_col].x, r, x + theView.headers[theView.cat_col].x + theView.headers[theView.cat_col].x, rb); END_PATCH
Re: [setup PATCH] Fix DEBUG mode in IniDBBuilderPackage, andimprove Category column contents.
On Thu, 2002-09-19 at 21:29, Max Bowsher wrote: Here is a patch for setup. IniDBBuilderPackage.cc: Fix DEBUG mode Hunk 1: Remove a DEBUG message box which otherwise pops up once per package during ini parsing, thus rendering DEBUG unusable. This stays for now. It's there because it was needed, and I don't think that has changed yet. Hunk 2 3: Update DEBUG code to match current layout of data structures. Thanks, I'll check these in shortly. (when I finished flushing my patch queue). PickPackageLine.cc: Show all Categories in package list, not just the first alphabetically. NB1: I'm sure there is a more concise way to say struct _Rb_tree_iteratorString,const String ,const String *, but I'm an STL novice. There is a much more compact way. Firstly, this is not a _rb_tree. Check the header files. I think you'll find it's a set. Secondly, the usual way is to typedef the type within the class, giving Categories::categorylisttype::const_iterator = Thirdly, this should be a method on the package version I.e. class ... String getReadableCategoryList (); ... That will allow factoring to cache if needed in the future. It most certainly will be needed if you run setup over a debian Release file - which is my current test case. Cheers, Rob. signature.asc Description: This is a digitally signed message part
Re: [setup PATCH] Fix DEBUG mode in IniDBBuilderPackage, andimproveCategory column contents.
On Thu, 2002-09-19 at 22:20, Max Bowsher wrote: Robert Collins wrote: On Thu, 2002-09-19 at 21:29, Max Bowsher wrote: Here is a patch for setup. IniDBBuilderPackage.cc: Fix DEBUG mode Hunk 1: Remove a DEBUG message box which otherwise pops up once per package during ini parsing, thus rendering DEBUG unusable. This stays for now. It's there because it was needed, and I don't think that has changed yet. I'm not that bothered, I can easily delete 3 lines at the same time as I add #define DEBUG 1, but seriously, have you ever actually clicked OK 171 times to proceed through all the ldescs in setup.ini ? Yes. through 8000 packages in fact. I had some nasty escaping problems. packagemeta::categories is defined directly as a set String, String::caseless. Are you saying that I should create a categorylisttype type? Or can I just use setString, String::caseless::const_iterator? You can do either. set is less changes. If this was not going to be a method, I'd say create the type. As it is, it doesn't really matter. Rob signature.asc Description: This is a digitally signed message part
[setup.exe BUG] LogSingleton::GetInstance(LOG_BABBLE) endLog; causes SEGV
The subject says it all really. I want to build up a log line bit by bit, and then terminate the line. It works OK if you do endLog, which is an acceptable workaround for now. Max.
[setup PATCH] Improve Category column (Take 2)
Take 2. I'm confident about everything but my const qualifiers on packagemeta::getReadableCategoryList (). Please pay close attention to them. Thanks. Max. Index: PickPackageLine.cc Comments: Call pkg.getReadableCategoryList(), and fix an error in the x2 arg of IntersectClipRect() === RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/PickPackageLine.cc,v retrieving revision 2.9 diff -u -p -r2.9 PickPackageLine.cc --- PickPackageLine.cc 2002/07/13 14:00:37 2.9 +++ PickPackageLine.cc 2002/09/19 14:51:36 -136,14 +136,10 PickPackageLine::paint (HDC hdc, int x, /* shows first category - do we want to show any? */ if (pkg.categories.size () show_cat) { - String catName; - if (pkg.categories.find (All) == pkg.categories.begin () - pkg.categories.size () 1) - catName = *(++pkg.categories.begin()); - else catName = * pkg.categories.begin (); + String catName = pkg.getReadableCategoryList(); IntersectClipRect (hdc, x + theView.headers[theView.cat_col].x, r, x + theView.headers[theView.cat_col].x + -theView.headers[theView.cat_col].x, rb); +theView.headers[theView.cat_col].width - HMARGIN / 2, rb); TextOut (hdc, x + theView.headers[theView.cat_col].x + HMARGIN / 2, r, catName.cstr_oneuse(), catName.size()); Index: PickView.cc Comments: Rename column === RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/PickView.cc,v retrieving revision 2.10 diff -u -p -r2.10 PickView.cc --- PickView.cc 2002/07/09 06:57:40 2.10 +++ PickView.cc 2002/09/19 14:45:34 -29,7 +29,7 static PickView::Header pkg_headers[] = {New, 3, 0, 0}, {Bin?, 4, 0, 0}, {Src?, 4, 0, 0}, - {Category, 8, 0, 0}, + {Categories, 8, 0, 0}, {Package, 7, 0, 0}, {0, 0, 0, 0} }; Index: package_meta.cc Comments: Implement packagemeta::getReadableCategoryList () === RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/package_meta.cc,v retrieving revision 2.31 diff -u -p -r2.31 package_meta.cc --- package_meta.cc 2002/07/13 14:00:37 2.31 +++ package_meta.cc 2002/09/19 14:40:13 -241,6 +241,30 packagemeta::add_category (String const categories.insert (cat); } +String const +packagemeta::getReadableCategoryList () const +{ + String catName; + setString, String::caseless::const_iterator it = categories.begin(); + setString, String::caseless::const_iterator end = categories.end(); + setString, String::caseless::const_iterator all = categories.find(All); + while(it != end) { +if (all == it) { + it++; + continue; +} +catName += *(it); +if (++it == end) + break; +if (all == it) { + it++; + continue; +} +catName += , ; + } + return catName; +} + static bool hasSDesc(packageversion const pkg) { Index: package_meta.h Comments: Declare packagemeta::getReadableCategoryList () === RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/package_meta.h,v retrieving revision 2.19 diff -u -p -r2.19 package_meta.h --- package_meta.h 2002/07/07 15:14:50 2.19 +++ package_meta.h 2002/09/19 14:32:08 -96,6 +96,7 public: */ void add_category (String const ); set String, String::caseless categories; + String const getReadableCategoryList () const; set packageversion versions; /* which one is installed. */ END_PATCH
Re: [setup PATCH] Fix DEBUG mode in IniDBBuilderPackage, andimproveCategory column contents.
Robert Collins wrote: On Thu, 2002-09-19 at 22:20, Max Bowsher wrote: I'm not that bothered, I can easily delete 3 lines at the same time as I add #define DEBUG 1, but seriously, have you ever actually clicked OK 171 times to proceed through all the ldescs in setup.ini ? Yes. through 8000 packages in fact. I had some nasty escaping problems. Ouch. OK. packagemeta::categories is defined directly as a set String, String::caseless. Are you saying that I should create a categorylisttype type? Or can I just use setString, String::caseless::const_iterator? You can do either. set is less changes. If this was not going to be a method, I'd say create the type. As it is, it doesn't really matter. set it is then. Max.
[setup] (Accidental?) Change in sort order in 'full' view.
In the snapshot, sort order is alphabetically by package name. In CVS HEAD, sort order is by installed/not installed, followed by alphabetically by package name. Is this intentional? I could not find a ChangeLog entry saying so. Max.
Re: [setup] (Accidental?) Change in sort order in 'full' view.
Max Bowsher wrote: In CVS HEAD, sort order is by installed/not installed, followed by alphabetically by package name. Is this intentional? I could not find a ChangeLog entry saying so. Don't know if it was intentional or not but I must say I like it. I actually would like to see that as user selectable - see them all alpha but also see them by installed and not installed. I had submitted a change that expanded on the idea of the full list and partial list view that included 2 additional views for Unchanged (all keeps) and Not Installed (all skips) but I don't know if Robert ever did anything with it. In lieu of those changes I like this but I also like the option of seeing the full list by name too. I wonder if we could make the list sortable by column. (Ie clicking on the column). On a side note - Max - did you have to make any changes to get it too compile - for some reason - my compile is now broken and I am not sure if it is the gcc3 install or the mingw changes. Do you have any ideas? Bk
Re: [setup] (Accidental?) Change in sort order in 'full' view.
Brian Keener wrote: On a side note - Max - did you have to make any changes to get it too compile - for some reason - my compile is now broken and I am not sure if it is the gcc3 install or the mingw changes. Do you have any ideas? Cygwin Packages: binutils20020706-2 gcc 2.95.3-5 mingw-runtime 2.2-1 w32api 2.0-1 Configure line: from http://sources.redhat.com/cygwin-apps/setup.html MinGW libstdc++: gcc-2.95.3-20010828 Problems: none :-) Max.
Re: [setup] (Accidental?) Change in sort order in 'full' view.
On Fri, 2002-09-20 at 01:34, Max Bowsher wrote: In the snapshot, sort order is alphabetically by package name. In CVS HEAD, sort order is by installed/not installed, followed by alphabetically by package name. Is this intentional? I could not find a ChangeLog entry saying so. It's a work in progress. The snapshot is not ready for release due to a couple of problems I observed when testing. Rob signature.asc Description: This is a digitally signed message part
setup HEAD (2.278) defaults to older packages
On the dialogs I choose: Download Source: Download from Internet OR Install from Internet Local package dir: C:\cygdist Internet Connection: Direct Connection Download Site: ftp://archive.progeny.com Now when the Chooser window comes up, I click on Base, and I see ash: 20020131-1 bash:2.05b-4 cygwin: 1.3.10-1 Despite the fact that the setup.ini says the current versions are: ash: 20020731-1 bash:2.05b-5 cygwin: 1.3.12-4 I can get at the latest version by clicking a few times, but shouldn't it default to the latest packages? I get the latest versions by default if I use version 2.249.2.5. Bug, or intentional? -Len
[setup] Requesting advice: How to code aPackageVersion == theEmptyPackageVersion (i.e. the one containing defaultversion)
I've coded a patch for colour-coding versions in the setup picker according to curr/prev/test. I need a way to test whether a packageversion is the null packageversion (containing defaultversion in data). At the moment I'm kludging it by testing for a Name of length 0. I'm thinking of adding an is_empty(), or similarly named function to packageversion, unless someone has a better solution ? Max.
Re: setup HEAD (2.278) defaults to older packages
Len Giambrone wrote: On the dialogs I choose: Download Source: Download from Internet OR Install from Internet Local package dir: C:\cygdist Internet Connection: Direct Connection Download Site: ftp://archive.progeny.com Now when the Chooser window comes up, I click on Base, and I see ash: 20020131-1 bash:2.05b-4 cygwin: 1.3.10-1 Despite the fact that the setup.ini says the current versions are: ash: 20020731-1 bash:2.05b-5 cygwin: 1.3.12-4 I can get at the latest version by clicking a few times, but shouldn't it default to the latest packages? I get the latest versions by default if I use version 2.249.2.5. Bug, or intentional? Bug, definitely, but this is HEAD, after all, and see Robert's last post. Max.
Re: [setup] (Accidental?) Change in sort order in 'full' view.
Robert Collins wrote: On Fri, 2002-09-20 at 01:34, Max Bowsher wrote: In the snapshot, sort order is alphabetically by package name. In CVS HEAD, sort order is by installed/not installed, followed by alphabetically by package name. Is this intentional? I could not find a ChangeLog entry saying so. It's a work in progress. The snapshot is not ready for release due to a couple of problems I observed when testing. I was just about to suggest a new snapshot :-) What are the bugs? (I'm using HEAD + personal work-in-progess as my main setup, with the release version on standby in case I run into any bugs) Thanks. Max.
Re: [setup] (Accidental?) Change in sort order in 'full' view.
Max Bowsher wrote: MinGW libstdc++: gcc-2.95.3-20010828 That was it Thanks Max. Somehow (not sure how) my version of libstdc++ in usr/lib/mingw got updated to a May 16 2002 version (appears to be for a 3.? Version of mingw). When I used the one from an older version - compile started functioning again. I am not sure what I did to cause this to change but looking back I have an idea it has to do with the some playing I've been doing with the Dev-C++ software. I guess I'll find out for sure when and if it goes to look for the 3. Version and can't find it. Again thanks for the help. Bk