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 "$1"x = "-v"x -o "$1"x = "-r"x; do
  if test "$1"x = "-v"x; then
exec 6>&2
shift
  fi
  if test "$1"x = "-r"x; 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 - "$@" 2>&6
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/

Re: User name with spaces and Cygwin web site suggestion

2004-12-04 Thread Nick Coghlan
Rodrigo de Salvo Braz wrote:
id -un, as it is the case with ssh. Did I miss something or renaming the
account really doesn't do anything to solve the problem?
Did you rename the actual account using the Management Console (Control 
Panel->Administrative Accounts->Computer Management), or did you change the user 
name in User Accounts (Control Panel->User Accounts)?

The latter doesn't actually rename the account itself - it merely adds a "Full 
Name" setting which is displayed by the Windows GUI instead of the actual 
account name.

Things like the location of your home directory will still be governed by the 
actual user name.

I'm pretty sure the Management Console will "do the right thing" and actually 
change the account name properly, but I haven't tested it myself, as I'd prefer 
not to break anything (like, oh, say, Mozilla Foundation apps like Firefox and 
Thunderbird that don't use relative paths in their preference files) ;)

Cheers,
Nick.
--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
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: User name with spaces and Cygwin web site suggestion

2004-12-04 Thread Pierre A. Humblet
On Sat, Dec 04, 2004 at 09:17:22PM -0600, Rodrigo de Salvo Braz wrote:
> Hi,
> 
> I had a Windows XP user account whose name had spaces. The Cygwin web site
> says that you should change your account's user name to something without
> spaces and, if Cygwin is already installed, re-run mkpasswd. Even before I
> installed Cygwin, I changed my user name, but this did not solve the
> problem because the command id -un used in /etc/profile to determine the
> user continues returning the previous spaced user name. So I manually set
> HOME and USER to the right thing in /etc/profile and at least I got the
> home directory right and so on. But apparently some programs may still use
> id -un, as it is the case with ssh. Did I miss something or renaming the
> account really doesn't do anything to solve the problem?

This is strange. Could you send us the output of mkpasswd and indicate
both the name you use to log in into Windows and the name returned by id -un

Pierre

--
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: PERL and XML::Parser

2004-12-04 Thread Larry Hall
At 10:39 PM 12/4/2004, you wrote:
>Hi 
>I have been having problems installing XML-Parser-2.34.tar.gz, 
>I came across the course of the problem in your mailing archive but it didn't 
>give the solution to the problem. 
>
>The original error was: 
>cp Parser/Encodings/iso-8859-5.enc 
>blib/lib/XML/Parser/Encodings/iso-8859-5.enc 
>Syntax error: Unterminated quoted string 
>
>The email I found was: 
>To: Cygwin List 
>Date: Tue, 06 Jul 2004 09:35:56 +0300 
>Subject: Re: PERL and XML::Parser 
>
>It said the problem was: 
>It appears that Visual Studio .NET environment variable "LIB" produced invalid 
>output in Makefile. 
>
>If any one could give me a detailed solution to this problem it would be 
>greatly appreciated, I'm new to cygwin so please keep it simple. 

How about adding:

SET LIB=

to your Cygwin.bat?  While you're at it, you might as well add 

SET INCLUDE=

too.

--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
838 Washington Street   (508) 893-9889 - FAX
Holliston, MA 01746 


--
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/



PERL and XML::Parser

2004-12-04 Thread Trevor McAlister
Hi 
I have been having problems installing XML-Parser-2.34.tar.gz, 
I came across the course of the problem in your mailing archive but it didn't 
give the solution to the problem. 

The original error was: 
cp Parser/Encodings/iso-8859-5.enc blib/lib/XML/Parser/Encodings/iso-8859-5.enc 
Syntax error: Unterminated quoted string 

The email I found was: 
To: Cygwin List 
Date: Tue, 06 Jul 2004 09:35:56 +0300 
Subject: Re: PERL and XML::Parser 

It said the problem was: 
It appears that Visual Studio .NET environment variable "LIB" produced invalid 
output in Makefile. 

If any one could give me a detailed solution to this problem it would be 
greatly appreciated, I'm new to cygwin so please keep it simple. 
Trevor

-- 

Whatever you Wanadoo:
http://www.wanadoo.co.uk/time/

This email has been checked for most known viruses - find out more at: 
http://www.wanadoo.co.uk/help/id/7098.htm

--
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: User name with spaces and Cygwin web site suggestion

2004-12-04 Thread Larry Hall
At 10:17 PM 12/4/2004, you wrote:
>Hi,
>
>I had a Windows XP user account whose name had spaces. The Cygwin web site
>says that you should change your account's user name to something without
>spaces and, if Cygwin is already installed, re-run mkpasswd. Even before I
>installed Cygwin, I changed my user name, but this did not solve the
>problem because the command id -un used in /etc/profile to determine the
>user continues returning the previous spaced user name. So I manually set
>HOME and USER to the right thing in /etc/profile and at least I got the
>home directory right and so on. But apparently some programs may still use
>id -un, as it is the case with ssh. Did I miss something or renaming the
>account really doesn't do anything to solve the problem?


Just change your user name in the first field of /etc/passwd.  That will
take care of it.



--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
838 Washington Street   (508) 893-9889 - FAX
Holliston, MA 01746 


--
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: Suggestions

2004-12-04 Thread Rodrigo de Salvo Braz
On Sat, 4 Dec 2004, Larry Hall wrote:

> At 06:43 PM 12/3/2004, you wrote:
> >Is there some more specific place in which to give suggestions or feedback
> >about the Cygwin pages?
> Sure.  Here. :-)

