[54364] trunk/base/src/upgrade_sources_conf_default.tcl

raimue at macports.org raimue at macports.org
Sat Jul 25 07:06:37 PDT 2009


Revision: 54364
          http://trac.macports.org/changeset/54364
Author:   raimue at macports.org
Date:     2009-07-25 07:06:37 -0700 (Sat, 25 Jul 2009)
Log Message:
-----------
upgrade_sources_conf_default.tcl:
Error out if svn can not be executed. Add an exception if the svn client is too
old for the working copy (as this is common but not a real error) and print a
warning in this case.

Modified Paths:
--------------
    trunk/base/src/upgrade_sources_conf_default.tcl

Modified: trunk/base/src/upgrade_sources_conf_default.tcl
===================================================================
--- trunk/base/src/upgrade_sources_conf_default.tcl	2009-07-25 13:53:07 UTC (rev 54363)
+++ trunk/base/src/upgrade_sources_conf_default.tcl	2009-07-25 14:06:37 UTC (rev 54364)
@@ -41,15 +41,26 @@
          } elseif {[regexp {rsync://rsync\.(macports|darwinports)\.org/(release|dpupdate)/d?ports} $url]} {
             set addDefault true
          } elseif {[regexp {file://(/.+)} $url -> filepath]} {
-            if {[file exists [file join ${filepath} .svn]] && ![catch {set svnChannel [open "|svn info ${filepath}" r]}]} {
-               set svnURL {}
-               while {[gets $svnChannel svnLine] >= 0} {
-                  regexp {^URL: (.*)} $svnLine -> svnURL
+            if {[file exists [file join ${filepath} .svn]]} {
+               if {![catch {set svnChannel [open "|svn info ${filepath}" r]} err]} {
+                  set svnURL {}
+                  while {[gets $svnChannel svnLine] >= 0} {
+                     regexp {^URL: (.*)} $svnLine -> svnURL
+                  }
+                  if {[catch {close $svnChannel} err]} {
+                     if {![string match "*This client is too old to work with working copy*" $err]} {
+                        return -code error $err
+                     } else {
+                        puts $err
+                        puts "WARNING: Unable to check svn URL for '$filepath' as it has been checked out with a newer Subversion client; please manually verify $sourcesConf!"
+                     }
+                  }
+                  if {[regexp {^https?://svn\.(macports|macosforge)\.org/repository/macports/trunk/dports} $svnURL]} {
+                     set addDefault true
+                  }
+               } else {
+                  return -code error $err
                }
-               close $svnChannel
-               if {[regexp {^https?://svn\.(macports|macosforge)\.org/repository/macports/trunk/dports} $svnURL]} {
-                  set addDefault true
-               }
             }
          }
          if {$addDefault} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090725/59c61669/attachment.html>


More information about the macports-changes mailing list