If we can't find the "svn" executable in the current path, look in
authorGerald Combs <gerald@wireshark.org>
Wed, 29 Dec 2004 15:54:55 +0000 (15:54 -0000)
committerGerald Combs <gerald@wireshark.org>
Wed, 29 Dec 2004 15:54:55 +0000 (15:54 -0000)
"c:/cygwin/lib/subversion/bin/", which is the current default location
for Subversion 1.1.1 under Cygwin.  If we still can't find "svn", simply
return instead of exiting.

svn path=/trunk/; revision=12856

make-version.pl

index 411dc0dcf71d5b4540f093e7aece0832edb997ee..9869709ee41126a7982141aea5cdc67ccd456683 100755 (executable)
@@ -75,8 +75,22 @@ sub read_svn_info {
        my $line;
        my $version_format = $version_pref{"format"};
        my $package_format = $version_pref{"pkg_format"};
-
-       open(SVNINFO, "svn info |") || die("Unable to get SVN info!");
+       # If any other odd paths pop up, put them here.
+       my @svn_paths = ("", "c:/cygwin/lib/subversion/bin/");
+       my $svn_cmd;
+       my $svn_pid;
+
+       foreach $svn_cmd (@svn_paths) {
+               $svn_cmd .= "svn info";
+               if ($svn_pid = open(SVNINFO, $svn_cmd . " |")) {
+                       print ("Fetching version with command \"$svn_cmd\".\n");
+                       last;
+               }
+       }
+       if (! defined($svn_pid)) {
+               print ("Unable to get SVN info.\n");
+               return;
+       }
        while ($line = <SVNINFO>) {
                if ($line =~ /^Last Changed Date: (\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)/) {
                        $last = timegm($6, $5, $4, $3, $2 - 1, $1);