Ok, just making sure, thanks.

I would like to suggest that the words "Keep", "Prev", "Curr" and "Exp" be
changed in the Cygwin Setup. I believe they are too abbreviated when there
is room for clearer words. But, more importantly, I believe that the
choice of words "Keep" and "Curr" is a bit confusing. "Keep" without
saying what is being kept suggests little and "Curr" may be interpreted as
the version currently installed in the computer (which is actually the
meaning of "Keep"), not the packages' currently released versions. Just a
thought.

Thanks,

Rodrigo

--
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/



User name with spaces and Cygwin web site suggestion

2004-12-04 Thread Rodrigo de Salvo Braz
Hi,

I had a Windows XP user account whose name had spaces. The Cygwin web site
says that you should change your account's user name to something without
spaces and, if Cygwin is already installed, re-run mkpasswd. Even before I
installed Cygwin, I changed my user name, but this did not solve the
problem because the command id -un used in /etc/profile to determine the
user continues returning the previous spaced user name. So I manually set
HOME and USER to the right thing in /etc/profile and at least I got the
home directory right and so on. But apparently some programs may still use
id -un, as it is the case with ssh. Did I miss something or renaming the
account really doesn't do anything to solve the problem?

Thanks,

Rodrigo

--
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: ssl on ssmtp

2004-12-04 Thread Robert R Schneck-McConnell
Two general points:
(1) Don't e-mail cygwin package maintainers directly; use the mailing
list.  Some maintainers don't like private e-mail, and it helps to
have things in the archive.
(2) Read the package README files in /usr/share/doc/Cygwin/.

