Re: How to detect CygWin SVN?

2011-02-10 Thread Jochen Wiedmann
On Wed, Feb 9, 2011 at 10:57 PM, Csaba Raduly rcs...@gmail.com wrote:

 Question is, why do you think you need to detect it ?

Assuming that I'd like to use the -f option of SVN (commit a list of
files, which are present in the file given by -f), the contents of the
file in question are quite different for CygWin SVN (/cygdrive/c/...)
and a native SVN. (C:\...)


 How about this:
 cygcheck `which svn` | grep cygwin1.dll

That's another solution that works excellent, if I know that CygWin is
present ... which I don't.



-- 
I Am What I Am And That's All What I Yam (Popeye)

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



How to detect CygWin SVN?

2011-02-09 Thread Jochen Wiedmann
Hi,

I'd like to write a script, which ought to work with the CygWin SVN
client as well as any native SVN clients. As a prerequisite, I need to
detect whether the svn program in the path is CygWin SVN or not.
Question is, how to do this? Because the output of svn --version
contains nothing that indicates compilation with CygWin.

Thanks for any suggestions,

Jochen

-- 
I Am What I Am And That's All What I Yam (Popeye)



bash-4.1$ svn --version
svn, version 1.6.15 (r1038135)
   compiled Nov 29 2010, 14:09:28

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.apache.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
  - handles 'http' scheme
  - handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
  - with Cyrus SASL authentication
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - handles 'http' scheme
  - handles 'https' scheme

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



Re: How to detect CygWin SVN?

2011-02-09 Thread Jeremy Bopp
On 02/09/2011 01:10 PM, Jochen Wiedmann wrote:
 Hi,
 
 I'd like to write a script, which ought to work with the CygWin SVN
 client as well as any native SVN clients. As a prerequisite, I need to
 detect whether the svn program in the path is CygWin SVN or not.
 Question is, how to do this? Because the output of svn --version
 contains nothing that indicates compilation with CygWin.

I'm assuming that your script expects svn to be in the PATH, so you
could check to see if the path to the svn client lives within Cygwin's
installation:

if [ $(type -p svn) = '/usr/bin/svn' ]; then
  echo Found Cygwin's svn client
fi

Unless someone goes out of their way to confound things, this should be
good enough.

-Jeremy

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



Re: How to detect CygWin SVN?

2011-02-09 Thread Jochen Wiedmann
On Wed, Feb 9, 2011 at 8:17 PM, Jeremy Bopp jer...@bopp.net wrote:

 I'm assuming that your script expects svn to be in the PATH, so you
 could check to see if the path to the svn client lives within Cygwin's
 installation:

 if [ $(type -p svn) = '/usr/bin/svn' ]; then
  echo Found Cygwin's svn client
 fi

 Unless someone goes out of their way to confound things, this should be
 good enough.

Thanks for the idea. However, I'd prefer a solution that works with
the native cmd-Shell too. Otherwise, I'd assume that CygWin is
installed.


-- 
I Am What I Am And That's All What I Yam (Popeye)

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



Re: How to detect CygWin SVN?

2011-02-09 Thread Jeremy Bopp
On 02/09/2011 02:22 PM, Jochen Wiedmann wrote:
 On Wed, Feb 9, 2011 at 8:17 PM, Jeremy Bopp jer...@bopp.net wrote:
 
 I'm assuming that your script expects svn to be in the PATH, so you
 could check to see if the path to the svn client lives within Cygwin's
 installation:

 if [ $(type -p svn) = '/usr/bin/svn' ]; then
  echo Found Cygwin's svn client
 fi

 Unless someone goes out of their way to confound things, this should be
 good enough.
 
 Thanks for the idea. However, I'd prefer a solution that works with
 the native cmd-Shell too. Otherwise, I'd assume that CygWin is
 installed.

Since you want a solution that works in either environment, in what
language are you going to implement your script?  You can do something
very similar in Perl and other such languages, but I can't think of a
single method that would work in both bash and cmd without at least some
syntax tweaks.

-Jeremy

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



Re: How to detect CygWin SVN?

2011-02-09 Thread Jochen Wiedmann
Preferrably cmd

Or, in the alternative, the output of a cmd-Shell invocation to be
analyzed by some Java program.


On Wed, Feb 9, 2011 at 9:26 PM, Jeremy Bopp jer...@bopp.net wrote:
 On 02/09/2011 02:22 PM, Jochen Wiedmann wrote:
 On Wed, Feb 9, 2011 at 8:17 PM, Jeremy Bopp jer...@bopp.net wrote:

 I'm assuming that your script expects svn to be in the PATH, so you
 could check to see if the path to the svn client lives within Cygwin's
 installation:

 if [ $(type -p svn) = '/usr/bin/svn' ]; then
  echo Found Cygwin's svn client
 fi

 Unless someone goes out of their way to confound things, this should be
 good enough.

 Thanks for the idea. However, I'd prefer a solution that works with
 the native cmd-Shell too. Otherwise, I'd assume that CygWin is
 installed.

 Since you want a solution that works in either environment, in what
 language are you going to implement your script?  You can do something
 very similar in Perl and other such languages, but I can't think of a
 single method that would work in both bash and cmd without at least some
 syntax tweaks.

 -Jeremy

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





-- 
I Am What I Am And That's All What I Yam (Popeye)

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



Re: How to detect CygWin SVN?

2011-02-09 Thread Csaba Raduly
Hi Jochen,

On 2/9/11, Jochen Wiedmann  wrote:
 Hi,

 I'd like to write a script, which ought to work with the CygWin SVN
 client as well as any native SVN clients. As a prerequisite, I need to
 detect whether the svn program in the path is CygWin SVN or not.
 Question is, how to do this?

Question is, why do you think you need to detect it ?

How about this:
cygcheck `which svn` | grep cygwin1.dll

(you could replace `which svn` with the full path of the svn executable)

Csaba
-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
Life is complex, with real and imaginary parts.
Ok, it boots. Which means it must be bug-free and perfect.  -- Linus
Torvalds
People disagree with me. I just ignore them. -- Linus Torvalds

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