Re: [Patch] Setup: A wider threebar.

2006-04-04 Thread Bas van Gompel
Op Thu, 09 Mar 2006 12:44:40 + schreef Max Bowsher
in 44102338.9030005atukf.net:

: Bas van Gompel wrote:
[...]

:  * res.rc (IDD_INSTATUS): Change left and right margin to 7.

:  It would make the page look a bit unbalanced, though, since most of the
:  content will be very much to the left of the page.

What is this? A fashion show? (The progress-bars balance it nicely IMO.)

:  Still, maybe that's an acceptable sacrifice. Though, bear in mind that
:  many URLs will fit in the display width currently used.

Actually, most don't. They get wrapped to the next (invisible) line.

[...]
:  +NOT WS_GROUP | SS_LEFTNOWORDWRAP

:  Is it right to combine NOT xxx and | xxx ?

It works fine for me.

:  I couldn't find any documentation one way or the other.
:  /me curses MSDN's labyrinthine website.

I don't recall where, but I did see an example like this, somewhere.


L8r,

Buzz. [Thanks for the other check-ins/fixes.]
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] Setup: Warn about dropped mirrors.

2006-03-05 Thread Bas van Gompel
Op Wed, 16 Nov 2005 23:29:50 +0100 (MET) schreef Bas van Gompel
in n2m-g.dlgdit.3vsvtmt.1atbuzzy-box.bavag:
[Warn about dropped mirrors]

One more iteration. This is what I've been testing/using for months
now. Before I start changing/optimizing this, I'd like to get it in.

[Oh and a big PING on those other setup-patches from me (and Igor[*]).]

Now using std::string, not String. Also, break write_cache_list out
of save_cache_file.


Improved ChangeLog-entry: (please fix the at.)

2006-03-06  Bas van Gompel  patch-cygsup.buzzatbavag.tmfweb.nl

* res.rc (IDD_DROPPED): New dialog.
* resource.h (IDD_DROPPED): New dialog-id.
(IDC_DROP_MIRRORS, IDC_DROP_NOWARN): New control-ids.
* site.cc: Add enum for response on dropped mirrors.
(cache_is_usable, cache_needs_writing): New bools.
(cache_warn_urls): New string.
(cached_site-list, dropped_site_list): New SiteLists.
(site_list_type::init, site_list_type::site_list_type):
Change to four parameter form.
(site_list_type::site_list_type, site_list_type::operator=) Copy
servername, area and location.
(load_site_list): New function, broken out of get_site_list.
Support four-parameter site_list_type.
(get_site_list): Break out load_site_list. Move reading cache
earlier. Don't write new cache. Set flags to record cache state.
Load both all_site_list and cached_site_list.
(SiteSetting::registerSavedSite): Use four-parameter site_list_type.
(drop_proc, check_dropped_mirrors, write_cache_list,
save_cache_file): New functions.
(SitePage::OnNext): Check for dropped mirrors and save cache as
appropriate.
(SitePage::OnMessageCmd): Use four-parameter site_list_type.
* site.h (site_list_type::init, site_list_type::site_list_type):
Change to four parameter form.
(site_list_type): Add servername, area and location members.


L8r,

Buzz.

*) WAG.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re
diff --exclude=*~ --exclude=*.orig --exclude=*.rej -Ndrup curr/setup/res.rc 
mine/setup/res.rc
--- setup/res.rc2006-02-12 03:04:56.0 +0100
+++ setup/res.rc2006-02-11 14:12:06.0 +0100
@@ -356,6 +359,32 @@ BEGIN
 
 END
 
+IDD_DROPPED DIALOG DISCARDABLE  0, 0, 317, 142
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION Cygwin Setup - Use dropped mirrors?
+FONT 8, MS Shell Dlg
+BEGIN
+LTEXT   Warning:,IDC_STATIC,7,8,40,8
+LTEXT   One or more mirrors you have selected is/are not on the
+list of official Cygwin mirrors any more. 
+It/They may be out of date or missing some packages.\n
+This affects the following mirror(s):,
+IDC_STATIC,47,8,263,32
+EDITTEXTIDC_DROP_MIRRORS,7,40,303,40,WS_VSCROLL | WS_HSCROLL |
+ES_LEFT | ES_MULTILINE | ES_READONLY | ES_AUTOHSCROLL |
+ES_AUTOVSCROLL
+LTEXT   If you experience installation problems consider trying 
+official mirrors only.\n\n
+Do you want to continue, using this/these mirror(s)?,
+IDC_STATIC,7,88,303,24
+CONTROL Don't warn me about this/these mirror(s) again,
+IDC_DROP_NOWARN,Button,BS_AUTOCHECKBOX | WS_TABSTOP,
+7,120,213,15
+PUSHBUTTON  Yes,IDYES,220,120,45,15
+DEFPUSHBUTTON   No,IDNO,265,120,45,15
+
+END
+
 /
 //
 // Manifest
diff --exclude=*~ --exclude=*.orig --exclude=*.rej -Ndrup curr/setup/resource.h 
mine/setup/resource.h
--- setup/resource.h2006-02-12 03:04:56.0 +0100
+++ setup/resource.h2006-02-11 14:12:06.0 +0100
@@ -55,6 +55,7 @@
 #define IDD_VIRUS 218
 #define IDD_DESKTOP   219
 #define IDD_PREREQ220
+#define IDD_DROPPED   221
 
 // Bitmaps
 
@@ -152,3 +153,5 @@
 #define IDC_PREREQ_TEXT   576
 #define IDC_PREREQ_EDIT   577
 #define IDC_PREREQ_CHECK  578
+#define IDC_DROP_MIRRORS  579
+#define IDC_DROP_NOWARN   580
diff --exclude=*~ --exclude=*.orig --exclude=*.rej -Ndrup curr/setup/site.cc 
mine/setup/site.cc
--- setup/site.cc   2006-02-12 03:05:00.0 +0100
+++ setup/site.cc   2006-02-11 14:12:06.0 +0100
@@ -49,6 +49,17 @@ using namespace std;
 
 extern ThreeBarProgressPage Progress;
 