On Fri, 3 Dec 2004, Reinhold May wrote:
>I've been using ssmtp quite successfully for  some  time  now
> but I've just recently found out  that  my  email  provider  now
> supports smtp over ssl and I'd really like to use that.
>
>Not finding any maintainer homepage for ssmtp,  I  thought  I
> just try to contact you as the maintainer of the cygwin  version
> (and maybe that's the only version there is?).

The upstream source is the Debian package at
http://packages.debian.org/testing/mail/ssmtp
(Hmm; looks like it's time for an upgrade)

>First of all, I don't know if the cygwin configuration is  by
> default configured with '--enable-ssl' as it  definitely  wasn't
> configured with '--enable-logfile' so I wonder,  if  I  have  to
> compile a new version in the first place (if it's in, I don't).

It does not have --enable-ssl on by default; this question is answered
in /usr/share/doc/Cygwin/ssmtp*README

Perhaps ssmtp should --enable-ssl by default?  Opinions?

>Secondly,  I  tried  to  compile  'ssmtp'   configured   with
> '--enable-ssl' and the  linker  gives  me  the  following  error
> message:
>
>ssmtp.o(.text+0x1716): In function `smtp_open':
>/usr/src/ssmtp-2.60.9-3/ssmtp.c:1119: undefined reference to
> `_X509_free'
>
>I commented the line out and I  got  an  executable  which  I
> could install and run,

I don't know what the right fix would be.

> but even with the options
>
>UseTLS=YES
>UseSTARTTLS=YES
>
>It still seems  to  use  port  25  to  connect  to  my  email
> provider's smtp server.  I can't figure out to find out if  it's
> encrypted or not, but I guess not.

You have to set the port number yourself.  I believe you want 465?
So in /etc/ssmtp/ssmtp.conf, you would have a line like

mailhub=mail.your.domain:465

Best,
Robert

--
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: Suggestions

2004-12-04 Thread Larry Hall
At 06:43 PM 12/3/2004, you wrote:
>Hi,
>
>Is there some more specific place in which to give suggestions or feedback
>about the Cygwin pages?


Sure.  Here. :-)

See  for more details.


--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
838 Washington Street   (508) 893-9889 - FAX
Holliston, MA 01746 


--
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: Environment variables & system privilages

2004-12-04 Thread Igor Pechtchanski
On Sat, 4 Dec 2004, Jason Pearce wrote:

> I have two seemingly simple questions that I just can't find the answers
> to. Any assistance would be appreciated
>
> 1. What's the "right" way to add add environment variables into the user and
> system maps?
> Currently I am using regtool to manipulate the registry. For instance to set
> an environment variable FOO=BAR I do:
>
> regtool set -s '\HKEY_CURRENT_USER\Environment\FOO' 'BAR'
> or
> regtool set -s 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session 
> Manager\FOO' 'BAR'
>
> The first form places it in the user's map, the second in the system
> map. But will this work across patform? Is there a more preferred
> method?

Well, that's probably the best you could hope for, if you want system-wide
settings.  I'm not aware of any other command-line tool that would set
these.  If you only want to set environment variables for Cygwin shells,
you might want to edit /cygwin.bat instead.

> 2. How can I test whether my script is running with system privilages?
> ie I want to write a script that installs a mount and sets and environment
> variable. If the script is running with system privilages I want to make the
> change system wide. Otherwise, in the user's profile.

Why not try mounting with system privileges first?  'mount' will fail if
it's unable to set mounts, and you can fall back on user mounts.  In other
words:

#!/bin/sh
if mount -tfs d:/projects /projects; then
   regtool set -s 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session 
Manager\FOO' 'BAR'
else
   # User ony
   mount -tfu d:/projects /projects
   regtool set -s '\HKEY_CURRENT_USER\Environment\FOO' 'BAR'
fi

> #!/bin/sh
> if [ ??? ]
> then
>  # Sytem wide
>  mount -tfs d:/projects /projects
>regtool set -s 
> 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\FOO' 
> 'BAR'
> else
>  # User ony
>  mount -tfu d:/projects /projects
>  regtool set -s '\HKEY_CURRENT_USER\Environment\FOO' 'BAR'
> fi
>
> What do I put in place of the ??

HTH,
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
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: sed: altered results in bash and cmd

2004-12-04 Thread Christopher Faylor
On Sat, Dec 04, 2004 at 03:04:52PM +0100, Jan Schormann wrote:
>> C:\>E:\cygwin\bin\echo.exe '/^ .*$/d'
>> / .*$/d
>
>>I'm not really sure but I think cmd doesn't treat single quotes as
>>quoting characters - at least not in the way bash does.
>
>That's true.  In addition, the '^' in cmd is an escape character, like
>the backslash in sh.  Search for "string literals" in the XP help and
>support center.

cmd may not treat single quotes as quoting characters but cygwin does
when a command is started from the windows command prompt.

As has been noted, the ^ is being eaten by cmd before cygwin ever sees
it.

cgf

--
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: sed: altered results in bash and cmd

2004-12-04 Thread Jan Schormann
Hi,

> C:\>E:\cygwin\bin\echo.exe '/^ .*$/d'
> / .*$/d

> I'm not really sure but I think cmd doesn't treat single quotes as
> quoting characters - at least not in the way bash does.

That's true. In addition, the '^' in cmd is an escape character,
like the backslash in sh. Search for "string literals" in the
XP help and support center.

Also, why not

$ grep -v "^ " filename

(slightly faster ;-)

HTH,
Jan.



--
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: sed: altered results in bash and cmd

2004-12-04 Thread Brian Dessent
Markus Schönhaber wrote:

> The difference in behaviour you are seeing results from the difference
> in the way cmd and bash interpret command lines and pass the resulting
> arguments to the specified commands.

You can read the specifics of how cmd.exe handles quoting at
,
specifically:

""
If you specify /c or /k, cmd processes the remainder of string and
quotation marks are preserved only if all of the following conditions
are met:
  * You do not use /s.
  * You use exactly one set of quotation marks.
  * You do not use any special characters within the quotation marks
(for example: &<>( ) @ ^ |).
  * You use one or more white-space characters within the quotation 
marks.
  * The string within quotation marks is the name of an executable
file.

If the previous conditions are not met, string is processed by examining
the first character to verify whether or not it is an opening quotation
mark. If the first character is an opening quotation mark, it is
stripped along with the closing quotation mark. Any text following the
closing quotation marks is preserved.
""

Brian

--
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/



Environment variables & system privilages

2004-12-04 Thread Jason Pearce
I have two seemingly simple questions that I just can't find the answers 
to. Any assistance would be appreciated

1. What's the "right" way to add add environment variables into the user 
and system maps?
Currently I am using regtool to manipulate the registry. For instance to 
set an environment variable FOO=BAR I do:

regtool set -s '\HKEY_CURRENT_USER\Environment\FOO' 'BAR'
or
regtool set -s 
'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session 
Manager\FOO' 'BAR'

The first form places it in the user's map, the second in the system 
map. But will this work across patform? Is there a more preferred method?


2. How can I test whether my script is running with system privilages?
ie I want to write a script that installs a mount and sets and 
environment variable. If the script is running with system privilages I 
want to make the change system wide. Otherwise, in the user's profile.

#!/bin/sh
if [ ??? ]
then
 # Sytem wide
 mount -tfs d:/projects /projects
   regtool set -s 
'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session 
Manager\FOO' 'BAR'
else
 # User ony
 mount -tfu d:/projects /projects
 regtool set -s '\HKEY_CURRENT_USER\Environment\FOO' 'BAR'
fi

What do I put in place of the ??
Thanks.
Jason
--
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: sed: altered results in bash and cmd

2004-12-04 Thread Markus Schönhaber
fergus wrote:
To delete all lines beginning with a  in a text file, this
command (a) seems correctly composed and (b) works:
sed '/^ .*$/d' filename
but if I use it in a cmd window, the result is that all lines
_containing_ a space are deleted, not just those beginning with a space.
In general, and assuming PATHs etc correctly set, should not Cygwin
command lines work identically in bash and cmd windows? Is this a
problem with sed, with (my) command line syntax above, or with my
understanding of what should work when?
The difference in behaviour you are seeing results from the difference 
in the way cmd and bash interpret command lines and pass the resulting 
arguments to the specified commands.
Compare:

C:\>E:\cygwin\bin\echo.exe '/^ .*$/d'
/ .*$/d
C:\>
to:
mks ~
$ /cygdrive/e/cygwin/bin/echo.exe '/^ .*$/d'
/^ .*$/d
mks ~
$
As you can see, the '^' isn't passed to echo.exe by cmd. I'm not really 
sure but I think cmd doesn't treat single quotes as quoting characters - 
at least not in the way bash does.
If you use double quotes, it shout work in cmd:

C:\>E:\cygwin\bin\echo.exe "/^ .*$/d"
/^ .*$/d
C:\>
BTW: '/^ /d' shoud be enough to achieve what you are trying to.
Regards
  mks
--
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/


sed: altered results in bash and cmd

2004-12-04 Thread fergus
To delete all lines beginning with a  in a text file, this
command (a) seems correctly composed and (b) works:

sed '/^ .*$/d' filename

but if I use it in a cmd window, the result is that all lines
_containing_ a space are deleted, not just those beginning with a space.

In general, and assuming PATHs etc correctly set, should not Cygwin
command lines work identically in bash and cmd windows? Is this a
problem with sed, with (my) command line syntax above, or with my
understanding of what should work when?

XP Pro SP2. Thank you.

Fergus




--
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/