public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* How to detect CygWin SVN?
@ 2011-02-09 19:11 Jochen Wiedmann
  2011-02-09 19:17 ` Jeremy Bopp
  2011-02-09 21:57 ` Csaba Raduly
  0 siblings, 2 replies; 8+ messages in thread
From: Jochen Wiedmann @ 2011-02-09 19:11 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to detect CygWin SVN?
  2011-02-09 19:11 How to detect CygWin SVN? Jochen Wiedmann
@ 2011-02-09 19:17 ` Jeremy Bopp
  2011-02-09 20:22   ` Jochen Wiedmann
  2011-02-09 21:57 ` Csaba Raduly
  1 sibling, 1 reply; 8+ messages in thread
From: Jeremy Bopp @ 2011-02-09 19:17 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to detect CygWin SVN?
  2011-02-09 19:17 ` Jeremy Bopp
@ 2011-02-09 20:22   ` Jochen Wiedmann
  2011-02-09 20:26     ` Jeremy Bopp
  0 siblings, 1 reply; 8+ messages in thread
From: Jochen Wiedmann @ 2011-02-09 20:22 UTC (permalink / raw)
  To: cygwin

On Wed, Feb 9, 2011 at 8:17 PM, Jeremy Bopp <jeremy@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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to detect CygWin SVN?
  2011-02-09 20:22   ` Jochen Wiedmann
@ 2011-02-09 20:26     ` Jeremy Bopp
  2011-02-09 20:29       ` Jochen Wiedmann
  0 siblings, 1 reply; 8+ messages in thread
From: Jeremy Bopp @ 2011-02-09 20:26 UTC (permalink / raw)
  To: cygwin

On 02/09/2011 02:22 PM, Jochen Wiedmann wrote:
> On Wed, Feb 9, 2011 at 8:17 PM, Jeremy Bopp <jeremy@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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to detect CygWin SVN?
  2011-02-09 20:26     ` Jeremy Bopp
@ 2011-02-09 20:29       ` Jochen Wiedmann
  0 siblings, 0 replies; 8+ messages in thread
From: Jochen Wiedmann @ 2011-02-09 20:29 UTC (permalink / raw)
  To: cygwin

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 <jeremy@bopp.net> wrote:
> On 02/09/2011 02:22 PM, Jochen Wiedmann wrote:
>> On Wed, Feb 9, 2011 at 8:17 PM, Jeremy Bopp <jeremy@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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to detect CygWin SVN?
  2011-02-09 19:11 How to detect CygWin SVN? Jochen Wiedmann
  2011-02-09 19:17 ` Jeremy Bopp
@ 2011-02-09 21:57 ` Csaba Raduly
  2011-02-10 11:54   ` Jochen Wiedmann
  1 sibling, 1 reply; 8+ messages in thread
From: Csaba Raduly @ 2011-02-09 21:57 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to detect CygWin SVN?
  2011-02-09 21:57 ` Csaba Raduly
@ 2011-02-10 11:54   ` Jochen Wiedmann
  2011-02-10 12:23     ` Gary
  0 siblings, 1 reply; 8+ messages in thread
From: Jochen Wiedmann @ 2011-02-10 11:54 UTC (permalink / raw)
  To: cygwin

On Wed, Feb 9, 2011 at 10:57 PM, Csaba Raduly <rcsaba@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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to detect CygWin SVN?
  2011-02-10 11:54   ` Jochen Wiedmann
@ 2011-02-10 12:23     ` Gary
  0 siblings, 0 replies; 8+ messages in thread
From: Gary @ 2011-02-10 12:23 UTC (permalink / raw)
  To: cygwin

Jochen Wiedmann wrote:
> On Wed, Feb 9, 2011 at 10:57 PM, Csaba Raduly <rcsaba@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:\...)

cygpath. Works from the Windows command line as well as bash and its
friends. If you're lucky, cygpath -f does exactly what you want, but it
appears to be undocumented...

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

So use a shell script for Cygwin, and a batch/command file for
non-Cygwin. Set paths accordingly. Done.


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-02-10 12:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-09 19:11 How to detect CygWin SVN? Jochen Wiedmann
2011-02-09 19:17 ` Jeremy Bopp
2011-02-09 20:22   ` Jochen Wiedmann
2011-02-09 20:26     ` Jeremy Bopp
2011-02-09 20:29       ` Jochen Wiedmann
2011-02-09 21:57 ` Csaba Raduly
2011-02-10 11:54   ` Jochen Wiedmann
2011-02-10 12:23     ` Gary

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).