+
+/*
+  What to do if dropped mirrors are selected.
+*/
+enum
+{
+  CACHE_REJECT

Shell (bash, (pd)ksh, zsh, /not/ ash) + exec + here-doc + redirect == trouble!

2006-01-24 Thread Bas van Gompel
Hi,

Try the following script:

=== begin testexec.sh ===
#!/bin/ksh

exec 50 /bin/ksh EOSH
echo First exec: Done.
exec 05
echo Second exec: Done.
exit 0
EOSH
 end testexec.sh 

(Replace ksh with bash or zsh at will, above.)

For me, this prints ``First exec: Done.'', then leaves me to type
shell-commands, _which are executed_, until I press EOF (^D).

In ash it prints ''

  First exec: Done.
  Second exec: Done.

'', as I expected. Compare p.e.

=== begin testexec2.sh ===
#!/bin/bash

echo 'echo First exec: Done.
exec 05
echo Second exec: Done.
exit 0' |exec 50 /bin/bash

 end testexec2.sh 

, which also performs as expected.

Has anybody got a clue?

Is this cygwin-specific?

Are all these shells borrowing code from eachother?


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



[Patch] Setup: A wider threebar.

2006-01-22 Thread Bas van Gompel
In order to be able to see the names of the ini-file being parsed, and
the location being dowloaded from (if/when that patch
([EMAIL PROTECTED]) gets applied), I
suggest making better use of the available window-width. Following
patch does that.


A ChangeLog-entry? (Please fix the at.)

2005-01-23  Bas van Gompel  patch-cygsup.buzzatbavag.tmfweb.nl

* res.rc (IDD_INSTATUS): Change left and right margin to 7.
Make IDC_INS_ACTION, IDC_INS_PKG and IDC_INS_FILE not wrap.
* threebar.cc (ThreeBarControlsInfo): Make IDC_INS_ACTION, IDC_INS_PKG
and IDC_INS_FILE stretchable.

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re
Index: setup/res.rc
===
RCS file: /cvs/cygwin-apps/setup/res.rc,v
retrieving revision 2.68
diff -u -p -r2.68 res.rc
--- setup/res.rc30 Nov 2005 22:48:31 -  2.68
+++ setup/res.rc22 Jan 2006 20:28:16 -
@@ -189,18 +189,21 @@ STYLE DS_MODALFRAME | DS_CENTER | WS_CHI
 CAPTION Cygwin Setup
 FONT 8, MS Shell Dlg
 BEGIN
-LTEXT   Installing...,IDC_INS_ACTION,45,55,205,8,NOT WS_GROUP
-LTEXT   (PKG),IDC_INS_PKG,45,70,205,8,NOT WS_GROUP
-LTEXT   (FILE),IDC_INS_FILE,45,85,205,8,NOT WS_GROUP
+LTEXT   Installing...,IDC_INS_ACTION,7,55,303,8,
+NOT WS_GROUP | SS_LEFTNOWORDWRAP
+LTEXT   (PKG),IDC_INS_PKG,7,70,303,8,
+NOT WS_GROUP | SS_LEFTNOWORDWRAP
+LTEXT   (FILE),IDC_INS_FILE,7,85,303,8,
+NOT WS_GROUP | SS_LEFTNOWORDWRAP
 CONTROL Progress1,IDC_INS_DISKFULL,msctls_progress32,
-PBS_SMOOTH | WS_BORDER,95,130,155,10
+PBS_SMOOTH | WS_BORDER,60,130,250,10
 CONTROL Progress1,IDC_INS_IPROGRESS,msctls_progress32,
-PBS_SMOOTH | WS_BORDER,95,115,155,10
+PBS_SMOOTH | WS_BORDER,60,115,250,10
 CONTROL Progress1,IDC_INS_PPROGRESS,msctls_progress32,
-PBS_SMOOTH | WS_BORDER,95,100,155,10
-LTEXT   Package:,IDC_INS_BL_PACKAGE,45,100,47,8,NOT WS_GROUP
-LTEXT   Total:,IDC_INS_BL_TOTAL,45,115,48,8,NOT WS_GROUP
-LTEXT   Disk:,IDC_INS_BL_DISK,45,130,47,8,NOT WS_GROUP
+PBS_SMOOTH | WS_BORDER,60,100,250,10
+LTEXT   Package:,IDC_INS_BL_PACKAGE,7,100,47,8,NOT WS_GROUP
+LTEXT   Total:,IDC_INS_BL_TOTAL,7,115,48,8,NOT WS_GROUP
+LTEXT   Disk:,IDC_INS_BL_DISK,7,130,47,8,NOT WS_GROUP
 ICONIDI_CYGWIN,IDC_HEADICON,290,0,21,20
 CONTROL ,IDC_HEADSEPARATOR,Static,SS_BLACKFRAME | 
SS_SUNKEN,0,28,
 317,1
Index: setup/threebar.cc
===
RCS file: /cvs/cygwin-apps/setup/threebar.cc,v
retrieving revision 2.10
diff -u -p -r2.10 threebar.cc
--- setup/threebar.cc   5 May 2005 22:48:36 -   2.10
+++ setup/threebar.cc   22 Jan 2006 20:28:22 -
@@ -34,9 +34,9 @@
   Sizing information.
  */
 static ControlAdjuster::ControlInfo ThreeBarControlsInfo[] = {
-  {IDC_INS_ACTION, CP_LEFT,CP_TOP},
-  {IDC_INS_PKG,CP_LEFT,CP_TOP},
-  {IDC_INS_FILE,   CP_LEFT,CP_TOP},
+  {IDC_INS_ACTION, CP_STRETCH, CP_TOP},
+  {IDC_INS_PKG,CP_STRETCH, CP_TOP},
+  {IDC_INS_FILE,   CP_STRETCH, CP_TOP},
   {IDC_INS_DISKFULL,   CP_STRETCH, CP_TOP},
   {IDC_INS_IPROGRESS,  CP_STRETCH, CP_TOP},
   {IDC_INS_PPROGRESS,  CP_STRETCH, CP_TOP},


[Patch] Setup: Tell where we're downloading from. (again)

2006-01-22 Thread Bas van Gompel
Here this is again, but with the modifications to threebar.cc/res.rc
split off into a separate patch (See
n2m-g.dr1l0a.3vva69r.1atbuzzy-box.bavag).


ChangeLog-entry: (Please fix the at.)

2006-01-23  Bas van Gompel  patch-cygsup.buzzatbavag.tmfweb.nl

* geturl.h: Replace String with std::string throughout.
* geturl.cc: Ditto.
(init_dialog): Tell where file is downloaded from.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re
Index: setup/geturl.cc
===
RCS file: /cvs/cygwin-apps/setup/geturl.cc,v
retrieving revision 2.25
diff -u -p -r2.25 geturl.cc
--- setup/geturl.cc 5 May 2005 22:48:35 -   2.25
+++ setup/geturl.cc 22 Jan 2006 20:27:41 -
@@ -61,18 +61,17 @@ int total_download_bytes_sofar = 0;
 static DWORD start_tics;
 
 static void
-init_dialog (String const url, int length, HWND owner)
+init_dialog (std::string const url, int length, HWND owner)
 {
   if (is_local_install)
 return;
 
-  char const *last_component = url.c_str();
-  for (const char *ch = last_component; *ch; ch++)
-if (*ch == '/' || *ch == '\\' || *ch == ':')
-  last_component = ch + 1;
+  int p_slash = url.find_last_of ('/');
+
   max_bytes = length;
   Progress.SetText1(Downloading...);
-  Progress.SetText2(last_component);
+  Progress.SetText2((url.substr(p_slash + 1) +  from 
++ url.substr(0, p_slash)).c_str());
   Progress.SetText3(Connecting...);
   Progress.SetBar1(0);
   start_tics = GetTickCount ();
@@ -112,7 +111,7 @@ progress (int bytes)
 }
 
 static void
-getUrlToStream (String const _url, HWND owner, io_stream *output)
+getUrlToStream (std::string const _url, HWND owner, io_stream *output)
 {
   log (LOG_BABBLE)  getUrlToStream   _url  endLog;
   is_local_install = (source == IDC_SOURCE_CWD);
@@ -153,7 +152,7 @@ getUrlToStream (String const _url, HWND
 }
 
 io_stream *
-get_url_to_membuf (String const _url, HWND owner)
+get_url_to_membuf (std::string const _url, HWND owner)
 {
   io_stream_memory *membuf = new io_stream_memory ();
   try 
@@ -181,31 +180,31 @@ get_url_to_membuf (String const _url, H
 }
 
 // predicate: url has no '\0''s in it.
-String
-get_url_to_string (String const _url, HWND owner)
+std::string
+get_url_to_string (std::string const _url, HWND owner)
 {
   io_stream *stream = get_url_to_membuf (_url, owner);
   if (!stream)
-return String();
+return std::string();
   size_t bytes = stream-get_size ();
   if (!bytes)
 {
   /* zero length, or error retrieving length */
   delete stream;
   log (LOG_BABBLE)  get_url_to_string(): couldn't retrieve buffer size, 
or zero length buffer  endLog;
-  return String();
+  return std::string();
 }
   char temp [bytes + 1];
   /* membufs are quite safe */
   stream-read (temp, bytes);
   temp [bytes] = '\0';
   delete stream;
-  return String(temp);
+  return std::string(temp);
 }
 
 int
-get_url_to_file (String const _url,
- String const _filename,
+get_url_to_file (std::string const _url,
+ std::string const _filename,
  int expected_length,
 HWND owner)
 {
Index: setup/geturl.h
===
RCS file: /cvs/cygwin-apps/setup/geturl.h,v
retrieving revision 2.10
diff -u -p -r2.10 geturl.h
--- setup/geturl.h  23 Dec 2004 18:12:12 -  2.10
+++ setup/geturl.h  22 Jan 2006 20:27:41 -
@@ -23,11 +23,10 @@ extern int total_download_bytes;
 extern int total_download_bytes_sofar;
 
 class io_stream;
-class String;
 
-io_stream *get_url_to_membuf (String const , HWND owner);
-String get_url_to_string (String const, HWND owner);
-int get_url_to_file (String const _url, String const _filename,
+io_stream *get_url_to_membuf (std::string const , HWND owner);
+std::string get_url_to_string (std::string const, HWND owner);
+int get_url_to_file (std::string const _url, std::string const _filename,
  int expected_size, HWND owner);
 
 #endif /* SETUP_GETURL_H */


gvim cannot open display.

2006-01-11 Thread Bas van Gompel
When I start a -- recently installed -- gvim it tells me: ``

  E233: cannot open display

'', and then stays in console mode.

This happens on various machines.
Is it working for anybody? Am I doing something wromg?


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Call for testing Cygwin snapshot

2005-12-21 Thread Bas van Gompel
Op Wed, 21 Dec 2005 00:46:48 -0500 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Wed, Dec 21, 2005 at 05:16:34AM +0100, Bas van Gompel wrote:
[Testing freshly built from a CVS-checkout on Dec 20...]

:  This is on win 95 again...

:  I commonly source a file containing among other things: ''
:  /usr/sbin/sshd
:  ''. With this build, when logging in (using ''
:  ssh machine-name
:  ''), a new console pops up. It didn't before. When using ''
:  ssh machine-name bash -li
:  '' two consoles pop up, and typing ''
:  tty
:  '' on the resultant prompt reports ''not a tty''.


:  If I can help by providing more info, let me know.

:  Could retype that without the strange quoting and maybe provide a little

What do you mean when you write: ``strange quoting''?

:  more explanation about what you mean by source a file, i.e., provide
:  step by step instructions for duplicating the problem?

On a bash-prompt started from cygwin.bat I type ``
. startsshd
'', where startsshd contains: ``
#!/bin/bash

sshd_pid=`ps |grep -i /usr/sbin/sshd |sed 's, *\([^ ]*\).*,\1,'`

if test -z $sshd_pid ; then
 /usr/sbin/sshd ;
 sshd_pid=`ps |grep -i /usr/sbin/sshd |sed 's, *\([^ ]*\).*,\1,'` ;
 PS1='sshd='$sshd_pid';'$PS1 ;
 trap 'sshd_pid=`ps |grep -i /usr/sbin/sshd |sed '\''s, *\([^ ]*\).*,\1,'\''`;if
 test -n $sshd_pid; then kill $sshd_pid; else echo sshd not running!; fi' 0 ;
else
 echo sshd already running';' pid=$sshd_pid';' ;
fi
''.

Then from another console or another machine, login as I described
before. Now on the (w85) machine, one (ssh machine) or two
(ssh machine bash -li) extra blank consoles appear. If in the
2nd case (ssh machine bash -li), I type ``tty'' at the prompt
from the console/machine where I logged in, it reports back:
``not a tty'', instead of the usual /dev/ttyN.


Need more info? Ask.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Call for testing Cygwin snapshot

2005-12-20 Thread Bas van Gompel
Op Wed, 30 Nov 2005 18:11:37 +0100 schreef Corinna Vinschen
in 20051130171137.GE2999atcalimero.vinschen.de:

:  ask people for testing the latest snapshot, 2005-Nov-30, from

Actually, this is freshly built from a CVS-checkout on Dec 20.

:  Please report back in this thread when you encounter a problem, which
:  you can't reproduce with 1.5.18.  We're interested in regressions in
:  the first place.

This is on win 95 again...

I commonly source a file containing among other things: ''
/usr/sbin/sshd
''. With this build, when logging in (using ''
ssh machine-name
''), a new console pops up. It didn't before. When using ''
ssh machine-name bash -li
'' two consoles pop up, and typing ''
tty
'' on the resultant prompt reports ''not a tty''.


If I can help by providing more info, let me know.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Ezmlm configuration.

2005-12-07 Thread Bas van Gompel
Hi,

Recently my mailbox was flooded by a virus (Sober CF), causing me
to miss several mails from cygwin-MLs and a report being sent by
ezmlm. When I later got the messages from the archive (using
ezmlm-get), I noticed the messages in the returned digest do not
have a ``In-Reply-To''- nor a ``References''-header. Would it be
possible to configure ezmlm to return those headers, when available?

I would love to be able to restore threading for my local archives.
(I use Hamster to read the MLs as if they were NGs.)


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: {Patch} Setup: Tell where we're downloading from.

2005-12-04 Thread Bas van Gompel
Op Tue,  8 Nov 2005 22:50:55 +0100 (MET) schreef Bas van Gompel
in [EMAIL PROTECTED]:
:  Hi,

:  Here is a patch to make setup tell where files are actually being
:  downloaded from.

So, here is a modified version, using more std::stringy ways.
I got carried away a bit, and turned some more Strings into
std::string.
Also I needed to edit res.rc to prevent wrapping.


ChangeLog-entry: (Please fix the at.)


2005-12-05  Bas van Gompel  patch-cygsup.buzzatbavag.tmfweb.nl

* geturl.cc: Use std::string, not String.
(init_dialog): Tell where file is downloaded from.
* geturl.h: Use std::string, not String.
* res.rc (IDD_INSTATUS): make IDC_INS_PKG not wrap.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re
Index: setup/geturl.cc
===
RCS file: /cvs/cygwin-apps/setup/geturl.cc,v
retrieving revision 2.25
diff -u -p -r2.25 geturl.cc
--- setup/geturl.cc 5 May 2005 22:48:35 -   2.25
+++ setup/geturl.cc 5 Dec 2005 02:58:22 -
@@ -61,18 +61,17 @@ int total_download_bytes_sofar = 0;
 static DWORD start_tics;
 
 static void
-init_dialog (String const url, int length, HWND owner)
+init_dialog (std::string const url, int length, HWND owner)
 {
   if (is_local_install)
 return;
 
-  char const *last_component = url.c_str();
-  for (const char *ch = last_component; *ch; ch++)
-if (*ch == '/' || *ch == '\\' || *ch == ':')
-  last_component = ch + 1;
+  int p_slash = url.find_last_of ('/');
+
   max_bytes = length;
   Progress.SetText1(Downloading...);
-  Progress.SetText2(last_component);
+  Progress.SetText2((url.substr(p_slash + 1) +  from 
++ url.substr(0, p_slash)).c_str());
   Progress.SetText3(Connecting...);
   Progress.SetBar1(0);
   start_tics = GetTickCount ();
@@ -112,7 +111,7 @@ progress (int bytes)
 }
 
 static void
-getUrlToStream (String const _url, HWND owner, io_stream *output)
+getUrlToStream (std::string const _url, HWND owner, io_stream *output)
 {
   log (LOG_BABBLE)  getUrlToStream   _url  endLog;
   is_local_install = (source == IDC_SOURCE_CWD);
@@ -153,7 +152,7 @@ getUrlToStream (String const _url, HWND
 }
 
 io_stream *
-get_url_to_membuf (String const _url, HWND owner)
+get_url_to_membuf (std::string const _url, HWND owner)
 {
   io_stream_memory *membuf = new io_stream_memory ();
   try 
@@ -181,31 +180,31 @@ get_url_to_membuf (String const _url, H
 }
 
 // predicate: url has no '\0''s in it.
-String
-get_url_to_string (String const _url, HWND owner)
+std::string
+get_url_to_string (std::string const _url, HWND owner)
 {
   io_stream *stream = get_url_to_membuf (_url, owner);
   if (!stream)
-return String();
+return std::string();
   size_t bytes = stream-get_size ();
   if (!bytes)
 {
   /* zero length, or error retrieving length */
   delete stream;
   log (LOG_BABBLE)  get_url_to_string(): couldn't retrieve buffer size, 
or zero length buffer  endLog;
-  return String();
+  return std::string();
 }
   char temp [bytes + 1];
   /* membufs are quite safe */
   stream-read (temp, bytes);
   temp [bytes] = '\0';
   delete stream;
-  return String(temp);
+  return std::string(temp);
 }
 
 int
-get_url_to_file (String const _url,
- String const _filename,
+get_url_to_file (std::string const _url,
+ std::string const _filename,
  int expected_length,
 HWND owner)
 {
Index: setup/geturl.h
===
RCS file: /cvs/cygwin-apps/setup/geturl.h,v
retrieving revision 2.10
diff -u -p -r2.10 geturl.h
--- setup/geturl.h  23 Dec 2004 18:12:12 -  2.10
+++ setup/geturl.h  5 Dec 2005 02:58:22 -
@@ -23,11 +23,10 @@ extern int total_download_bytes;
 extern int total_download_bytes_sofar;
 
 class io_stream;
-class String;
 
-io_stream *get_url_to_membuf (String const , HWND owner);
-String get_url_to_string (String const, HWND owner);
-int get_url_to_file (String const _url, String const _filename,
+io_stream *get_url_to_membuf (std::string const , HWND owner);
+std::string get_url_to_string (std::string const, HWND owner);
+int get_url_to_file (std::string const _url, std::string const _filename,
  int expected_size, HWND owner);
 
 #endif /* SETUP_GETURL_H */
Index: setup/res.rc
===
RCS file: /cvs/cygwin-apps/setup/res.rc,v
retrieving revision 2.68
diff -u -p -r2.68 res.rc
--- setup/res.rc30 Nov 2005 22:48:31 -  2.68
+++ setup/res.rc5 Dec 2005 02:58:49 -
@@ -190,7 +190,7 @@ CAPTION Cygwin Setup
 FONT 8, MS Shell Dlg
 BEGIN
 LTEXT

Re: Call for testing Cygwin snapshot

2005-12-02 Thread Bas van Gompel
Op Fri, 2 Dec 2005 11:40:49 +0100 schreef Corinna Vinschen
in 20051202104049.GN2999atcalimero.vinschen.de:
:  On Dec  2 01:27, Bas van Gompel wrote:
[gethostbyname on w95]

:if (gethostbyname (localhost))
:  puts (Could get host by name (localhost));
:else
:  perror (Could NOT get host by name (localhost));
:
:  errno isn't meaningful after a call to gethostbyname, you should look at
:  h_errno instead:

Ah.

:fprintf (stderr, Could NOT get host by name (localhost): %d %s\n,
:  h_errno, hstrerror (h_errno));
:
:  Would result in:
:
: Could NOT get host by name (localhost): herrno: 1 Unknown host

``Could NOT get host by name (localhost): 1 Unknown host''

Yes, so it does.
[...]

:  I have no w95, only w98 SE.  Works for me:
:
:$ ./tghbn
:Could get a host by name (localhost)

No surprises there...

:  The difference between the snapshot and 1.5.18 is that we dropped
:  winsock 1 support entirely, and that we now load the symbols from
:  ws2_32.dll instead of from wsock32.dll.  Maybe there's a bug in w95's
:  WinSock2 implementation?  I don't know.  I don't see anything in
:  Microsoft's KB.  However, does it work for no hostname or just for
:  localhost?  If only for localhost, what happens if you add a matching
:  entry to C:/WINDOWS/HOSTS:
:
:127.0.0.1  localhost

Any host. (That line is already in my hosts-file.)

[...]
:  1191806 1834791 [main] tghbn 758909 __set_errno: void 
__set_winsock_errno(const char*, int):278 val 1
:997 1835788 [main] tghbn 758909 __set_winsock_errno: __dup_ent:378 - 
winsock error 11001 - errno 1
:
:  Winsock error 11001: No such host.
:
:  Hmm.  Are you set up to build your own Cygwin DLL?  If so, could you
:  try if it suddenly works again (remove the above entry from the hosts
:  file first, don't change anything else!), if you make this change:
:
:  Index: autoload.cc

I just tried it. It doesn't help.

Oh, I just found a build of September 15, and it shows the failure,
so the change should be somewhere between Sep 2 and then.

Also: Did you notice it works when invoked from strace or DOS command?

Could this have to do with env-vars?

Any other things I should try/report?


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: [Patch] setup: site.cc: dot[3] may not be valid.

2005-12-01 Thread Bas van Gompel
Op Wed, 30 Nov 2005 22:18:54 + schreef Max Bowsher
in 438E254E.5070101atukf.net:
:  Bas van Gompel wrote:
[patch]

:  The terrifying irony here, is that after all this icky pointer
:  manipulation, the calculated value is totally ignored anyway!

:  I've rewritten all the pointer work in terms of STL strings, and will
:  commit it now.

Nice, but three-letter TLDs now sort at the beginning, not the end.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] setup: site.cc: dot[3] may not be valid.

2005-12-01 Thread Bas van Gompel
Op Thu, 01 Dec 2005 16:45:31 + schreef Max Bowsher
in 438F28AB.80109atukf.net:
:  Bas van Gompel wrote:
:  Op Wed, 30 Nov 2005 22:18:54 + schreef Max Bowsher
:  in 438E254E.5070101atukf.net:
[patch for site.cc]

:  :  I've rewritten all the pointer work in terms of STL strings, and will
:  :  commit it now.
: 
:  Nice, but three-letter TLDs now sort at the beginning, not the end.

:  I'd assumed that was what the original coder intended.

How odd. The original code used '~'.

:  I'm quite happy to put them at the end, if consensus points that way.

I have no strong opinion on this either way.


BTW: Is anybody working on using a listview or treeview iso a listbox
 for the site-list? if not, I might have a go...


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: Call for testing Cygwin snapshot

2005-12-01 Thread Bas van Gompel
Op Wed, 30 Nov 2005 18:11:37 +0100 schreef Corinna Vinschen
in 20051130171137.GE2999atcalimero.vinschen.de:
[Test the 20051130 snapshot]

:  Please report back in this thread when you encounter a problem, which
:  you can't reproduce with 1.5.18.  We're interested in regressions in
:  the first place.

On my (w95) machine gethostbyname is failing with the snapshot.

[...]
:  Keep in mind that we can easier find problems if you attach a brief,
:  concise, selfcontained testcase, if possible in plain C, which allows
:  easy reproducing.
[...]

You'll find one in the following transcript.


Start transcript
$ uname -vr
1.5.19s(0.145/4/2) 20051130 13:17:51

$ cat tghbn.c
#include stdio.h
#include netdb.h
#include errno.h

int
main (int argc, char **argv)
{
  if (gethostbyname (localhost))
puts (Could get host by name (localhost));
  else
perror (Could NOT get host by name (localhost));
}

$ make tghbn
gcc tghbn.c   -o tghbn

$ ./tghbn
Could NOT get host by name (localhost): Operation not permitted

$ strace -o tghbn.strace0 -m all ./tghbn
Could get host by name (localhost)

$ strace -o tghbn.strace -m all sh -c ./tghbn
Could NOT get host by name (localhost): Operation not permitted

End transcript.


The bit of the strace leading upto the error in tghbn.strace:

 2103  218163 [main] TGHBN 758909 pinfo_init: pid 758909, pgid 765225
 4853  223016 [sig] TGHBN 758909 wait_sig: myself-dwProcessId 4294282123
 -977  222039 [main] TGHBN 758909 sigproc_init: process/signal handling 
enabled, state 0xC1
 2918  224957 [main] tghbn 758909 dll_crt0_1: user_data-main 0x401050
 -888  224069 [sig] TGHBN 758909 wait_sig: entering ReadFile loop, readsig 
0xD4, myself-sendsig 0xD8
 1767  225836 [main] tghbn 758909 __set_errno: void dll_crt0_1(char*):896 val 0
 1537  227373 [main] tghbn 758909 wait_for_sigthread: wait_sig_inited 0xC8
374106  601479 [main] tghbn 758909 wsock_init: res 0
15488  616967 [main] tghbn 758909 wsock_init: wVersion 514
 1502  618469 [main] tghbn 758909 wsock_init: wHighVersion 514
 1916  620385 [main] tghbn 758909 wsock_init: szDescription WinSock 2.0
 7935  628320 [main] tghbn 758909 wsock_init: szSystemStatus Running
10963  639283 [main] tghbn 758909 wsock_init: iMaxSockets 0
 2118  641401 [main] tghbn 758909 wsock_init: iMaxUdpDg 0
 1584  642985 [main] tghbn 758909 wsock_init: lpVendorInfo 0
1191806 1834791 [main] tghbn 758909 __set_errno: void __set_winsock_errno(const 
char*, int):278 val 1
  997 1835788 [main] tghbn 758909 __set_winsock_errno: __dup_ent:378 - winsock 
error 11001 - errno 1
  799 1836587 [main] tghbn 758909 cygwin_gethostbyname: dup_ent returned NULL 
for name localhost, h 0x0


This is/was working in 1.5.18.

Attached is cygcheck -svr output. with a self built cygwin1.dll from
Mon Nov 28 16:30:21 2005, which is the last version I have, which
doesn't show the failure. CVS-checkout for that build can't have been
much more than 24 hours earlier, probably less.

If there is other info I can provide, please let me know.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re
Cygwin Configuration Diagnostics
Current System Time: Fri Dec 02 00:00:17 2005

Windows 95 Ver 4.0 Build 1212 

Path:   k:\cygwin\local\users\Buzz\bin
d:\cygwin\bin
c:\WINDOWS
c:\WINDOWS\COMMAND
c:\DOS
c:\util
c:\util\BVG
k:\cygwin\local\BIN
g:\PROGRAMS\NETWOR~1\PGP
g:\PROGRAMS\ULTRAE~1
g:\MASM32\BIN

Output from d:\cygwin\bin\id.exe (nontsec)
UID: 501(Buzz)   GID: 544(admins)
544(admins)

Output from d:\cygwin\bin\id.exe (ntsec)
UID: 501(Buzz)   GID: 544(admins)
544(admins)

SysDir: C:\WINDOWS\SYSTEM
WinDir: C:\WINDOWS

USER = `Buzz'
PWD = `/home/Buzz'
HOME = `/home/Buzz'

NNTPSERVER = `buzzy-box.bavag'
TERM = `cygwin'
CMDLINE = `WIN'
WINDIR = `C:\WINDOWS'
SEARCHPATHS = `/ /c /d /e /f /g /h /i /j /k /l'
CVSROOT = `/home/buzz/cvs-repo'
TEMP = `/h/temp'
QTJAVA = `C:\WINDOWS\SYSTEM\QTJava.zip'
HOST_SYSTEM_TYPE = `CygWin'
EDITOR = `vim'
FDRV = `c:\Util\BvG\'
WINBOOTDIR = `C:\WINDOWS'
SHLVL = `1'
BLASTER = `A240 I2 D1'
PROMPT = `$b$l$p$g$b '
COMSPEC = `C:\COMMAND.COM'
TMP = `/h/tmp'
CVS_RSH = `ssh'
GMT_TZ = `-1'
CLASSPATH = `C:\WINDOWS\SYSTEM\QTJava.zip;'
LOCATE_DB = `/d/cygwin/usr/var/locatedb'
_ = `/usr/bin/cygcheck'
SYSTEMROOT = `C:\WINDOWS'
POSIXLY_CORRECT = `1'

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start
 Menu\Programma's\Cygnus Solutions
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start
 Menu\Programma's\Cygnus Solutions\Menu
  (default) = (unsupported type)
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start
 Menu\Programs\Cygnus Solutions
  (default) = (unsupported 

[Patch] g-b-s: New command: upgrade-self. (was: Re: generic-build-script extension to update version numbers in README)

2005-11-21 Thread Bas van Gompel
Op Fri, 18 Nov 2005 23:20:25 -0500 schreef Charles Wilson
in 437EA809.30204atcwilson.fastmail.fm:
:  Igor Pechtchanski wrote:
[new gbs features]

:  Well, the problem is, logging is a decorator: it decorates the existing 
:  functions.  Unless you want a whole new build-with-logging() function 
:  that has to be maintained in parallel with the regular build() function 
:  for package foo, I don't see how this particular feature can be moved 
:  out of the core gbs without getting REAL ugly: building cmd strings, 
:  possibly decorating _those_, and then eval'ing them.  Sad, really.

How about:
build_with_logging() {
  build 21 |tee logfilename
}
?

:  Every new feature added to gbs makes it that much more difficult for
:  maintainers to keep pace with gbs updates when they update their
:  packages. Please think carefully before adding new stuff: is feature X
:  *really* worth it?

So, I'm gonna suggest another feature. :-

:  BTW, thanks for your comments, Chuck.  I'm afraid I lost sight of the fact
:  that many maintainers have private mods to the g-b-s, and that feature
:  updates may cause them trouble.  We should definitely rectify this.

:  The problem comes in when trying to 'upgrade' our fork to the ongoing 
:  development in the 'trunk'.  It really is a branch-and-merge-from type 
:  of operation.  Maybe I should give that local cvs mirror idea some more 
:  thought...

I came up with the following, which should make upgrading easier in
the future. You'll still have to hand-merge this into your existing
scripts though, sorry, but from then on, non-conflicting updates to
g-b-s should be easily retrieved.

How it works: When invoked with the `upgrade-self' command, the script
attempts to get the HEAD-version from cvs, if it hasn't in the last
24 hours. This HEAD-version is invoked with the `version' command
to get it's CVS-revision. If it was just downloaded, the HEAD revision
is stored in /usr/share/gbs as generic-build-script-HEAD and
generic-build-script-HEAD-revision If the HEAD-revision doesn't
match this build-script's CVS-revision, the build-script's revision
is gotten from /usr/share/gbs if available, otherwise it is gotten
through CVS and stored in /usr/share/gbs. Than merging is done
on a copy of the build-script. If the merge has conflicts, one is
given the possibility to edit the script and the option to reject the
new script. Finally the new script is copied into place and executed
with the remaining parameters.


ChangeLog-entry: (Please fix the at.)

2005-11-21  Bas van Gompel  g-b-s-patch.buzzatbavag.tmfweb.nl

* templates/generic-build-script Add upgrade-self to main switch.
(help): Add upgrade_self.
(upgrade_self): new function.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re
Index: packaging/templates/generic-build-script
===
RCS file: /cvs/cygwin-apps/packaging/templates/generic-build-script,v
retrieving revision 1.43
diff -u -p -r1.43 generic-build-script
--- packaging/templates/generic-build-script18 Oct 2005 05:01:36 -  
1.43
+++ packaging/templates/generic-build-script20 Nov 2005 21:05:49 -
@@ -163,7 +163,7 @@ Actions are:
 spkg, src-package  Prepare the source package ${src_pkg_name}
 finish Remove source directory ${srcdir}
 checksig   Validate GPG signatures (requires gpg)
+upgrade-self   Merge changes from upstream generic-build-script.
 first  Full run for spkg (mkdirs, spkg, finish)
 almostall  Full run for bin pkg, except for finish
 allFull run for bin pkg
@@ -402,6 +403,111 @@ checksig() {
 echo You need the gnupg package installed in order to check signatures. 
; \
   fi
 }
+upgrade_self() {
+  # make sure we have cvs and merge.
+  if ! which merge /dev/null || ! which cvs /dev/null; then
+echo $0 upgrade-self: I need merge and cvs!
+exit 1
+  fi
+  scriptname=`basename $0`
+  my_gbs_ver=$(version |sed -e 's/.* //')
+  gbs_cvs_repo=':pserver:[EMAIL PROTECTED]:/cvs/cygwin-apps'
+  gbs_cvs_dir='packaging/templates/'
+  mkdir -p /usr/share/gbs
+  share_gbs_fresh=false
+  test -n $(find /usr/share/gbs -name generic-build-script-HEAD -mtime -1) \
+ share_gbs_fresh=true
+  # get HEAD
+  if ${share_gbs_fresh}; then
+cp /usr/share/gbs/generic-build-script-HEAD \
+  /tmp/generic-build-script-HEAD-$$-1.sh
+  else
+echo $0 upgrade-self will now connect to the Red Hat CVS-server.
+echo If you are prompted for a password, press 'Enter'.
+cvs -z3 -d ${gbs_cvs_repo} co -p ${gbs_cvs_dir}generic-build-script \
+  /tmp/generic-build-script-HEAD-$$-1.sh
+  fi
+  # fool version-check

[Patch] g-b-s: Fix description of accept-patch.

2005-11-21 Thread Bas van Gompel
[Message sent Sat, 19 Nov 2005 17:22:42 +0100 (MET) bounced:
``cygwin-apps@cygwin.com: host sourceware.org[209.132.176.174] refused to talk
to me: 500 Unrecognized command:''
Here it is again, with a new date on the ChangeLog-entry.]

Hi,

I just noticed, the description of ``accept-patch'' in the help-text
for the generic-build-script is incorrect. This patch contains a
possible replacement. 


ChangeLog-entry: (Please fix the at.)

2005-11-22  Bas van Gompel  g-b-s-patch.buzzatbavag.tmfweb.nl

* templates/generic-build-script (help): fix help-text for
accept-patch.


--- templates/generic-build-script  2005-11-19 16:08:54.0 +0100
+++ templates/generic-build-script  2005-11-19 16:10:04.0 +0100
@@ -159,7 +159,7 @@ Actions are:
 strip  Strip package executables
 pkg, package   Prepare the binary package ${bin_pkg_name}
 mkpatchPrepare the patch file ${src_patch_name}
-acceptpatchApply a patch to the source
+acceptpatchCopy patch file ${src_patch_name} to ${topdir}
 spkg, src-package  Prepare the source package ${src_pkg_name}
 finish Remove source directory ${srcdir}
 checksig   Validate GPG signatures (requires gpg)


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] Setup: Warn about dropped mirrors.

2005-11-16 Thread Bas van Gompel
Op Wed,  2 Nov 2005 22:29:10 +0100 (MET) schreef Bas van Gompel
in n2m-g.dkbctp.3vv3gvj.1atbuzzy-box.bavag:
[Warn about dropped mirrors]

I cleaned this up a little (use ``area'', not ``continent'', check for
``!size()'' instead of ``==''.) I also folded the second patch
(Initializing cache_action) into this one and added some missing parts
to the ChangeLog-entry. Please use this one.


ChangeLog-entry: (please fix the at.)

2005-11-16  Bas van Gompel  patch-cygsup.buzzatbavag.tmfweb.nl

* res.rc (IDD_DROPPED): New dialog.
* resource.h (IDD_DROPPED): New dialog-id.
(IDC_DROP_MIRRORS, IDC_DROP_NOWARN): New control-ids.
* site.cc (site_list_type::init, site_list_type::site_list_type):
Change to four parameter form.
(site_list_type::site_list_type, site_list_type::operator=) Copy
servername, area and location.
(load_site_list): New function, broken out of get_site_list.
Support four-parameter site_list_type.
(get_site_list): Break out load_site_list. Move reading cache
earlier. Don't write new cache. Set flags to record cache state.
Load both all_site_list and cached_site_list.
(SiteSetting::registerSavedSite): Use four-parameter site_list_type.
(drop_proc, check_dropped_mirrors, save_cache_file): New functions.
(SitePage::OnNext): Check for dropped mirrors and save cache as
appropriate.
(SitePage::OnMessageCmd): Use four-parameter site_list_type.
* site.h (site_list_type::init, site_list_type::site_list_type):
Change to four parameter form.
(site_list_type): Add servername, area and location members.


L8r,
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re
Index: setup/res.rc
===
RCS file: /cvs/cygwin-apps/setup/res.rc,v
retrieving revision 2.67
diff -u -p -r2.67 res.rc
--- setup/res.rc9 Sep 2005 19:52:51 -   2.67
+++ setup/res.rc16 Nov 2005 19:59:08 -
@@ -356,6 +356,32 @@ BEGIN
 
 END
 
+IDD_DROPPED DIALOG DISCARDABLE  0, 0, 317, 142
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION Cygwin Setup - Use dropped mirrors?
+FONT 8, MS Shell Dlg
+BEGIN
+LTEXT   Warning:,IDC_STATIC,7,8,40,8
+LTEXT   One or more mirrors you have selected is/are not on the
+list of official Cygwin mirrors any more. 
+It/They may be out of date or missing some packages.\n
+This affects the following mirror(s):,
+IDC_STATIC,47,8,263,32
+EDITTEXTIDC_DROP_MIRRORS,7,40,303,40,WS_VSCROLL | WS_HSCROLL |
+ES_LEFT | ES_MULTILINE | ES_READONLY | ES_AUTOHSCROLL |
+ES_AUTOVSCROLL
+LTEXT   If you experience installation problems, consider trying 
+official mirrors only.\n\n
+Do you want to continue, using this/these mirror(s)?,
+IDC_STATIC,7,88,303,24
+CONTROL Don't warn me about this/these mirror(s) again,
+IDC_DROP_NOWARN,Button,BS_AUTOCHECKBOX | WS_TABSTOP,
+7,120,213,15
+PUSHBUTTON  Yes,IDYES,220,120,45,15
+DEFPUSHBUTTON   No,IDNO,265,120,45,15
+
+END
+
 /
 //
 // Manifest
Index: setup/resource.h
===
RCS file: /cvs/cygwin-apps/setup/resource.h,v
retrieving revision 2.32
diff -u -p -r2.32 resource.h
--- setup/resource.h9 Sep 2005 19:52:51 -   2.32
+++ setup/resource.h16 Nov 2005 19:59:09 -
@@ -55,6 +55,7 @@
 #define IDD_VIRUS 218
 #define IDD_DESKTOP   219
 #define IDD_PREREQ220
+#define IDD_DROPPED   221
 
 // Bitmaps
 
@@ -152,3 +153,5 @@
 #define IDC_PREREQ_TEXT   576
 #define IDC_PREREQ_EDIT   577
 #define IDC_PREREQ_CHECK  578
+#define IDC_DROP_MIRRORS  579
+#define IDC_DROP_NOWARN   580
Index: setup/site.cc
===
RCS file: /cvs/cygwin-apps/setup/site.cc,v
retrieving revision 2.40
diff -u -p -r2.40 site.cc
--- setup/site.cc   14 Oct 2005 04:23:14 -  2.40
+++ setup/site.cc   16 Nov 2005 19:59:13 -
@@ -46,6 +46,17 @@ static const char *cvsid =
 
 extern ThreeBarProgressPage Progress;
 
+
+/*
+  What to do if dropped mirrors are selected.
+*/
+enum
+{
+  CACHE_REJECT,// Go back to re-select mirrors.
+  CACHE_ACCEPT_WARN

[Patch] Setup: Store view setting. (was: Re: RFC: [ITP] Installation Profiles packages)

2005-11-13 Thread Bas van Gompel
Op Sun, 13 Nov 2005 02:15:51 -0500 (EST) schreef Igor Pechtchanski
in Pine.GSO.4.63.0511130213590.24379atslinky.cs.nyu.edu:
:  On Sun, 13 Nov 2005, Bas van Gompel wrote:
[Patch to let setup store the latest view of the chooser window]

:  Can we please get this re-sent with a non-inline patch and with a
:  different subject line?  This thread is already horribly overloaded.
[...]

Sure.


ChangeLog-entry: (Please fix the at.)

2005-11-13  Bas van Gompel  patch-cygsup.buzzatbavag.tmfweb.nl

* choose.h (class ViewSetting): Declare.
* choose.cc (ViewSetting::load, ViewSetting::save): Implement.
(ChooserPage::createListview): Use ViewSetting.
(ChooserPage::OnNext): Store ViewSetting.


L9r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re
Index: setup/choose.cc
===
RCS file: /cvs/cygwin-apps/setup/choose.cc,v
retrieving revision 2.142
diff -u -p -r2.142 choose.cc
--- setup/choose.cc 9 Sep 2005 19:52:51 -   2.142
+++ setup/choose.cc 13 Nov 2005 16:22:32 -
@@ -58,6 +58,8 @@ static const char *cvsid =
 #include ControlAdjuster.h
 #include prereq.h
 
+#include UserSettings.h
+
 using namespace std;
 
 extern ThreeBarProgressPage Progress;
@@ -78,6 +80,39 @@ static ControlAdjuster::ControlInfo Choo
   {0, CP_LEFT, CP_TOP}
 };
 
+static ViewSetting ChosenView;
+
+void 
+ViewSetting::load()
+{
+  value = PickView::views::Category;
+  io_stream *f = UserSettings::Instance().settingFileForLoad(last-view);
+  if (f)
+{
+  char view[1000];
+  if (f-gets (view, 1000))
+   {
+ while (String (value.caption()) != String (view) 
+++value != PickView::views::Category) ; // Do nothing
+   }
+  delete f;
+}
+  log (LOG_PLAIN)  Loaded last view setting:   value.caption()  endLog;
+}
+
+void 
+ViewSetting::save()
+{
+  io_stream *f = UserSettings::Instance().settingFileForSave(last-view);
+  if (f)
+{
+  f-write ((String(value.caption()) + \n).c_str(),
+strlen (value.caption()) + 1);
+  delete f;
+  log (LOG_PLAIN)  Saved last view setting:   value.caption()  
endLog;
+}
+}
+
 ChooserPage::ChooserPage ()
 {
   sizeProcessor.AddControlInfo (ChooserControlsInfo);
@@ -92,11 +127,11 @@ ChooserPage::createListview ()
   if (!chooser-Create(this, WS_CHILD | WS_HSCROLL | WS_VSCROLL | 
WS_VISIBLE,r))
 // TODO throw exception
 exit (11);
-  chooser-init(PickView::views::Category);
+  chooser-init(ChosenView.value);
   chooser-Show(SW_SHOW);
 
   chooser-defaultTrust (TRUST_CURR);
-  chooser-setViewMode (PickView::views::Category);
+  chooser-setViewMode (ChosenView.value);
   if (!SetDlgItemText (GetHWND (), IDC_CHOOSE_VIEWCAPTION, 
chooser-mode_caption ()))
 log (LOG_BABBLE)  Failed to set View button caption %ld  
 GetLastError ()  endLog;
@@ -193,6 +228,10 @@ ChooserPage::OnNext ()
   logResults();
 #endif
 
+  ChosenView.value = PickView::views::Category;
+  while (String (ChosenView.value.caption()) != String 
(chooser-mode_caption()) 
+++ChosenView.value != PickView::views::Category) ; // Do nothing
+
   PrereqChecker p;
   if (p.isMet ())
 {
Index: setup/choose.h
===
RCS file: /cvs/cygwin-apps/setup/choose.h,v
retrieving revision 2.36
diff -u -p -r2.36 choose.h
--- setup/choose.h  21 May 2005 23:04:02 -  2.36
+++ setup/choose.h  13 Nov 2005 16:22:33 -
@@ -55,4 +55,13 @@ public:
   PickView *chooser;
 };
 
+#include UserSetting.h
+class ViewSetting : public UserSetting 
+{
+  public:
+PickView::views value;
+virtual void load();
+virtual void save();
+};
+
 #endif /* SETUP_CHOOSE_H */


Re: RFC: [ITP] Installation Profiles packages

2005-11-12 Thread Bas van Gompel
Op Thu, 10 Nov 2005 01:51:45 +0100 (MET) schreef Bas van Gompel
in n2m-g.dku81h.3vvae1b.at@buzzy-box.bavag:
:  Op Wed, 9 Nov 2005 17:21:28 +0100 schreef Corinna Vinschen
:  in 20051109162128.GA29765atcalimero.vinschen.de:
:  [...]
::  Which reminds me... isn't there a way that setup could store the latest
::  view of the chooser window the user has selected?  For instance, in
::  almost all cases I'd like to see the Partial view, not the Category
::  view.  Can storing the last view be added easily?
:
: It doesn't look hard... I've partly done it. If no-one starts jumping
:  up and down saying ``Let me!'', I'll finish it.

Its done.


ChangeLog-entry: (Please fix the at.)

2005-11-13  Bas van Gompel  patch-cygsup.buzzatbavag.tmfweb.nl

* choose.h (class ViewSetting): Declare.
* choose.cc (ViewSetting::load, ViewSetting::save): Implement.
(ChooserPage::createListview): Use ViewSetting.
(ChooserPage::OnNext): Store ViewSetting.


--- setup/choose.h  21 May 2005 23:04:02 -  2.36
+++ setup/choose.h  12 Nov 2005 19:36:21 -
@@ -55,4 +55,13 @@ public:
   PickView *chooser;
 };
 
+#include UserSetting.h
+class ViewSetting : public UserSetting 
+{
+  public:
+PickView::views value;
+virtual void load();
+virtual void save();
+};
+
 #endif /* SETUP_CHOOSE_H */
--- setup/choose.cc 9 Sep 2005 19:52:51 -   2.142
+++ setup/choose.cc 12 Nov 2005 19:36:21 -
@@ -58,6 +58,8 @@ static const char *cvsid =
 #include ControlAdjuster.h
 #include prereq.h
 
+#include UserSettings.h
+
 using namespace std;
 
 extern ThreeBarProgressPage Progress;
@@ -78,6 +80,39 @@ static ControlAdjuster::ControlInfo Choo
   {0, CP_LEFT, CP_TOP}
 };
 
+static ViewSetting ChosenView;
+
+void 
+ViewSetting::load()
+{
+  value = PickView::views::Category;
+  io_stream *f = UserSettings::Instance().settingFileForLoad(last-view);
+  if (f)
+{
+  char view[1000];
+  if (f-gets (view, 1000))
+   {
+ while (String (value.caption()) != String (view) 
+++value != PickView::views::Category) ; // Do nothing
+   }
+  delete f;
+}
+  log (LOG_PLAIN)  Loaded last view setting:   value.caption()  endLog;
+}
+
+void 
+ViewSetting::save()
+{
+  io_stream *f = UserSettings::Instance().settingFileForSave(last-view);
+  if (f)
+{
+  f-write ((String(value.caption()) + \n).c_str(),
+strlen (value.caption()) + 1);
+  delete f;
+  log (LOG_PLAIN)  Saved last view setting:   value.caption()  
endLog;
+}
+}
+
 ChooserPage::ChooserPage ()
 {
   sizeProcessor.AddControlInfo (ChooserControlsInfo);
@@ -92,11 +127,11 @@ ChooserPage::createListview ()
   if (!chooser-Create(this, WS_CHILD | WS_HSCROLL | WS_VSCROLL | 
WS_VISIBLE,r))
 // TODO throw exception
 exit (11);
-  chooser-init(PickView::views::Category);
+  chooser-init(ChosenView.value);
   chooser-Show(SW_SHOW);
 
   chooser-defaultTrust (TRUST_CURR);
-  chooser-setViewMode (PickView::views::Category);
+  chooser-setViewMode (ChosenView.value);
   if (!SetDlgItemText (GetHWND (), IDC_CHOOSE_VIEWCAPTION, 
chooser-mode_caption ()))
 log (LOG_BABBLE)  Failed to set View button caption %ld  
 GetLastError ()  endLog;
@@ -193,6 +228,10 @@ ChooserPage::OnNext ()
   logResults();
 #endif
 
+  ChosenView.value = PickView::views::Category;
+  while (String (ChosenView.value.caption()) != String 
(chooser-mode_caption()) 
+++ChosenView.value != PickView::views::Category) ; // Do nothing
+
   PrereqChecker p;
   if (p.isMet ())
 {


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] setup: site.cc: dot[3] may not be valid.

2005-11-11 Thread Bas van Gompel
Op Tue, 25 Oct 2005 01:42:56 +0200 (MET DST) schreef Bas van Gompel
in n2m-g.djjiq9.3vsgglv.1atbuzzy-box.bavag:
[...]

:   * site.cc (site_list_type::init): Avoid reading past end of
:   string.

Ping.

[...]


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: RFC: [ITP] Installation Profiles packages

2005-11-09 Thread Bas van Gompel
Op Wed, 9 Nov 2005 17:21:28 +0100 schreef Corinna Vinschen
in 20051109162128.GA29765atcalimero.vinschen.de:
[...]
:  Which reminds me... isn't there a way that setup could store the latest
:  view of the chooser window the user has selected?  For instance, in
:  almost all cases I'd like to see the Partial view, not the Category
:  view.  Can storing the last view be added easily?

It doesn't look hard... I've partly done it. If no-one starts jumping
up and down saying ``Let me!'', I'll finish it.


L8r,

Buzz. [What about my other setup-patches? (I tested them. They WFM.)]
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] Setup: Warn about dropped mirrors.

2005-11-08 Thread Bas van Gompel
Op Wed,  2 Nov 2005 22:29:10 +0100 (MET) schreef Bas van Gompel
in n2m-g.dkbctp.3vv3gvj.1atbuzzy-box.bavag:
:  Op Wed, 19 Oct 2005 17:17:15 -0400 (EDT) schreef Igor Pechtchanski
[Using cached mirror-list]

:  I didn't add the info to last-mirror, because that would make for more
:  needlesly complicated code (IMO). I do add a comment to the newly
:  written mirrors-lst file, though.

[...]
:  --- setup/site.cc14 Oct 2005 04:23:14 -  2.40
:  +++ setup/site.cc2 Nov 2005 20:11:16 -
[...]
:  @@ -393,8 +575,16 @@ long
:   SitePage::OnNext ()
:   {
: HWND h = GetHWND ();
:  +  int cache_action;

Ouch, I missed a path through there which might leave cache_action
uninitialized. Therefore please apply following patch after this one.


--- setup/site.cc   2 Nov 2005 20:11:16 -
+++ setup/site.cc   8 Nov 2005 20:11:00 -
@@ -575,7 +575,7 @@ long
 SitePage::OnNext ()
 {
   HWND h = GetHWND ();
-  int cache_action;
+  int cache_action = CACHE_ACCEPT_NOWARN;
 
   save_dialog (h);


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


{Patch} Setup: Tell where we're downloading from.

2005-11-08 Thread Bas van Gompel
Hi,

Here is a patch to make setup tell where files are actually being
downloaded from.


ChangeLog-entry: (Please fix the at.)


2005-11-08  Bas van Gompel  patch-cygsup.buzzatbavag.tmfweb.nl

* geturl.cc (init_dialog): Tell where file is downloaded from.


--- setup/geturl.cc 5 May 2005 22:48:35 -   2.25
+++ setup/geturl.cc 8 Nov 2005 20:10:35 -
@@ -66,16 +66,29 @@ init_dialog (String const url, int leng
   if (is_local_install)
 return;
 
+  int n = 0;
+  char *buf;
+  char *first_component = buf = new_cstr_char_array (url);
+  for (char *ch = first_component; *ch  n  3 ; ch++)
+if (*ch == '/')
+  {
+   if (++n == 2)
+ first_component = ch + 1;
+   if (n == 3)
+ *ch = 0;
+  }
   char const *last_component = url.c_str();
   for (const char *ch = last_component; *ch; ch++)
 if (*ch == '/' || *ch == '\\' || *ch == ':')
   last_component = ch + 1;
   max_bytes = length;
   Progress.SetText1(Downloading...);
-  Progress.SetText2(last_component);
+  Progress.SetText2((String (last_component) +  from  + 
first_component).c_str());
   Progress.SetText3(Connecting...);
   Progress.SetBar1(0);
   start_tics = GetTickCount ();
+
+  delete [] buf;
 }
 
 
L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


[Patch] Setup: Warn about dropped mirrors. (was: Re: Multiple pending setup patches)

2005-11-02 Thread Bas van Gompel
Op Wed, 19 Oct 2005 17:17:15 -0400 (EDT) schreef Igor Pechtchanski
in Pine.GSO.4.63.0510191712430.409atslinky.cs.nyu.edu:
:  On Tue, 18 Oct 2005, Bas Buzz van Gompel wrote:
:
:  Op Tue, 18 Oct 2005 01:35:12 -0400 (EDT) schreef Igor Pechtchanski:
:  :  On Tue, 18 Oct 2005, Buzz wrote:
: 
:  :  Op Sun, 16 Oct 2005 17:30:34 -0400 (EDT) schreef Igor Pechtchanski:
:  [Mirror manually added or stale.]

:  :  b) the cached mirror-list is overwritten every time a successful
:  :  connection is established with sourceware.org,
: 
:  That could change. (Or the stale mirrors might get appended.)
:
:  SHTDI.  PTC.

I did. I took this approach.

[...]
:  If there's interest, I'm willing to look into the source. (It may take
:  me a while. The last time I looked at it is way back.)
:
:  There's always interest for setup improvements.  But, as I said before,
:  I've given it some thought, and it's my opinion that this information
:  belongs in last-mirror rather than mirror-list.  You are, of course,
:  welcome to take any approach you deem necessary.

I didn't add the info to last-mirror, because that would make for more
needlesly complicated code (IMO). I do add a comment to the newly
written mirrors-lst file, though.


ChangeLog-entry: (please fix the at.)

2005-11-02  Bas van Gompel  patch-cygsup.buzzatbavag.tmfweb.nl

* res.rc (IDD_DROPPED): New dialog.
* resource.h (IDD_DROPPED): New dialog-id.
(IDC_DROP_MIRRORS, IDC_DROP_NOWARN): New control-ids.
* site.cc (site_list_type::init, site_list_type::site_list_type):
Change to four parameter form.
(load_site_list): New function, broken out of get_site_list.
Support four-parameter site_list_type.
(get_site_list): Break out load_site_list. Move reading cache
forward. Don't write new cache. Set flags to record cache state.
Load both all_site_list and cached_site_list.
(SiteSetting::registerSavedSite): Use four-parameter site_list_type.
(drop_proc, check_dropped_mirrors, save_cache_file): New functions.
(SitePage::OnNext): Check for dropped mirrors and save cache as
appropriate.
* site.h (site_list_type::init, site_list_type::site_list_type):
Change to four parameter form.
(site_list_type): Add servername, continent and location members.


Index: setup/res.rc
===
RCS file: /cvs/cygwin-apps/setup/res.rc,v
retrieving revision 2.67
diff -u -p -r2.67 res.rc
--- setup/res.rc9 Sep 2005 19:52:51 -   2.67
+++ setup/res.rc2 Nov 2005 20:10:16 -
@@ -356,6 +356,32 @@ BEGIN
 
 END
 
+IDD_DROPPED DIALOG DISCARDABLE  0, 0, 317, 142
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION Cygwin Setup - Use dropped mirrors?
+FONT 8, MS Shell Dlg
+BEGIN
+LTEXT   Warning:,IDC_STATIC,7,8,40,8
+LTEXT   One or more mirrors you have selected is/are not on the
+list of official Cygwin mirrors any more. 
+It/They may be out of date or missing some packages.\n
+This affects the following mirror(s):,
+IDC_STATIC,47,8,263,32
+EDITTEXTIDC_DROP_MIRRORS,7,40,303,40,WS_VSCROLL | WS_HSCROLL |
+ES_LEFT | ES_MULTILINE | ES_READONLY | ES_AUTOHSCROLL |
+ES_AUTOVSCROLL
+LTEXT   If you experience installation problems consider trying 
+official mirrors only.\n\n
+Do you want to continue, using this/these mirror(s)?,
+IDC_STATIC,7,88,303,24
+CONTROL Don't warn me about this/these mirror(s) again,
+IDC_DROP_NOWARN,Button,BS_AUTOCHECKBOX | WS_TABSTOP,
+7,120,213,15
+PUSHBUTTON  Yes,IDYES,220,120,45,15
+DEFPUSHBUTTON   No,IDNO,265,120,45,15
+
+END
+
 /
 //
 // Manifest
Index: setup/resource.h
===
RCS file: /cvs/cygwin-apps/setup/resource.h,v
retrieving revision 2.32
diff -u -p -r2.32 resource.h
--- setup/resource.h9 Sep 2005 19:52:51 -   2.32
+++ setup/resource.h2 Nov 2005 20:10:17 -
@@ -55,6 +55,7 @@
 #define IDD_VIRUS 218
 #define IDD_DESKTOP   219
 #define IDD_PREREQ220
+#define IDD_DROPPED   221
 
 // Bitmaps
 
@@ -152,3 +153,5 @@
 #define IDC_PREREQ_TEXT   576
 #define IDC_PREREQ_EDIT   577
 #define IDC_PREREQ_CHECK  578
+#define IDC_DROP_MIRRORS  579
+#define IDC_DROP_NOWARN   580
Index: setup/site.cc
===
RCS file: /cvs/cygwin-apps/setup/site.cc,v
retrieving revision 2.40
diff -u -p -r2.40

[Patch] setup: site.cc: dot[3] may not be valid.

2005-10-24 Thread Bas van Gompel
Hi,

While looking at site.cc I noticed a check where dot[3] might
point past the end of the allocated string. this may cause false
matches or even a segfault. I suggest following:


2005-10-24  Bas van Gompel  [EMAIL PROTECTED]

* site.cc (site_list_type::init): Avoid reading past end of
string.


--- setup/site.cc   14 Oct 2005 04:23:14 -  2.40
+++ setup/site.cc   24 Oct 2005 18:05:14 -
@@ -122,7 +122,7 @@ site_list_type::init (String const newu
   if (*dot == '.' || *dot == '/')
{
  char *sp;
- if (dot[3] == 0)
+ if (strlen (dot) == 3)
*dp++ = '~';/* sort .com/.edu/.org together */
  for (sp = dot + 1; *sp  *sp != '.'  *sp != '/';)
*dp++ = *sp++;


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: Where is documentation on bash wait?

2005-10-16 Thread Bas van Gompel
Op Sat, 15 Oct 2005 22:01:26 -0600 schreef Eric Blake
in [EMAIL PROTECTED]:
:  According to Buzz on 10/15/2005 9:46 PM:
[(possibly stale) bash.1 about somewhere.]

:  Hmm, I do have /usr/local/man on my manpath, and it did indeed have
:  man1/bash.1, but I don't know if that affected things.

I don't think so, as long bash_builins.1.gz didn't have the dirname in
the .so.

:  I'm curious how that's gonna work. My ``man'', after i've edited
:  bash_builtins.1(.gz) to mention man1/bash.1.gz me, says:
: 
:  | man1/bash.1.gz:1: warning: can't find character with input code 6
:
:  It seems like man can cope with a .so that points to a .gz if that is the
:  only line, but has problems if the .so points to a .gz when embedded in
:  remaining text.

That appears to be an accurate description of this issue.

:   I'm not familiar enough with man to know what is going on
:  here, but it does seem like a man issue.

Indeed (same here).

:   Meanwhile, I can distribute
:  bash.1 instead of bash.1.gz since that is all that works with the current
:  version of man.

That does WJFFM. Thanks a lot for your efforts.

[...]


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Where is documentation on bash wait?

2005-10-16 Thread Bas van Gompel
Op Sun, 16 Oct 2005 12:11:00 +0200 schreef Dr. Volker Zell
in [EMAIL PROTECTED]:
:  Buzz  writes:

:   I was hoping for ``our'' man-maintainer, being much more knowledgeable
:   about such issues, to be proactive...
:   ...If (s)he isn't I'll look into finding the upstream ``man''-list.

:  I will forward this issues to the upstream man maintainer.

Great, thank you very much.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Where is documentation on bash wait?

2005-10-15 Thread Bas van Gompel
Op Sat, 15 Oct 2005 17:45:06 + schreef Eric Blake
in [EMAIL PROTECTED]:
[What the...]
:  I tried info and man and could not find any information on wait. I want to
:  (using bash)
:
:  Did you try 'man wait'?  That would have pointed you to 'man bash', where

Did /you/ try it?

It complains about not finding bash.1.
Do you have a copy of bash.1 lying around somewhere?

To get this to work as I think it is intended, I need to:

1) gunzip /usr/share/man/man1/bash.1.gz and
   /usr/share/man/man1/bash_builtins.1.gz

2) patch /usr/share/man/man1/bash_builtins.1 like so:
--- /usr/share/man/man1/bash_builtins.1~2005-10-15 21:27:52.0 
+0200
+++ /usr/share/man/man1/bash_builtins.1 2005-10-15 21:44:33.77000 +0200
@@ -10,6 +10,6 @@
 ulimit, umask, unalias, unset, wait \- bash built-in commands, see 
\fBbash\fR(1)
 .SH BASH BUILTIN COMMANDS
 .nr zZ 1
-.so bash.1
+.so man1/bash.1
 .SH SEE ALSO
 bash(1), sh(1)

3) re-gzip /usr/share/man/man1/bash_builtins.1, but not bash.1


For some reason it doesn't work with a gzipped bash.1.
(A bug in man? It looks like it doesn't gunzip in this case.)

[...]


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: [patch] Don't append extra NUL to registry-strings.

2005-09-03 Thread Bas van Gompel
Op Mon, 29 Aug 2005 10:21:19 +0200 schreef Corinna Vinschen
in [EMAIL PROTECTED]:
:  On Aug 28 22:49, Bas van Gompel wrote:
:  Hi,
: 
:  When RegQueryValueEx returns a string-type, the final NUL is included
:  in the returned size. I suggest dropping it.
:
:  I see what you're up to, but there would be two reasons not to drop the
:  trailing \0.  First, the \0 is part of the file content in a way.  

Don't file-systems have their own way of reporting ends (EOF)?

:  Second, it would break backward compatibility with applications using
:  /proc/registry.  This latter point concerns me a bit, though it can
:  naturally only affect Cygwin applications.

Hmmm... :( ... possibly the CYGWIN-environment-variable might have room
for something like ``registry:raw,data'' (default, for  now) to mean
``as is'', and other options might cause various levels of verbosity/
interpretation... (I know SHTDI, but would P be TC for such a thing?)


L8r,
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] readdir_r: fix sense of error-test.

2005-08-28 Thread Bas van Gompel
Op Sun, 28 Aug 2005 13:16:44 -0400 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Sat, Aug 27, 2005 at 09:58:47PM +0200, Bas van Gompel wrote:
:  If you want to see why this really does not require a copyright-
:  assignment, view the diff with testsuite/winsup.api/ltp/readdir01.c,
:  and remove all parts which are just comments.
:
:   Btw, you can't just grab someone else's source code and put your
:  own copyright on it.

Right. Any suggestion as to how better approach this?

[TITT[TLM]L as you prefer.]


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [ITP] GnuTLS, Tiny ASN.1, OpenCDK

2005-08-27 Thread Bas van Gompel
Op Mon, 22 Aug 2005 12:09:21 +0200 schreef Gerrit P. Haase
in [EMAIL PROTECTED]:
:  Bas van Gompel wrote:
:
:  Op Sun, 21 Aug 2005 09:11:14 +0200 schreef Gerrit P. Haase
:  in [EMAIL PROTECTED]:
:  [...]
: 
:  :  libgnutls11 setup.hint:
:  [...]
:  :  requires: cygwin libgnutls11 libgpg-error libgcrypt libtasn1 libopencdk8 
libiconv2 libintl3 zlib
: 
:  This requires itself?
:
:  It was a copy passte error on my side.  I hope I got it right before
:  uploading ;)

No, you didn't. Sorry.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [ITP] GnuTLS, Tiny ASN.1, OpenCDK

2005-08-21 Thread Bas van Gompel
Op Sun, 21 Aug 2005 09:11:14 +0200 schreef Gerrit P. Haase
in [EMAIL PROTECTED]:
[...]

:  libgnutls11 setup.hint:
[...]
:  requires: cygwin libgnutls11 libgpg-error libgcrypt libtasn1 libopencdk8 
libiconv2 libintl3 zlib

This requires itself?


[...]

:  opencdk setup.hint:

Lacks a ``Category'' line, causing it to end up in ``Misc''.

[...]
:  libopencdk8 setup.hint:

Ditto.


Great work, otherwise. Thanks.


L8r,
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Latest openssl tickles bug on win95?

2005-07-30 Thread Bas van Gompel
Hi,

I'm sorry I can't supply more detail...

Lately, I've been noticing, on w95, when I'm closing a shell which
(WAG) at anytime used a program compiled against latest openssl
(0.9.8-2), the console won't disappear. Sysinternals' process-
explorer and `ps -W` show stubs of the ssl-using program (ssh, lynx)
remaining (some devices, acquired mutexes and threads remain in
procexp's handle-view).

`ps` and `top` don't show the broken processes. If occasionally one
can attach a strace to one of them, it just sits there.

If, one afterwards tries to reboot the system (even after killing
winoldap). a hard reset (and scandisk) is required.


The reason I think openssl is involved is this: When one downgrades
openssh to the '4.1p1-1' version (which uses openssl097) the problem
doesn't happen on ssh-usage.


If there is anything I can do to help narrow this down further, let me
know.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re
Cygwin Configuration Diagnostics
Current System Time: Sun Jul 31 06:29:00 2005

Windows 95 Ver 4.0 Build 1212 

Path:   k:\cygwin\local\users\Buzz\bin
d:\cygwin\bin
c:\WINDOWS
c:\WINDOWS\COMMAND
c:\DOS
c:\util
c:\util\BVG
k:\cygwin\local\BIN
g:\PROGRAMS\NETWOR~1\PGP
g:\PROGRAMS\ULTRAE~1
g:\MASM32\BIN

Output from d:\cygwin\bin\id.exe (nontsec)
UID: 501(Buzz)   GID: 544(admins)
544(admins)

Output from d:\cygwin\bin\id.exe (ntsec)
UID: 501(Buzz)   GID: 544(admins)
544(admins)

SysDir: C:\WINDOWS\SYSTEM
WinDir: C:\WINDOWS

USER = `Buzz'
PWD = `/j/Programs/Hamster/Mails/Mail.Out'
HOME = `/home/Buzz'

NNTPSERVER = `buzzy-box.bavag'
TERM = `cygwin'
CMDLINE = `WIN'
WINDIR = `C:\WINDOWS'
SEARCHPATHS = `/ /c /d /e /f /g /h /i /j /k /l'
CVSROOT = `/home/buzz/cvs-repo'
TEMP = `/h/temp'
QTJAVA = `C:\WINDOWS\SYSTEM\QTJava.zip'
HOST_SYSTEM_TYPE = `CygWin'
EDITOR = `vim'
FDRV = `c:\Util\BvG\'
WINBOOTDIR = `C:\WINDOWS'
SHLVL = `1'
BLASTER = `A240 I2 D1'
PROMPT = `$b$l$p$g$b '
COMSPEC = `C:\COMMAND.COM'
TMP = `/h/tmp'
CVS_RSH = `ssh'
GMT_TZ = `-2'
CLASSPATH = `C:\WINDOWS\SYSTEM\QTJava.zip;'
LOCATE_DB = `/d/cygwin/usr/var/locatedb'
_ = `/usr/bin/cygcheck'
SYSTEMROOT = `C:\WINDOWS'
POSIXLY_CORRECT = `1'

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start
 Menu\Programma's\Cygnus Solutions
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start
 Menu\Programma's\Cygnus Solutions\Menu
  (default) = (unsupported type)
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start
 Menu\Programs\Cygnus Solutions
  (default) = (unsupported type)
HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/cygdrive'
  cygdrive flags = 0x0022
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\00
  (default) = `\\.\tape1:'
  unix = `/dev/st1'
  fbinary = 0x
  fsilent = 0x0001
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\01
  (default) = `\\.\tape0:'
  unix = `/dev/st0'
  fbinary = 0x
  fsilent = 0x0001
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\02
  (default) = `\\.\b:'
  unix = `/dev/fd1'
  fbinary = 0x
  fsilent = 0x0001
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\03
  (default) = `\\.\a:'
  unix = `/dev/fd0'
  fbinary = 0x
  fsilent = 0x0001
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\04
  (default) = `C:'
  unix = `/'
  fbinary = 0x
  fsilent = 0x
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/cygdrive'
  cygdrive flags = 0x0022
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/local
  (default) = `k:\cygwin\local'
  flags = 0x000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/lib
  (default) = 0x000a
  native = `k:\cygwin\lib'
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/z
  (default) = `z:'
  flags = 0x000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/c
  (default) = `c:'
  flags = 0x000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/d
  (default) = `d:'
  flags = 0x000a

Re: update-alternatives

2005-06-30 Thread Bas van Gompel
Op Wed, 29 Jun 2005 22:32:17 -0400 (EDT) schreef Igor Pechtchanski
in [EMAIL PROTECTED]:
:  On Thu, 30 Jun 2005, Bas van Gompel wrote:
[...]
:  Op Mon, 27 Jun 2005 00:17:01 -0400 schreef Charles Wilson:
:  :  Bas van Gompel wrote:
:  [Re-adding attribution:]
:  +  Charles Wilson:
[``wrap'' *not* to wrap DLLs.]
:
:  Umm, why not?  I mean, the mechanism for wrapping DLLs is very different
:  than that of wrapping executables (and much more involved), but isn't
:  there a possibility of writing a wrapdll.dll that looks up the name of
:  the DLL in the /etc/alternatives database, dlopen's it, and emulates all
:  of its functions somehow?  ISTR something like this done in my OS class
:  ages ago, but don't recall the exact details.  Am I misremembering?

I Don't see how this could work. ``Statically'' linked, the wrapper's
``exports''-table would be consulted, would it not?

I can imagine building a custom wrapper-dll for each wrappee, using an
autoload-like method, but don't intend to investigate further, for now.

Wouldn't this kind of thing be easier to address from the context of
``libtool'', in each DLL's build-system?

So far, I can envision this working (reasonably) only when making
gcc/binutils a run-time requirement of ``wrap'', or having a topheavy
(dll-analyzing/building) installer, both of which I'd prefer not to.

[how ``alternatives'' works]

:  Yes. I have since seen that ``alternatives'' uses a pure ``C'' approach,
:  so my shell-script installers might not be appropriate. It should not be
:  hard for ``alternatives'' to copy the wrapper bin-file itself, however.
:
:  I wonder if these could be real symlink approximations, i.e., the path
:  to the executable to run would sit in some static string at a known
:  offset, and the installer could simply write into the executable at that
:  offset?  Or is this too much?

I guess this could be done... Nice idea. I will look into it.
Thanks.
There is probably a CRC to contend with somewhere.

:  :  I'm not sure it's worth your time to do so right now.  I think the
:  :  /bin/ash vs. /bin/bash thing will be resolved some other way, and that's
:  :  the only pressing need for an MSWin-friendly symlink-wrap-thingy from
:  :  the perspective of update-alternatives.
: 
:  I did since however write a ``wrap-alternative'' executable, which uses
:  execv... Not having to read a file makes it even simpler than the
:  ``wrap'' executable. :)
:
:  That actually sounds like what I mentioned above...

It isn't, however. The link is read from ${sysconfdir} + /alternatives/ +
basename(argv[0])''

[FHS-issues]
:  Preliminary binary package file-list:
: 
:  /usr/bin/wrap
:  /usr/bin/wrap-alternative
:  /usr/lib/wrap/wrap.bin
:  /usr/lib/wrap/wrap-alternative.bin
[...]

:  Any comments?)
:
:  Looks good.  You could also provide a create-wrap script/program, that
:  would have ln -s semantics and create a wrapped executable (and it could
:  also check that the thing you're wrapping *is* an executable, and not,
:  say, a DLL).  That way, if you decide to switch the implementation later,
:  the scripts that create wrapped executables won't have to change.

In the above, /usr/bin/wrap and /usr/bin/wrap-alternative are the
scripts you suggest (No checking for DLLs (or non-executables for that
matter) yet, though). I should rename them I guess. It's confusing
already. create-wrap? install-wrap? mkwrap?

:  HTH,

It does, thanks.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: update-alternatives

2005-06-29 Thread Bas van Gompel
Sorry for the slow reply...

Op Mon, 27 Jun 2005 00:17:01 -0400 schreef Charles Wilson
in [EMAIL PROTECTED]:
:  Bas van Gompel wrote:
[Re-adding attribution:]
+  Charles Wilson:
[...]
:  :  without using execvp().
[...]
:  :  Plus, alternatives itself needs to be smart 
:  :  about when to use a wrap executable, and when to use normal symlinks. 
[...]
:  Certainly. I'd think generally one should only wrap executables.
:  (*and take real special care of dll's.*)
:
:  Yes.

What I meant to say was: ``Special care should be taken *not* to wrap
DLLs, although they appear as executables in the file-system.''

:  :  So, (a) alternatives isn't set up, YET, to use any sort of wrap prog, 
:  :  and (b) when it is, it probably shouldn't use your wrap, directly. 
[how ``alternatives'' works]

:  update-alternatives manages the symlinks in /usr/bin AND the symlinks in 
:  /etc/alternatives/.  Under a wrap scenario, update-alternatives would 
:  need to know (sometimes) to make the item in /usr/bin be a wrap 
:  executable, pointing to the appropriate /etc/alternatives/ target 
:  symlink, which in turns points back to /usr/bin/...

Yes. I have since seen that ``alternatives'' uses a pure ``C'' approach,
so my shell-script installers might not be appropriate. It should not be
hard for ``alternatives'' to copy the wrapper bin-file itself, however.

:  Your wrap program seems intended for a different audience: the end user 
:  -- who might copy the orginal exe away to some other directory, and 
:  put the wrap program in the original location -- thus leading to DLL 
:  search issues, as you say.

It's more intended for when a package uses a symlink to an executable,
and you want to use the program from outside of cygwin.

(e.g. unison.exe being replaced with a(n ``alternatives'') symlink, as
multiple versions became supported or to have a ``rbash'', ``egrep'',
``fgrep'' etc. which can be invoked from windows, without having
to resort to hardlinks/copying.)

I never intended to say anything about DLL search issues. :]

[...]

:  I will look into creating a (new) executable to do what
:  ``alternatives'' wants, as soon as I find out what format the
:  links in /etc/alternatives take.
:
:  I'm not sure it's worth your time to do so right now.  I think the 
:  /bin/ash vs. /bin/bash thing will be resolved some other way, and that's 
:  the only pressing need for an MSWin-friendly symlink-wrap-thingy from 
:  the perspective of update-alternatives.

I did since however write a ``wrap-alternative'' executable, which uses
execv... Not having to read a file makes it even simpler than the
``wrap'' executable. :)


When I have resolved FHS-issues...

(I'm going for ${libdir}/wrap/ to store the binaries, ${bindir}/
for the install-scripts, pointerfiles/links go in ${sysconfdir}/wrap
and ${sysconfdir}/alternatives, respectively, for now.


Preliminary binary package file-list:

/usr/bin/wrap
/usr/bin/wrap-alternative
/usr/lib/wrap/wrap.bin
/usr/lib/wrap/wrap-alternative.bin
/usr/share/doc/wrap-1.0/AUTHORS
/usr/share/doc/wrap-1.0/ChangeLog
/usr/share/doc/wrap-1.0/COPYING
/usr/share/doc/wrap-1.0/INSTALL
/usr/share/doc/wrap-1.0/NEWS
/usr/share/doc/wrap-1.0/README
/usr/share/doc/Cygwin/wrap-1.0.README

Any comments?)


...and have thought over info/man-pages, the ITP will follow,


L8r,

Buzz. [If this is too OT do feel free to TITTTL, I read there as well.]

BTW: The ``alternatives'' man-page points to a ``Red Hat'' bugzilla,
and mentions a copyright by them. Is that as should be?
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: update-alternatives

2005-06-26 Thread Bas van Gompel
[I'm reformatting some of your lines, to be able to answer points
individually.]

Op Sun, 26 Jun 2005 19:12:00 -0400 schreef Charles Wilson
in [EMAIL PROTECTED]:
:  Buzz wrote:
[A ``wrap'' executable.]

:  I think it's a neat idea, but I don't think update-alternatives should 
:  use it.  I plan to, eventually, borrow some of the ideas you mention and 
:  integrate them into a similar program distributed as part of the 
:  alternatives package.

I understand, in the long run, st. like that could evolve.

:  The reason I'm planning to do it that way rather 
:  than use your version directly, is because I don't want the 
:  alternatives package to have to manage TWO different databases. 

That makes sense. So let it be a separate package.

:  Further, since the alternatives-wrap program would be a cygwin prog, 
:  it can unwrap chains of symlinks itself and exec the actual target 
:  without using execvp().

When being a cygwin program (as will be proposed) execvp will take care
of that.

:  Plus, alternatives itself needs to be smart 
:  about when to use a wrap executable, and when to use normal symlinks. 
:e.g. scripts should never be the target of a wrap, unless wrap is 
:  smart enough to parse sh-bang headers, and exec(/bin/bash -c 
:  real-target $@).

execvp has no prblems with this. (And, the stripped (-O2) executable
makes only 4096 bytes.)

:  Regardless, sometimes you want alternatives to swap 
:  out man pages and such, and alternatives would definitely need to know 
:  NOT to use a wrap proggie in those cases.

Certainly. I'd think generally one should only wrap executables.
(*and take real special care of dll's.*)

:  So, (a) alternatives isn't set up, YET, to use any sort of wrap prog, 
:  and (b) when it is, it probably shouldn't use your wrap, directly. 

Agreed. You might however be able to get away with just replacing the
top link with ``wrap.exe'', writing '/etc/alternatives/' + $target to
'/etc/wrap/' + basename($source) and having ``wrap'' (execvp) resolve
the symlink in /etc/alternatives (for executables, noting dlls.)

:  Worse, I'll need to come up with some extension to the database language 
:  used in /var/lib/alternatives/*, or add mucho smarts to 
:  update-alternatives, before even considering to use any wrap prog.

One more reason to delegate this to another package.

:  I think your wrap program is a fine tool, and I'd encourage you to ITP 
:  it (or submit it for inclusion within the cygutils package; IMO it's a 
:  good candidate for that).  I just don't think it does, exactly, what the 
:  alternatives package will eventually need.

I'd prefer to keep this as a separate package. (This
functionality can be used in other contexts as well.)

ITP forthcoming. (I'll need to flesh out the README, write a
setup.hint and prepare an announcement...)

I will look into creating a (new) executable to do what
``alternatives'' wants, as soon as I find out what format the
links in /etc/alternatives take.

[I can't seem to download your packages. My local ftp appears to be
borked. For this once, could you mail me your -src file?]


L8r,

Buzz. [What's with the trailing spaces?]
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: update-alternatives

2005-06-20 Thread Bas van Gompel
Op Sun, 19 Jun 2005 16:17:13 -0500 schreef Gary R. Van Sickle
in [EMAIL PROTECTED]:
:  -Original Message-
[...] On Behalf Of Charles Wilson
:  Sent: Saturday, June 18, 2005 3:06 PM

:  It seems there may be a need for a Debian-like 
:  update-alternatives system on cygwin (see the recent thread 
:  on the main list about making /bin/sh be bash instead of 
:  ash).  Also, such a system would be a better approach than my 
:  cobbled-together postinstall scripts for the many new 
:  versions of automake (ditto libpng).
:  [snip]
:
:  On the symlinks issue: 
:
:  Suppose instead of the current shortcut hybrid scheme, and also instead of
:  copying the executables, and also instead of using NT-only hardlinks (which
:  IIUC aren't Unixoid enough to be drop-ins anyway), Somebody wrote a
:  symlink.exe executable that worked sort of like this:

I happen to have a program I call ``wrap''...

:  - A suitable centralized alternatives database would be kept somewhere, with
:  entries of a /bin/ls == /bin/alternatives/actual-ls.exe nature.

It (my ``wrap'') uses files in /etc/wrap/ + basename(argv[0]).

:  - The symlink.exe program would be a one-pager that you copied, under the
:  assumed name of the exe you're trying to symlink.  So, as the /bin/ls.exe
:  executable, it would:

My current wrap.exe is 4096 bytes, after stripping.

:- See that it was executed with the name /bin/ls.exe
:- Look up /bin/ls.exe in the database to find which real executable it
:  should run.

The name of the executable to execute is read from /etc/wrap/ls.

:- spawn() that real executable.

My ``wrap'' uses execvp()...

:  That would solve the can't run it from a windows command line problem,
:  wouldn't it?

Absolutely. (I've been using this for unison for a while now.)

If there is interest in this, I'll happily ``ITP'' it...
Just let me know.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: Ready to begin release cycle?

2005-05-09 Thread Bas van Gompel
Op Sat, 7 May 2005 23:21:31 +0100 schreef Max Bowsher
in [EMAIL PROTECTED]:
[...]
:  Any thoughts on anything additional which ought to go in before the branch?

I sent this before...


2005-05-10  Bas van Gompel  [EMAIL PROTECTED]

* archive.cc (archive::extract_file): Use prefixPath for linktarget
on hardlinks.


diff -u -p -r2.11 archive.cc
--- setup/archive.cc5 May 2005 22:48:34 -   2.11
+++ setup/archive.cc8 May 2005 18:40:31 -
@@ -161,7 +161,7 @@ archive::extract_file (archive * source,
io_stream::remove (destfilename);
int ok =
  io_stream::mklink (destfilename,
- prefixURL + source-linktarget (),
+ prefixURL + prefixPath + source-linktarget (),
 IO_STREAM_HARDLINK);
/* FIXME: check what tar's filelength is set to for hardlinks */
source-skip_file ();


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: create installation using installed.db

2005-05-01 Thread Bas van Gompel
Op Thu, 28 Apr 2005 21:41:26 -0700 schreef Joshua Daniel Franklin
in [EMAIL PROTECTED]:
[...]

:  You particularly want 'mount -m':
:
:  -m, --mount-commands  write mount commands to replace user and
 ^^^
:  system mount points and cygdrive prefixes

Would not ``replicate'' express the intention better, above...

:  (from mount --help or
:  http://www.cygwin.com/cygwin-ug-net/using-utils.html#mount)

...and in the manpage?

[...]


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: one Cygwin file

2005-05-01 Thread Bas van Gompel
Op Fri, 29 Apr 2005 21:39:36 -0700 schreef Brian Dessent
in [EMAIL PROTECTED]:
[...]

:  cygwin web site.  The minimum you will need is everything in category
:  base.

You may also need any packages which those depend on.

Specifically this means you might need following packages which are not
in Base, according to my current local setup.inis:

_update-info-dir
bzip2
cygutils
groff
less
libbz2_1
libcharset1
libiconv
libiconv2
libintl
libintl1
libintl2
libintl3
libpcre
libpcre0
libpopt0
mktemp
texinfo

Maybe these could/should be added to Base?


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: recommendations for 3rd party distributors?

2005-02-17 Thread Bas van Gompel
Op Mon, 14 Feb 2005 10:16:08 -0500 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Mon, Feb 14, 2005 at 09:54:41AM -0500, Dick Repasky wrote:
:  Every so often a query surfaces about cygwin dll version compatibility.
[...]
:  The recommendations are:
: 
:1) Use a distinctly named shared memory area in the cygwin dll.
:   2) Use a distinctly named registry key for storing cygwin file system
:  mount points.
:   3) Identify the origin of the cygwin dll in the cygwin dll.
[...]
:  If you are a 3rd party distributor, you should check for existing
:  installations of the dll.  If the existing version of cygwin DLL is the
:  same or newer than the one you want to use, then notify the user that
:  there is already a version on the system and that you will not be
:  installing a new version.
:
:  Otherwise, install your version in a standard location so that it will
:  survive being upgraded if a user decides to upgrade.
:
:  And, of course, unless this is a distribution which is internal to your
   ^^^
:  organization, remember to offer the user the source code to whatever
   
:  application you're providing to them.

Where did you find this exception? I don't recall seeing it in the GPL.
(I'm a member of the organization of all beings, aren't you as well?)

[...]


L8r,

Buzz. [TITT[TL]L]
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Setup: hardlinks percentages. (+patches)

2005-01-27 Thread Bas van Gompel
Op Thu, 27 Jan 2005 15:06:08 - schreef Max Bowsher
in [EMAIL PROTECTED]:
:  Bas van Gompel wrote:
:  2005-01-07  Bas van Gompel  [EMAIL PROTECTED]
: 
:  * archive.cc (archive::extract_file): Use prefixPath for linktarget
:  on hardlinks.
: 
: 
:  --- setup/archive.cc 25 Dec 2004 23:05:56 - 2.10
:  +++ setup/archive.cc 7 Jan 2005 20:39:42 -
:  @@ -161,7 +161,7 @@ archive::extract_file (archive * source,
:   io_stream::remove (destfilename);
:   int ok =
: io_stream::mklink (destfilename,
:  -   prefixURL + source-linktarget (),
:  +   prefixURL + prefixPath + source-linktarget (),
:IO_STREAM_HARDLINK);
:   /* FIXME: check what tar's filelength is set to for hardlinks */
:   source-skip_file ();
:
:  I agree something is wrong here, but there are the following issues to 
:  consider:

Well, lets consider them, then.

:  A copy/paste of virtually the same code above deals with symlinks. 
:  Presumably that needs fixing too.

That would be wrong. The target for symlinks is stored relative to
their position, or absolute, AIUI.

:  Also, might we need to handle relative and absolute linktarget paths 
:  differently here?

That appears not to be needed. All hardlinks are stored relative to
the top of the archive AFAICT. Links to outside the stored tree are
replaced with copies.

To see how this works, consider the following script and output:

===begin script
#!/bin/sh
cd /tmp
mkdir test
cd test
mkdir outside
echo testfile outside/afile1
echo testfile outside/afile2
mkdir inside
cd inside
echo another testfile afile
ln afile link
ln -s afile slink
ln /tmp/test/inside/afile alink
ln -s /tmp/test/inside/afile salink
ln ../outside/afile1 xlink
ln -s ../outside/afile2 sxlink
ln /tmp/test/outside/afile1 axlink
ln -s /tmp/test/outside/afile2 saxlink
mkdir adir
cd adir
echo yet another testfile afile
ln ../afile link
ln -s ../afile slink
cd ..
ln adir/afile dlink
ln -s adir/afile sdlink
cd ..
ls -Rl
tar -jcf test.tar.bz2 inside
tar -jtvf test.tar.bz2
cd ..
rm -rf test
#!/bin/sh
cd /tmp
mkdir test
cd test
mkdir outside
echo testfile outside/afile
mkdir inside
cd inside
echo another testfile afile
ln afile link
ln -s afile slink
ln /tmp/test/inside/afile alink
ln -s /tmp/test/inside/afile salink
ln ../outside/afile xlink
ln -s ../outside/afile sxlink
ln /tmp/test/outside/afile axlink
ln -s /tmp/test/outside/afile saxlink
mkdir adir
cd adir
echo yet another testfile afile
ln ../afile link
ln -s ../afile slink
cd ..
ln adir/afile dlink
ln -s adir/afile sdlink
cd ..
ls -Rl
tar -jcf test.tar.bz2 inside
tar -jtvf test.tar.bz2
cd ..
rm -rf test

===end script

===atsrt output
.:
total 0
drwxr-xr-x+ 3 Buzz Geen 0 Jan 28 02:19 inside
drwxr-xr-x+ 2 Buzz Geen 0 Jan 28 02:19 outside

./inside:
total 11
drwxr-xr-x+ 2 Buzz Geen  0 Jan 28 02:19 adir
-rw-r--r--  4 Buzz Geen 17 Jan 28 02:19 afile
-rw-r--r--  4 Buzz Geen 17 Jan 28 02:19 alink
-rw-r--r--  3 Buzz Geen  9 Jan 28 02:19 axlink
-rw-r--r--  2 Buzz Geen 21 Jan 28 02:19 dlink
-rw-r--r--  4 Buzz Geen 17 Jan 28 02:19 link
lrwxrwxrwx  1 Buzz Geen 22 Jan 28 02:19 salink - /tmp/test/inside/afile
lrwxrwxrwx  1 Buzz Geen 24 Jan 28 02:19 saxlink - /tmp/test/outside/afile2
lrwxrwxrwx  1 Buzz Geen 10 Jan 28 02:19 sdlink - adir/afile
lrwxrwxrwx  1 Buzz Geen  5 Jan 28 02:19 slink - afile
lrwxrwxrwx  1 Buzz Geen 17 Jan 28 02:19 sxlink - ../outside/afile2
-rw-r--r--  3 Buzz Geen  9 Jan 28 02:19 xlink

./inside/adir:
total 3
-rw-r--r--  2 Buzz Geen 21 Jan 28 02:19 afile
-rw-r--r--  4 Buzz Geen 17 Jan 28 02:19 link
lrwxrwxrwx  1 Buzz Geen  8 Jan 28 02:19 slink - ../afile

./outside:
total 2
-rw-r--r--  3 Buzz Geen 9 Jan 28 02:19 afile1
-rw-r--r--  1 Buzz Geen 9 Jan 28 02:19 afile2
drwxr-xr-x Buzz/Geen 0 2005-01-28 02:19:05 inside/
drwxr-xr-x Buzz/Geen 0 2005-01-28 02:19:05 inside/adir/
-rw-r--r-- Buzz/Geen21 2005-01-28 02:19:05 inside/adir/afile
-rw-r--r-- Buzz/Geen17 2005-01-28 02:19:05 inside/adir/link
lrwxrwxrwx Buzz/Geen 0 2005-01-28 02:19:05 inside/adir/slink - ../afile
-rw-r--r-- Buzz/Geen 0 2005-01-28 02:19:05 inside/afile link to 
inside/adir/link
-rw-r--r-- Buzz/Geen 0 2005-01-28 02:19:05 inside/alink link to 
inside/adir/link
-rw-r--r-- Buzz/Geen 9 2005-01-28 02:19:05 inside/axlink
-rw-r--r-- Buzz/Geen 0 2005-01-28 02:19:05 inside/dlink link to 
inside/adir/afile
-rw-r--r-- Buzz/Geen 0 2005-01-28 02:19:05 inside/link link to 
inside/adir/link
lrwxrwxrwx Buzz/Geen 0 2005-01-28 02:19:05 inside/salink - 
/tmp/test/inside/afile
lrwxrwxrwx Buzz/Geen 0 2005-01-28 02:19:05 inside/saxlink - 
/tmp/test/outside/afile2
lrwxrwxrwx Buzz/Geen 0 2005-01-28 02:19:05 inside/sdlink - adir/afile
lrwxrwxrwx Buzz/Geen 0 2005-01-28 02:19:05 inside/slink - afile
lrwxrwxrwx Buzz/Geen 0 2005-01-28 02:19:05 inside/sxlink - 
../outside/afile2
-rw-r--r-- Buzz/Geen 0 2005-01-28 02:19:05 inside/xlink link to 
inside/axlink

===end output

[...]


L8r,

Buzz

Re: Setup: hardlinks percentages. (+patches)

2005-01-08 Thread Bas van Gompel
Op Sat, 08 Jan 2005 21:04:44 +0100 schreef Reini Urban
in [EMAIL PROTECTED]:
:  Bas van Gompel schrieb:
:  Two little patches:
:
:  Maybe you want to add them to 
:  http://sources.redhat.com/bugzilla/enter_bug.cgi?product=cygwin
:  also.

No, not really.

This (``cygwin-apps'') is still the main bug-reporting interface for
cygwin-setup, IIUC?


TUVM, KUTGW (Max, Reini, everybody), L8r,

Buzz [prefers E-mail to most web-interfaces]. YMMV, TITTTL.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [ITP] cvsutils

2005-01-08 Thread Bas van Gompel
Op Sat, 8 Jan 2005 10:53:41 +0100 schreef Corinna Vinschen
in [EMAIL PROTECTED]:
:  On Jan  7 07:31, Eric Blake wrote:
:  I would like to add cvsutils to my growing list of maintained packages.
:  Debian lists it as stable, packages.debian.org/stable/devel/cvsutils.
[...]
:  This is useful.  Thanks for providing.

AOL

:  +1 from me.

Voting isn't needed AFAICS. (Debian has it, if OP is not lying. :))


:  Packaging looks good to me.

Are you GTGing it?


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] cygcheck: eprintf + display_error: Do /something/.

2004-12-17 Thread Bas van Gompel
Op Fri, 17 Dec 2004 01:19:32 -0500 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Fri, Dec 17, 2004 at 04:33:10AM +0100, Bas van Gompel wrote:
[...]
:  * cygcheck.cc (eprintf): Flush stdout before, and stderr after output,
:  when stdout and stderr both don't refer to ttys.
:  (display_error): Use eprintf.
:
:   Ok.  I don't see any reason to check for ttyness, then.  If this is an issue
:  then lets just flush stdout prior to doing anything with stderr.  Flushing
:  stderr should always be a no-op.

It isn't (a no-op). (See the snippet in my previous mail.) Is this a
difference between cygwin and mingw, maybe?

:  Or, we could just make stdout always unbuffered.

That would force unbuffered output also when there is no error...

Following is the minimal patch which still works for me.


2004-12-17  Bas van Gompel  [EMAIL PROTECTED]

* cygcheck.cc (eprintf): Flush stdout before, and stderr after output.
(display_error): Use eprintf.


--- cygcheck.cc 18 Nov 2004 05:20:23 -  1.64
+++ cygcheck.cc 17 Dec 2004 08:38:06 -
@@ -9,6 +9,7 @@
details. */
 
 #include stdio.h
+#include unistd.h
 #include stdlib.h
 #include string.h
 #include sys/time.h
@@ -102,9 +103,15 @@ void
 eprintf (const char *format, ...)
 {
   va_list ap;
+
+  fflush (stdout);
+
   va_start (ap, format);
   vfprintf (stderr, format, ap);
   va_end (ap);
+
+  fflush (stderr);
+
 }
 
 /*
@@ -114,10 +121,10 @@ static int
 display_error (const char *name, bool show_error = true, bool print_failed = 
true)
 {
   if (show_error)
-fprintf (stderr, cygcheck: %s%s: %lu\n, name,
+eprintf (cygcheck: %s%s: %lu\n, name,
print_failed ?  failed : , GetLastError ());
   else
-fprintf (stderr, cygcheck: %s%s\n, name,
+eprintf (cygcheck: %s%s\n, name,
print_failed ?  failed : );
   return 1;
 }


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] cygcheck: eprintf + display_error: Do /something/.

2004-12-16 Thread Bas van Gompel
Op Thu, 16 Dec 2004 21:02:05 -0500 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Fri, Dec 17, 2004 at 02:04:40AM +0100, Buzz wrote:
:  Here is another attempt at making eprintf a usable/used function in
:  cygcheck. It this time just flushes stdout and stderr before/after
:  output on stderr, when both (stdout and stderr) are ttys.

[...]

:  I'm still not sure what you're hoping to accomplish with this.  I haven't
:  seen any problems with flushing in cygcheck and I wouldn't expect any
:  since the flushing should be automatic if stdout is a tty.

I seem to be making a mess here... The point is to have the error-messages
appear at about the appropriate point in the output, not bunched together
near the beginning or end. Here is another attempt. This time, do the
flushing when both are ttys or neither are.

(If you know of a simple test to find out if the two are identical,
that would be preferable. No test at all is also an option...)


ChangeLog-entry:

2004-12-17  Bas van Gompel  [EMAIL PROTECTED]

* cygcheck.cc (eprintf): Flush stdout before, and stderr after output,
when stdout and stderr both refer to tty's, or both don't.
(display_error): Use eprintf.


--- src/winsup/utils/cygcheck.cc18 Nov 2004 05:20:23 -  1.64
+++ src/winsup/utils/cygcheck.cc17 Dec 2004 02:45:43 -
@@ -9,6 +9,7 @@
details. */
 
 #include stdio.h
+#include unistd.h
 #include stdlib.h
 #include string.h
 #include sys/time.h
@@ -102,9 +103,16 @@ void
 eprintf (const char *format, ...)
 {
   va_list ap;
+
+  if (isatty (fileno (stdout)) == isatty (fileno (stderr)))
+fflush (stdout);
+
   va_start (ap, format);
   vfprintf (stderr, format, ap);
   va_end (ap);
+
+  if (isatty (fileno (stdout)) == isatty (fileno (stderr)))
+fflush (stderr);
 }
 
 /*
@@ -114,10 +122,10 @@ static int
 display_error (const char *name, bool show_error = true, bool print_failed = 
true)
 {
   if (show_error)
-fprintf (stderr, cygcheck: %s%s: %lu\n, name,
+eprintf (cygcheck: %s%s: %lu\n, name,
print_failed ?  failed : , GetLastError ());
   else
-fprintf (stderr, cygcheck: %s%s\n, name,
+eprintf (cygcheck: %s%s\n, name,
print_failed ?  failed : );
   return 1;
 }


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] cygcheck: eprintf + display_error: Do /something/.

2004-12-16 Thread Bas van Gompel
Op Thu, 16 Dec 2004 21:56:07 -0500 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Fri, Dec 17, 2004 at 03:51:47AM +0100, Bas van Gompel wrote:

[...]

:  I seem to be making a mess here... The point is to have the error-messages
:  appear at about the appropriate point in the output, not bunched together
:  near the beginning or end. Here is another attempt. This time, do the
:  flushing when both are ttys or neither are.
:
:   I still don't see the point.  There is no need to do explicit flushes if
:  both stdout and stderr are ttys.  In the case of stdout the flush should
:  occur every time there's a newline.  In the case of stderr, the flush
:  should happen after every write.

So, the test can exclude the case where both are ttys. (Did I say I was
making a mess?) Here is a sample of ``cygcheck -s -v -r cygcheck.out
21'', when some (network) drives can not be read:


...
zip 2.3-6
zlib1.2.2-1
zsh 4.2.0-2
Use -h to see help about each section
cygcheck: dump_sysinfo: GetVolumeInformation() failed: 5
cygcheck: dump_sysinfo: GetVolumeInformation() failed: 5


Another version of the ChangeLog-entry/patch:

2004-12-17  Bas van Gompel  [EMAIL PROTECTED]

* cygcheck.cc (eprintf): Flush stdout before, and stderr after output,
when stdout and stderr both don't refer to ttys.
(display_error): Use eprintf.


--- src/winsup/utils/cygcheck.cc18 Nov 2004 05:20:23 -  1.64
+++ src/winsup/utils/cygcheck.cc17 Dec 2004 02:45:43 -
@@ -9,6 +9,7 @@
details. */
 
 #include stdio.h
+#include unistd.h
 #include stdlib.h
 #include string.h
 #include sys/time.h
@@ -102,9 +103,16 @@ void
 eprintf (const char *format, ...)
 {
   va_list ap;
+
+  if (!isatty (fileno (stdout))  !isatty (fileno (stderr)))
+fflush (stdout);
+
   va_start (ap, format);
   vfprintf (stderr, format, ap);
   va_end (ap);
+
+  if (!isatty (fileno (stdout))  !isatty (fileno (stderr)))
+fflush (stderr);
 }
 
 /*
@@ -114,10 +122,10 @@ static int
 display_error (const char *name, bool show_error = true, bool print_failed = 
true)
 {
   if (show_error)
-fprintf (stderr, cygcheck: %s%s: %lu\n, name,
+eprintf (cygcheck: %s%s: %lu\n, name,
print_failed ?  failed : , GetLastError ());
   else
-fprintf (stderr, cygcheck: %s%s\n, name,
+eprintf (cygcheck: %s%s\n, name,
print_failed ?  failed : );
   return 1;
 }


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] fhandler.cc (pust_readahead): end-condition off.

2004-12-11 Thread Bas van Gompel
Op Sat, 11 Dec 2004 09:53:19 +0100 schreef Corinna Vinschen
in [EMAIL PROTECTED]:
:  On Dec  6 02:45, Bas van Gompel wrote:
[...]
:  * fhandler.cc (fhandler_base::puts_readahead): Fix end-condition.
:  Yes, that looks better.  I'd say the patch is correct.  Please apply.

Thanks, Done.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] fhandler.cc (pust_readahead): end-condition off.

2004-12-06 Thread Bas van Gompel
Op Mon, 6 Dec 2004 10:16:19 -0500 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Mon, Dec 06, 2004 at 02:45:10AM +0100, Bas van Gompel wrote:
[...]

:  * fhandler.cc (fhandler_base::puts_readahead): Fix end-condition.
:
:   This patch changes things so that len characters are always output if
:  len is != -1.  It has been a while since I worked on this code but it's
:  not clear that that is correct.

I found following clues:


C1:
`cvs annotate -r1.16 fhandler.cc`, line 75:
| 1.1  (cgf  17-Feb-00):   while len == (size_t) -1)  *s) || 
len--) 

This code seems to intend to not test ``*s'' when len != -1.


C2:
`cvs annotate fhandler.cc` (for current version), line 57
| 1.17 (corinna  09-May-00):   while ((*s || (len != (size_t) -1  
len--))
ChangeLog-2000 about above change:
|   * fhandler.cc (fhandler_base::puts_readahead): Change
|   while condition to disallow wild runs.

The wild runs would occur when *s became 0, len would then be
decremented to -2. This ``new'' code does not seem to want to decrement
len when ``*s'' is nonzero.


C3:
(fhandler_tty.cc (fhandler_pty_master::accept_input):)
...
|  rc = WriteFile (get_output_handle (), p, bytes_left, written, NULL);
...
| p += written;
| bytes_left -= written;
...
| puts_readahead (p, bytes_left);


I don't think there is a reason to not send all that wasn't written,
to the readahead-buffer.
[...]


I hope this helps.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: What depends on less and what man depends on.

2004-12-06 Thread Bas van Gompel
Op Sun, 5 Dec 2004 17:57:32 -0800 schreef Joshua Daniel Franklin
in [EMAIL PROTECTED]:
:  On Sun,  5 Dec 2004 08:13:34 +0100 (MET), Bas van Gompel wrote:
:  Sometimes one wants to know what depends on a package or vice versa.
: 
:  To find out, using the local setup.inis, I wrote following script.
:  It uses make to recursively find and display all dependencies in
:  either direction.
:
:  Buzz, 
:
:  These scripts you've made seem both cool and useful to me. It would

Thanks, that's nice to hear.

:  be even better if we had this functionality in some of the cygwin utils,
:  though, like cygcheck. Any interest in that?

? I'd like it... If there is general interest in them I may attempt to
get the scripts added to cygutils. I might write a wrapper around them
and add some similar functions. Or did I misunderstand your question?

(If you're asking me to duplicate the dependency-tracking logic from
``make'' in another app, I'm not very likely to do that.)

:  I'm also thinking maybe setup.exe should store the latest known good
:  setup.ini as /etc/setup/setup.ini or something like that.

I think that may be a good idea. It should then however store
setup.inis for all selected mirrors, not just the one.

A symlink is not a good idea, IMO, as reading a new ini from internet
may fail (If you refuse going online (dial-up) setup will empty all
inis it attenpts to download.) Also people apparently tend to download
into a temp-dir, install and then delete the local files.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



[Patch] fhandler.cc (pust_readahead): end-condition off.

2004-12-05 Thread Bas van Gompel
Hi,

A real bugfix this time.

When fhandler_base::puts_readahead is given a (non -1) len-parameter,
in the current implementation, not len characters are stowed, but len
z-strings. This affects at least fhandler_pty_master::accept_input in
fhandler_tty.cc.

Following (trivial, I'd say) patch ought to fix it.


ChangeLog-entry:

2004-12-06 Bas van Gompel  [EMAIL PROTECTED]

* fhandler.cc (fhandler_base::puts_readahead): Fix end-condition.


--- src/winsup/cygwin-mmod/fhandler.cc  5 Dec 2004 07:28:27 -   1.209
+++ src/winsup/cygwin-mmod/fhandler.cc  6 Dec 2004 01:14:14 -
@@ -54,7 +54,7 @@ int
 fhandler_base::puts_readahead (const char *s, size_t len)
 {
   int success = 1;
-  while ((*s || (len != (size_t) -1  len--))
+  while ((len == (size_t) -1 ? *s : len--)
  (success = put_readahead (*s++)  0))
 continue;
   return success;


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


[Patch] fhandler.cc: Don't worry about SPC in __small_printf-format

2004-12-04 Thread Bas van Gompel
Hi,

Three lines up from the previous patch there is a check to decide which
format to use. This is not needed, an equivalent test is already done in
__small_vsprintf.

(Trivial) patch follows.


ChangeLog-entry:

2004-12-05  Bas van Gompel  [EMAIL PROTECTED]

* fhandler.cc (fhandler_base::read): Remove superfluous check in
__small_sprintf format for strace.


--- src/winsup/cygwin/fhandler.cc   5 Dec 2004 01:53:47 -   1.208
+++ src/winsup/cygwin/fhandler.cc   5 Dec 2004 04:13:08 -
@@ -754,8 +754,7 @@ fhandler_base::read (void *in_ptr, size_
   for (int i = 0; i  copied_chars  i  16; ++i)
{
  unsigned char c = ((unsigned char *) ptr)[i];
- /* = 33 so space prints in hex */
- __small_sprintf (p, c = 33  c = 127 ?  %c :  %p, c);
+ __small_sprintf (p,  %c, c);
  p += strlen (p);
}
   *p = '\0';


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] fhandler.cc: Don't worry about SPC in __small_printf-format

2004-12-04 Thread Bas van Gompel
Op Sun, 5 Dec 2004 00:37:33 -0500 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Sun, Dec 05, 2004 at 05:44:24AM +0100, Bas van Gompel wrote:
:  2004-12-05  Bas van Gompel  [EMAIL PROTECTED]
: 
:  * fhandler.cc (fhandler_base::read): Remove superfluous check in
:  __small_sprintf format for strace.
:
:   Ok.  Please checkin.

Thanks. Done.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


What depends on less and what man depends on.

2004-12-04 Thread Bas van Gompel
No, I'm not getting filosofical here. ;)

Hallo all,

Sometimes one wants to know what depends on a package or vice versa.

To find out, using the local setup.inis, I wrote following script.
It uses make to recursively find and display all dependencies in
either direction.

To find out what needs less:
cyg-deps less
To find out what man needs:
cyg-deps -r man

Insert a '-v' after the script's name to see any messages from make.
(e.g. about circular dependencies.)


This script requires /bin/sh, cat, sed, cygpath, (g)awk, make, a
package-dir left by setup, /etc/setup/last-mirror and
/etc/setup/last-cache.


I hope anyone likes and/or can find a use for it.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re
#!/bin/sh

# Copyright (C) Bas van Gompel 2004.

# All rights reserved. No warranties.
# This software may not be used for aggressive purposes.

RCS_ID='$Id: cyg-deps,v 1.6 2004/12/05 06:54:56 Buzz Exp Buzz $'

this_one='p'
op=' :  '
the_others='gensub (/^requires: /, , 1)'

relation=${the_others}${op}${this_one}

exec 6/dev/null

while test $1x = -vx -o $1x = -rx; do
  if test $1x = -vx; then
exec 62
shift
  fi
  if test $1x = -rx; then
relation=${this_one}${op}${the_others}
shift
  fi
done

if test -f /etc/setup/last-mirror; then
  for f in $(cat /etc/setup/last-mirror); do
cache_file=$(cygpath -u $(cat /etc/setup/last-cache))/$(\
echo $f|sed 's,:,%3a,g;s,/,%2f,g')/setup.ini
if test -f $cache_file; then
awk -f - ${cache_file} -EOA \
|make -f - $@ 26
BEGIN {print all:}
/^@/ {ib=1;p=\$2;l=l   p;next}
/^requires: / {
  print ${relation}
  print p :
  print@echo  p
}
END {print .PHONY: all l}
EOA
break
fi
echo $0: Can not read cache-file ${cache_file} 2
  done
else
  echo $0: Can not read mirror-file /etc/setup/last-mirror 2
fi

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/

Finding package-descriptions.

2004-12-02 Thread Bas van Gompel
Hallo,

Sometimes one wants to read a description for one or more packages.

I wrote following script to retrieve that info from the locally
installed setup-inis. It's parameters are anchored regexes if
the first one is not ``-r'', after which they are plain text:
$ cyg-desc '.*ss[hl]' '.*x11.*'
or
$ cyg-desc -r gtk+ gcc-g++


The script requires /bin/sh, cat, awk, true, false, cygpath, a package-
dir left by setup, /etc/setup/last-mirror and /etc/setup/last-cache.

I hope this is of use to anybody.

L8r,


Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re
#!/bin/sh

# Copyright (C) Bas van Gompel 2004.

# All rights reserved. No warranties.
# This software may not be used for aggressive purposes.

RCS_ID=$Id: cyg-desc.sh,v 1.11 2004/12/02 18:25:30 Buzz Exp Buzz $

cache_files=

if test $1x = -rx; then
  regex=false
  shift
else
  regex=true
fi

if test -f /etc/setup/last-mirror; then
  for f in $(cat /etc/setup/last-mirror); do
cache_files=${cache_files}$(
  cygpath -u $(
cat /etc/setup/last-cache
  )
)/$(
  echo $f|sed 's,:,%3a,g;s,/,%2f,g'
)/setup.ini

  done
  until test -z $1; do
echo ${cache_files} |until
  read cache_file
  if test -z ${cache_file}; then
echo $0: desc for $1 not found.
true
  elif test -f ${cache_file}; then
if ${regex}; then
  reg_op='~ /^'$1'$/'
else
  reg_op='== '$1''
fi
awk -f - ${cache_file} -EOA
  BEGIN {rv = 1}
  /^@/ {
 if (ib == 1) {
   if (!hd  sd) {
 print gensub (/^sdesc/, pn, 1, sd)
 sd = 
 rv = 0
   }
   print 
 }
 hd = 0
 if (\$2 ${reg_op}) {
   ib = 1
   pn = \$2
   next
 } else {
   ib = 0
   } }
  /^sdesc: / {if (ib) {sd = \$0; next}}
  /^ldesc: .*/ {if (ib) {print gensub (/^ldesc/, pn, 1); hd = 1; rv = 
0; next}}
  /^ldesc: / {if (ib) {id = 1; print gensub (/^ldesc/, pn, 1); hd = 1; 
next}}
  /\$/ {if (id) {id = 0; print \$0; rv = 0}}
  /.*/ {if (id) {print \$0}}
  END {exit rv}
EOA
  else
false
  fi
do
  :
done
shift
  done
else
  echo $0: Can not read mirror-file /etc/setup/last-mirror 2
fi

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/

[Patch] cygcheck: Unset show_error and print_failed in some places.

2004-11-15 Thread Bas van Gompel
Hi,

More trivia, I'd say.

This sets print_failed to false in places where printing failed
makes no sense. In some of those places show_error is also cleared.


ChangeLog-entry.

2004-11-16  Bas van Gompel  [EMAIL PROTECTED]

* cygcheck.cc (find_on_path): Clear show_error and/or print_failed
parameters to display_error.
(rva_to_offset): Ditto.
(dll_info): Ditto.
(track_down): Ditto.


--- src/winsup/utils/cygcheck.cc11 Nov 2004 01:56:02 -  1.62
+++ src/winsup/utils/cygcheck.cc16 Nov 2004 02:52:08 -
@@ -190,13 +190,13 @@ find_on_path (char *file, char *default_
 
   if (!file)
 {
-  display_error (find_on_path: NULL pointer for file);
+  display_error (find_on_path: NULL pointer for file, false, false);
   return 0;
 }
 
   if (default_extension == NULL)
 {
-  display_error (find_on_path: NULL pointer for default_extension);
+  display_error (find_on_path: NULL pointer for default_extension, 
false, false);
   return 0;
 }
 
@@ -305,7 +305,7 @@ rva_to_offset (int rva, char *sections, 
 
   if (sections == NULL)
 {
-  display_error (rva_to_offset: NULL passed for sections);
+  display_error (rva_to_offset: NULL passed for sections, true, false);
   return 0;
 }
 
@@ -437,7 +437,7 @@ dll_info (const char *path, HANDLE fh, i
 
   if (path == NULL)
 {
-  display_error (dll_info: NULL passed for path);
+  display_error (dll_info: NULL passed for path, true, false);
   return;
 }
 
@@ -542,13 +542,13 @@ track_down (char *file, char *suffix, in
 {
   if (file == NULL)
 {
-  display_error (track_down: NULL passed for file);
+  display_error (track_down: NULL passed for file, true, false);
   return;
 }
 
   if (suffix == NULL)
 {
-  display_error (track_down: NULL passed for suffix);
+  display_error (track_down: NULL passed for suffix, false, false);
   return;
 }
 


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


[Patch] cygcheck: Make keyeprint more versatile.

2004-11-10 Thread Bas van Gompel
Hi,

Another (trivial, I hope) patch.

It will add some optional parameters to keyeprint, so errormessages
can be made more appropriate. When the options are not supplied, output
will remain as is.


ChangeLog-entry:

2004-11-11  Bas van Gompel  [EMAIL PROTECTED]

* cygcheck.cc (keyeprint): New optional parameters: show_error and
print_failed.


--- src/winsup/utils/cygcheck.cc31 Oct 2004 18:46:31 -  1.59
+++ src/winsup/utils/cygcheck.cc10 Nov 2004 21:11:26 -
@@ -102,9 +102,14 @@ static char **paths = 0;
  * keyeprint() is used to report failure modes
  */
 static int
-keyeprint (const char *name)
+keyeprint (const char *name, bool show_error = true, bool print_failed = true)
 {
-  fprintf (stderr, cygcheck: %s failed: %lu\n, name, GetLastError ());
+  if (show_error)
+fprintf (stderr, cygcheck: %s%s: %lu\n, name,
+   print_failed ?  failed : , GetLastError ());
+  else
+fprintf (stderr, cygcheck: %s%s\n, name,
+   print_failed ?  failed : );
   return 1;
 }
 


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] cygcheck: Make keyeprint more versatile.

2004-11-10 Thread Bas van Gompel
Op Wed, 10 Nov 2004 19:35:51 -0500 schreef Christopher Faylor
in [EMAIL PROTECTED]:
[...]
:  * cygcheck.cc (keyeprint): New optional parameters: show_error and
:  print_failed.
:
:   Please check in.  Thanks.

Done.

:  Have I mentioned that I don't like the name 'keyeprint'?  It seems like an 
odd
:  name to me.

Well, why don't you change it to something sensible, then?
May I suggest:

sed -i -e 's/keyeprint/display_error/' src/winsup/utils/cygcheck.cc

(I'd post a patch, but am afraid it'd be too large...)


* cygcheck.cc (keyeprint): Rename to display_error.
(display_error): Renamed from keyeprint.
(add_path): keyeprint is now called display_error.
(init_paths): ditto.
(find_on_path): ditto.
(get_word): ditto.
(get_dword): ditto.
(rva_to_offset): ditto.
(cygwin_info): ditto.
(init_paths): ditto.
(dll_info): ditto.
(track_down): ditto.
(ls): ditto.
(scan_registry): ditto.
(dump_sysinfo): ditto.
(check_keys): ditto.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] cygcheck: Make keyeprint more versatile.

2004-11-10 Thread Bas van Gompel
Op Wed, 10 Nov 2004 20:57:36 -0500 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Thu, Nov 11, 2004 at 02:49:35AM +0100, Bas van Gompel wrote:
:  Op Wed, 10 Nov 2004 19:35:51 -0500 schreef Christopher Faylor
:  Have I mentioned that I don't like the name 'keyeprint'?  It seems like
:  an odd name to me.
: 
:  Well, why don't you change it to something sensible, then?
:  May I suggest:
: 
:  sed -i -e 's/keyeprint/display_error/' src/winsup/utils/cygcheck.cc
:
:   I've renamed this to display_error, as per your suggestion, and added
:  an abbreviated ChangeLog, giving you the credit.
:
:  Thanks.

T/U/VM.


L8r,
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] cygcheck: Don't use keyeprint if GetLastError is irrelevant.

2004-10-31 Thread Bas van Gompel
Op Sat, 30 Oct 2004 19:42:16 -0400 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Sat, Oct 30, 2004 at 11:32:27PM +0200, Bas van Gompel wrote:
:  2004-10-28  Bas van Gompel  [EMAIL PROTECTED]
: 
:  * cygcheck.cc (get_dword): Fix errormessage.
:  (cygwin_info): Ditto.
:  (track_down): Ditto.
:  (check_keys): Ditto.
:
:   Go ahead and check these in.

Done, thanks.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] cygcheck: Don't use keyeprint if GetLastError is irrelevant.

2004-10-30 Thread Bas van Gompel
Op Fri, 29 Oct 2004 11:22:38 -0400 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Fri, Oct 29, 2004 at 06:31:11AM +0200, Bas van Gompel wrote:
:  Following (trivial, once more, I hope) patch cleans up some of the
:  (IMO) inappropriate ``keyeprint'' usage in cygcheck. It (keyeprint)
:  should not be used when GetLastError does not apply, I think. Also the
:  format ending in ``failed'' can cause strange messages like ``NULL
:  pointer for file failed''.
:
:   If malloc failed, it is not inconceivable that there is a system error.

Ok.

:  Since the point of keyeprint is to print error messages, reverting to
:  using raw puts is a step backwards.  If it is really known that there is
:  not a remote possibility that GetLastError will be useful, then an
:  option to keyeprint should be added.

I thought so too, at first. I'll admit my solution wasn't pretty
either. Maybe a new function sh/could be added to print messages on
stderr, but without the ``failed'' suffix and the LastError output.
(This could then be called from keyeprint as well.)

:  I'd rather regularize error output
:  throughout cygcheck (which may be a bigger job than your current assignment
:  status will allow) than sprinkle fputs's, and fprints's around the code.

I hope a step-by-step approach will work...
[...]

:  While doing this I caught a typo in get_dword.

I'll start by trying to fix that one (and some more).
(The ones in track_down don't look like they can ever really
get triggered.)


ChangeLog-entry:

2004-10-28  Bas van Gompel  [EMAIL PROTECTED]

* cygcheck.cc (get_dword): Fix errormessage.
(cygwin_info): Ditto.
(track_down): Ditto.
(check_keys): Ditto.


--- src/winsup/utils-keye-usage-p0/cygcheck.cc  27 Oct 2004 01:28:07 -  1.58
+++ src/winsup/utils-keye-usage-p0/cygcheck.cc  30 Oct 2004 03:16:07 -
@@ -276,7 +276,7 @@ get_dword (HANDLE fh, int offset)
 
   if (SetFilePointer (fh, offset, 0, FILE_BEGIN) == INVALID_SET_FILE_POINTER
GetLastError () != NO_ERROR)
-keyeprint (get_word: SetFilePointer());
+keyeprint (get_dword: SetFilePointer());
 
   if (!ReadFile (fh, rv, 4, (DWORD *) r, 0))
 keyeprint (get_dword: Readfile());
@@ -359,7 +359,7 @@ cygwin_info (HANDLE h)
   buf_start = buf = (char *) calloc (1, size + 1);
   if (buf == NULL)
 {
-  keyeprint (cygwin_info: malloc());
+  keyeprint (cygwin_info: calloc());
   return;
 }
 
@@ -537,13 +537,13 @@ track_down (char *file, char *suffix, in
 {
   if (file == NULL)
 {
-  keyeprint (track_down: malloc());
+  keyeprint (track_down: NULL passed for file);
   return;
 }
 
   if (suffix == NULL)
 {
-  keyeprint (track_down: malloc());
+  keyeprint (track_down: NULL passed for suffix);
   return;
 }
 
@@ -1271,7 +1271,7 @@ check_keys ()
  OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
 
   if (h == INVALID_HANDLE_VALUE || h == NULL)
-return (keyeprint (check_key: Opening CONIN$));
+return (keyeprint (check_keys: Opening CONIN$));
 
   DWORD mode;
 
@@ -1281,7 +1281,7 @@ check_keys ()
 {
   mode = ~ENABLE_PROCESSED_INPUT;
   if (!SetConsoleMode (h, mode))
-   keyeprint (check_keys: GetConsoleMode());
+   keyeprint (check_keys: SetConsoleMode());
 }
 
   fputs (\nThis key check works only in a console window,, stderr);
@@ -1300,7 +1300,7 @@ check_keys ()
 {
   prev_in = in;
   if (!ReadConsoleInput (h, in, 1, mode))
-   keyeprint (ReadConsoleInput);
+   keyeprint (check_keys: ReadConsoleInput());
 
   if (!memcmp (in, prev_in, sizeof in))
continue;


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


[Patch] cygcheck: Don't use keyeprint if GetLastError is irrelevant.

2004-10-28 Thread Bas van Gompel
Hi,

Following (trivial, once more, I hope) patch cleans up some of the
(IMO) inappropriate ``keyeprint'' usage in cygcheck. It (keyeprint)
should not be used when GetLastError does not apply, I think. Also the
format ending in ``failed'' can cause strange messages like ``NULL
pointer for file failed''.

While doing this I caught a typo in get_dword.


ChangeLog-entry:

2004-10-28  Bas van Gompel  [EMAIL PROTECTED]

* cygcheck.cc (add_path): Don't use keyeprint when GetLastError is
irrelevant.
(find_on_path): Ditto.
(rva_to_offset): Ditto.
(cygwin_info): Ditto.
(get_dword): Fix typo in errormessage.


--- src/winsup/utils/cygcheck.cc27 Oct 2004 01:28:07 -  1.58
+++ src/winsup/utils/cygcheck.cc29 Oct 2004 03:34:15 -
@@ -122,7 +122,7 @@ add_path (char *s, int maxlen)
   paths[num_paths] = (char *) malloc (maxlen + 1);
   if (paths[num_paths] == NULL)
 {
-  keyeprint (add_path: malloc());
+  fputs (cygcheck: add_path: malloc() failed, stderr);
   return;
 }
   memcpy (paths[num_paths], s, maxlen);
@@ -185,13 +185,14 @@ find_on_path (char *file, char *default_
 
   if (!file)
 {
-  keyeprint (find_on_path: NULL pointer for file);
+  fputs (cygcheck: find_on_path: NULL pointer for file, stderr);
   return 0;
 }
 
   if (default_extension == NULL)
 {
-  keyeprint (find_on_path: NULL pointer for default_extension);
+  fputs (cygcheck: find_on_path: NULL pointer for default_extension,
+   stderr);
   return 0;
 }
 
@@ -276,7 +277,7 @@ get_dword (HANDLE fh, int offset)
 
   if (SetFilePointer (fh, offset, 0, FILE_BEGIN) == INVALID_SET_FILE_POINTER
GetLastError () != NO_ERROR)
-keyeprint (get_word: SetFilePointer());
+keyeprint (get_dword: SetFilePointer());
 
   if (!ReadFile (fh, rv, 4, (DWORD *) r, 0))
 keyeprint (get_dword: Readfile());
@@ -300,7 +301,7 @@ rva_to_offset (int rva, char *sections, 
 
   if (sections == NULL)
 {
-  keyeprint (rva_to_offset: NULL passed for sections);
+  fputs (cygcheck: rva_to_offset: NULL passed for sections, stderr);
   return 0;
 }
 
@@ -359,7 +360,7 @@ cygwin_info (HANDLE h)
   buf_start = buf = (char *) calloc (1, size + 1);
   if (buf == NULL)
 {
-  keyeprint (cygwin_info: malloc());
+  fputs (cygcheck: cygwin_info: calloc() failed, stderr);
   return;
 }
 


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] cygcheck: More complete helptext on drive-list.

2004-10-26 Thread Bas van Gompel
Op Mon, 25 Oct 2004 17:28:07 -0400 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Mon, Oct 25, 2004 at 06:25:16PM +0200, Bas van Gompel wrote:
:  Op Mon, 25 Oct 2004 11:51:32 -0400 schreef Christopher Faylor

[Messed up ChangeLog-entry]

:  :   I fixed this and checked it in.  In general, you don't add ChangeLog entries
:  :  about the ChangeLog.
: 
:  Ok. (There are other instances...)
:
:   With the exception of the famous subauth, the word ChangeLog does not show
:  up in any cygwin-specific ChangeLog that I can see.

You are of course correct.
The instances which fooled me into adding it are in w32api and cygwin-apps:

| w32api/ChangeLog:4225: * ChangeLog: Fix omission of name in recent entries.
| w32api/ChangeLog:4250: * ChangeLog: Fix typo in last entry.
| w32api/ChangeLog:4442: * ChangeLog: correct date in last entry.
| w32api/ChangeLog:4731: * ChangeLog: Fix typo in last entry.
| w32api/ChangeLog:8072: * ChangeLog started
| cygwin-apps/cygutils/ChangeLog:865:   * ChangeLog: fix tabs
| cygwin-apps/cygutils/ChangeLog:1682:  * ChangeLog: fix tabs
| cygwin-apps/setup/ChangeLog:258:  * ChangeLog: Fix broken line-wrapping throughout. 
Clarify that


L8r,

Buzz. (EOT|TITTTL?)
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


[Patch] cygcheck: Warn about multiple or missing cygwin1.dlls.

2004-10-26 Thread Bas van Gompel
Hi,

Another (trivial, I think) patch, this time to warn about one of the
more common pitfalls: multiple or missing cygwin1.dlls.

2004-10-26  Bas van Gompel  [EMAIL PROTECTED]

* cygcheck.cc (dump_sysinfo): Warn about missing or multiple cygwin1
dlls.


--- src/winsup/utils-3/cygcheck.cc  25 Oct 2004 16:11:41 -  1.57
+++ src/winsup/utils-3/cygcheck.cc  26 Oct 2004 20:50:24 -
@@ -1222,6 +1222,7 @@ dump_sysinfo ()
 
   if (givehelp)
 printf (Looking for various Cygnus DLLs...  (-v gives version info)\n);
+  int cygwin_dll_count = 0;
   for (i = 0; i  num_paths; i++)
 {
   WIN32_FIND_DATA ffinfo;
@@ -1238,7 +1239,10 @@ dump_sysinfo ()
{
  sprintf (tmp, %s\\%s, paths[i], f);
  if (strcasecmp (f, cygwin1.dll) == 0)
-   found_cygwin_dll = strdup (tmp);
+   {
+ cygwin_dll_count++;
+ found_cygwin_dll = strdup (tmp);
+   }
  else
ls (tmp);
}
@@ -1253,6 +1257,10 @@ dump_sysinfo ()
 
   FindClose (ff);
 }
+  if (cygwin_dll_count  1)
+puts (Warning: There are multiple cygwin1.dlls on your path);
+  if (!cygwin_dll_count)
+puts (Warning: cygwin1.dll not found on your path);
 }
 
 static int



L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] cygcheck: Warn about multiple or missing cygwin1.dlls.

2004-10-26 Thread Bas van Gompel
Op Tue, 26 Oct 2004 19:03:00 -0400 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Tue, Oct 26, 2004 at 11:34:13PM +0200, Bas van Gompel wrote:
:  2004-10-26  Bas van Gompel  [EMAIL PROTECTED]
: 
:  * cygcheck.cc (dump_sysinfo): Warn about missing or multiple cygwin1
:  dlls.
:
:   Please checkin.

Done.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] cygcheck: More complete helptext on drive-list.

2004-10-25 Thread Bas van Gompel
Op Mon, 25 Oct 2004 11:51:32 -0400 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Sat, Oct 23, 2004 at 10:17:02PM +0200, Bas van Gompel wrote:
:  Op Fri, 22 Oct 2004 04:34:05 +0200 (MET DST) schreef Bas van Gompel
:  in [EMAIL PROTECTED]:
:  [...]
: 
:  :  D**n, the leading newline was lost...
:
:   I fixed this and checked it in.  In general, you don't add ChangeLog entries
:  about the ChangeLog.

Ok. (There are other instances...)

[...]

:  Go ahead and can check in the leading newline change.

Done. (This time correctly, I think.)


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] cygcheck: More complete helptext on drive-list.

2004-10-23 Thread Bas van Gompel
Op Fri, 22 Oct 2004 04:34:05 +0200 (MET DST) schreef Bas van Gompel
in [EMAIL PROTECTED]:
[...]

:  D**n, the leading newline was lost...

...and I checked in CRLF's in the Changelog...

...Ain't I doing great. :(


ChangeLog-entry:

2004-10-23  Bas van Gompel  [EMAIL PROTECTED]

* ChangeLog: Fix line-endings on previous entry.
* cygcheck.cc (dump_sysinfo): Add leading newline before legend for
drive-list.


--- cygcheck.cc 22 Oct 2004 01:29:10 -  1.55
+++ cygcheck.cc 23 Oct 2004 18:01:20 -
@@ -1160,7 +1160,7 @@ dump_sysinfo ()
   SetErrorMode (prev_mode);
   if (givehelp)
 {
-  puts (
+  puts (\n
  fd = floppy,  hd = hard drive,   cd = CD-ROM\n
  net= Network Share,   ram= RAM drive,unk= Unknown\n
  CP = Case Preserving, CS = Case Sensitive,   UN = Unicode\n


L8r,

Buzz. (Can I check this in? I'll try not to let it happen again.)
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: Still hosed by setup problem

2004-10-22 Thread Bas van Gompel
Op Tue, 12 Oct 2004 18:55:25 -0400 schreef David A. Cobb
in [EMAIL PROTECTED]:

:  Well, now I am completely out of business!
:
:  This is more data regarding the URL Scheme Not Registered failure in 
:  SETUP, last reports were around 9/18.
:
:  In the last progress message posted before the crash, I spotted a 
:  package name (from gnome) that was one character short at the left-hand 

This happens if a package is in the same directory as the ini-file.

eg: ``install: packagename_without_slashes-1.0-1 ...''
causes setup to display: ``ackagename_without_slashes-1.0-1''

(A patch for this was submitted by me several months ago, but never
reacted upon...)

If the string is left empty, an attempt to allocate -1 bytes is made...

[...]

:  Then Install from Local Directory -- BANG it immediately crashes with 
:  the URL Scheme Not Registered error.

This /might/ be caused by the above. (Who knows what happens if you
try to allocate a negative amount of memory.)

try:
find -name setup.ini |xargs -r grep '^install: *$'
in your package-dir (if you ever get a working installation).

[...]

Good luck.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


[Patch] cygcheck: Allow for larger drives. ``Used'', not ``Free''.

2004-10-20 Thread Bas van Gompel
Hi,

Another (trivial, IMO) patch:

I noticed the format for ``Size'' in the drive-list is 5 digits long.
This overflows for drives = 100 gigabytes. This patch allows for drives
 10 terabytes. While at this, I spotted, in the help-text, where the
title reads ``Free'', it should read ``Used''.


ChangeLog-entry:

2004-10-20  Bas van Gompel  [EMAIL PROTECTED]

* cygcheck.cc (dump_sysinfo): Allow for larger drives in drive-list.
Change ``Used'' to ``Free'' in helptext-title for drive-list.


--- src/winsup/utils/cygcheck.cc18 Oct 2004 10:25:38 -  1.53
+++ src/winsup/utils/cygcheck.cc20 Oct 2004 15:25:16 -
@@ -1064,7 +1064,7 @@ dump_sysinfo ()
   if (givehelp)
 {
   printf (Listing available drives...\n);
-  printf (Drv TypeSize   Free Flags  Name\n);
+  printf (Drv Type  Size   Used Flags  Name\n);
 }
   int prev_mode =
 SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
@@ -1135,9 +1135,9 @@ dump_sysinfo ()
 
   printf (%.2s  %s %-6s , drive, drive_type, fsname);
   if (capacity_mb = 0)
-   printf (%5dMb %3d%% , (int) capacity_mb, (int) percent_full);
+   printf (%7dMb %3d%% , (int) capacity_mb, (int) percent_full);
   else
-   printf (  N/AN/A );
+   printf (N/AN/A );
   printf (%s %s %s %s %s %s  %s\n,
  flags  FS_CASE_IS_PRESERVED ? CP :   ,
  flags  FS_CASE_SENSITIVE ? CS :   ,


BTW: Should not dump_sysinfo be split up into a number of smaller
functions?

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: line-drawing

2004-10-18 Thread Bas van Gompel
Op Thu, 14 Oct 2004 16:35:22 +0200 (MEST) schreef towo
in [EMAIL PROTECTED]:
:  According to a recent mailing on cygwin-apps BLOB cygwin BLIP com, 
:  the alternate character set terminal controls (fixed wrt. the 
:  currently buggy terminfo entry) are supposed to work and to 
:  provide line drawing (like with VT100 graphics characters).
:  Is that true?

I'm nt sure how this relates to vt100... It did make (the thread-
display in) slrn work for me. (s-lang's smgtest's Alt charset test,
Drawing Symbols, Line Drawing Test and Box Test, work as well.)

:  What do you see if you send \[[11mn to the terminal 
:  (where the \[ is of course an escape, properly escaped :) - 
:  I see only an n here, not a graphics symbol.

So do I. Some experimenting got me this:


=== Begin ti_acslist.sh ===
#!/bin/bash

cd /tmp
cat - 'EOPROG' ti_acslist.c
#include curses.h
#include ncurses/term.h

main (int argc, char *argv[])
{
  char *as;
  int err, n;
  if (setupterm (NULL, 1, err) == OK) {
as = tigetstr (acsc);
if (as  as != (char *) -1) {
  for (n = 0; as[n]; n += 2) {
printf (%c: %02x%s, as[n], as[n + 1]  255,
n % 22 == 20 || !as[n + 2] ? \n : , );
  }
} else
  fputs (tigetstr (\acsc\) failed., stderr);
  } else {
fputs (setupterm failed, stderr);
  }
}

EOPROG
gcc -o ti_acslist ti_acslist.c -L/usr/bin -lncurses-8

./ti_acslist

rm ti_acslist.c ti_acslist.exe

 End ti_acslist.sh 


Output of the above: 
+: 10, ,: 11, -: 18, .: 19, 0: db, `: 04, a: b1, f: f8, g: f1, h: b0, j: d9
k: bf, l: da, m: c0, n: c5, o: 7e, p: c4, q: c4, r: c4, s: 5f, t: c3, u: b4
v: c1, w: c2, x: b3, y: f3, z: f2, {: e3, |: d8, }: 9c, ~: fe


So, the code you are looking for, probably is:
echo -e '\e[11m\xc5'


I'm no expert on this either, but I guess that's right... (WFM)


HTH, L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: [Patch] cygcheck: pretty_id misbehaving.

2004-10-17 Thread Bas van Gompel
Op Sun, 17 Oct 2004 21:46:29 -0400 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Mon, Oct 18, 2004 at 03:32:07AM +0200, Buzz wrote:

[...]

:  * Cygcheck.cc (pretty_id): Count ')' in ui_len and gui_len.
:
:   Thanks.  Checked in without change.

Thank you (for writing a better ChangeLog-entry as well).

Remaining items... (I missed these last time around.)


ChangeLog-entry:

2004-10-18  Bas van Gompel  [EMAIL PROTECTED]

* cygcheck.cc (pretty_id): Don't let i become negative. Fix
printf-format.


--- src/winsup/utils/cygcheck.cc18 Oct 2004 01:44:55 -  1.52
+++ src/winsup/utils/cygcheck.cc18 Oct 2004 04:47:24 -
@@ -836,11 +836,11 @@ pretty_id (const char *s, char *cygwin, 
 
   printf (\nOutput from %s (%s)\n, id, s);
   int n = 80 / (int) ++sz;
-  int i = n ? n - 2 : 0;
+  int i = n  2 ? n - 2 : 0;
   sz = -sz;
   for (char **g = groups; g = ng; g++)
 if ((g != ng)  (++i  n))
-  printf (%*s , sz, *g);
+  printf (%*s, sz, *g);
 else
   {
puts (*g);


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] cygcheck: pretty_id misbehaving.

2004-10-15 Thread Bas van Gompel
Op Thu, 14 Oct 2004 13:36:21 -0400 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Thu, Oct 14, 2004 at 05:31:16PM +0200, Bas van Gompel wrote:

[...]

:  * cygcheck.cc (pretty_id): Correct layout.
:
:   Thanks for the patch but I think it's possible to do this and make
:  things a little more robust wrt the column calculations.  See below.
:  This actually shrinks the number of lines slightly too.
:
:  I'm going to check this in.

Here are some corrections/changes to your patch:

*) Don't exit, return. (Allow other checks to run.)
*) Update len_gid, not len_uid.
*) Correct calculation of sz. (sizeof(x) == strlen(x) + 1)
*) Don't negate sz, update printf-format
*) Correct low values of n and i.
*) Change order in which final n and sz are set.


ChangeLog-entry:

2004-10-15  Bas van Gompel  [EMAIL PROTECTED]

* cygcheck.cc (pretty_id): Don't exit, return. Correct layout.


--- src/winsup/utils-3/cygcheck.cc  14 Oct 2004 17:35:46 -  1.49
+++ src/winsup/utils-3/cygcheck.cc  15 Oct 2004 10:56:44 -
@@ -802,7 +802,7 @@ pretty_id (const char *s, char *cygwin, 
   else
 {
   fprintf (stderr, garbled output from `id' command - no uid= found\n);
-  exit (1);
+  return;
 }
   char *gid = strtok (NULL, ));
   if (gid)
@@ -810,17 +810,17 @@ pretty_id (const char *s, char *cygwin, 
   else
 {
   fprintf (stderr, garbled output from `id' command - no gid= found\n);
-  exit (1);
+  return;
 }
 
   char **ng = groups - 1;
   size_t len_uid = strlen (uid);
   size_t len_gid = strlen (gid);
   *++ng = groups[0] = (char *) alloca (len_uid += sizeof (UID: )));
-  *++ng = groups[1] = (char *) alloca (len_uid += sizeof (GID: )));
+  *++ng = groups[1] = (char *) alloca (len_gid += sizeof (GID: )));
   sprintf (groups[0], UID: %s), uid);
   sprintf (groups[1], GID: %s), gid);
-  size_t sz = max (len_uid, len_gid);
+  size_t sz = max (len_uid, len_gid) - 1;
   while ((*++ng = strtok (NULL, ,)))
 {
   char *p = strchr (*ng, '\n');
@@ -834,12 +834,14 @@ pretty_id (const char *s, char *cygwin, 
 }
 
   printf (\nOutput from %s (%s)\n, id, s);
+  sz++;
   int n = 80 / (int) sz;
-  sz = -(sz + 1);
-  int i = n - 2;
+  if (!n)
+n = 1;
+  int i = (n  1) ? n - 2 : 0;
   for (char **g = groups; g  ng; g++)
 if ((g != ng - 1)  (++i  n))
-  printf (%*s , sz, *g);
+  printf (%-*s, sz, *g);
 else
   {
puts (*g);


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] testsuite and newlib's signal.h.

2004-10-15 Thread Bas van Gompel
Op Thu, 14 Oct 2004 11:55:59 -0400 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Thu, Oct 14, 2004 at 05:31:31PM +0200, Bas van Gompel wrote:
:  Another trivial patch, a bit kludgy...
: 
:  ATM the testsuite does not build, because
:  newlib/libc/include/sys/signal.h includes newlib/libc/include/signal.h.
:
:   This is a recent change to sys/signal.h and it is supposed to just
:  work.  

I was aware of that.

:  If it isn't working then please report the problem to the newlib
:  mailing list.

I also noticed this change was instigated by you. As I'm not subscribed
to the newlib-list and have no idea of how to fix this, apart from
applying the patch, or undoing the newlib change, which I think is a
good thing in principle (the newlib change, not undoing it), I was
hoping you'd take action on this (or just apply the patch).

I'll subscribe the newlib-list, and --if you insist-- report there.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


[Patch] cygheap.cc: Allow _crealloc to shrink memory-block.

2004-10-12 Thread Bas van Gompel
Hi,

Following (trivial IMO) patch, allows memory blocks on the cygheap to
be shrunk.

There are some issues with this:
- The code is slightly slower.
- This change is in a block of code marked ``copyright D. J. Delorie''.
- I'm not sure _crealloc is ever called with a smaller size. (If it
  isn't, this patch is useless.)

(I did test this, and it WJFFM.)


ChangeLog-entry:

20040-10-13  Bas van Gompel  [EMAIL PROTECTED]

* cygheap.cc (_crealloc): Allow memory-block to shrink.


--- src/winsup/cygwin/cygheap.cc2 Jun 2004 21:20:53 -   1.103
+++ src/winsup/cygwin/cygheap.cc12 Oct 2004 02:43:30 -
@@ -324,16 +324,22 @@ _cfree (void *ptr)
 static void *__stdcall
 _crealloc (void *ptr, unsigned size)
 {
+  unsigned sz;
   void *newptr;
   if (ptr == NULL)
 newptr = _cmalloc (size);
   else
 {
   unsigned oldsize = 1  to_cmalloc (ptr)-b;
-  if (size = oldsize)
+
+ /* Calculate size as a power of two. */
+  for (sz = 8; sz  sz  size; sz = 1)
+   continue;
+
+  if (sz == oldsize)
return ptr;
   newptr = _cmalloc (size);
-  memcpy (newptr, ptr, oldsize);
+  memcpy (newptr, ptr, min(sz, oldsize));
   _cfree (ptr);
 }
   return newptr;


Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] cygcheck: warn about empty path-components

2004-10-09 Thread Bas van Gompel
Op Thu, 7 Oct 2004 20:17:55 -0400 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Fri, Oct 08, 2004 at 01:42:05AM +0200, Bas van Gompel wrote:
:  :  :  Why are we bothering with this?
:  : 
:  :  If I may attempt to answer this one... Many people may not know of
:  :  this usage, yet may have their windows path ending on a ';'.
:  :
:  :   I'm sure the same thing is true on UNIX and yet it has survived for
:  :  years without a unicheck program informing people of this fact.
: 
:  There are no windows paths in UNIX, and there is no unicheck program
:  for any purpose. Does this mean cygcheck should be removed?
:
:   We're talking about paths, not Windows paths.

We're talking about how paths are displayed by cygcheck.
It displays them using window's conventions.

[...]

:  Of course, if someone can use cygcheck to diagnose their own problems
:  then, that's great.  I don't see any reason to alarm someone with a
:  warning about a minor issue like an empty path component when it
:  is not an uncommon idiom, though.

I see what you mean. I got the idea for the patch when reviewing a
cygcheck.out which I first thought had 2 empty lines after the path.
Further examination revealed the first of these held a TAB.

I thought that was unclear. One might miss the fact there was an empty
component.

:  What are you planning to do? Will you revert this patch, reject the
:  next patch and leave things as they are, or consider it when it's
:  submitted?
:
:   I'm leaning to reverting the patch unless you can point me to a
:  preponderance of email messages in the cygwin list which illustrate
:  that this has been a common problem crying out for a warning.  Maybe
:  I just missed something.

You know there is no such thing. Would you anyhow consider the
following patch, which just displays . instead of the warning?

:  If you are interested in adding real improvements to cygcheck, I'd
:  suggest something to ensure that the permissions on system directories
:  and files are sane, and maybe even a method to correct problems in that
:  area.  That seems to be one of the biggest complaints in the mailing
:  list.

I'll see what I can do. I however doubt if this can be accomplished
with a trivial patch. (I do have some more trivia in store...)

(Would not corrections be misplaced in cygcheck?
Is ensuring correct permissions not something better handled in setup?)


ChangeLog-entry:

2004-10-10  Bas van Gompel  [EMAIL PROTECTED]

* cygcheck.cc (dump_sysinfo): Don't warn about empty path-
components, just display ``.''.


--- src/winsup/utils/cygcheck.cc6 Oct 2004 09:46:40 -   1.45
+++ src/winsup/utils/cygcheck.cc9 Oct 2004 07:39:01 -
@@ -958,9 +958,9 @@ dump_sysinfo ()
 {
   for (e = s; *e  *e != sep; e++);
   if (e-s)
-printf (\t%.*s\n, e - s, s);
+   printf (\t%.*s\n, e - s, s);
   else
-puts (\tWarning: Empty path-component);
+   puts (\t.);
   count_path_items++;
   if (!*e)
break;


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] cygcheck: warn about empty path-components

2004-10-07 Thread Bas van Gompel
Op Wed, 6 Oct 2004 22:15:58 -0400 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Thu, Oct 07, 2004 at 04:05:14AM +0200, Bas van Gompel wrote:

[...]

:  s/-v/-h/. (I'm waiting for the other (trailing slash) patch to be
:  applied or rejected, before submitting this.)
:
:   I missed the part about the warning before but I *really* don't think we
:  need to warn the user about standard UNIX behavior in cygcheck.  That is
:  really not what's for.

It's for diagnosing problems with the cygwin-environment, isn't it?
The (to be) warned about condition is on the edge of windows and cygwin.
No windows or UNIX utility is going to warn about it.

[...]

:  :  Why are we bothering with this?
: 
:  If I may attempt to answer this one... Many people may not know of
:  this usage, yet may have their windows path ending on a ';'.
:
:   I'm sure the same thing is true on UNIX and yet it has survived for
:  years without a unicheck program informing people of this fact.

There are no windows paths in UNIX, and there is no unicheck program
for any purpose. Does this mean cygcheck should be removed?

What are you planning to do? Will you revert this patch, reject the
next patch and leave things as they are, or consider it when it's
submitted?

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] cygcheck: warn about trailing (back)slash on mount entries

2004-10-06 Thread Bas van Gompel
Op Wed, 06 Oct 2004 12:00:15 -0400 schreef Pierre A. Humblet
in [EMAIL PROTECTED]:
:
:
:  Christopher Faylor wrote:
: 
:  On Wed, Oct 06, 2004 at 11:30:17AM -0400, Pierre A. Humblet wrote:
: 
:  Christopher Faylor wrote:
: 
:  On Wed, Oct 06, 2004 at 03:12:45PM +0200, Bas van Gompel wrote:
:  Another (hopefully trivial) patch, to help in trouble-shooting.
: 
:  Wasn't there another problem where foo\/bar type of entries were
:  showing up?  Could you add a check for that, too?

I think so.

Would it also be of interest to check for forward slashes in the
native-, and backslashes in the posix-path?

:  I while ago I have modified Cygwin to accept this kind of syntax.
:  Is there a remaining problem in the current release?
:  Otherwise I don't see the need to alarm the user.
: 
:  It's just a warning.  This really shouldn't be in the mount table
:  and it really should be corrected.
:
:  I don't think it's checking the mount table, it's checking the registry.

Indeed.

:  The entry will be cleaned up by the time it gets to the mount table.

Is that a reason to not /attempt/ to ensure the entries in the registry
are correct? One might consider writing back the cleaned up entries to
the registry.

:  What would be useful is a check that ::add_item will accept the registry
:  entry, i.e. won't return EINVAL or perhaps path too long.

mount_info::add_info is not available when running cygcheck, it being
a mingw app. (BYKT)

:  The relevant part of add_item is pasted below. It shows when EINVAL
:  is returned.

The resulting patch would not be trivial, so I can't be submitting it,
as long as i've not received any reply from the Red Hat legal team on
my query. (I don't want to cause the patch to become inadmissible.)

Sorry.

BTW: Any reason for not applying the trailing-slash patch? (If I were
to add any of the here discussed, I would expect to be (rightly) told
to split the patch into functionally distinct parts.)

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] cygcheck: warn about empty path-components

2004-10-06 Thread Bas van Gompel
Op Wed, 6 Oct 2004 11:49:39 +0200 schreef Corinna Vinschen
in [EMAIL PROTECTED]:
:  On Oct  6 10:49, Bas van Gompel wrote:
:  Op Tue, 5 Oct 2004 16:46:49 +0200 schreef Corinna Vinschen
:  in [EMAIL PROTECTED]:
: 
:  [Empty path-components resolving to current dir.]

[...]

:  Are you applying the patch?
:
:  I did, but I'm wondering if a check for relative paths wouldn't be
:  more useful.

I'll see if I can whip up something (trivial) in the not too far future.
(If noone beats me to it.)

BTW: Applying this (empty path-components) patch apparently caused some
TABs to be replaced by 8 spaces, somehow...

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] pinfo.cc: second CreatePipe, not first.

2004-10-05 Thread Bas van Gompel
Op Mon, 4 Oct 2004 22:10:43 -0400 schreef Christopher Faylor
in [EMAIL PROTECTED]:
:  On Tue, Oct 05, 2004 at 03:49:20AM +0200, Bas van Gompel wrote:

[...]

:  * pinfo.cc (_pinfo::commune_send): Make debugging output less ambiguous.
:
:   I've applied this patch.  Thanks.
:
:  I used a slightly less ambiguous ChangeLog, though. :-)

``Correct debugging output.'' is less ambiguous? If you say so... :]

BTW: What was your change to fhandler_termios.cc about? I see no
ChangeLog-entry/cvs message for that.

BTW2: Did you see the question at the bottom of my other mail?

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


[Patch] cygcheck: warn about empty path-components

2004-10-04 Thread Bas van Gompel
Hi,

This little patch makes cygcheck warn about empty path-components
(leading/trailing/double ':'/';' in $PATH).


ChangeLog-entry:

2004-10-05  Bas van Gompel  [EMAIL PROTECTED]

* cygcheck.cc (dump_sysinfo): Warn about empty path-components.


--- src/winsup/utils/cygcheck.cc4 Oct 2004 09:42:08 -   1.44
+++ src/winsup/utils/cygcheck.cc5 Oct 2004 02:19:35 -
@@ -957,7 +957,10 @@ dump_sysinfo ()
   while (1)
 {
   for (e = s; *e  *e != sep; e++);
-  printf (\t%.*s\n, e - s, s);
+  if (e-s)
+   printf (\t%.*s\n, e - s, s);
+  else
+   puts (\tWarning: Empty path-component);
   count_path_items++;
   if (!*e)
break;


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^r


[Patch] cygwin terminfo ``smacs'' setting.

2004-10-02 Thread Bas van Gompel
When playing around with a terminfo-aware app (see User-Agent header),
I noticed that the ``smacs''-setting in the cygwin-entry reads
``\E11m'', not the apparently correct ``\E[11m'', causing line-drawing
to fail. Following patch should fix that.

Apply with ``patch -p0'' in ``/usr/src'' _after_ running the ``prep''-
command.


--- terminfo-5.3_20030726-orig/terminfo.src 2003-08-02 21:13:16.0 +0200
+++ terminfo-5.3_20030726/terminfo.src  2004-10-02 15:07:28.0 +0200
@@ -4324,7 +4324,7 @@
rmso=\E[27m, rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, 
setab=\E[4%p1%dm, setaf=\E[3%p1%dm, 

sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m,
 
-   sgr0=\E[0;10m, smacs=\E11m, smcup=\E7\E[?47h, smir=\E[4h, 
+   sgr0=\E[0;10m, smacs=\E[11m, smcup=\E7\E[?47h, smir=\E[4h, 
smpch=\E[11m, smso=\E[7m, smul=\E[4m, tsl=\E];, 
u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?6c, u9=\E[c, 
vpa=\E[%i%p1%dd, 

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^r


[Patch] cygcheck: ``pclose'' what was ``popen''ed.

2004-09-28 Thread Bas van Gompel
Hi,

Another trivial (IMO) patch. What was opened by ``popen'', needs
closing by ``pclose''.


ChangeLog-entry:

2004-09-29  Bas van Gompel  [EMAIL PROTECTED]

* cygcheck.cc (pretty_id): Close pipe.


--- src/winsup/utils/cygcheck.cc21 Mar 2004 17:58:14 -  1.43
+++ src/winsup/utils/cygcheck.cc28 Sep 2004 20:42:32 -
@@ -793,6 +793,7 @@ pretty_id (const char *s, char *cygwin, 
   static char empty[] = ;
   buf[0] = '\0';
   fgets (buf, sizeof (buf), f);
+  pclose(f);
   char *uid = strtok (buf, ));
   if (uid)
 uid += strlen (uid=);


L8r.

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Broken pipe warning from bash.

2004-09-28 Thread Bas van Gompel
Hi,

Following little (bash) shell-script many times causes a Broken pipe
(SIGPIPE) warning to be emitted by bash. Is this expected behaviour?

An example of the message:
./tc-pipe.sh: line 5: 3541109 Broken pipe seq 1 2

The message is generated on the second pass through the loop.
Changing ``a b'' to ``a b c d e'' below, often prints the message 4
times.

=== Begin tc-pipe.sh ===
#!/bin/bash

for t in a b; do
 seq 1 2
done | head -n 1

 End tc-pipe.sh 

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Broken pipe warning from bash.

2004-09-28 Thread Bas van Gompel
Op Tue, 28 Sep 2004 09:53:32 +0200 (MET DST) schreef ik

: Following little (bash) shell-script many times causes a Broken pipe
: (SIGPIPE) warning to be emitted by bash. Is this expected behaviour?

Maybe I should have been clearer... Aargh/...

[Explanation I was writing snipped.]

...It's in the bash FAQ... URL:ftp://ftp.cwru.edu/pub/bash/FAQ
section E2.

According to that, defining ``DONT_REPORT_SIGPIPE'' in ``config-top.h''
will enable building a version which does not show the behaviour.

Is this flag set on the various distro's?

Should it be set on cygwin? (If only to prevent more stupid questions
like mine...)

Sorry about the noise, ppl.

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Generic build script instructions

2004-09-23 Thread Bas van Gompel
Op Sun, 20 Jun 2004 10:38:57 -0400 (EDT) schreef Igor Pechtchanski
in [EMAIL PROTECTED]:
:  On Sun, 20 Jun 2004, Bas van Gompel wrote:
[...]

:  ChangeLog entry:
: 
:  2004-06-20  Bas van Gompel  [EMAIL PROTECTED]
: 
:  * templates/generic-build-script (acceptpatch): New function to copy
:  a fresh patch from ${srcinstdir} to ${topdir}.
:
:  Looks good.  Any objections from people to me checking this in?

Don't you think you waited long enough for objections?

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [Patch] Trailing spaces in cygcheck -cd or -s output.

2004-09-23 Thread Bas van Gompel
Op Wed, 22 Sep 2004 13:54:53 +0200 schreef Corinna Vinschen
in [EMAIL PROTECTED]:
:  On Sep 16 07:26, Bas van Gompel wrote:

[dump_setup.cc (dump_setup): Avoid trailing spaces on package-list.]

:  Thanks for the patch.  I've applied the patch plus an additional patch which
:  adds an `if (check_files)' to simplify the expressions in (now two) printf's.

Thanks, that's much more readable.

Now one can eliminate a spurious ``strlen'', as well.

ChangeLog-entry:

2004-09-23  Bas van Gompel  [EMAIL PROTECTED]

* dump_setup.cc (dump_setup): Remove unneeded strlen when check_files
is not set.

Patch:

--- src/winsup/utils/dump_setup.cc  22 Sep 2004 11:50:51 -  1.15
+++ src/winsup/utils/dump_setup.cc  23 Sep 2004 05:26:51 -
@@ -403,8 +403,8 @@ dump_setup (int verbose, char **argv, bo
check_package_files (verbose, packages[i].name)
  ?  OK :  Incomplete);
   else
-   printf (%-*s %-*s\n, package_len, packages[i].name,
- strlen(packages[i].ver), packages[i].ver);
+   printf (%-*s %s\n, package_len, packages[i].name,
+ packages[i].ver);
   fflush(stdout);
 }
 
L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: [setup] ini in same dir as package - 'base' is one off. (+ patch)

2004-09-22 Thread Bas van Gompel
Ehh... Ping (-c 2)

Op Sat,  6 Mar 2004 22:35:37 +0100 (MET) schreef ik
in [EMAIL PROTECTED]:

[One-off in package_source.cc]

:  A patch against the current cvs version (2.8) for this follows.

(It also prevents unpredictable (by me) behaviour if a setup.ini
would contain an empty install:  line.)

(Slightly altered) Changelog-Entry:

2004-09-23  Bas van Gompel  [EMAIL PROTECTED]

* package_source.cc (packagesource::set_canonical): Fix one-off in
'base' when ini is in same dir as package.

The patch, once more, as it has been a while:

--- setup/package_source.cc 18 Feb 2002 12:35:22 -  2.8
+++ setup/package_source.cc 22 Sep 2004 21:48:18 -
@@ -44,7 +44,9 @@ packagesource::set_canonical (char const
   while (bstart  (tmp = strchr (bstart + 1, '/')))
 bstart = tmp;
 
-  if (!bstart)
+  if (bstart)
+bstart++;
+  else
 bstart = fn;
   char const *bend = strchr (bstart, '-');
   while (bend  (tmp = strchr (bend + 1, '-')))
@@ -59,15 +61,15 @@ packagesource::set_canonical (char const
   char const *end = strchr (fn, '\0');
   if (base)
 delete[] base;
-  base = new char[bend - bstart];
-  memcpy (base, bstart + 1, bend - bstart - 1);
-  base[bend - bstart - 1] = '\0';
+  base = new char[bend - bstart + 1];
+  memcpy (base, bstart, bend - bstart);
+  base[bend - bstart] = '\0';
 
   if (filename)
 delete[] filename;
-  filename = new char[end - bstart];
-  memcpy (filename, bstart + 1, end - bstart - 1);
-  filename[end - bstart - 1] = '\0';
+  filename = new char[end - bstart + 1];
+  memcpy (filename, bstart, end - bstart);
+  filename[end - bstart] = '\0';
 
   cached = String();
 }

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


[Patch] getfacl -n layout not upto spec.

2004-09-14 Thread Bas van Gompel
Hi,

I noticed, getfacl -n ... returns badly formatted
output like:

...
group:544
rwx
..

instead of:

...
group:544:rwx
...

This (trivial, I think) patch fixes that.

--- src/winsup/utils/getfacl.c  11 Sep 2003 07:55:51 -  1.11
+++ src/winsup/utils/getfacl.c  14 Sep 2004 21:21:45 -
@@ -229,7 +229,7 @@ main (int argc, char **argv)
  break;
case USER:
  if (nopt)
-   printf (user:%lu\n, (unsigned long)acls[i].a_id);
+   printf (user:%lu:, (unsigned long)acls[i].a_id);
  else
printf (user:%s:, username (acls[i].a_id));
  break;
@@ -238,7 +238,7 @@ main (int argc, char **argv)
  break;
case GROUP:
  if (nopt)
-   printf (group:%lu\n, (unsigned long)acls[i].a_id);
+   printf (group:%lu:, (unsigned long)acls[i].a_id);
  else
printf (group:%s:, groupname (acls[i].a_id));
  break;


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: win95 pipe problems -- report + testcase + patch

2004-09-08 Thread Bas van Gompel
Op Wed, 8 Sep 2004 12:06:57 +0200 schreef Corinna Vinschen
in [EMAIL PROTECTED]:
:  On Sep  8 01:55, Bas van Gompel wrote:
:  This fix trips on a bug in (my) windows 95 (OSR2):
:  It's CreateNamedPipe returns 0 instead of -1 (INVALID_HANDLE_VALUE),
:  causing all operations on pipes to fail.
:  [...]
:  A patch to work around this in cygwin could be: (WFM)

[pipe-w95.diff]

:  I hope this patch is small enough to qualify as `trivial', as I
:
:  It is.  I'm just wondering if it is really necessary to assume, that
:  CreateNamedPipe will ever return NULL as a vaild handle.  I'd assume

The fact that INVALID_HANDLE_VALUE != NULL, made me think NULL might
be a valid handle value elsewhere. I was just trying to be thorough.
I don't think the difference will severely hurt performance or size...

:  that the following patch is sufficient:

[...]

Possibly. However MS might also make NULL be an alias to NUL in the
future, or just treat NULL like any other handle.

:  haven't received any reply to my legal query (yet). (Did the reply
:  get blocked from the list?)
:
:  No, there was no reply so far, unfortunately.  I'm sorry.  I'll try to
:  nudge our legal department again.

I'll be waiting. (This will give me more time to test readdir_r,
once I decide how to keep accesses separate.)

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



win95 pipe problems -- report + testcase + patch (was: Re: [ANNOUNCEMENT] Updated: cygwin-1.5.11-1)

2004-09-07 Thread Bas van Gompel
Op Sat, 4 Sep 2004 23:51:25 -0500 (CDT) schreef Christopher Faylor
in [EMAIL PROTECTED]:

[...]

:  - Fix some problems with rsync hangs on Windows NT class systems.  (Bob Byrnes)

This fix trips on a bug in (my) windows 95 (OSR2):
It's CreateNamedPipe returns 0 instead of -1 (INVALID_HANDLE_VALUE),
causing all operations on pipes to fail.

Testcase: (Read on below.)
(Somebody else with windows 95, please confirm this reports
'Handle 0, Error 120'.)

 Begin mktpipe.sh 
#!/bin/bash

cd /tmp
cat -'EOP' tpipe.c
#include windows.h
#include stdio.h

main(){
  HANDLE read_pipe;
  DWORD errnum;

  SetLastError(0);
  read_pipe = CreateNamedPipe (.\\pipe\\testpipe-1,
   PIPE_ACCESS_INBOUND,
   PIPE_TYPE_BYTE | PIPE_READMODE_BYTE,
   1,   /* max instances */
   16384,   /* output buffer size */
   14384,   /* input buffer size */
   NMPWAIT_USE_DEFAULT_WAIT,
   NULL);

  if (read_pipe == INVALID_HANDLE_VALUE || !read_pipe) {
printf(Handle %d, Error %d\n, read_pipe, GetLastError());
  } else {
printf(No error, read handle: %d\n, read_pipe);
CloseHandle(read_pipe);
  }
}
EOP
gcc -o tpipe.exe tpipe.c
./tpipe
rm tpipe.c tpipe.exe

= End mktpipe.sh =

A patch to work around this in cygwin could be: (WFM)

 Begin pipe-w95.diff 
--- src/winsup/cygwin/pipe.cc   3 Sep 2004 01:32:02 -   1.62
+++ src/winsup/cygwin/pipe.cc   7 Sep 2004 19:09:55 -
@@ -259,6 +259,7 @@ create_selectable_pipe (PHANDLE read_pip
  the pipe was not created earlier by some other process, even if
  the pid has been reused.  We avoid FILE_FLAG_FIRST_PIPE_INSTANCE
  because that is only available for Win2k SP2 and WinXP.  */
+  SetLastError(0);
   read_pipe = CreateNamedPipe (pipename,
PIPE_ACCESS_INBOUND,
PIPE_TYPE_BYTE | PIPE_READMODE_BYTE,
@@ -268,13 +269,13 @@ create_selectable_pipe (PHANDLE read_pip
NMPWAIT_USE_DEFAULT_WAIT,
sa_ptr);
 
-  if (read_pipe != INVALID_HANDLE_VALUE)
+  DWORD err = GetLastError ();
+  if ((read_pipe || !err)  read_pipe != INVALID_HANDLE_VALUE)
 {
   debug_printf (pipe read handle %p, read_pipe);
   break;
 }
 
-  DWORD err = GetLastError ();
   switch (err)
 {
 case ERROR_PIPE_BUSY:

= End pipe-w95.diff =

I hope this patch is small enough to qualify as `trivial', as I
haven't received any reply to my legal query (yet). (Did the reply
get blocked from the list?)

ChangeLog-entry:

08-09-2004  Bas van Gompel  [EMAIL PROTECTED]

* pipe.cc: (create_selectable_pipe) Work around bug in windows 95
where CreateNamedPipe returns zero.

[...]

HTH,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: win95 pipe problems -- report + testcase + patch

2004-09-07 Thread Bas van Gompel
Op Wed,  8 Sep 2004 01:55:29 +0200 (MET DST) schreef ik
in [EMAIL PROTECTED]:
[...]
:  ChangeLog-entry:

That was fu^Houled up. Let me try again.

2004-09-08  Bas van Gompel  [EMAIL PROTECTED]
* pipe.cc (create_selectable_pipe): Work around bug in windows 95
where CreateNamedPipe returns zero.

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: [RFC] Change to subversion package: Move /usr/bin/* - /usr/bin/subversion/* and add symlinks in /usr/bin

2004-07-13 Thread Bas van Gompel
Op Mon, 12 Jul 2004 11:32:30 +0100 schreef Max Bowsher
in [EMAIL PROTECTED]:
:  Christopher Faylor wrote:
[...]
:  The FHS dictates no subdirectories in /usr/bin and I think it's a good
:  rule.  Program specific subdirectories belong in /usr/lib.
:
:  ...
:
:  Why didn't rpm just put its binaries in /usr/bin/rpm?  Why didn't qt put
:  them in /usr/bin/qt?  Regardless of the reason, they put their packages
:  in /usr/lib.  So should you.
:
:  OK, I'll use /usr/lib.
:
:  Though the FHS actually permits subdirs of /usr/bin, even defining the
:  meaning of one subdir, /usr/bin/mh

...as an option, and it may also be a symlink (The following
directories, or symbolic links to directories, must be in /usr/bin,
if the corresponding subsystem is installed)

:  http://www.pathname.com/fhs/pub/fhs-2.3.html#USRBINMOSTUSERCOMMANDS

It /does/ require: /usr/bin/X11 must be a symlink to /usr/X11R6/bin if
the latter exists. The latter *does* exist. The former _does not_.
[Heads up X11-maintainer? (Same is true for /usr/lib/X11 -
/usr/X11R6/lib/X11 and /usr/include/X11 - /usr/X11R6/include/X11
url:http://www.pathname.com/fhs/pub/fhs-2.3.html#USRX11R6XWINDOWSYSTEMVERSION11REL
)]

However, in http://www.pathname.com/fhs/pub/fhs-2.3.html#REQUIREMENTS2
it clearly states: There must be no subdirectories in /bin.

It does not forbid symlinks to dirs AFAICS...

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: bfd_get_section_size() undeclared

2004-07-09 Thread Bas van Gompel
Op Wed, 30 Jun 2004 12:03:20 +0100 schreef Dave Korn
in [EMAIL PROTECTED]:
:  -Original Message-
:  From: cygwin-owner On Behalf Of Sean McCune
:  Sent: 30 June 2004 04:51
:
:  Howdy all,
: 
:  In building the latest source (checked out tonight), I'm getting the
:  following error, stating that bfd_get_section_size() is 
:  undeclared.  Was
:  something not checked in to CVS fully?

[...]
:WFM this morning.

So, you have a local copy of bfd. [WAG]

[...]
:  bfd_get_section_size is a new macro; see
:
:  http://sources.redhat.com/ml/binutils/2004-06/msg00396.html
:
:  for example.

Therefore, you'll need to checkout bfd as well as winsup, newlib and
libiberty currently, before you can complete the build of cygwin.

(This need will go away with the next binutils-release IIUC...)

HTH,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Generic build script instructions

2004-06-25 Thread Bas van Gompel
Op Sun, 20 Jun 2004 10:38:57 -0400 (EDT) schreef Igor Pechtchanski
in [EMAIL PROTECTED]:
:  On Sun, 20 Jun 2004, Bas van Gompel wrote:
:
:  Op Sat, 19 Jun 2004 17:11:22 -0400 (EDT) schreef Igor Pechtchanski:
[submitting locally maintained packages?]

:  :  Oh.  Well, if nothing else, it's a valuable experience for you...
: 
:  What is? Are you suggesting I ITP s-lang?
:
:  It = keeping a local copy.  I'm very much against pressuring anyone into
:  ITP'ing anything... :-)

Ok, I'll consider it. ;-p

:  [ispatch is not the best name]
[accept ``acceptpatch'' patch]

:  Looks good.  Any objections from people to me checking this in?

Well? (Huff huff.)

[...]

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: Generic build script instructions

2004-06-20 Thread Bas van Gompel
Op Sat, 19 Jun 2004 17:11:22 -0400 (EDT) schreef Igor Pechtchanski
in [EMAIL PROTECTED]:
:  On Sat, 19 Jun 2004, Bas van Gompel wrote:
:
:  Op Fri, 18 Jun 2004 22:22:59 -0400 (EDT) schreef Igor Pechtchanski:

...Snipped some stuff that was going OT, enjoyable though it was...

[reason for not submitting packages?]

:  One, (s-lang) is rather complex and I expect I could not really
:  support it. It also builds OOTB (sort of). (I'll consider votes an
:  incentive to start cleaning up my patches :- ). The other is just
:  waiting for the announced maintainer to publish his work. (core-utils)
:
:  Oh.  Well, if nothing else, it's a valuable experience for you...

What is? Are you suggesting I ITP s-lang?

[why not 2 patches]
:  is moot.

Right. ;)

[ispatch is not the best name]
[savepatch, ``acceptpatch'')
:
:  As I said, these were suggestions.  acceptpatch sounds fine to me.
:  Unless anyone objects, we can go with that.

I'm attaching the patch.

ChangeLog entry:

2004-06-20  Bas van Gompel  [EMAIL PROTECTED]

* templates/generic-build-script (acceptpatch): New function to copy
a fresh patch from ${srcinstdir} to ${topdir}.

[autodetect testsuite rule]

:  Found it. it uses ``-f Makefile -f -'' to get the value of
:  a Makefile-variable, and is of no use to us here. ``make -n''
:  is probably the WTG.
:
:  Okay, we'll see what can be done.

Yes, we will. :)

:  [snip]
[Igor: append a (wrapped) GBS patch to the GBS]
[Buzz: store gbs, before mods to CYGWIN-PATCHES]
[Igor: gbs patching self in place]
[Buzz: confused]

:  Umm, on reviewing it in light of morning (it was late night when I wrote
:  the above yesterday), it does look nonsensical.  I probably meant
:  something like
:
:  (echo --- generic-build-script
:  +++ $0; cat END-OF-PATCH
:  @@ -1,100 +1,100 @@
:  - patch goes here
:  + patch goes here
:  END-OF-PATCH
:  ) | patch -o tmp.$$.sh  exec tmp.$$.sh
:
:  instead.  This certainly makes more sense...

I still wonder why you'd would want to do this. If you must have the
``state'' stored in the same file, why not store the diff in a copy
of the _modified_ gbs, not the original. You would then not have to
patch the script for every run. (You'd _still_ have to jump through
several burning hoops to edit the resulting build-script, while
keeping the diff current, though.)

:  :  Hope this clears up the confusion,
: 
:  I think storing the diff in CYGWIN-PATCHES (and having it automatically
:  be included in foo-x.y-z.patch) is cleanest/clearest.

I'm not sure about this anymore. Probably storing the orig gbs /is/
easier/less error-prone.

:  This, IMO, creates a chicken-and-egg problem, as the patched directory
:  won't be available until the script is run...

Not really. Just keep a copy of the unedited gbs in topdir until you
round off your changes and get ready to do a ``spkg''. At that time
store the diff (or gbs-orig) into C-P. (Just remember to recreate the
original gbs before later editing the modified one, if storing the
diff.)

:Also, foo-x.y-z.patch
:  usually stores the diff between the original source and the Cygwin package
:  source, and the original won't have contained the unpatched gbs...

The original source won't have contained a generic-readme either...
There is a reason the directory is called CYGWIN-PATCHES, isn't there?

L8r,
Index: packaging/templates/generic-build-script
===
RCS file: /cvs/cygwin-apps/packaging/templates/generic-build-script,v
retrieving revision 1.24
diff -u -p -r1.24 generic-build-script
--- packaging/templates/generic-build-script19 Jun 2004 19:23:09 -  1.24
+++ packaging/templates/generic-build-script20 Jun 2004 02:26:30 -
@@ -258,6 +258,9 @@ mkpatch() {
 ${srcinstdir}/${src_patch_name} ; \
   rm -rf ${BASEPKG}-orig )
 }
+acceptpatch() {
+  cp --backup=numbered ${srcinstdir}/${src_patch_name} ${topdir}
+}
 spkg() {
   (mkpatch  \
   if [ ${SIG} -eq 1 ] ; then \
@@ -332,6 +335,7 @@ while test -n $1 ; do
 package)   pkg ; STATUS=$? ;;
 pkg)   pkg ; STATUS=$? ;;
 mkpatch)   mkpatch ; STATUS=$? ;;
+acceptpatch)   acceptpatch ; STATUS=$? ;;
 src-package)   spkg ; STATUS=$? ;;
 spkg)  spkg ; STATUS=$? ;;
 finish)finish ; STATUS=$? ;;
Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| post for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re

Re: Generic build script instructions

2004-06-20 Thread Bas van Gompel
Op Sat, 19 Jun 2004 15:24:06 -0400 (EDT) schreef Igor Pechtchanski
in [EMAIL PROTECTED]:
:  On Sat, 19 Jun 2004, Bas van Gompel wrote:
[...]
:  * templates/generic-build-script: Allow multiple arguments.

:  Committed, thanks.

SHTDI, KUTGW,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: Generic build script instructions

2004-06-20 Thread Bas van Gompel
Op Sun, 20 Jun 2004 08:00:03 +0200 (MET DST)
schreef ik in [EMAIL PROTECTED]:
[...]
:  Not really. Just keep a copy of the unedited gbs in topdir until you
:  round off your changes and get ready to do a ``spkg''. At that time
:  store the diff (or gbs-orig) into C-P. (Just remember to recreate the
:  original gbs before later editing the modified one, if storing the
:  diff.)

s/spkg/mkpatch/ above. In fact anytime after ``prep'' will do.

L8r,
 
Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re


Re: Generic build script instructions

2004-06-19 Thread Bas van Gompel
Op Fri, 18 Jun 2004 22:49:11 -0400 (EDT) schreef Igor Pechtchanski
in [EMAIL PROTECTED]:

[ask for two separate patches?]

:  I think I'd prefer the multiple parameters patch first, with its own
:  ChangeLog.  That part looks good enough to check in, actually.

Attached.

ChangeLog entry:

2004-06-19  Bas van Gompel  [EMAIL PROTECTED]

* templates/generic-build-script: Allow multiple arguments.

:As for the
:  ispatch part, let's discuss the name and the possible functionality (you
:  mentioned adding extra), and then it can be an add-on on top of the first
:  patch.  Frankly, I have reservations about the build script mucking with
:  anything outside of the build directory...

See other mail. About the extras I'm not sure what you mean... the
backing up is already implemented (by using ``cp --backup=numbered'').

:  Thanks for contributing,
:   Igor

hth,
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   //   really is |   and false bits entirely.| mail for
  ) |  |  //a 72 by 4 +---+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe s.u(z)\1.as.| me. 4^re
Index: packaging/templates/generic-build-script
===
RCS file: /cvs/cygwin-apps/packaging/templates/generic-build-script,v
retrieving revision 1.22
diff -u -p -r1.22 generic-build-script
--- packaging/templates/generic-build-script31 Mar 2004 00:56:17 -  1.22
+++ packaging/templates/generic-build-script19 Jun 2004 00:32:57 -
@@ -312,33 +312,35 @@ checksig() {
 echo You need the gnupg package installed in order to check signatures. ; \
   fi
 }
-case $1 in
-  prep)prep ; STATUS=$? ;;
-  mkdirs)  mkdirs ; STATUS=$? ;;
-  conf)conf ; STATUS=$? ;;
-  configure)   conf ; STATUS=$? ;;
-  reconf)  reconf ; STATUS=$? ;;
-  build)   build ; STATUS=$? ;;
-  make)build ; STATUS=$? ;;
-  check)   check ; STATUS=$? ;;
-  test)check ; STATUS=$? ;;
-  clean)   clean ; STATUS=$? ;;
-  install) install ; STATUS=$? ;;
-  list)list ; STATUS=$? ;;
-  depend)  depend ; STATUS=$? ;;
-  strip)   strip ; STATUS=$? ;;
-  package) pkg ; STATUS=$? ;;
-  pkg) pkg ; STATUS=$? ;;
-  mkpatch) mkpatch ; STATUS=$? ;;
-  src-package) spkg ; STATUS=$? ;;
-  spkg)spkg ; STATUS=$? ;;
-  finish)  finish ; STATUS=$? ;;
-  checksig)checksig ; STATUS=$? ;;
-  first)   mkdirs  spkg  finish ; STATUS=$? ;;
-  all) checksig  prep  conf  build  install  \
+while test -n $1 ; do
+  case $1 in
+prep)  prep ; STATUS=$? ;;
+mkdirs)mkdirs ; STATUS=$? ;;
+conf)  conf ; STATUS=$? ;;
+configure) conf ; STATUS=$? ;;
+reconf)reconf ; STATUS=$? ;;
+build) build ; STATUS=$? ;;
+make)  build ; STATUS=$? ;;
+check) check ; STATUS=$? ;;
+test)  check ; STATUS=$? ;;
+clean) clean ; STATUS=$? ;;
+install)   install ; STATUS=$? ;;
+list)  list ; STATUS=$? ;;
+depend)depend ; STATUS=$? ;;
+strip) strip ; STATUS=$? ;;
+package)   pkg ; STATUS=$? ;;
+pkg)   pkg ; STATUS=$? ;;
+mkpatch)   mkpatch ; STATUS=$? ;;
+src-package)   spkg ; STATUS=$? ;;
+spkg)  spkg ; STATUS=$? ;;
+finish)finish ; STATUS=$? ;;
+checksig)  checksig ; STATUS=$? ;;
+first) mkdirs  spkg  finish ; STATUS=$? ;;
+all)   checksig  prep  conf  build  install  \
strip  pkg  spkg  finish ; \
STATUS=$? ;;
-  *) echo Error: bad arguments ; exit 1 ;;
-esac
-exit ${STATUS}
-
+*) echo Error: bad arguments ; exit 1 ;;
+  esac
+  ( exit ${STATUS} ) || exit ${STATUS}
+  shift
+done

Re: Generic build script instructions

2004-06-19 Thread Bas van Gompel
Op Fri, 18 Jun 2004 22:22:59 -0400 (EDT) schreef Igor Pechtchanski
in [EMAIL PROTECTED]:
:  On Sat, 19 Jun 2004, Bas van Gompel wrote:
:
:  Op Fri, 18 Jun 2004 08:58:42 -0400 (EDT) schreef Igor Pechtchanski:
:  :  On Fri, 18 Jun 2004, Bas van Gompel wrote:
[pechtcha at see es dot and why you dot ee dee you]
:  : Cute, very cute...
:  Ehh... Thanks, I think.
:
:  Yeah, I just never saw this particular obfuscation before, is all. :-)

I did it by hand. (I know, I should get a job.)

[EMBI]
:  Excuse My Butting In.
:
:  Ok, this one's on its way to the OLOCA. :-D

g

[package maintainers]

:  I keep some packages locally, following changes are in them...
:
:  Then, as far as I'm concerned, you're a maintainer.  Any particular reason
:  for not submitting those packages, though?  License issues, perhaps?

One, (s-lang) is rather complex and I expect I could not really
support it. It also builds OOTB (sort of). (I'll consider votes an
incentive to start cleaning up my patches :- ). The other is just
waiting for the announced maintainer to publish his work. (core-utils)

[...]

:  The change in indentation makes the ``ispatch()'' call hard to spot,
:  hence the (botched) copy.
:
:  Why not submit two separate patches, then? ;-)

The change in indentation would still affect many lines which are not
functionally changed. (I would thus want to add a 3rd patch.)

[the purpose of ispatch()]
:  In other words: ``ispatch'' copies the patch generated by ``mkpatch''
:  from .sinst to ${topdir}, so it can be used now, not just get included
:  by ``spkg''.
:
:  I see.  That's not quite the way I use the gbs (I never edit the patched
:  directory, but keep the original edited version separately).

? I'm talking about when you first port the app, or when you are
changing to a new upstream version.

:Perhaps
:  ispatch is not the best name for it?

Could be. You use it when you determine this _is_ the correct patch.

:Looks like savepatch might be
:  better...  As I never intend to use this feature, the above is just a
:  suggestion.

I would expect that --``savepatch''-- to do st else (like store the
patch from ${topdir} someplace). But if you insist I'll change it to
that. I would prefer st different, though. (``acceptpatch'' maybe?)

:  :  : We could also try putting some more
:  :  : autodetection code into the GBS (e.g., get make to try both the test
:  :  : rule and the check rule -- the two most common names for running the
:  :  : testsuite -- and pick the one that exists).
:  : 
:  :  I saw a trick that might be usable for this somewhere... i'll get back
:  :  to you on it...
:  :
:  :  I think we could use something like make -n and check the return code...
:  :  But as I don't have the time to implement it properly now, I'll look at
:  :  whatever methods people choose to provide in their patches.
: 
:  It was something using a ``make -f -'' IIRC... (l8r)
:
:  Hmm, make -f - will actually not be useful, FWICS.  We want to check
:  whether the Makefile contains either a test or a check rule, whereas
:  make -f - will bypass the Makefile altogether.  But if I'm wrong, it
:  won't be the first time.

Found it. it uses ``-f Makefile -f -'' to get the value of
a Makefile-variable, and is of no use to us here. ``make -n''
is probably the WTG.
 
[patch-size vs. functionality]

:  Oh, I see the confusion.  I didn't mean the size of the patches that are
:  incorporated into the gbs itself -- those can be arbitrarily large.  I
:  meant the size of the patches that the packagers have to maintain
:  separately from the gbs, i.e., the things in the package build that don't
:  fit into the gbs defaults.  I think it's pretty obvious that *those*
:  should be small.

slap target=face subject=self/
Now I get it. Ofcourse. You're correct.

:  [append a (wrapped) GBS patch to the GBS]
[store gbs, before mods to CYGWIN-PATCHES]

:  Oh.  Well, again, I never store the build script into CYGWIN-PATCHES, but
:  it doesn't mean that nobody else should...  Everyone has his own methods.

I'm not saying anybody _should_, just that it will make upgrading the
specific-build-script easier.

:  Or maybe just store the diff? One could then recreate the original gbs
:  to merge against.
:
:  That's more or less what I'm proposing.  Take the (default) gbs, add a
:  section to it that does something like
:
:  (echo --- generic-build-script
:  +++ $0; cat END-OF-PATCH
:  @@ -1,100 +1,100 @@
:  - patch goes here
:  + patch goes here
:  END-OF-PATCH
:  ) | patch  exec $0
:
:  and let the maintainers put their patches between the cat and
:  END-OF-PATCH.  At least, that's what I had in mind.  Then the set of
:  changes to the gbs can be easily extracted (and moved) to the new version.

Let me get this straight. First you take a copy of gbs. you edit it.
You make a diff against the orig gbs. you paste that diff into yet
another copy of the gbs. you then run the last one, which will then
recreate the file you had before, by editing itself inplace

Re: Generic build script instructions

2004-06-18 Thread Bas van Gompel
Op Fri, 18 Jun 2004 08:58:42 -0400 (EDT) schreef Igor Pechtchanski in
[EMAIL PROTECTED]:
:  On Fri, 18 Jun 2004, Bas van Gompel wrote:
:
:  Op Tue, 15 Jun 2004 16:52:31 -0400 (EDT) schreef Igor Pechtchanski
:  pechtcha at see es dot and why you dot ee dee you:
:
:  Cute, very cute...

Ehh... Thanks, I think.

[...package maintainers could take...adapt the CVS HEAD of the GBS...]

:  I am not a package maintainer, so EMBI.
:
:  I'm not familiar with the acronym.

Excuse My Butting In.

:  What I meant by package maintainers
:  take time to adapt the CVS head of the GBS was that most packages now use
:  an older version of the GBS, and don't keep the CVS Id, so that makes it
:  very hard to determine the exact set of changes that everyone had to make.

I keep some packages locally, following changes are in them...

:  This doesn't mean that I won't be considering patches from
:  non-maintainers.

Pfew!

:  Following are two patches, one (inline) for review (ignoring
:  changes in whitespace) and one (attached) for easy application
:  (``patch gbs-loop-ispatch.patch'' in the src-directory.)
:
:  FWIW, I can review attached patches just as easily as the inline ones --
:  no need to duplicate the information.

The change in indentation makes the ``ispatch()'' call hard to spot,
hence the (botched) copy.

:  Each of them does:
: 
:  *) Allow more than one argument at a time (e.g. do
:  ``./boffo-1.0.36-1.sh prep conf build'').
: 
:  *) An ``ispatch'' command, copying a fresh patch, to make the porting
:  process easier. (When you're done editing, do a
:  ``./boffo-1.0.36-1 clean mkpatch ispatch finish all''
:  to get your new packages.) It backs up your old patch, to be on the
:  safe side.
:
:  I'm not clear on what the second part does.  Could you please elaborate on
:  the purpose of ispatch()?

Ok. Let me try to make this clear...

You install the upstream package and a new gbs. you do a
``./boffo-x.y-1.sh prep'', cd into boffo-x.y and edit some files.
You now do a ``./boffo-x.y-1.sh conf build'' and discover the
build succeeds. A ``./boffo-x.y-1.sh check'' reveals it passes it's
testsuite. You do a ``./boffo-x.y-1.sh clean mkpatch'' and
look at the generated patch. It looks OK. You can then do
`./boffo-x.y-1.sh ispatch'' to make sure you don't lose your
edits when you remove the boffo-x.y-directory (e.g. by doing
`./boffo-x.y-1.sh finish all'').

In other words: ``ispatch'' copies the patch generated by ``mkpatch''
from .sinst to ${topdir}, so it can be used now, not just get included
by ``spkg''.

:  :  We could also try putting some more
:  :  autodetection code into the GBS (e.g., get make to try both the test
:  :  rule and the check rule -- the two most common names for running the
:  :  testsuite -- and pick the one that exists).
: 
:  I saw a trick that might be usable for this somewhere... i'll get back
:  to you on it...
:
:  I think we could use something like make -n and check the return code...
:  But as I don't have the time to implement it properly now, I'll look at
:  whatever methods people choose to provide in their patches.

It was something using a ``make -f -'' IIRC... (l8r)

:  :  I'm willing to coordinate the effort on this, but please everyone feel
:  :  free to send patches based on the above input.  One major criterion for
:  :  accepting those patches would be to make the overall amount of changes to
:  :  the scripts smaller (with the secondary goal of making each individual set
:  :  of changes smaller).
: 
:  Should not the main objective be to make the needed effort (for
:  understanding, maintaining, using effectively) smallest? (NRN)
:
:  Well, not quite.  The main objective, as far as I understood Chuck
:  Wilson's comments, was to be able to get a *new* package off the ground
:  fast.  The GBS embodies several of the policies (e.g., the FHS, the
:  default configure arguments, the tarball filenames) which would otherwise
:  need to be taken care of.  The more packages can be built with a minimal
:  (preferably empty)  set of changes, the better.  Understandability is
:  certainly an issue.  Judging the needed effort, however, is very
:  subjective, so I'd prefer using the size of the necessary patch to
:  quantify it.

Fair enough. Ny point was: Allowing multiple arguments, or auto-
detecting various aspects, makes the patches bigger, but the gbs
more useful.

[append a (wrapped) GBS patch to the GBS]

:  Would not that create an entirely new build method (with a very
:  impractical structure)?
: 
:  Isn't it more in style with method 2 to store a copy of the gbs,
:  before you made any mods to it, in CYGWIN-PATCHES?  you can then
:  always (diff out any changes you made/merge in changes from the
:  latest cvs version).
:
:  Huh?  No, the GBS just gets edited -- I don't think it should go into
:  CYGWIN-PATCHES...

It improves maintainability e.g.
``diff -u  boffo-x.y/CYGWIN-PATCHES/gbs-orig boffo-x.y-1.sh''
and
``merge boffo-x.y-1.sh boffo-x.y/CYGWIN-PATCHES/gbs-orig

  1   2   >